ATLAS Offline Software
Loading...
Searching...
No Matches
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
25class SoSFNode;
27
52
53class SoCons:public SoShape {
54
55 // The following is required:
57
58public:
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
126protected:
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
143private:
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
virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f &center)
compute bounding Box, required
Definition SoCons.cxx:239
SoCons()
Constructor, required.
Definition SoCons.cxx:37
SoSFFloat fDPhi
Delta-angle, in radians.
Definition SoCons.h:87
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
SoSFInt32 pOverrideNPhi
Override number of phi subdivision used for rendering shape (i.e.
Definition SoCons.h:96
virtual void generateAlternateRep()
Generate AlternateRep, required.
Definition SoCons.cxx:428
virtual void clearAlternateRep()
We better be able to clear it, too!
Definition SoCons.cxx:439
static void initClass()
Class Initializer, required.
Definition SoCons.cxx:59
SoSFFloat fSPhi
Starting angle, in radians.
Definition SoCons.h:83
SoSFFloat fRmax2
Outside radius at +fDz.
Definition SoCons.h:75
std::unique_ptr< SoChildList > m_children
ChildList. Required whenever the class has hidden children.
Definition SoCons.h:160
virtual void generatePrimitives(SoAction *action)
Generate Primitives, required.
Definition SoCons.cxx:69
SoSFFloat fRmax1
Outside radius at -fDz.
Definition SoCons.h:71
SoSFFloat fRmin1
Inside radius at -fDz.
Definition SoCons.h:63
SoSFFloat fRmin2
Inside radius at +fDz.
Definition SoCons.h:67
SoSFNode alternateRep
Alternate rep required - for use by users without HEPVis shared objects.
Definition SoCons.h:100
void updateChildren()
Used to modify hidden children when a data field is changed.
Definition SoCons.cxx:251
SoSFFloat fDz
Half-length along Z.
Definition SoCons.h:79
void generateChildren()
Generate Children.
Definition SoCons.cxx:404
virtual SoChildList * getChildren() const
GetChildList, required whenever the class has hidden children.
Definition SoCons.cxx:233
SO_NODE_HEADER(SoCons)
SoSFBool smoothDraw
An Inventor option - slightly better render, worse performance.
Definition SoCons.h:91