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
SoBox.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: SoBox */
32/* Description: Represents the G4Box Geant Geometry entity */
33/* Author: Joe Boudreau Nov 11 1996 */
34/* */
35/*---------------------------------------------------------------------------*/
36#ifndef HEPVis_SoBox_h
37#define HEPVis_SoBox_h
38
39#include <Inventor/fields/SoSFFloat.h>
40#include <Inventor/fields/SoSFNode.h>
41#include <Inventor/nodes/SoShape.h>
42
43class SoSFNode;
44
45//! SoBox - Inventor version of the G4Box Geant Geometry entity
46/*!
47 * Node: SoBox
48 *
49 * Description: The Inventor version of the G4Box Geant Geometry entity
50 *
51 * Author: Joe Boudreau Nov 11 1996
52 *
53 * class G4Box
54 *
55 * A Box is a cuboid of given half lengths dx,dy,dz. The Box is
56 * centred on the origin with sides parallel to the x/y/z axes.
57 *
58 * Always use Inventor Fields. This allows Inventor to detect a change to
59 * the data field and take the appropriate action; e.g., redraw the scene.
60*/
61
62#define SoBox Geant4_SoBox
63
64class SoBox:public SoShape {
65
66 // The following is required:
67 SO_NODE_HEADER(SoBox);
68
69public:
70
71 //
72 //! Half-length along X
73 //
74 SoSFFloat fDx;
75 //
76 //! Half-length along Y
77 //
78 SoSFFloat fDy;
79 //
80 //! Half-length along Z
81 //
82 SoSFFloat fDz;
83 //
84 //! Alternate rep - for use by users without HEPVis shared objects
85 //
86 SoSFNode alternateRep;
87
88 //
89 //! Constructor, required
90 //
92
93 //
94 //! Class Initializer, required
95 //
96 static void initClass();
97
98 //
99 //! Generate AlternateRep, required. Generating an alternate representation
100 //! must be done upon users request. It allows an Inventor program to read
101 //! back the file without requiring *this* code to be dynamically linked.
102 //! If the users expects that *this* code will be dynamically linked, he
103 //! need not invoke this method.
104 //
105 virtual void generateAlternateRep();
106
107 //
108 //! We better be able to clear it, too!
109 //
110 virtual void clearAlternateRep();
111
112protected:
113
114 //
115 //! compute bounding Box, required
116 //
117 virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f &center );
118
119 //
120 //! Generate Primitives, required
121 //
122 virtual void generatePrimitives(SoAction *action);
123
124 //
125 //! GetChildList, required whenever the class has hidden children
126 //
127 virtual SoChildList *getChildren() const;
128
129
130protected:
131 //
132 //! Destructor, required
133 //
134 virtual ~SoBox();
135
136private:
137
138 //
139 //! Generate Children. Used to create the hidden children. Required whenever
140 //! the node has hidden children.
141 //
142 void generateChildren();
143
144 //
145 //! Used to modify hidden children when a data field is changed. Required
146 //! whenever the class has hidden children.
147 //
148 void updateChildren();
149
150 //
151 //! ChildList. Required whenever the class has hidden children.
152 //
153 SoChildList *children;
154
155};
156
157#endif
Definition: SoBox.h:64
SoBox()
Constructor, required.
SoSFFloat fDx
Half-length along X.
Definition: SoBox.h:74
virtual void generateAlternateRep()
SoSFNode alternateRep
Alternate rep - for use by users without HEPVis shared objects.
Definition: SoBox.h:86
SoSFFloat fDy
Half-length along Y.
Definition: SoBox.h:78
virtual SoChildList * getChildren() const
GetChildList, required whenever the class has hidden children.
virtual ~SoBox()
Destructor, required.
SoSFFloat fDz
Half-length along Z.
Definition: SoBox.h:82
static void initClass()
Class Initializer, required.
virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f &center)
compute bounding Box, required
virtual void generatePrimitives(SoAction *action)
Generate Primitives, required.
virtual void clearAlternateRep()
We better be able to clear it, too!