GeoModel - GeoModelCore
GeoFacet.h
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef GEOMODELKERNEL_GEOFACET_H
6 #define GEOMODELKERNEL_GEOFACET_H
7 
17 #include "GeoModelKernel/RCBase.h"
18 #include "GeoModelKernel/GeoDefinitions.h"
19 #include <vector>
20 
21 typedef GeoTrf::Vector3D GeoFacetVertex;
22 
23 // ** Base class
24 class GeoFacet : public RCBase
25 {
26  public:
27  enum GeoFacetVertexType
28  {
29  ABSOLUTE,
30  RELATIVE
31  };
32 
33  inline size_t getNumberOfVertices() const;
34  inline GeoFacetVertex getVertex(size_t) const;
35  inline GeoFacetVertexType getVertexType() const;
36 
37  protected:
38  GeoFacet()
39  : m_nVertices(0),
40  m_vertexType(ABSOLUTE) {};
41  virtual ~GeoFacet(){};
42 
43  size_t m_nVertices;
44  std::vector<GeoFacetVertex> m_vertices;
45  GeoFacetVertexType m_vertexType;
46 };
47 
48 // Triangular facet
50 {
51  public:
52  GeoTriangularFacet(GeoFacetVertex
53  ,GeoFacetVertex
54  ,GeoFacetVertex
55  ,GeoFacetVertexType);
56 
57  virtual ~GeoTriangularFacet();
58 };
59 
60 // Quadrangular facet
62 {
63  public:
64  GeoQuadrangularFacet(GeoFacetVertex
65  ,GeoFacetVertex
66  ,GeoFacetVertex
67  ,GeoFacetVertex
68  ,GeoFacetVertexType);
69 
70  virtual ~GeoQuadrangularFacet();
71 };
72 
73 // Inline methods
74 inline size_t GeoFacet::getNumberOfVertices() const
75 {
76  return m_nVertices;
77 }
78 
79 inline GeoFacetVertex GeoFacet::getVertex(size_t index) const
80 {
81  return (index<m_nVertices ? m_vertices[index] : GeoFacetVertex(999999.,999999.,999999.));
82 }
83 
84 inline GeoFacet::GeoFacetVertexType GeoFacet::getVertexType() const
85 {
86  return m_vertexType;
87 }
88 
89 #endif
Base class for GeoModel Facets Two implementations exist:
Definition: GeoFacet.h:24
This is a base class for objects whose memory is managed through reference counting. Reference-counted objects can only be created using operator new, the cannot be created on the stack.
Definition: RCBase.h:24