ATLAS Offline Software
SoCons.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: SoCons */
8 /* Description: Represents the G4Cons Geant Geometry entity */
9 /* Author: Joe Boudreau Nov 11 1996 */
10 /* */
11 /*---------------------------------------------------------------------------*/
12 #ifndef HEPVis_SoCons_h
13 #define HEPVis_SoCons_h
14 
15 #include <Inventor/C/errors/debugerror.h>
16 #include <Inventor/fields/SoSFFloat.h>
17 #include <Inventor/fields/SoSFInt32.h>
18 #include <Inventor/fields/SoSFNode.h>
19 #include <Inventor/fields/SoSFBool.h>
20 #include <Inventor/nodes/SoShape.h>
21 
22 class SoSFNode;
24 
50 class SoCons:public SoShape {
51 
52  // The following is required:
54 
55 public:
56 
57  //
59  //
60  SoSFFloat fRmin1;
61  //
63  //
64  SoSFFloat fRmin2;
65  //
67  //
68  SoSFFloat fRmax1;
69  //
71  //
72  SoSFFloat fRmax2;
73  //
75  //
76  SoSFFloat fDz;
77  //
79  //
80  SoSFFloat fSPhi;
81  //
83  //
84  SoSFFloat fDPhi;
85  //
87  //
88  SoSFBool smoothDraw;
89  //
92  //
93  SoSFInt32 pOverrideNPhi;
94  //
96  //
97  SoSFNode alternateRep;
98 
99  //
101  //
102  SoCons();
103 
104  //
106  //
107  static void initClass();
108 
109  //
115  //
116  virtual void generateAlternateRep();
117 
118  //
120  //
121  virtual void clearAlternateRep();
122 
123 protected:
124 
125  //
127  //
128  virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f &center );
129 
130  //
132  //
133  virtual void generatePrimitives(SoAction *action);
134 
135  //
137  //
138  virtual SoChildList *getChildren() const;
139 
140 
141 protected:
142  //
144  //
145  virtual ~SoCons();
146 
147 private:
148 
149  //
152  //
153  void generateChildren();
154 
155  //
158  //
159  void updateChildren();
160 
161  //
163  //
164  SoChildList *m_children;
165 
166  //
168  //
169  void inc(double & sinPhi, double & cosPhi, double sinDeltaPhi, double cosDeltaPhi) const {
170  double oldSin=sinPhi,oldCos=cosPhi;
171  sinPhi = oldSin*cosDeltaPhi+oldCos*sinDeltaPhi;
172  cosPhi = oldCos*cosDeltaPhi-oldSin*sinDeltaPhi;
173  }
174 };
175 
176 #endif
SoCons::fDz
SoSFFloat fDz
Half-length along Z.
Definition: SoCons.h:76
SoCons::fRmax2
SoSFFloat fRmax2
Outside radius at +fDz.
Definition: SoCons.h:72
SoCons::SO_NODE_HEADER
SO_NODE_HEADER(SoCons)
SoCons::fDPhi
SoSFFloat fDPhi
Delta-angle, in radians.
Definition: SoCons.h:84
SoCons::fSPhi
SoSFFloat fSPhi
Starting angle, in radians.
Definition: SoCons.h:80
SoCons::clearAlternateRep
virtual void clearAlternateRep()
We better be able to clear it, too!
Definition: SoCons.cxx:443
SoCons::updateChildren
void updateChildren()
Used to modify hidden children when a data field is changed.
Definition: SoCons.cxx:255
SoCons::alternateRep
SoSFNode alternateRep
Alternate rep required - for use by users without HEPVis shared objects.
Definition: SoCons.h:97
SoCons::fRmin1
SoSFFloat fRmin1
Inside radius at -fDz.
Definition: SoCons.h:60
SoCons::generatePrimitives
virtual void generatePrimitives(SoAction *action)
Generate Primitives, required.
Definition: SoCons.cxx:73
SoCons::SoCons
SoCons()
Constructor, required.
Definition: SoCons.cxx:37
SoCons::~SoCons
virtual ~SoCons()
Destructor, required.
Definition: SoCons.cxx:58
SoCons::pOverrideNPhi
SoSFInt32 pOverrideNPhi
Override number of phi subdivision used for rendering shape (i.e.
Definition: SoCons.h:93
SoCons::m_children
SoChildList * m_children
ChildList. Required whenever the class has hidden children.
Definition: SoCons.h:164
SoCons::computeBBox
virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f &center)
compute bounding Box, required
Definition: SoCons.cxx:243
python.CaloScaleNoiseConfig.action
action
Definition: CaloScaleNoiseConfig.py:77
SoCons::getChildren
virtual SoChildList * getChildren() const
GetChildList, required whenever the class has hidden children.
Definition: SoCons.cxx:237
SoCons::inc
void inc(double &sinPhi, double &cosPhi, double sinDeltaPhi, double cosDeltaPhi) const
help with trigonometry. increments sines an cosines by an angle.
Definition: SoCons.h:169
SoCons::initClass
static void initClass()
Class Initializer, required.
Definition: SoCons.cxx:63
SoCons
SoCons - Inventor version of the G4Cons Geant Geometry entity.
Definition: SoCons.h:50
SoCons::smoothDraw
SoSFBool smoothDraw
An Inventor option - slightly better render, worse performance.
Definition: SoCons.h:88
SoCons::generateChildren
void generateChildren()
Generate Children.
Definition: SoCons.cxx:408
SoCons::fRmax1
SoSFFloat fRmax1
Outside radius at -fDz.
Definition: SoCons.h:68
SoCons::fRmin2
SoSFFloat fRmin2
Inside radius at +fDz.
Definition: SoCons.h:64
SoCons::generateAlternateRep
virtual void generateAlternateRep()
Generate AlternateRep, required.
Definition: SoCons.cxx:432