ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
ObjVisualization.hpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file ObjVisualization.hpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2019 CERN for the benefit of the Acts project
4
//
5
// This Source Code Form is subject to the terms of the Mozilla Public
6
// License, v. 2.0. If a copy of the MPL was not distributed with this
7
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
9
#pragma once
10
11
#include "
Acts/Utilities/Definitions.hpp
"
12
#include "
Acts/Visualization/IVisualization.hpp
"
13
14
#include <array>
15
#include <fstream>
16
#include <map>
17
#include <sstream>
18
#include <string>
19
#include <vector>
20
21
namespace
Acts {
22
26
template
<
typename
T =
double
>
27
class
ObjVisualization
:
public
IVisualization
{
28
public
:
29
static_assert(std::is_same_v<T, double> || std::is_same_v<T, float>,
30
"Use either double or float"
);
31
33
using
ValueType
=
T
;
34
36
using
VertexType
=
ActsVector<ValueType, 3>
;
37
39
using
LineType
= std::pair<size_t, size_t>;
40
42
void
vertex
(
const
Vector3D
& vtx,
43
IVisualization::ColorType
color
= {0, 0, 0})
final
;
44
46
void
line
(
const
Vector3D
&
a
,
const
Vector3D
&
b
,
47
IVisualization::ColorType
color
= {0, 0, 0})
final
;
48
50
void
face
(
const
std::vector<Vector3D>& vtxs,
51
IVisualization::ColorType
color
= {0, 0, 0})
final
;
52
54
void
faces
(
const
std::vector<Vector3D>& vtxs,
55
const
std::vector<FaceType>&
faces
,
56
ColorType
color
= {0, 0, 0})
final
;
57
59
void
write
(
const
std::string& path)
const
final
;
60
62
void
write
(std::ostream& os)
const
final
;
63
67
void
write
(std::ostream& os, std::ostream& mos)
const
;
68
70
void
clear
() final;
71
72
private:
73
std::vector<
VertexType
>
m_vertices
;
74
std::vector<
FaceType
>
m_faces
;
75
std::vector<
LineType
>
m_lines
;
77
std::map<
size_t
,
IVisualization
::
ColorType
>
m_lineColors
;
78
std::map<
size_t
,
IVisualization
::
ColorType
>
m_vertexColors
;
79
std::map<
size_t
,
IVisualization
::
ColorType
>
m_faceColors
;
80
};
81
82
#include "detail/ObjVisualization.ipp"
83
84
}
// namespace Acts
acts
blob
master
Core
include
Acts
Visualization
ObjVisualization.hpp
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:22
using
1.8.2 with
ECCE GitHub integration