Skip to content
Snippets Groups Projects
Commit 62142525 authored by Joseph Boudreau's avatar Joseph Boudreau
Browse files

Deprecation of custom shape and introduction of the GeoUnidentifiedShape

parent 9109fb2d
No related branches found
No related tags found
1 merge request!6Deprecation of custom shape and introduction of the GeoUnidentifiedShape
Pipeline #1494534 passed
...@@ -33,9 +33,7 @@ class GeoTubs; ...@@ -33,9 +33,7 @@ class GeoTubs;
class GeoTube; class GeoTube;
class GeoEllipticalTube; class GeoEllipticalTube;
class GeoTorus; class GeoTorus;
class GeoUnidentifiedShape;
class LArCustomShape;
class GeoSimplePolygonBrep; class GeoSimplePolygonBrep;
class GeoTessellatedSolid; class GeoTessellatedSolid;
...@@ -106,13 +104,14 @@ class GeoShapeAction ...@@ -106,13 +104,14 @@ class GeoShapeAction
// Returns a pointer to the path object. // Returns a pointer to the path object.
GeoShapePath * getPath (); GeoShapePath * getPath ();
virtual void handleLArCustom (const LArCustomShape *);
virtual void handleSimplePolygonBrep (const GeoSimplePolygonBrep *); virtual void handleSimplePolygonBrep (const GeoSimplePolygonBrep *);
virtual void handleTessellatedSolid (const GeoTessellatedSolid *); virtual void handleTessellatedSolid (const GeoTessellatedSolid *);
virtual void handleEllipticalTube (const GeoEllipticalTube *); virtual void handleEllipticalTube (const GeoEllipticalTube *);
virtual void handleTorus (const GeoTorus *); virtual void handleTorus (const GeoTorus *);
virtual void handleGenericTrap (const GeoGenericTrap *); virtual void handleGenericTrap (const GeoGenericTrap *);
virtual void handleUnidentifiedShape(const GeoUnidentifiedShape *shape);
private: private:
GeoShapeAction(const GeoShapeAction &right); GeoShapeAction(const GeoShapeAction &right);
GeoShapeAction & operator=(const GeoShapeAction &right); GeoShapeAction & operator=(const GeoShapeAction &right);
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
//=========================================================================
//
// GeoUnidentifiedShape
//
// This class is essentially a bundle of data with no fixed format.
// ASCII information can be added and retreived. It serves as a
// proxy for shapes that are not part of the kernel, i.e. extender-
// class shapes.
//
// Joe Boudreau 2020
//
//=========================================================================
#ifndef _GeoUnidentifiedShape_h_
#define _GeoUnidentifiedShape_h_
#include "GeoModelKernel/GeoShape.h"
#include "GeoModelKernel/Query.h"
#include <string>
class GeoUnidentifiedShape: public GeoShape {
public:
// Constructor:
GeoUnidentifiedShape(const std::string & name);
// Constructor:
GeoUnidentifiedShape(const std::string & name, const std::string & asciiData);
// Constructor with volume:
GeoUnidentifiedShape(const std::string & name, const std::string & asciiData, double volume);
// Returns the user-provided name of the volume (eg "MySpecialShape");
const std::string & name() const;
// Returns the ascii data associated with this object (possibly empty);
const std::string & asciiData() const;
// Returns the volume of the shape, for mass inventory
virtual double volume () const;
// Returns the shape type, as a string.
virtual const std::string & type () const;
// Returns the shape type, as an coded integer.
virtual ShapeType typeID () const;
// For type identification.
static const std::string& getClassType ();
// For type identification.,
static ShapeType getClassTypeID ();
// Executes a GeoShapeAction
virtual void exec (GeoShapeAction *action) const;
protected:
// Destructor:
~GeoUnidentifiedShape();
private:
const std::string _name;
const std::string _asciiData;
const Query<double> _volume;
static const std::string _classType;
static const ShapeType _classTypeID;
};
inline const std::string& GeoUnidentifiedShape::getClassType ()
{
return _classType;
}
inline ShapeType GeoUnidentifiedShape::getClassTypeID ()
{
return _classTypeID;
}
#endif
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include "GeoModelKernel/GeoEllipticalTube.h" #include "GeoModelKernel/GeoEllipticalTube.h"
#include "GeoModelKernel/GeoTorus.h" #include "GeoModelKernel/GeoTorus.h"
#include "GeoModelKernel/GeoGenericTrap.h" #include "GeoModelKernel/GeoGenericTrap.h"
#include "GeoModelKernel/GeoUnidentifiedShape.h"
GeoShapeAction::GeoShapeAction() GeoShapeAction::GeoShapeAction()
: m_terminate(false) : m_terminate(false)
...@@ -133,11 +133,6 @@ GeoShapePath * GeoShapeAction::getPath () ...@@ -133,11 +133,6 @@ GeoShapePath * GeoShapeAction::getPath ()
return &m_path; return &m_path;
} }
void GeoShapeAction::handleLArCustom (const LArCustomShape *lar)
{
handleShape( (GeoShape *) lar);
}
void GeoShapeAction::handleSimplePolygonBrep (const GeoSimplePolygonBrep* brep) void GeoShapeAction::handleSimplePolygonBrep (const GeoSimplePolygonBrep* brep)
{ {
handleShape(brep); handleShape(brep);
...@@ -163,4 +158,9 @@ void GeoShapeAction::handleGenericTrap (const GeoGenericTrap * gentrap) ...@@ -163,4 +158,9 @@ void GeoShapeAction::handleGenericTrap (const GeoGenericTrap * gentrap)
handleShape(gentrap); handleShape(gentrap);
} }
void GeoShapeAction::handleUnidentifiedShape (const GeoUnidentifiedShape * uShape)
{
handleShape(uShape);
}
#include "GeoModelKernel/GeoUnidentifiedShape.h"
#include "GeoModelKernel/Query.h"
#include "GeoModelKernel/GeoShapeAction.h"
const std::string GeoUnidentifiedShape::_classType="UnidentifiedShape";
const ShapeType GeoUnidentifiedShape::_classTypeID=0xFFFFFFFF;
// Destructor:
GeoUnidentifiedShape::~GeoUnidentifiedShape() {
}
// Constructor:
GeoUnidentifiedShape::GeoUnidentifiedShape(const std::string & name):
_name(name) {}
// Constructor:
GeoUnidentifiedShape::GeoUnidentifiedShape(const std::string & name, const std::string & asciiData) :
_name(name),
_asciiData(asciiData) {}
// Constructor with volume:
GeoUnidentifiedShape::GeoUnidentifiedShape(const std::string & name, const std::string & asciiData, double volume):
_name(name),
_asciiData(asciiData),
_volume(volume) {}
// Returns the user-provided name of the volume (eg "MySpecialShape");
const std::string & GeoUnidentifiedShape::name() const {
return _name;
}
// Returns the ascii data associated with this object (possibly empty);
const std::string & GeoUnidentifiedShape::asciiData() const {
return _asciiData;
}
// Returns the volume of the shape, for mass inventory
double GeoUnidentifiedShape::volume () const {
return _volume;
}
// Returns the shape type, as a string.
const std::string & GeoUnidentifiedShape::type () const {
return _classType;
}
// Returns the shape type, as an coded integer.
ShapeType GeoUnidentifiedShape::typeID () const {
return _classTypeID;
}
// Executes a GeoShapeAction
void GeoUnidentifiedShape::exec (GeoShapeAction *action) const {
action->handleUnidentifiedShape(this);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment