source: trunk/source/visualization/OpenInventor/include/HEPVis/nodes/SoTrd.h @ 1347

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

geant4 tag 9.4

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