Geant4 Cross Reference |
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 // 28 /*-----------------------------Hepvis----------------------------------------*/ 29 /* */ 30 /* Node: SoTrap */ 31 /* Description: Represents the G4Trap Geant Geometry entity */ 32 /* Author: Joe Boudreau Nov 11 1996 */ 33 /* */ 34 /*---------------------------------------------------------------------------*/ 35 #ifndef HEPVis_SoTrap_h 36 #define HEPVis_SoTrap_h 37 38 // Inheritance : 39 #include <Inventor/nodes/SoShape.h> 40 41 #include <Inventor/fields/SoSFNode.h> 42 #include <Inventor/fields/SoSFBool.h> 43 #include <Inventor/fields/SoSFFloat.h> 44 45 //adding fields 46 #ifdef WIN32 47 #include <SoWinEnterScope.h> 48 #endif 49 50 51 // Defining Class 52 #ifdef WIN32 53 #include <SoWinLeaveScope.h> 54 #endif 55 56 class SoSFNode; 57 58 //! SoTrap - Inventor version of the G4Trap Geant Geometry entity 59 /*! Node: SoTrap 60 * 61 * Description: Inventor version of the G4Trap Geant Geometry entity 62 * 63 * Author: Joe Boudreau Nov 11 1996 64 * 65 * A G4Trap is a general trapezoid: The faces perpendicular to the z planes 66 * are tapezia, and their centres are not necessarily on a line parallel to 67 * the z axis. 68 * 69 * Note that of the 11 parameters desribed below, only 9 are really 70 * independent - a check for planarity is made in the calculation of the 71 * equation for each plane. If the planes are not parallel, a call to 72 * G4Exception is made. 73 * 74 * Always use Inventor Fields. This allows Inventor to detect a change to 75 * the data field and take the appropriate action; e.g., redraw the scene. 76 * 77 */ 78 79 #define SoTrap Geant4_SoTrap 80 81 class SoTrap:public SoShape { 82 83 // The following is required: 84 SO_NODE_HEADER(SoTrap); 85 86 public: 87 #if defined(WIN32) && defined(BUILDING_DLL) 88 // When building the node as a DLL under Win32 we must explicitly 89 // declare this entry point as visible outside the DLL. The macro 90 // BUILDING_DLL is defined in the node's source file. 91 _declspec(dllexport) 92 #endif 93 94 // 95 //! half-length along Z 96 // 97 SoSFFloat pDz; 98 // 99 //! Polar angle of the line joining the centres of the faces at -/+pDz 100 // 101 SoSFFloat pTheta; 102 // 103 //! Azimuthal angle of the line joing the centre of the face at -pDz 104 //! to the centre of the face at +pDz 105 // 106 SoSFFloat pPhi; 107 // 108 //! Half-length along y of the face at -pDz 109 // 110 SoSFFloat pDy1; 111 // 112 //! Half-length along x of the side at y=-pDy1 of the face at -pDz 113 // 114 SoSFFloat pDx1; 115 // 116 //! Half-length along x of the side at y=+pDy1 of the face at -pDz 117 // 118 SoSFFloat pDx2; 119 // 120 //! Half-length along y of the face at +pDz 121 // 122 SoSFFloat pDy2; 123 // 124 //! Half-length along x of the side at y=-pDy2 of the face at +pDz 125 // 126 SoSFFloat pDx3; 127 // 128 //! Half-length along x of the side at y=+pDy2 of the face at +pDz 129 // 130 SoSFFloat pDx4; 131 // 132 //! Angle with respect to the y axis from the centre of the side at 133 //! y=-pDy1 to the centre at y=+pDy1 of the face at -pDz 134 // 135 SoSFFloat pAlp1; 136 // 137 //! Angle with respect to the y axis from the centre of the side at 138 //! y=-pDy2 to the centre at y=+pDy2 of the face at +pDz 139 // 140 SoSFFloat pAlp2; 141 142 // 143 //! Alternate rep - required 144 // 145 SoSFNode alternateRep; 146 147 // 148 //! Constructor, required 149 // 150 SoTrap(); 151 152 // 153 //! Class Initializer, required 154 // 155 static void initClass(); 156 157 // 158 //! Generate AlternateRep, required. Generating an alternate representation 159 //! must be done upon users request. It allows an Inventor program to read 160 //! back the file without requiring *this* code to be dynamically linked. 161 //! If the users expects that *this* code will be dynamically linked, he 162 //! need not invoke this method. 163 // 164 virtual void generateAlternateRep(); 165 166 // 167 //! We better be able to clear it, too! 168 // 169 virtual void clearAlternateRep(); 170 171 protected: 172 173 // 174 //! compute bounding Box, required 175 // 176 virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er ); 177 178 // 179 //! Generate Primitives, required 180 // 181 virtual void generatePrimitives(SoAction *action); 182 183 // 184 //! GetChildList, required whenever the class has hidden children 185 // 186 virtual SoChildList *getChildren() const; 187 188 // 189 //! Destructor, required 190 // 191 virtual ~SoTrap(); 192 193 private: 194 195 // 196 //! Generate Children. Used to create the hidden children. Required whenever 197 //! the node has hidden children. 198 // 199 void generateChildren(); 200 201 // 202 //! Used to modify hidden children when a data field is changed. Required 203 //! whenever the class has hidden children. 204 // 205 void updateChildren(); 206 207 // 208 //! ChildList. Required whenever the class has hidden children. 209 // 210 SoChildList *children; 211 212 }; 213 214 #ifdef WIN32 215 #include <SoWinEnterScope.h> 216 #endif 217 218 #endif 219