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
Obj.cpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file Obj.cpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2023 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
#include <
Acts/Definitions/Algebra.hpp
>
10
#include <
Acts/Geometry/GeometryContext.hpp
>
11
#include <
Acts/Plugins/Python/Utilities.hpp
>
12
#include <
Acts/Surfaces/Surface.hpp
>
13
#include <
Acts/Visualization/GeometryView3D.hpp
>
14
#include <
Acts/Visualization/ObjVisualization3D.hpp
>
15
#include <
Acts/Visualization/ViewConfig.hpp
>
16
17
#include <memory>
18
19
#include <pybind11/pybind11.h>
20
#include <pybind11/stl.h>
21
22
namespace
py = pybind11;
23
using namespace
pybind11::literals;
24
25
using namespace
Acts;
26
27
namespace
Acts::Python {
28
void
addObj
(
Context
& ctx) {
29
auto
[
m
, mex] = ctx.
get
(
"main"
,
"examples"
);
30
31
{
39
mex.def(
"writeSurfacesObj"
,
40
[](
const
std::vector<std::shared_ptr<Surface>>& surfaces,
41
const
GeometryContext
& viewContext,
42
const
std::array<int, 3>& viewRgb,
const
std::string
& fileName) {
43
Acts::ViewConfig
sConfig =
Acts::ViewConfig
{viewRgb};
44
Acts::GeometryView3D
view3D;
45
Acts::ObjVisualization3D
obj;
46
47
for
(
const
auto
&
surface
: surfaces) {
48
view3D.
drawSurface
(obj, *
surface
, viewContext,
49
Acts::Transform3::Identity(), sConfig);
50
}
51
obj.
write
(fileName);
52
});
53
}
54
}
55
}
// namespace Acts::Python
acts
blob
sPHENIX
Examples
Python
src
Obj.cpp
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:39
using
1.8.2 with
sPHENIX GitHub integration