ATLAS Offline Software
SoTubs.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /*-----------------------------HEPVis----------------------------------------*/
6 /* */
7 /* Node: SoTubs */
8 /* Description: Represents the G4Tubs Geant Geometry entity */
9 /* Author: Joe Boudreau Nov 11 1996 */
10 /* */
11 /*---------------------------------------------------------------------------*/
12 #ifndef HEPVis_SoTubs_h
13 #define HEPVis_SoTubs_h
14 
15 #include <Inventor/C/errors/debugerror.h>
16 #include <Inventor/fields/SoSFFloat.h>
17 #include <Inventor/fields/SoSFNode.h>
18 #include <Inventor/fields/SoSFBool.h>
19 #include <Inventor/fields/SoSFInt32.h>
20 #include <Inventor/nodes/SoShape.h>
21 
22 #include <memory>
23 
24 class SoSFNode;
25 
27 
52 class SoTubs:public SoShape {
53 
54  // The following is required:
56 
57 public:
58 
59  //
61  //
62  SoSFFloat pRMin;
63  //
65  //
66  SoSFFloat pRMax;
67  //
69  //
70  SoSFFloat pDz;
71  //
73  //
74  SoSFFloat pSPhi;
75  //
77  //
78  SoSFFloat pDPhi;
79  //
82  //
83  SoSFInt32 pOverrideNPhi;
84  //
86  //
87  SoSFNode alternateRep;
88 
89  SoSFBool drawEdgeLines;//Default: False
90 
91  //
93  //
94  SoTubs();
95 
96  //
98  //
99  static void initClass();
100 
101  //
107  //
108  virtual void generateAlternateRep();
109 
110  //
112  //
113  virtual void clearAlternateRep();
114 
115 protected:
116 
117  //
119  //
120  virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f &center );
121 
122  //
124  //
125  virtual void generatePrimitives(SoAction *action);
126 
127  //
129  //
130  virtual SoChildList *getChildren() const;
131 
132 private:
133 
134  //
137  //
138  void generateChildren();
139 
140  //
143  //
144  void updateChildren();
145 
146  //
148  //
149  std::unique_ptr<SoChildList> m_children;
150 
151  //
153  //
154  void inc(double & sinPhi, double & cosPhi, double sinDeltaPhi, double cosDeltaPhi) const {
155  double oldSin=sinPhi,oldCos=cosPhi;
156  sinPhi = oldSin*cosDeltaPhi+oldCos*sinDeltaPhi;
157  cosPhi = oldCos*cosDeltaPhi-oldSin*sinDeltaPhi;
158  }
159 
160 };
161 
162 #endif
SoTubs::SoTubs
SoTubs()
Constructor, required.
Definition: SoTubs.cxx:40
SoTubs::updateChildren
void updateChildren()
Used to modify hidden children when a data field is changed.
Definition: SoTubs.cxx:364
SoTubs::getChildren
virtual SoChildList * getChildren() const
GetChildList, required whenever the class has hidden children.
Definition: SoTubs.cxx:349
SoTubs
SoTubs - Inventor version of the G4Tubs Geant Geometry entity.
Definition: SoTubs.h:52
SoTubs::clearAlternateRep
virtual void clearAlternateRep()
We better be able to clear it, too!
Definition: SoTubs.cxx:568
SoTubs::inc
void inc(double &sinPhi, double &cosPhi, double sinDeltaPhi, double cosDeltaPhi) const
help with trigonometry. increments sines an cosines by an angle.
Definition: SoTubs.h:154
SoTubs::m_children
std::unique_ptr< SoChildList > m_children
ChildList. Required whenever the class has hidden children.
Definition: SoTubs.h:149
SoTubs::generatePrimitives
virtual void generatePrimitives(SoAction *action)
Generate Primitives, required.
Definition: SoTubs.cxx:72
SoTubs::computeBBox
virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f &center)
compute bounding Box, required
Definition: SoTubs.cxx:355
SoTubs::alternateRep
SoSFNode alternateRep
Alternate rep - required.
Definition: SoTubs.h:87
SoTubs::initClass
static void initClass()
Class Initializer, required.
Definition: SoTubs.cxx:63
SoTubs::drawEdgeLines
SoSFBool drawEdgeLines
Definition: SoTubs.h:89
SoTubs::generateAlternateRep
virtual void generateAlternateRep()
Generate AlternateRep, required.
Definition: SoTubs.cxx:557
SoTubs::pDPhi
SoSFFloat pDPhi
Delta-angle, in radians.
Definition: SoTubs.h:78
SoTubs::pOverrideNPhi
SoSFInt32 pOverrideNPhi
Override number of phi subdivision used for rendering shape (i.e.
Definition: SoTubs.h:83
SoTubs::SO_NODE_HEADER
SO_NODE_HEADER(SoTubs)
python.CaloScaleNoiseConfig.action
action
Definition: CaloScaleNoiseConfig.py:77
SoTubs::pDz
SoSFFloat pDz
Half-length in Z.
Definition: SoTubs.h:70
SoTubs::generateChildren
void generateChildren()
Generate Children.
Definition: SoTubs.cxx:533
SoTubs::pRMin
SoSFFloat pRMin
Inside radius of the tube.
Definition: SoTubs.h:62
SoTubs::pRMax
SoSFFloat pRMax
Outside radius of the tube.
Definition: SoTubs.h:66
SoTubs::pSPhi
SoSFFloat pSPhi
Starting angle, in radians.
Definition: SoTubs.h:74