Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
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/Definitions/Algebra.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
= Eigen::Matrix<ValueType, 3, 1>;
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
Vector3
& vtx,
ColorRGB
color
= {0, 0, 0})
final
;
51
53
void
line
(
const
Vector3
&
a
,
const
Vector3
&
b
,
54
ColorRGB
color
= {0, 0, 0})
final
;
55
57
void
face
(
const
std::vector<Vector3>& vtxs,
ColorRGB
color
= {0, 0, 0})
final
;
58
60
void
faces
(
const
std::vector<Vector3>& vtxs,
61
const
std::vector<FaceType>&
faces
,
62
ColorRGB
color
= {0, 0, 0})
final
;
63
65
void
write
(
const
std::string
&
path
)
const
final
;
66
68
void
write
(std::ostream&
os
)
const
final
;
69
73
void
write
(std::ostream&
os
, std::ostream& mos)
const
;
74
76
void
clear
() final;
77
78
private
:
80
unsigned
int
m_outputPrecision
= 4;
81
double
m_outputScalor
= 1.;
83
std::vector<
VertexType
>
m_vertices
;
84
std::vector<
FaceType
>
m_faces
;
85
std::vector<
LineType
>
m_lines
;
87
std::map<
size_t
,
ColorRGB
>
m_lineColors
;
88
std::map<
size_t
,
ColorRGB
>
m_vertexColors
;
89
std::map<
size_t
,
ColorRGB
>
m_faceColors
;
90
};
91
92
#ifndef DOXYGEN
93
#include "
detail/ObjVisualization3D.ipp
"
94
#endif
95
96
}
// namespace Acts
acts
blob
sPHENIX
Core
include
Acts
Visualization
ObjVisualization3D.hpp
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:35
using
1.8.2 with
sPHENIX GitHub integration