GeoModel - GeoModelCore
GeoSimplePolygonBrep.h
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef GEOMODELKERNEL_GEOSIMPLEPOLYGONBREP_H
6 #define GEOMODELKERNEL_GEOSIMPLEPOLYGONBREP_H
7 
19 #include <vector>
20 #include "GeoModelKernel/GeoShape.h"
21 
22 
24 {
25  public:
26  GeoSimplePolygonBrep(double dz);
27 
28  virtual double volume() const;
29 
30  virtual const std::string& type() const;
31  virtual ShapeType typeID() const;
32 
33  void addVertex(double XVertex, double YVertex);
34  unsigned int getNVertices() const;
35 
36  bool isValid () const;
37 
38  const double & getXVertex(unsigned int i) const;
39  const double & getYVertex(unsigned int i) const;
40 
41  virtual void exec(GeoShapeAction *action) const;
42 
43  static const std::string& getClassType();
44  static ShapeType getClassTypeID();
45 
46  const double& getDZ() const;
47 
48  protected:
49  virtual ~GeoSimplePolygonBrep();
50 
51  private:
53  GeoSimplePolygonBrep & operator=(const GeoSimplePolygonBrep &right);
54 
55  static const std::string s_classType;
56  static const ShapeType s_classTypeID;
57 
58  double m_dZ;
59  std::vector<double> m_xVertices;
60  std::vector<double> m_yVertices;
61 };
62 
63 inline unsigned int GeoSimplePolygonBrep::getNVertices() const
64 {
65  return m_xVertices.size();
66 }
67 
68 inline bool GeoSimplePolygonBrep::isValid() const
69 {
70  return getNVertices()>=3;
71 }
72 
73 inline const double& GeoSimplePolygonBrep::getXVertex(unsigned int i) const
74 {
75  return m_xVertices[i];
76 }
77 
78 inline const double& GeoSimplePolygonBrep::getYVertex(unsigned int i) const
79 {
80  return m_yVertices[i];
81 }
82 
83 inline const std::string& GeoSimplePolygonBrep::getClassType()
84 {
85  return s_classType;
86 }
87 
88 inline ShapeType GeoSimplePolygonBrep::getClassTypeID()
89 {
90  return s_classTypeID;
91 }
92 
93 inline const double& GeoSimplePolygonBrep::getDZ() const
94 {
95  return m_dZ;
96 }
97 
98 #endif
This shape represents a BREP solid consisting of two equivalent polygonial faces perpendicular to Z a...
This class is a visitor for shapes. It allows a navigation of the boolean expression tree for shapes...
This class describes a Shape. Shapes will be able to do the following things:
Definition: GeoShape.h:38