ATLAS Offline Software
SoTessellated.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef SOTESSELLATED_H
6 #define SOTESSELLATED_H
7 
8 #include <Inventor/C/errors/debugerror.h>
9 #include <Inventor/fields/SoSFNode.h>
10 #include <Inventor/fields/SoSFBool.h>
11 #include <Inventor/nodes/SoShape.h>
12 #include <vector>
13 
14 //**************************************************************//
15 // //
16 // Class SoTessellated //
17 // //
18 // Visualization of Tessellated Solid - generic solid defined //
19 // by a number of either triangular or quadrangular facets. //
20 // //
21 //**************************************************************//
22 
23 class SoTessellated : public SoShape
24 {
25 
27 
28  public:
29 
30  //Fields:
31  SoSFBool drawEdgeLines; //Default: False
32  SoSFBool forceEdgeLinesInBaseColour; //Default: True
33  SoSFNode alternateRep;
34 
35  // Following two methods add facets to the solid
36  //
37  // NB: must provide ABSOLUTE coordinates!
38  //
39  // (relative coordinates should be handled in the
40  // SoVisualizeAction beforehand)
41  //
42  void addTriangularFacet(double x1, double y1, double z1,
43  double x2, double y2, double z2,
44  double x3, double y3, double z3);
45 
46  void addQuadrangularFacet(double x1, double y1, double z1,
47  double x2, double y2, double z2,
48  double x3, double y3, double z3,
49  double x4, double y4, double z4);
50 
51  // Finalize:
52  // 1. Compute bounding box and center
53  // 2. Touch drawEdgeLines
54  void finalize();
55 
56  //_____ Required stuff _____
57  SoTessellated();
58  static void initClass();
59  virtual void generateAlternateRep();
60  virtual void clearAlternateRep();
61 
62  protected:
63 
64  virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f &center );
65  virtual void generatePrimitives(SoAction *action);
66  virtual ~SoTessellated();
67 
68  private:
69 
70  void setupDefaultPoints();
71 
72  std::vector<float> m_points;
73  std::vector<float> m_normals;
74  SbBox3f m_bbox;
75  SbVec3f m_center;
76 };
77 
78 #endif
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
SoTessellated::generateAlternateRep
virtual void generateAlternateRep()
Definition: SoTessellated.cxx:196
SoTessellated::finalize
void finalize()
Definition: SoTessellated.cxx:81
SoTessellated::setupDefaultPoints
void setupDefaultPoints()
Definition: SoTessellated.cxx:177
SoTessellated::drawEdgeLines
SoSFBool drawEdgeLines
Definition: SoTessellated.h:31
plotBeamSpotCompare.x2
x2
Definition: plotBeamSpotCompare.py:218
SoTessellated::m_bbox
SbBox3f m_bbox
Definition: SoTessellated.h:74
SoTessellated::SO_NODE_HEADER
SO_NODE_HEADER(SoTessellated)
SoTessellated::generatePrimitives
virtual void generatePrimitives(SoAction *action)
Definition: SoTessellated.cxx:108
SoTessellated::forceEdgeLinesInBaseColour
SoSFBool forceEdgeLinesInBaseColour
Definition: SoTessellated.h:32
SoTessellated::alternateRep
SoSFNode alternateRep
Definition: SoTessellated.h:33
SoTessellated::initClass
static void initClass()
Definition: SoTessellated.cxx:19
makeTRTBarrelCans.y1
tuple y1
Definition: makeTRTBarrelCans.py:15
SoTessellated::addQuadrangularFacet
void addQuadrangularFacet(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, double x4, double y4, double z4)
Definition: SoTessellated.cxx:71
SoTessellated
Definition: SoTessellated.h:24
makeTRTBarrelCans.y2
tuple y2
Definition: makeTRTBarrelCans.py:18
SoTessellated::~SoTessellated
virtual ~SoTessellated()
Definition: SoTessellated.cxx:38
SoTessellated::m_normals
std::vector< float > m_normals
Definition: SoTessellated.h:73
SoTessellated::computeBBox
virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f &center)
Definition: SoTessellated.cxx:188
SoTessellated::clearAlternateRep
virtual void clearAlternateRep()
Definition: SoTessellated.cxx:250
SoTessellated::m_points
std::vector< float > m_points
Definition: SoTessellated.h:72
SoTessellated::SoTessellated
SoTessellated()
Definition: SoTessellated.cxx:28
python.CaloScaleNoiseConfig.action
action
Definition: CaloScaleNoiseConfig.py:77
SoTessellated::addTriangularFacet
void addTriangularFacet(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3)
Definition: SoTessellated.cxx:43
SoTessellated::m_center
SbVec3f m_center
Definition: SoTessellated.h:75