ATLAS Offline Software
SoCons.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: 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 #include <memory>
23 
24 
25 class SoSFNode;
27 
53 class SoCons:public SoShape {
54 
55  // The following is required:
57 
58 public:
59 
60  //
62  //
63  SoSFFloat fRmin1;
64  //
66  //
67  SoSFFloat fRmin2;
68  //
70  //
71  SoSFFloat fRmax1;
72  //
74  //
75  SoSFFloat fRmax2;
76  //
78  //
79  SoSFFloat fDz;
80  //
82  //
83  SoSFFloat fSPhi;
84  //
86  //
87  SoSFFloat fDPhi;
88  //
90  //
91  SoSFBool smoothDraw;
92  //
95  //
96  SoSFInt32 pOverrideNPhi;
97  //
99  //
100  SoSFNode alternateRep;
101 
102  //
104  //
105  SoCons();
106 
107  //
109  //
110  static void initClass();
111 
112  //
118  //
119  virtual void generateAlternateRep();
120 
121  //
123  //
124  virtual void clearAlternateRep();
125 
126 protected:
127 
128  //
130  //
131  virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f &center );
132 
133  //
135  //
136  virtual void generatePrimitives(SoAction *action);
137 
138  //
140  //
141  virtual SoChildList *getChildren() const;
142 
143 private:
144 
145  //
148  //
149  void generateChildren();
150 
151  //
154  //
155  void updateChildren();
156 
157  //
159  //
160  std::unique_ptr<SoChildList> m_children;
161 
162  //
164  //
165  void inc(double & sinPhi, double & cosPhi, double sinDeltaPhi, double cosDeltaPhi) const {
166  double oldSin=sinPhi,oldCos=cosPhi;
167  sinPhi = oldSin*cosDeltaPhi+oldCos*sinDeltaPhi;
168  cosPhi = oldCos*cosDeltaPhi-oldSin*sinDeltaPhi;
169  }
170 };
171 
172 #endif
SoCons::fDz
SoSFFloat fDz
Half-length along Z.
Definition: SoCons.h:79
SoCons::m_children
std::unique_ptr< SoChildList > m_children
ChildList. Required whenever the class has hidden children.
Definition: SoCons.h:160
SoCons::fRmax2
SoSFFloat fRmax2
Outside radius at +fDz.
Definition: SoCons.h:75
SoCons::SO_NODE_HEADER
SO_NODE_HEADER(SoCons)
SoCons::fDPhi
SoSFFloat fDPhi
Delta-angle, in radians.
Definition: SoCons.h:87
SoCons::fSPhi
SoSFFloat fSPhi
Starting angle, in radians.
Definition: SoCons.h:83
SoCons::clearAlternateRep
virtual void clearAlternateRep()
We better be able to clear it, too!
Definition: SoCons.cxx:439
SoCons::updateChildren
void updateChildren()
Used to modify hidden children when a data field is changed.
Definition: SoCons.cxx:251
SoCons::alternateRep
SoSFNode alternateRep
Alternate rep required - for use by users without HEPVis shared objects.
Definition: SoCons.h:100
SoCons::fRmin1
SoSFFloat fRmin1
Inside radius at -fDz.
Definition: SoCons.h:63
SoCons::generatePrimitives
virtual void generatePrimitives(SoAction *action)
Generate Primitives, required.
Definition: SoCons.cxx:69
SoCons::SoCons
SoCons()
Constructor, required.
Definition: SoCons.cxx:37
SoCons::pOverrideNPhi
SoSFInt32 pOverrideNPhi
Override number of phi subdivision used for rendering shape (i.e.
Definition: SoCons.h:96
SoCons::computeBBox
virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f &center)
compute bounding Box, required
Definition: SoCons.cxx:239
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:233
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:165
SoCons::initClass
static void initClass()
Class Initializer, required.
Definition: SoCons.cxx:59
SoCons
SoCons - Inventor version of the G4Cons Geant Geometry entity.
Definition: SoCons.h:53
SoCons::smoothDraw
SoSFBool smoothDraw
An Inventor option - slightly better render, worse performance.
Definition: SoCons.h:91
SoCons::generateChildren
void generateChildren()
Generate Children.
Definition: SoCons.cxx:404
SoCons::fRmax1
SoSFFloat fRmax1
Outside radius at -fDz.
Definition: SoCons.h:71
SoCons::fRmin2
SoSFFloat fRmin2
Inside radius at +fDz.
Definition: SoCons.h:67
SoCons::generateAlternateRep
virtual void generateAlternateRep()
Generate AlternateRep, required.
Definition: SoCons.cxx:428