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 #include "Acts/Surfaces/ConeSurface.hpp"
53 #include "Acts/Surfaces/CylinderSurface.hpp"
54 #include "Acts/Surfaces/DiscSurface.hpp"
55 #include "Acts/Surfaces/PerigeeSurface.hpp"
56 #include "Acts/Surfaces/PlaneSurface.hpp"
57 #include "Acts/Surfaces/RectangleBounds.hpp"
58 #include "Acts/Surfaces/StrawSurface.hpp"
59 #include "Acts/Surfaces/SurfaceBounds.hpp"
61 static double surfaceThickness = 0.1;
66 const typename ActsTrk::TrackStateBackend::ConstTrackStateProxy& trackstate)
69 m_indexOfPointOnTrack(indexOfPointOnTrack),
71 m_objBrowseTree(nullptr),
72 m_trackstate(trackstate)
76 if (
surface().associatedDetectorElement())
82 if (
m_trackstate.typeFlags().test(Acts::TrackStateFlag::ParameterFlag ))
85 if (
m_trackstate.typeFlags().test(Acts::TrackStateFlag::MeasurementFlag)){
87 if (
m_trackstate.typeFlags().test(Acts::TrackStateFlag::OutlierFlag ))
93 if (
m_trackstate.typeFlags().test(Acts::TrackStateFlag::HoleFlag))
96 if (
m_trackstate.typeFlags().test(Acts::TrackStateFlag::MaterialFlag ))
110 return surface().center(
common()->geometryContext().context() );
112 "AscObj_TrackState::approxCenter() WARNING: Failed to determine"
113 " position from either params or surface");
121 return static_cast<int>(
c.z() /
l) + 1000 *
static_cast<int>(
c.y() /
l) +
122 1000000 *
static_cast<int>(
c.x() /
l);
129 SoSeparator*& shape_detailed,
135 SoSeparator* param_simple =
new SoSeparator;
136 SoSeparator* param_detailed =
new SoSeparator;
142 "AscObj_TrackState::addTrackParamInfoToShapes() - no reference "
147 const Acts::BoundTrackParameters trackparams(
150 auto p1 = trackparams.position(
common()->geometryContext().context());
152 auto u = trackparams.direction().unit();
158 SoLineSet*
line =
new SoLineSet();
159 SoVertexProperty* vertices =
new SoVertexProperty();
160 vertices->vertex.set1Value(0,
p1.x(),
p1.y(),
p1.z());
161 vertices->vertex.set1Value(1,
p2.x(),
p2.y(),
p2.z());
162 line->numVertices.set1Value(0, 2);
165 SoPointSet*
points =
new SoPointSet;
166 SoVertexProperty* vertices2 =
new SoVertexProperty;
167 vertices2->vertex.set1Value(0,
p1.x(),
p1.y(),
p1.z());
169 line->vertexProperty = vertices;
170 points->vertexProperty = vertices2;
175 (isHole && (
trackHandle()->customColouredTSOSParts() &
177 SoMaterial*
mat = isHole
180 SoSeparator*
sep =
new SoSeparator;
184 param_simple->addChild(
sep);
185 param_detailed->addChild(
sep);
187 param_simple->addChild(
line);
188 param_simple->addChild(
points);
189 param_detailed->addChild(
line);
190 param_detailed->addChild(
points);
192 if (showParsErrors) {
195 shape_simple->addChild(param_simple);
196 shape_detailed->addChild(param_detailed);
202 SoSeparator*& shape_detailed) {
214 shape_detailed->addChild(sotra);
264 SoNode*& shape_detailed) {
267 if (shape_detailed->getTypeId().isDerivedFrom(SoSeparator::getClassTypeId())) {
269 static_cast<SoSeparator*
>(shape_detailed)->insertChild(
mat,0);
277 SoSeparator *
sep =
new SoSeparator;
279 sep->addChild(shape_detailed);
280 shape_detailed =
sep;
286 SoSeparator*& shape_detailed,
287 const Acts::Surface& surface) {
289 SoNode * nodeToAddSimple =
nullptr;
290 SoNode * nodeToAddDetailed =
nullptr;
293 switch (
surface.bounds().type()) {
294 case Acts::SurfaceBounds::BoundsType::eBoundless: {
295 const double halfX = 100.0;
296 const double halfY = 100.0;
299 0.5 * surfaceThickness);
301 nodeToAddDetailed = box;
304 case Acts::SurfaceBounds::BoundsType::eRectangle: {
306 const Acts::RectangleBounds& rectBounds =
307 dynamic_cast<const Acts::RectangleBounds&
>(
surface.bounds());
308 const double halfX = rectBounds.halfLengthX();
309 const double halfY = rectBounds.halfLengthY();
312 0.5 * surfaceThickness);
314 nodeToAddDetailed = box;
324 if (nodeToAddDetailed!=
nullptr){
326 shape_simple->addChild(nodeToAddDetailed);
327 shape_detailed->addChild(nodeToAddDetailed);
332 SoSeparator*& shape_detailed,
333 const Acts::Surface& surface) {
334 SoNode * nodeToAddSimple =
nullptr;
335 SoNode * nodeToAddDetailed =
nullptr;
337 switch (
surface.bounds().type()) {
338 case Acts::SurfaceBounds::BoundsType::eLine: {
339 const Acts::LineBounds& lineBounds =
340 dynamic_cast<const Acts::LineBounds&
>(
surface.bounds());
341 double hlength = lineBounds.get(Acts::LineBounds::eHalfLengthZ);
343 SoVertexProperty * scatVtxProperty =
new SoVertexProperty();
344 scatVtxProperty->vertex.set1Value(0, 0.0,0.0,-hlength);
345 scatVtxProperty->vertex.set1Value(1, 0.0,0.0, hlength);
346 SoLineSet * lineSurface =
new SoLineSet();
347 lineSurface->numVertices = 2;
348 lineSurface->vertexProperty = scatVtxProperty;
350 nodeToAddSimple = lineSurface;
352 double radius = lineBounds.get(Acts::LineBounds::eR);
355 (*lineSurfaceDetailed).pRMin = 0.;
356 (*lineSurfaceDetailed).pRMax =
radius;
357 (*lineSurfaceDetailed).pDz = hlength;
359 nodeToAddDetailed = lineSurfaceDetailed;
367 if (nodeToAddDetailed!=
nullptr){
369 shape_simple->addChild(nodeToAddDetailed);
370 shape_detailed->addChild(nodeToAddDetailed);
376 SoSeparator*& , SoSeparator*& ) {}
379 SoSeparator*& shape_detailed) {
385 !
flag.test(Acts::TrackStateFlag::MeasurementFlag ||
402 shape_simple->addChild(
mat);
403 shape_detailed->addChild(
mat);
409 assert(sl !=
nullptr);
415 switch (measurementType) {
436 "AscObj_TrackState::addMeasurementToShapes: Unable to handle this "
437 "measurement type ");
446 SoSeparator*& shape_detailed) {
448 shape_simple =
new SoSeparator;
450 shape_detailed =
new SoSeparator;
455 SoSeparator*& shape_detailed) {
499 if (
common()->controller()->orientAndZoomOnSingleSelection() )