EIC Software
Reference for
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
ObjVisualization3D.hpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file ObjVisualization3D.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/IVisualization3D.hpp
"
13
#include "
Acts/Visualization/ViewConfig.hpp
"
14
15
#include <array>
16
#include <fstream>
17
#include <iomanip>
18
#include <map>
19
#include <sstream>
20
#include <string>
21
#include <vector>
22
23
namespace
Acts {
24
28
template
<
typename
T =
double
>
29
class
ObjVisualization3D
:
public
IVisualization3D
{
30
public
:
31
static_assert(std::is_same_v<T, double> || std::is_same_v<T, float>,
32
"Use either double or float"
);
33
35
using
ValueType
=
T
;
36
38
using
VertexType
=
ActsVector<ValueType, 3>
;
39
41
using
LineType
= std::pair<size_t, size_t>;
42
46
ObjVisualization3D
(
unsigned
int
prec = 4,
double
scale = 1.)
47
:
m_outputPrecision
(prec),
m_outputScalor
(scale) {}
48
50
void
vertex
(
const
Vector3D
&
vtx
,
ColorRGB
color
= {0, 0, 0})
final
;
51
53
void
line
(
const
Vector3D
& a,
const
Vector3D
& b,
54
ColorRGB
color
= {0, 0, 0})
final
;
55
57
void
face
(
const
std::vector<Vector3D>& vtxs,
58
ColorRGB
color
= {0, 0, 0})
final
;
59
61
void
faces
(
const
std::vector<Vector3D>& vtxs,
62
const
std::vector<FaceType>&
faces
,
63
ColorRGB
color
= {0, 0, 0})
final
;
64
66
void
write
(
const
std::string& path)
const
final
;
67
69
void
write
(std::ostream& os)
const
final
;
70
74
void
write
(std::ostream& os, std::ostream& mos)
const
;
75
77
void
clear
() final;
78
79
private:
81
unsigned
int
m_outputPrecision
= 4;
82
double
m_outputScalor
= 1.;
84
std::
vector
<
VertexType
>
m_vertices
;
85
std::
vector
<
FaceType
>
m_faces
;
86
std::
vector
<
LineType
>
m_lines
;
88
std::map<
size_t
,
ColorRGB
>
m_lineColors
;
89
std::map<
size_t
,
ColorRGB
>
m_vertexColors
;
90
std::map<
size_t
,
ColorRGB
>
m_faceColors
;
91
};
92
93
#include "detail/ObjVisualization3D.ipp"
94
95
}
// namespace Acts
acts
blob
sPHENIX
Core
include
Acts
Visualization
ObjVisualization3D.hpp
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:24
using
1.8.2 with
EIC GitHub integration