13 #include <Inventor/nodes/SoCamera.h>
14 #include <Inventor/nodes/SoCylinder.h>
15 #include <Inventor/nodes/SoLineSet.h>
16 #include <Inventor/nodes/SoMaterial.h>
17 #include <Inventor/nodes/SoPointSet.h>
18 #include <Inventor/nodes/SoRotationXYZ.h>
19 #include <Inventor/nodes/SoSeparator.h>
20 #include <Inventor/nodes/SoSphere.h>
21 #include <Inventor/nodes/SoTransform.h>
22 #include <Inventor/nodes/SoTranslation.h>
23 #include <Inventor/nodes/SoVertexProperty.h>
28 #include "Acts/Surfaces/Surface.hpp"
29 #include "Acts/EventData/ParticleHypothesis.hpp"
52 static double surfaceThickness = 0.1;
57 const typename ActsTrk::TrackStateBackend::ConstTrackStateProxy& trackstate)
60 m_indexOfPointOnTrack(indexOfPointOnTrack),
62 m_objBrowseTree(nullptr),
63 m_trackstate(trackstate)
67 if (
surface().associatedDetectorElement())
73 if (
m_trackstate.typeFlags().test(Acts::TrackStateFlag::ParameterFlag ))
76 if (
m_trackstate.typeFlags().test(Acts::TrackStateFlag::MeasurementFlag)){
78 if (
m_trackstate.typeFlags().test(Acts::TrackStateFlag::OutlierFlag ))
84 if (
m_trackstate.typeFlags().test(Acts::TrackStateFlag::HoleFlag))
87 if (
m_trackstate.typeFlags().test(Acts::TrackStateFlag::MaterialFlag ))
101 return surface().center(
common()->geometryContext().context() );
103 "AscObj_TrackState::approxCenter() WARNING: Failed to determine"
104 " position from either params or surface");
112 return static_cast<int>(
c.z() /
l) + 1000 *
static_cast<int>(
c.y() /
l) +
113 1000000 *
static_cast<int>(
c.x() /
l);
120 SoSeparator*& shape_detailed,
126 SoSeparator* param_simple =
new SoSeparator;
127 SoSeparator* param_detailed =
new SoSeparator;
133 "AscObj_TrackState::addTrackParamInfoToShapes() - no reference "
138 const Acts::BoundTrackParameters trackparams(
141 auto p1 = trackparams.position(
common()->geometryContext().context());
143 auto u = trackparams.direction().unit();
149 SoLineSet*
line =
new SoLineSet();
150 SoVertexProperty* vertices =
new SoVertexProperty();
151 vertices->vertex.set1Value(0,
p1.x(),
p1.y(),
p1.z());
152 vertices->vertex.set1Value(1,
p2.x(),
p2.y(),
p2.z());
153 line->numVertices.set1Value(0, 2);
156 SoPointSet*
points =
new SoPointSet;
157 SoVertexProperty* vertices2 =
new SoVertexProperty;
158 vertices2->vertex.set1Value(0,
p1.x(),
p1.y(),
p1.z());
160 line->vertexProperty = vertices;
161 points->vertexProperty = vertices2;
166 (isHole && (
trackHandle()->customColouredTSOSParts() &
168 SoMaterial*
mat = isHole
171 SoSeparator*
sep =
new SoSeparator;
175 param_simple->addChild(
sep);
176 param_detailed->addChild(
sep);
178 param_simple->addChild(
line);
179 param_simple->addChild(
points);
180 param_detailed->addChild(
line);
181 param_detailed->addChild(
points);
183 if (showParsErrors) {
186 shape_simple->addChild(param_simple);
187 shape_detailed->addChild(param_detailed);
193 SoSeparator*& shape_detailed) {
205 shape_detailed->addChild(sotra);
255 SoNode*& shape_detailed) {
258 if (shape_detailed->getTypeId().isDerivedFrom(SoSeparator::getClassTypeId())) {
260 static_cast<SoSeparator*
>(shape_detailed)->insertChild(
mat,0);
268 SoSeparator *
sep =
new SoSeparator;
270 sep->addChild(shape_detailed);
271 shape_detailed =
sep;
277 SoSeparator*& shape_detailed,
278 const Acts::Surface& surface) {
280 SoNode * nodeToAddSimple =
nullptr;
281 SoNode * nodeToAddDetailed =
nullptr;
284 switch (
surface.bounds().type()) {
285 case Acts::SurfaceBounds::BoundsType::eBoundless: {
286 const double halfX = 100.0;
287 const double halfY = 100.0;
290 0.5 * surfaceThickness);
292 nodeToAddDetailed = box;
295 case Acts::SurfaceBounds::BoundsType::eRectangle: {
297 const Acts::RectangleBounds& rectBounds =
298 dynamic_cast<const Acts::RectangleBounds&
>(
surface.bounds());
299 const double halfX = rectBounds.halfLengthX();
300 const double halfY = rectBounds.halfLengthY();
303 0.5 * surfaceThickness);
305 nodeToAddDetailed = box;
315 if (nodeToAddDetailed!=
nullptr){
317 shape_simple->addChild(nodeToAddDetailed);
318 shape_detailed->addChild(nodeToAddDetailed);
323 SoSeparator*& shape_detailed,
324 const Acts::Surface& surface) {
325 SoNode * nodeToAddSimple =
nullptr;
326 SoNode * nodeToAddDetailed =
nullptr;
328 switch (
surface.bounds().type()) {
329 case Acts::SurfaceBounds::BoundsType::eLine: {
330 const Acts::LineBounds& lineBounds =
331 dynamic_cast<const Acts::LineBounds&
>(
surface.bounds());
332 double hlength = lineBounds.get(Acts::LineBounds::eHalfLengthZ);
334 SoVertexProperty * scatVtxProperty =
new SoVertexProperty();
335 scatVtxProperty->vertex.set1Value(0, 0.0,0.0,-hlength);
336 scatVtxProperty->vertex.set1Value(1, 0.0,0.0, hlength);
337 SoLineSet * lineSurface =
new SoLineSet();
338 lineSurface->numVertices = 2;
339 lineSurface->vertexProperty = scatVtxProperty;
341 nodeToAddSimple = lineSurface;
343 double radius = lineBounds.get(Acts::LineBounds::eR);
346 (*lineSurfaceDetailed).pRMin = 0.;
347 (*lineSurfaceDetailed).pRMax =
radius;
348 (*lineSurfaceDetailed).pDz = hlength;
350 nodeToAddDetailed = lineSurfaceDetailed;
358 if (nodeToAddDetailed!=
nullptr){
360 shape_simple->addChild(nodeToAddDetailed);
361 shape_detailed->addChild(nodeToAddDetailed);
367 SoSeparator*& , SoSeparator*& ) {}
370 SoSeparator*& shape_detailed) {
376 !
flag.test(Acts::TrackStateFlag::MeasurementFlag ||
393 shape_simple->addChild(
mat);
394 shape_detailed->addChild(
mat);
400 assert(sl !=
nullptr);
406 switch (measurementType) {
427 "AscObj_TrackState::addMeasurementToShapes: Unable to handle this "
428 "measurement type ");
437 SoSeparator*& shape_detailed) {
439 shape_simple =
new SoSeparator;
441 shape_detailed =
new SoSeparator;
446 SoSeparator*& shape_detailed) {
490 if (
common()->controller()->orientAndZoomOnSingleSelection() )