source: trunk/source/geometry/solids/specific/include/G4VFacet.hh@ 1036

Last change on this file since 1036 was 850, checked in by garnier, 17 years ago

geant4.8.2 beta

File size: 4.9 KB
RevLine 
[831]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 and of QinetiQ Ltd, *
20// * subject DEFCON 705 IPR conditions. *
21// * By using, copying, modifying or distributing the software (or *
22// * any work based on the software) you agree to acknowledge its *
23// * use in resulting scientific publications, and indicate your *
24// * acceptance of all terms of the Geant4 Software license. *
25// ********************************************************************
26//
27// $Id: G4VFacet.hh,v 1.6 2007/08/23 14:45:03 gcosmo Exp $
[850]28// GEANT4 tag $Name: HEAD $
[831]29//
30// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31//
32// MODULE: G4VFacet.hh
33//
34// Date: 15/06/2005
35// Author: P R Truscott
36// Organisation: QinetiQ Ltd, UK
37// Customer: UK Ministry of Defence : RAO CRP TD Electronic Systems
38// Contract: C/MAT/N03517
39//
40// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
41//
42// CHANGE HISTORY
43// --------------
44//
45// 31 October 2004, P R Truscott, QinetiQ Ltd, UK - Created.
46//
47// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
48//
49// Class description:
50//
51// Base class defining the facets which are components of a
52// G4TessellatedSolid shape.
53//
54
55///////////////////////////////////////////////////////////////////////////////
56#ifndef G4VFacet_hh
57#define G4VFacet_hh 1
58
59#include "G4VSolid.hh"
60#include "G4ThreeVector.hh"
61#include "globals.hh"
62
63#include <iostream>
64#include <vector>
65
66enum G4FacetVertexType {ABSOLUTE, RELATIVE};
67
68class G4VFacet
69{
70 public: // with description
71
72 G4VFacet ();
73 virtual ~G4VFacet ();
74
75 G4bool operator== (const G4VFacet &right) const;
76
77 inline size_t GetNumberOfVertices () const;
78 inline G4ThreeVector GetVertex (size_t i) const;
79
80 inline G4GeometryType GetEntityType () const;
81 inline G4ThreeVector GetSurfaceNormal () const;
82 inline G4bool IsInside(const G4ThreeVector &p) const;
83 inline G4bool IsDefined () const;
84 inline void SetVertexIndex (const size_t i, const size_t j);
85 inline size_t GetVertexIndex (const size_t i) const;
86 inline G4ThreeVector GetCircumcentre () const;
87 inline G4double GetRadius () const;
88 inline G4double GetRadiusSquared() const;
89
90 void ApplyTranslation (const G4ThreeVector v);
91
92 std::ostream &StreamInfo(std::ostream &os) const;
93
94 virtual G4VFacet *GetClone ();
95 virtual G4double Distance (const G4ThreeVector&, const G4double);
96 virtual G4double Distance (const G4ThreeVector&, const G4double,
97 const G4bool);
98 virtual G4double Extent (const G4ThreeVector);
99 virtual G4bool Intersect (const G4ThreeVector&, const G4ThreeVector &,
100 const G4bool , G4double &, G4double &,
101 G4ThreeVector &);
102 virtual G4double GetArea() = 0;
103 virtual G4ThreeVector GetPointOnFace() const = 0;
104
105 protected:
106
107 G4GeometryType geometryType;
108 G4bool isDefined;
109 size_t nVertices;
110 G4ThreeVector P0;
111 G4ThreeVectorList P;
112 G4ThreeVectorList E;
113 std::vector<size_t> I;
114 G4ThreeVector surfaceNormal;
115 G4ThreeVector circumcentre;
116 G4double radius;
117 G4double radiusSqr;
118
119 G4double dirTolerance;
120 G4double kCarTolerance;
121 G4double area;
122
123 private:
124
125 G4VFacet (const G4VFacet &right);
126 const G4VFacet &operator=(G4VFacet &right);
127};
128
129typedef std::vector<G4VFacet*>::iterator FacetI;
130typedef std::vector<G4VFacet*>::const_iterator FacetCI;
131
132#include "G4VFacet.icc"
133
134#endif
Note: See TracBrowser for help on using the repository browser.