GeoModel - GeoModelCore
GeoTessellatedSolid.cxx
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "GeoModelKernel/GeoTessellatedSolid.h"
6 #include "GeoModelKernel/GeoShapeAction.h"
7 
8 const std::string GeoTessellatedSolid::s_classType = "TessellatedSolid";
9 const ShapeType GeoTessellatedSolid::s_classTypeID = 0x21;
10 
11 GeoTessellatedSolid::GeoTessellatedSolid()
12 {
13 }
14 
16 {
17  for(size_t i=0; i<m_facets.size(); ++i)
18  m_facets[i]->unref();
19 }
20 
21 double GeoTessellatedSolid::volume() const
22 {
23  // -- ToDo
24  return 0.;
25 }
26 
27 const std::string& GeoTessellatedSolid::type() const
28 {
29  return s_classType;
30 }
31 
32 ShapeType GeoTessellatedSolid::typeID() const
33 {
34  return s_classTypeID;
35 }
36 
37 void GeoTessellatedSolid::exec(GeoShapeAction *action) const
38 {
39  action->handleTessellatedSolid(this);
40 }
41 
42 void GeoTessellatedSolid::addFacet(GeoFacet* facet)
43 {
44  facet->ref();
45  m_facets.push_back(facet);
46 }
47 
48 GeoFacet* GeoTessellatedSolid::getFacet(size_t index) const
49 {
50  return (index<m_facets.size() ? m_facets[index] : 0);
51 }
52 
53 size_t GeoTessellatedSolid::getNumberOfFacets() const
54 {
55  return m_facets.size();
56 }
Base class for GeoModel Facets Two implementations exist:
Definition: GeoFacet.h:24
virtual ~GeoTessellatedSolid()
True if the polygon has at least two facets. False otherwise.
This class is a visitor for shapes. It allows a navigation of the boolean expression tree for shapes...