Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SoTubs.h
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // $Id: SoTubs.h 66373 2012-12-18 09:41:34Z gcosmo $
28 //
29 /*-----------------------------Hepvis----------------------------------------*/
30 /* */
31 /* Node: SoTubs */
32 /* Description: Represents the G4Tubs Geant Geometry entity */
33 /* Author: Joe Boudreau Nov 11 1996 */
34 /* */
35 /*---------------------------------------------------------------------------*/
36 #ifndef HEPVis_SoTubs_h
37 #define HEPVis_SoTubs_h
38 
39 #include <Inventor/fields/SoSFFloat.h>
40 #include <Inventor/fields/SoSFNode.h>
41 #include <Inventor/fields/SoSFBool.h>
42 #include <Inventor/nodes/SoShape.h>
43 
44 class SoSFNode;
45 
47 
70 #define SoTubs Geant4_SoTubs
71 
72 class SoTubs:public SoShape {
73 
74  // The following is required:
75  SO_NODE_HEADER(SoTubs);
76 
77 public:
78 
79  //
81  //
82  SoSFFloat pRMin;
83  //
85  //
86  SoSFFloat pRMax;
87  //
89  //
90  SoSFFloat pDz;
91  //
93  //
94  SoSFFloat pSPhi;
95  //
97  //
98  SoSFFloat pDPhi;
99  //
101  //
102  SoSFNode alternateRep;
103 
104  //
106  //
107  SoTubs();
108 
109  //
111  //
112  static void initClass();
113 
114  //
120  //
121  virtual void generateAlternateRep();
122 
123  //
125  //
126  virtual void clearAlternateRep();
127 
128 protected:
129 
130  //
132  //
133  virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f &center );
134 
135  //
137  //
138  virtual void generatePrimitives(SoAction *action);
139 
140  //
142  //
143  virtual SoChildList *getChildren() const;
144 
145 
146 protected:
147  //
149  //
150  virtual ~SoTubs();
151 
152 private:
153 
154  //
157  //
158  void generateChildren();
159 
160  //
163  //
164  void updateChildren();
165 
166  //
168  //
169  SoChildList *children;
170 
171  //
173  //
174  void inc(double & sinPhi, double & cosPhi, double sinDeltaPhi, double cosDeltaPhi) const {
175  double oldSin=sinPhi,oldCos=cosPhi;
176  sinPhi = oldSin*cosDeltaPhi+oldCos*sinDeltaPhi;
177  cosPhi = oldCos*cosDeltaPhi-oldSin*sinDeltaPhi;
178  }
179 
180 };
181 
182 #endif
SoTubs()
Constructor, required.
SoSFFloat pSPhi
Starting angle, in radians.
Definition: SoTubs.h:94
static void initClass()
Class Initializer, required.
SoSFNode alternateRep
Alternate rep - required.
Definition: SoTubs.h:102
virtual void clearAlternateRep()
We better be able to clear it, too!
virtual void generateAlternateRep()
virtual void generatePrimitives(SoAction *action)
Generate Primitives, required.
virtual SoChildList * getChildren() const
GetChildList, required whenever the class has hidden children.
SoSFFloat pDz
Half-length in Z.
Definition: SoTubs.h:90
SoSFFloat pRMin
Inside radius of the tube.
Definition: SoTubs.h:82
virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f &center)
compute bounding Box, required
SoSFFloat pDPhi
Delta-angle, in radians.
Definition: SoTubs.h:98
virtual ~SoTubs()
Destructor, required.
Definition: SoTubs.h:72
SoSFFloat pRMax
Outside radius of the tube.
Definition: SoTubs.h:86