source: trunk/source/geometry/solids/Boolean/include/G4BooleanSolid.hh @ 1315

Last change on this file since 1315 was 1315, checked in by garnier, 14 years ago

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

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: G4BooleanSolid.hh,v 1.17 2010/05/11 15:03:45 gcosmo Exp $
28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
29//
30//
31// class G4BooleanSolid
32//
33// Class description:
34//
35// Abstract base class for solids created by boolean operations
36// between other solids.
37
38// History:
39//
40// 10.09.98 V.Grichine, created
41//
42// --------------------------------------------------------------------
43#ifndef G4BOOLEANSOLID_HH
44#define G4BOOLEANSOLID_HH
45
46#include "G4DisplacedSolid.hh"
47
48#include "G4ThreeVector.hh"
49#include "G4RotationMatrix.hh"
50#include "G4Transform3D.hh"
51
52class HepPolyhedronProcessor;
53
54class G4BooleanSolid : public G4VSolid
55{
56  public:  // with description
57 
58    G4BooleanSolid( const G4String& pName,
59                          G4VSolid* pSolidA ,
60                          G4VSolid* pSolidB   );
61
62    G4BooleanSolid( const G4String& pName,
63                          G4VSolid* pSolidA ,
64                          G4VSolid* pSolidB,
65                          G4RotationMatrix* rotMatrix,
66                    const G4ThreeVector& transVector    );
67
68    G4BooleanSolid( const G4String& pName,
69                          G4VSolid* pSolidA ,
70                          G4VSolid* pSolidB , 
71                    const G4Transform3D& transform   );
72
73    virtual ~G4BooleanSolid();
74
75    virtual const G4VSolid* GetConstituentSolid(G4int no) const;
76    virtual       G4VSolid* GetConstituentSolid(G4int no);
77      // If Solid is made up from a Boolean operation of two solids,
78      // return the corresponding solid (for no=0 and 1).
79      // If the solid is not a "Boolean", return 0.
80
81    inline G4double GetCubicVolume();
82    inline G4double GetSurfaceArea();
83
84    virtual G4GeometryType  GetEntityType() const;
85    virtual G4Polyhedron* GetPolyhedron () const;
86
87    std::ostream& StreamInfo(std::ostream& os) const;
88
89    inline G4int GetCubVolStatistics() const;
90    inline G4double GetCubVolEpsilon() const;
91    inline void SetCubVolStatistics(G4int st);
92    inline void SetCubVolEpsilon(G4double ep);
93
94    inline G4int GetAreaStatistics() const;
95    inline G4double GetAreaAccuracy() const;
96    inline void SetAreaStatistics(G4int st);
97    inline void SetAreaAccuracy(G4double ep);
98
99    G4ThreeVector GetPointOnSurface() const;
100
101  public:  // without description
102
103    G4BooleanSolid(__void__&);
104      // Fake default constructor for usage restricted to direct object
105      // persistency for clients requiring preallocation of memory for
106      // persistifiable objects.
107
108  protected:
109 
110    G4VSolid* fPtrSolidA;
111    G4VSolid* fPtrSolidB;
112
113    G4Polyhedron* StackPolyhedron(HepPolyhedronProcessor&,
114                                  const G4VSolid*) const;
115      // Stack polyhedra for processing. Return top polyhedron.
116
117  private:
118
119    G4BooleanSolid(const G4BooleanSolid&);
120    G4BooleanSolid& operator=(const G4BooleanSolid&);
121      // Private copy constructor and assignment operator.
122
123  private:
124
125    G4int    fStatistics;
126    G4double fCubVolEpsilon;
127    G4double fAreaAccuracy;
128    G4double fCubicVolume;
129    G4double fSurfaceArea;
130
131    mutable G4Polyhedron* fpPolyhedron;
132
133    G4bool  createdDisplacedSolid;
134      // If & only if this object created it, it must delete it
135
136} ;
137
138#include "G4BooleanSolid.icc"
139
140#endif
Note: See TracBrowser for help on using the repository browser.