source: trunk/source/visualization/OpenInventor/include/HEPVis/nodes/SoBox.h@ 1348

Last change on this file since 1348 was 1347, checked in by garnier, 15 years ago

geant4 tag 9.4

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