Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VUFacet.hh
Go to the documentation of this file.
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: UFacet.hh,v 1.8 2010-09-23 10:27:25 gcosmo Exp $
28 // GEANT4 tag $Name: not supported by cvs2svn $
29 //
30 // Author: Marek Gayer, started from original implementation by P R Truscott, 2004
31 //
32 ////
33 // Class description:
34 //
35 // Base class defining the facets which are components of a
36 // G4TessellatedSolid shape.
37 //
38 ///////////////////////////////////////////////////////////////////////////////
39 
40 #ifndef UFacet_hh
41 #define UFacet_hh
42 
43 #include <iostream>
44 #include <vector>
45 
46 #include "UVector3.hh"
47 #include "UTypes.hh"
48 
50 
51 class UTessellatedSolid;
52 
53 class VUFacet
54 {
55 public:
56 
57  virtual ~VUFacet () {};
58 
59  virtual int GetNumberOfVertices () const = 0;
60  virtual UVector3 GetVertex (int i) const = 0;
61  virtual void SetVertex (int i, const UVector3 &val) = 0;
62  virtual UGeometryType GetEntityType () const = 0;
63  virtual UVector3 GetSurfaceNormal () const = 0;
64  virtual bool IsDefined () const = 0;
65  virtual UVector3 GetCircumcentre () const = 0;
66  virtual double GetRadius () const = 0;
67  virtual VUFacet *GetClone () = 0;
68  virtual double Distance (const UVector3&, const double) = 0;
69  virtual double Distance (const UVector3&, const double, const bool) = 0;
70  virtual double Extent (const UVector3) = 0;
71  virtual bool Intersect (const UVector3&, const UVector3 &, const bool , double &, double &, UVector3 &) = 0;
72  virtual double GetArea() = 0;
73  virtual UVector3 GetPointOnFace() const = 0;
74 
75  bool operator== (const VUFacet &right) const;
76  void ApplyTranslation (const UVector3 v);
77  std::ostream &StreamInfo(std::ostream &os) const;
78  bool IsInside(const UVector3 &p) const;
79 
80  virtual int AllocatedMemory() = 0;
81  virtual void SetVertexIndex (const int i, const int j) = 0;
82  virtual int GetVertexIndex (const int i) const = 0;
83 
84  virtual void SetVertices(std::vector<UVector3> *vertices) = 0;
85 
86 protected:
87 
88  static const double dirTolerance;
89  static const double kCarTolerance;
90 };
91 
92 #endif
virtual UVector3 GetPointOnFace() const =0
virtual bool Intersect(const UVector3 &, const UVector3 &, const bool, double &, double &, UVector3 &)=0
static const double dirTolerance
Definition: VUFacet.hh:88
virtual void SetVertex(int i, const UVector3 &val)=0
bool operator==(const VUFacet &right) const
Definition: VUFacet.cc:42
virtual int GetNumberOfVertices() const =0
const char * p
Definition: xmltok.h:285
virtual double Extent(const UVector3)=0
std::ostream & StreamInfo(std::ostream &os) const
Definition: VUFacet.cc:79
UFacetVertexType
Definition: VUFacet.hh:49
virtual UVector3 GetVertex(int i) const =0
void ApplyTranslation(const UVector3 v)
Definition: VUFacet.cc:70
virtual UGeometryType GetEntityType() const =0
virtual UVector3 GetSurfaceNormal() const =0
virtual UVector3 GetCircumcentre() const =0
virtual double GetRadius() const =0
bool IsInside(const UVector3 &p) const
Definition: VUFacet.cc:100
virtual int AllocatedMemory()=0
virtual double GetArea()=0
virtual bool IsDefined() const =0
virtual void SetVertices(std::vector< UVector3 > *vertices)=0
virtual int GetVertexIndex(const int i) const =0
std::string UGeometryType
Definition: UTypes.hh:70
virtual VUFacet * GetClone()=0
virtual ~VUFacet()
Definition: VUFacet.hh:57
static const double kCarTolerance
Definition: VUFacet.hh:89
virtual void SetVertexIndex(const int i, const int j)=0
virtual double Distance(const UVector3 &, const double)=0