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 // /vis/geometry commands - John Allison 31st January 2006 29 30 #ifndef G4VISCOMMANDSGEOMETRYSET_HH 31 #define G4VISCOMMANDSGEOMETRYSET_HH 32 33 #include "G4VisCommandsGeometry.hh" 34 35 class G4UIcommand; 36 class G4VisAttributes; 37 38 class G4VVisCommandGeometrySetFunction { 39 public: 40 virtual ~G4VVisCommandGeometrySetFunction() {} 41 virtual void operator()(G4VisAttributes*) const = 0; 42 }; 43 44 class G4VisCommandGeometrySetColourFunction: 45 public G4VVisCommandGeometrySetFunction { 46 public: 47 virtual ~G4VisCommandGeometrySetColourFunction() {} 48 G4VisCommandGeometrySetColourFunction 49 (const G4Colour& colour): 50 fColour(colour) {} 51 void operator() 52 (G4VisAttributes* visAtts) const 53 {visAtts->SetColour(fColour);} 54 private: 55 const G4Colour& fColour; 56 }; 57 58 class G4VisCommandGeometrySetDaughtersInvisibleFunction: 59 public G4VVisCommandGeometrySetFunction { 60 public: 61 virtual ~G4VisCommandGeometrySetDaughtersInvisibleFunction() {} 62 G4VisCommandGeometrySetDaughtersInvisibleFunction 63 (G4bool daughtersInvisible): 64 fDaughtersInvisible(daughtersInvisible) {} 65 void operator() 66 (G4VisAttributes* visAtts) const 67 {visAtts->SetDaughtersInvisible(fDaughtersInvisible);} 68 private: 69 G4bool fDaughtersInvisible; 70 }; 71 72 class G4VisCommandGeometrySetForceAuxEdgeVisibleFunction: 73 public G4VVisCommandGeometrySetFunction { 74 public: 75 virtual ~G4VisCommandGeometrySetForceAuxEdgeVisibleFunction() {} 76 G4VisCommandGeometrySetForceAuxEdgeVisibleFunction 77 (G4bool force): 78 fForce(force) {} 79 void operator() 80 (G4VisAttributes* visAtts) const 81 {visAtts->SetForceAuxEdgeVisible(fForce);} 82 private: 83 G4bool fForce; 84 }; 85 86 class G4VisCommandGeometrySetForceCloudFunction: 87 public G4VVisCommandGeometrySetFunction { 88 public: 89 virtual ~G4VisCommandGeometrySetForceCloudFunction() {} 90 G4VisCommandGeometrySetForceCloudFunction 91 (G4bool force, G4int nPoints) 92 :fForce(force) 93 ,fNPoints(nPoints) {} 94 void operator() (G4VisAttributes* visAtts) const { 95 visAtts->SetForceCloud(fForce); 96 visAtts->SetForceNumberOfCloudPoints(fNPoints); 97 } 98 private: 99 G4bool fForce; 100 G4int fNPoints; 101 }; 102 103 class G4VisCommandGeometrySetForceLineSegmentsPerCircleFunction: 104 public G4VVisCommandGeometrySetFunction { 105 public: 106 virtual ~G4VisCommandGeometrySetForceLineSegmentsPerCircleFunction() {} 107 G4VisCommandGeometrySetForceLineSegmentsPerCircleFunction 108 (G4int lineSegmentsPerCircle): 109 fLineSegmentsPerCircle(lineSegmentsPerCircle) {} 110 void operator() 111 (G4VisAttributes* visAtts) const 112 {visAtts->SetForceLineSegmentsPerCircle(fLineSegmentsPerCircle);} 113 private: 114 G4int fLineSegmentsPerCircle; 115 }; 116 117 class G4VisCommandGeometrySetForceSolidFunction: 118 public G4VVisCommandGeometrySetFunction { 119 public: 120 virtual ~G4VisCommandGeometrySetForceSolidFunction() {} 121 G4VisCommandGeometrySetForceSolidFunction 122 (G4bool force): 123 fForce(force) {} 124 void operator() 125 (G4VisAttributes* visAtts) const 126 {visAtts->SetForceSolid(fForce);} 127 private: 128 G4bool fForce; 129 }; 130 131 class G4VisCommandGeometrySetForceWireframeFunction: 132 public G4VVisCommandGeometrySetFunction { 133 public: 134 virtual ~G4VisCommandGeometrySetForceWireframeFunction() {} 135 G4VisCommandGeometrySetForceWireframeFunction 136 (G4bool force): 137 fForce(force) {} 138 void operator() 139 (G4VisAttributes* visAtts) const 140 {visAtts->SetForceWireframe(fForce);} 141 private: 142 G4bool fForce; 143 }; 144 145 class G4VisCommandGeometrySetLineStyleFunction: 146 public G4VVisCommandGeometrySetFunction { 147 public: 148 virtual ~G4VisCommandGeometrySetLineStyleFunction() {} 149 G4VisCommandGeometrySetLineStyleFunction 150 (G4VisAttributes::LineStyle lineStyle): 151 fLineStyle(lineStyle) {} 152 void operator() 153 (G4VisAttributes* visAtts) const 154 {visAtts->SetLineStyle(fLineStyle);} 155 private: 156 G4VisAttributes::LineStyle fLineStyle; 157 }; 158 159 class G4VisCommandGeometrySetLineWidthFunction: 160 public G4VVisCommandGeometrySetFunction { 161 public: 162 virtual ~G4VisCommandGeometrySetLineWidthFunction() {} 163 G4VisCommandGeometrySetLineWidthFunction 164 (G4double lineWidth): 165 fLineWidth(lineWidth) {} 166 void operator() 167 (G4VisAttributes* visAtts) const 168 {visAtts->SetLineWidth(fLineWidth);} 169 private: 170 G4double fLineWidth; 171 }; 172 173 class G4VisCommandGeometrySetVisibilityFunction: 174 public G4VVisCommandGeometrySetFunction { 175 public: 176 virtual ~G4VisCommandGeometrySetVisibilityFunction() {} 177 G4VisCommandGeometrySetVisibilityFunction 178 (G4bool visibility): 179 fVisibility(visibility) {} 180 void operator() 181 (G4VisAttributes* visAtts) const 182 {visAtts->SetVisibility(fVisibility);} 183 private: 184 G4bool fVisibility; 185 }; 186 187 class G4VVisCommandGeometrySet: public G4VVisCommandGeometry { 188 protected: 189 void Set(const G4String& logVolName, const G4VVisCommandGeometrySetFunction&, 190 G4int requestedDepth); 191 void SetLVVisAtts(G4LogicalVolume*, const G4VVisCommandGeometrySetFunction&, 192 G4int depth, G4int requestedDepth); 193 }; 194 195 class G4VisCommandGeometrySetColour: public G4VVisCommandGeometrySet { 196 public: 197 G4VisCommandGeometrySetColour (); 198 virtual ~G4VisCommandGeometrySetColour (); 199 G4String GetCurrentValue (G4UIcommand* command); 200 void SetNewValue (G4UIcommand* command, G4String newValue); 201 private: 202 G4VisCommandGeometrySetColour (const G4VisCommandGeometrySetColour&); 203 G4VisCommandGeometrySetColour& operator = (const G4VisCommandGeometrySetColour&); 204 G4UIcommand* fpCommand; 205 }; 206 207 class G4VisCommandGeometrySetDaughtersInvisible: 208 public G4VVisCommandGeometrySet { 209 public: 210 G4VisCommandGeometrySetDaughtersInvisible (); 211 virtual ~G4VisCommandGeometrySetDaughtersInvisible (); 212 G4String GetCurrentValue (G4UIcommand* command); 213 void SetNewValue (G4UIcommand* command, G4String newValue); 214 private: 215 G4VisCommandGeometrySetDaughtersInvisible 216 (const G4VisCommandGeometrySetDaughtersInvisible&); 217 G4VisCommandGeometrySetDaughtersInvisible& operator= 218 (const G4VisCommandGeometrySetDaughtersInvisible&); 219 G4UIcommand* fpCommand; 220 }; 221 222 class G4VisCommandGeometrySetForceAuxEdgeVisible: 223 public G4VVisCommandGeometrySet { 224 public: 225 G4VisCommandGeometrySetForceAuxEdgeVisible (); 226 virtual ~G4VisCommandGeometrySetForceAuxEdgeVisible (); 227 G4String GetCurrentValue (G4UIcommand* command); 228 void SetNewValue (G4UIcommand* command, G4String newValue); 229 private: 230 G4VisCommandGeometrySetForceAuxEdgeVisible 231 (const G4VisCommandGeometrySetForceAuxEdgeVisible&); 232 G4VisCommandGeometrySetForceAuxEdgeVisible& operator= 233 (const G4VisCommandGeometrySetForceAuxEdgeVisible&); 234 G4UIcommand* fpCommand; 235 }; 236 237 class G4VisCommandGeometrySetForceCloud: 238 public G4VVisCommandGeometrySet { 239 public: 240 G4VisCommandGeometrySetForceCloud (); 241 virtual ~G4VisCommandGeometrySetForceCloud (); 242 G4String GetCurrentValue (G4UIcommand* command); 243 void SetNewValue (G4UIcommand* command, G4String newValue); 244 private: 245 G4VisCommandGeometrySetForceCloud 246 (const G4VisCommandGeometrySetForceCloud&); 247 G4VisCommandGeometrySetForceCloud& operator= 248 (const G4VisCommandGeometrySetForceCloud&); 249 G4UIcommand* fpCommand; 250 }; 251 252 class G4VisCommandGeometrySetForceSolid: 253 public G4VVisCommandGeometrySet { 254 public: 255 G4VisCommandGeometrySetForceSolid (); 256 virtual ~G4VisCommandGeometrySetForceSolid (); 257 G4String GetCurrentValue (G4UIcommand* command); 258 void SetNewValue (G4UIcommand* command, G4String newValue); 259 private: 260 G4VisCommandGeometrySetForceSolid 261 (const G4VisCommandGeometrySetForceSolid&); 262 G4VisCommandGeometrySetForceSolid& operator= 263 (const G4VisCommandGeometrySetForceSolid&); 264 G4UIcommand* fpCommand; 265 }; 266 267 class G4VisCommandGeometrySetForceLineSegmentsPerCircle: 268 public G4VVisCommandGeometrySet { 269 public: 270 G4VisCommandGeometrySetForceLineSegmentsPerCircle (); 271 virtual ~G4VisCommandGeometrySetForceLineSegmentsPerCircle (); 272 G4String GetCurrentValue (G4UIcommand* command); 273 void SetNewValue (G4UIcommand* command, G4String newValue); 274 private: 275 G4VisCommandGeometrySetForceLineSegmentsPerCircle 276 (const G4VisCommandGeometrySetForceLineSegmentsPerCircle&); 277 G4VisCommandGeometrySetForceLineSegmentsPerCircle& operator= 278 (const G4VisCommandGeometrySetForceLineSegmentsPerCircle&); 279 G4UIcommand* fpCommand; 280 }; 281 282 class G4VisCommandGeometrySetForceWireframe: 283 public G4VVisCommandGeometrySet { 284 public: 285 G4VisCommandGeometrySetForceWireframe (); 286 virtual ~G4VisCommandGeometrySetForceWireframe (); 287 G4String GetCurrentValue (G4UIcommand* command); 288 void SetNewValue (G4UIcommand* command, G4String newValue); 289 private: 290 G4VisCommandGeometrySetForceWireframe 291 (const G4VisCommandGeometrySetForceWireframe&); 292 G4VisCommandGeometrySetForceWireframe& operator= 293 (const G4VisCommandGeometrySetForceWireframe&); 294 G4UIcommand* fpCommand; 295 }; 296 297 class G4VisCommandGeometrySetLineStyle: 298 public G4VVisCommandGeometrySet { 299 public: 300 G4VisCommandGeometrySetLineStyle (); 301 virtual ~G4VisCommandGeometrySetLineStyle (); 302 G4String GetCurrentValue (G4UIcommand* command); 303 void SetNewValue (G4UIcommand* command, G4String newValue); 304 private: 305 G4VisCommandGeometrySetLineStyle 306 (const G4VisCommandGeometrySetLineStyle&); 307 G4VisCommandGeometrySetLineStyle& operator= 308 (const G4VisCommandGeometrySetLineStyle&); 309 G4UIcommand* fpCommand; 310 }; 311 312 class G4VisCommandGeometrySetLineWidth: 313 public G4VVisCommandGeometrySet { 314 public: 315 G4VisCommandGeometrySetLineWidth (); 316 virtual ~G4VisCommandGeometrySetLineWidth (); 317 G4String GetCurrentValue (G4UIcommand* command); 318 void SetNewValue (G4UIcommand* command, G4String newValue); 319 private: 320 G4VisCommandGeometrySetLineWidth 321 (const G4VisCommandGeometrySetLineWidth&); 322 G4VisCommandGeometrySetLineWidth& operator= 323 (const G4VisCommandGeometrySetLineWidth&); 324 G4UIcommand* fpCommand; 325 }; 326 327 class G4VisCommandGeometrySetVisibility: public G4VVisCommandGeometrySet { 328 public: 329 G4VisCommandGeometrySetVisibility (); 330 virtual ~G4VisCommandGeometrySetVisibility (); 331 G4String GetCurrentValue (G4UIcommand* command); 332 void SetNewValue (G4UIcommand* command, G4String newValue); 333 void SetNewValueOnLV (G4LogicalVolume* pLV, G4int,G4bool); 334 private: 335 G4VisCommandGeometrySetVisibility (const G4VisCommandGeometrySetVisibility&); 336 G4VisCommandGeometrySetVisibility& operator = (const G4VisCommandGeometrySetVisibility&); 337 G4UIcommand* fpCommand; 338 }; 339 340 #endif 341