GeoModel - GeoModelCore
GeoShapeShift.cxx
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "GeoModelKernel/GeoShapeShift.h"
6 #include "GeoModelKernel/GeoShapeAction.h"
7 
8 const std::string GeoShapeShift::s_classType = "Shift";
9 const ShapeType GeoShapeShift::s_classTypeID = 0x03;
10 
11 GeoShapeShift::GeoShapeShift (const GeoShape* A, const GeoTrf::Transform3D &X)
12  : m_op (A)
13  , m_shift (X)
14 {
15  m_op->ref ();
16 }
17 
18 GeoShapeShift::~GeoShapeShift()
19 {
20  m_op->unref ();
21 }
22 
23 double GeoShapeShift::volume () const
24 {
25  return m_op->volume ();
26 }
27 
28 const std::string & GeoShapeShift::type () const
29 {
30  return s_classType;
31 }
32 
33 ShapeType GeoShapeShift::typeID () const
34 {
35  return s_classTypeID;
36 }
37 
38 const GeoShape* GeoShapeShift::getOp () const
39 {
40  return m_op;
41 }
42 
43 const GeoTrf::Transform3D & GeoShapeShift::getX () const
44 {
45  return m_shift;
46 }
47 
48 void GeoShapeShift::exec (GeoShapeAction *action) const
49 {
50  action->getPath ()->push (this);
51  action->handleShift (this);
52  if (action->shouldTerminate ())
53  {
54  action->getPath ()->pop ();
55  return;
56  }
57 
58  if (action->getDepthLimit ().isValid ()
59  && action->getPath ()->getLength () > action->getDepthLimit ())
60  {
61  }
62 
63  else
64  {
65  m_op->exec(action);
66  if (action->shouldTerminate ())
67  {
68  action->getPath ()->pop ();
69  return;
70  }
71  }
72  action->getPath()->pop();
73 }
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