ATLAS Offline Software
Loading...
Searching...
No Matches
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
24class SoSFNode;
25
27
51
52class SoTubs:public SoShape {
53
54 // The following is required:
56
57public:
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
115protected:
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
132private:
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
std::unique_ptr< SoChildList > m_children
ChildList. Required whenever the class has hidden children.
Definition SoTubs.h:149
SoSFInt32 pOverrideNPhi
Override number of phi subdivision used for rendering shape (i.e.
Definition SoTubs.h:83
virtual SoChildList * getChildren() const
GetChildList, required whenever the class has hidden children.
Definition SoTubs.cxx:349
virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f &center)
compute bounding Box, required
Definition SoTubs.cxx:355
SoSFBool drawEdgeLines
Definition SoTubs.h:89
SoSFFloat pDz
Half-length in Z.
Definition SoTubs.h:70
virtual void clearAlternateRep()
We better be able to clear it, too!
Definition SoTubs.cxx:568
SO_NODE_HEADER(SoTubs)
SoSFNode alternateRep
Alternate rep - required.
Definition SoTubs.h:87
virtual void generatePrimitives(SoAction *action)
Generate Primitives, required.
Definition SoTubs.cxx:72
SoSFFloat pDPhi
Delta-angle, in radians.
Definition SoTubs.h:78
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
virtual void generateAlternateRep()
Generate AlternateRep, required.
Definition SoTubs.cxx:557
SoSFFloat pSPhi
Starting angle, in radians.
Definition SoTubs.h:74
static void initClass()
Class Initializer, required.
Definition SoTubs.cxx:63
void updateChildren()
Used to modify hidden children when a data field is changed.
Definition SoTubs.cxx:364
void generateChildren()
Generate Children.
Definition SoTubs.cxx:533
SoTubs()
Constructor, required.
Definition SoTubs.cxx:40
SoSFFloat pRMin
Inside radius of the tube.
Definition SoTubs.h:62
SoSFFloat pRMax
Outside radius of the tube.
Definition SoTubs.h:66