source: trunk/source/geometry/solids/specific/include/G4TriangularFacet.hh @ 1202

Last change on this file since 1202 was 1058, checked in by garnier, 15 years ago

file release beta

File size: 4.7 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 and of QinetiQ Ltd,   *
20// * subject to 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: G4TriangularFacet.hh,v 1.8 2007/12/10 16:30:18 gunter Exp $
28// GEANT4 tag $Name: geant4-09-02-ref-02 $
29//
30// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31//
32// MODULE:              G4TriangularFacet.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//   The G4TriangularFacet class is used for the contruction of
52//   G4TessellatedSolid.
53//   It is defined by three vertices, which shall be supplied in anti-clockwise
54//   order looking from the outsider of the solid where it belongs.
55//   Its constructor:
56//   
57//      G4TriangularFacet (const G4ThreeVector Pt0, const G4ThreeVector vt1,
58//                         const G4ThreeVector vt2, G4FacetVertexType);
59//
60//   takes 4 parameters to define the three vertices:
61//      1) G4FacetvertexType = "ABSOLUTE": in this case Pt0, vt1 and vt2 are
62//         the 3 vertices in anti-clockwise order looking from the outsider.
63//      2) G4FacetvertexType = "RELATIVE": in this case the first vertex is Pt0,
64//         the second vertex is Pt0+vt1 and the third vertex is Pt0+vt2, all 
65//         in anti-clockwise order when looking from the outsider.
66
67///////////////////////////////////////////////////////////////////////////////
68#ifndef G4TriangularFacet_hh
69#define G4TriangularFacet_hh 1
70
71#include "globals.hh"
72#include "G4VFacet.hh"
73#include "G4ThreeVector.hh"
74#include "G4TessellatedGeometryAlgorithms.hh"
75
76class G4TriangularFacet : public G4VFacet
77{
78  public:  // with description
79
80    G4TriangularFacet (const G4ThreeVector Pt0, const G4ThreeVector vt1,
81                       const G4ThreeVector vt2, G4FacetVertexType);
82    ~G4TriangularFacet ();
83   
84    G4TriangularFacet (const G4TriangularFacet &right);
85    const G4TriangularFacet &operator=(G4TriangularFacet &right);   
86
87    G4VFacet *GetClone ();
88    G4TriangularFacet *GetFlippedFacet ();
89   
90    G4ThreeVector Distance (const G4ThreeVector &p);
91    G4double Distance (const G4ThreeVector &p, const G4double minDist);
92    G4double Distance (const G4ThreeVector &p, const G4double minDist,
93                       const G4bool outgoing);
94    G4double Extent   (const G4ThreeVector axis);
95    G4bool Intersect  (const G4ThreeVector &p, const G4ThreeVector &v,
96                       const G4bool outgoing, G4double &distance,
97                             G4double &distFromSurface, G4ThreeVector &normal);
98    G4double GetArea ();
99    G4ThreeVector GetPointOnFace () const;
100
101  private:
102
103    G4double a;
104    G4double b;
105    G4double c;
106    G4double det;
107   
108    G4double sMin, sMax;
109    G4double tMin;
110
111    G4double sqrDist;
112
113    G4TessellatedGeometryAlgorithms *tGeomAlg;
114};
115
116#endif
Note: See TracBrowser for help on using the repository browser.