ATLAS Offline Software
SoTubs.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 /*-----------------------------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 class SoSFNode;
23 
25 
50 class SoTubs:public SoShape {
51 
52  // The following is required:
54 
55 public:
56 
57  //
59  //
60  SoSFFloat pRMin;
61  //
63  //
64  SoSFFloat pRMax;
65  //
67  //
68  SoSFFloat pDz;
69  //
71  //
72  SoSFFloat pSPhi;
73  //
75  //
76  SoSFFloat pDPhi;
77  //
80  //
81  SoSFInt32 pOverrideNPhi;
82  //
84  //
85  SoSFNode alternateRep;
86 
87  SoSFBool drawEdgeLines;//Default: False
88 
89  //
91  //
92  SoTubs();
93 
94  //
96  //
97  static void initClass();
98 
99  //
105  //
106  virtual void generateAlternateRep();
107 
108  //
110  //
111  virtual void clearAlternateRep();
112 
113 protected:
114 
115  //
117  //
118  virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f &center );
119 
120  //
122  //
123  virtual void generatePrimitives(SoAction *action);
124 
125  //
127  //
128  virtual SoChildList *getChildren() const;
129 
130 protected:
131  //
133  //
134  virtual ~SoTubs();
135 
136 private:
137 
138  //
141  //
142  void generateChildren();
143 
144  //
147  //
148  void updateChildren();
149 
150  //
152  //
153  SoChildList *m_children;
154 
155  //
157  //
158  void inc(double & sinPhi, double & cosPhi, double sinDeltaPhi, double cosDeltaPhi) const {
159  double oldSin=sinPhi,oldCos=cosPhi;
160  sinPhi = oldSin*cosDeltaPhi+oldCos*sinDeltaPhi;
161  cosPhi = oldCos*cosDeltaPhi-oldSin*sinDeltaPhi;
162  }
163 
164 };
165 
166 #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:369
SoTubs::getChildren
virtual SoChildList * getChildren() const
GetChildList, required whenever the class has hidden children.
Definition: SoTubs.cxx:354
SoTubs
SoTubs - Inventor version of the G4Tubs Geant Geometry entity.
Definition: SoTubs.h:50
SoTubs::clearAlternateRep
virtual void clearAlternateRep()
We better be able to clear it, too!
Definition: SoTubs.cxx:573
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:158
SoTubs::generatePrimitives
virtual void generatePrimitives(SoAction *action)
Generate Primitives, required.
Definition: SoTubs.cxx:77
SoTubs::computeBBox
virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f &center)
compute bounding Box, required
Definition: SoTubs.cxx:360
SoTubs::alternateRep
SoSFNode alternateRep
Alternate rep - required.
Definition: SoTubs.h:85
SoTubs::~SoTubs
virtual ~SoTubs()
Destructor, required.
Definition: SoTubs.cxx:62
SoTubs::initClass
static void initClass()
Class Initializer, required.
Definition: SoTubs.cxx:68
SoTubs::drawEdgeLines
SoSFBool drawEdgeLines
Definition: SoTubs.h:87
SoTubs::generateAlternateRep
virtual void generateAlternateRep()
Generate AlternateRep, required.
Definition: SoTubs.cxx:562
SoTubs::pDPhi
SoSFFloat pDPhi
Delta-angle, in radians.
Definition: SoTubs.h:76
SoTubs::pOverrideNPhi
SoSFInt32 pOverrideNPhi
Override number of phi subdivision used for rendering shape (i.e.
Definition: SoTubs.h:81
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:68
SoTubs::m_children
SoChildList * m_children
ChildList. Required whenever the class has hidden children.
Definition: SoTubs.h:153
SoTubs::generateChildren
void generateChildren()
Generate Children.
Definition: SoTubs.cxx:538
SoTubs::pRMin
SoSFFloat pRMin
Inside radius of the tube.
Definition: SoTubs.h:60
SoTubs::pRMax
SoSFFloat pRMax
Outside radius of the tube.
Definition: SoTubs.h:64
SoTubs::pSPhi
SoSFFloat pSPhi
Starting angle, in radians.
Definition: SoTubs.h:72