Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SoTrd.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$
28//
29/*-----------------------------Hepvis----------------------------------------*/
30/* */
31/* Node: SoTrd */
32/* Description: Represents the G4Trd Geant Geometry entity */
33/* Author: Joe Boudreau Nov 11 1996 */
34/* */
35/*---------------------------------------------------------------------------*/
36#ifndef HEPVis_SoTrd_h
37#define HEPVis_SoTrd_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
44class SoSFNode;
45
46//! SoTrd - Inventor version of the G4Trd Geant Geometry entity
47/*!
48 * Node: SoTrd
49 *
50 * Description: Inventor version of the G4Trd Geant Geometry entity
51 *
52 * Author: Joe Boudreau Nov 11 1996
53 *
54 * A Trd is a trapezoid with the x and y dimensions varying along z
55 *
56 * Always use Inventor Fields. This allows Inventor to detect a change to
57 * the data field and take the appropriate action; e.g., redraw the scene.
58 *
59 */
60
61#define SoTrd Geant4_SoTrd
62
63class SoTrd:public SoShape {
64
65 //
66 //! This is required
67 //
68 SO_NODE_HEADER(SoTrd);
69
70public:
71
72 //
73 //! half-length of x, at -fDz
74 //
75 SoSFFloat fDx1;
76
77 //
78 //! half-length of x, at +fDz
79 //
80 SoSFFloat fDx2;
81
82 //
83 //! half-length of y, at -fDz
84 //
85 SoSFFloat fDy1;
86
87 //
88 //! half-length of y, at +fDz
89 //
90 SoSFFloat fDy2;
91
92 //
93 //! half-length along Z
94 //
95 SoSFFloat fDz;
96
97 //
98 //! Alternate rep - required
99 //
100 SoSFNode alternateRep;
101
102 //
103 //! Constructor, required
104 //
106
107 //
108 //! Class Initializer, required
109 //
110 static void initClass();
111
112 //
113 //! Generate AlternateRep, required. Generating an alternate representation
114 //! must be done upon users request. It allows an Inventor program to read
115 //! back the file without requiring *this* code to be dynamically linked.
116 //! If the users expects that *this* code will be dynamically linked, he
117 //! need not invoke this method.
118 //
119 virtual void generateAlternateRep();
120
121 //
122 //! We better be able to clear it, too!
123 //
124 virtual void clearAlternateRep();
125
126protected:
127
128 //
129 //! compute bounding Box, required
130 //
131 virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f &center );
132
133 //
134 //! Generate Primitives, required
135 //
136 virtual void generatePrimitives(SoAction *action);
137
138 //
139 //! GetChildList, required whenever the class has hidden children
140 //
141 virtual SoChildList *getChildren() const;
142
143
144protected:
145
146 //
147 //! Destructor, required
148 //
149 virtual ~SoTrd();
150
151private:
152
153 //
154 //! Generate Children. Used to create the hidden children. Required whenever
155 //! the node has hidden children.
156 //
157 void generateChildren();
158
159 //
160 //! Used to modify hidden children when a data field is changed. Required
161 //! whenever the class has hidden children.
162 //
163 void updateChildren();
164
165 //
166 //! ChildList. Required whenever the class has hidden children.
167 //
168 SoChildList *children;
169};
170
171#endif
Definition: SoTrd.h:63
virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f &center)
compute bounding Box, required
SoSFFloat fDx2
half-length of x, at +fDz
Definition: SoTrd.h:80
virtual void generateAlternateRep()
virtual void clearAlternateRep()
We better be able to clear it, too!
SoTrd()
Constructor, required.
virtual void generatePrimitives(SoAction *action)
Generate Primitives, required.
virtual ~SoTrd()
Destructor, required.
SoSFFloat fDy2
half-length of y, at +fDz
Definition: SoTrd.h:90
SoSFFloat fDy1
half-length of y, at -fDz
Definition: SoTrd.h:85
SoSFNode alternateRep
Alternate rep - required.
Definition: SoTrd.h:100
static void initClass()
Class Initializer, required.
SoSFFloat fDx1
half-length of x, at -fDz
Definition: SoTrd.h:75
virtual SoChildList * getChildren() const
GetChildList, required whenever the class has hidden children.
SoSFFloat fDz
half-length along Z
Definition: SoTrd.h:95