CEDRIC  Revision_backup-2009-02
Classes | Public Types | Public Member Functions | Protected Member Functions | List of all members
PhastNode Class Reference

Graphical representation of Phast objects (e.g. PaDetector, PaTrack, ...) as OpenSceneGraph node. More...

#include <PhastNode.h>

Inheritance diagram for PhastNode:
TypedTransform Selectable PickingHandler::Pickable

Classes

struct  Magnet
 
struct  Target
 

Public Types

enum  Type {
  GROUP =1, DETECTOR =2, CALORIMETER =4, RICH =8,
  TRACK =16, MAGNET =32, TARGET =64, CLUSTER =128
}
 
- Public Types inherited from TypedTransform
enum  ReservedTypes { UNSPECIFIED =-1, GROUP =1 }
 
typedef TypedTransform T
 

Public Member Functions

 PhastNode ()
 Constructor for a GROUP node. More...
 
 PhastNode (const PaDetect &det, osg::Vec4 color=osg::Vec4(1.f, 1.f, 1.f, 1.f))
 Constructor for a DETECTOR node. More...
 
 PhastNode (const PaCalorimeter &cal, osg::Vec4 color=osg::Vec4(1.f, 1.f, 1.f, 1.f))
 Constructor for a CALORIMETER node. More...
 
 PhastNode (const PaRich &rich, osg::Vec4 color=osg::Vec4(1.f, 1.f, 1.f, 1.f))
 Constructor for a RICH node. More...
 
 PhastNode (const PaTrack &track, osg::Vec4 color=osg::Vec4(1.f, 1.f, 1.f, 1.f))
 Constructor for a TRACK node. More...
 
 PhastNode (const PaCaloClus &cluster)
 Constructor for a CLUSTER node, a special node showing the energy deposit in a Calorimeter Cluster. More...
 
std::string getName () const
 Return name (matches Phast object's name if node corresponds to a Phast object) More...
 
int getUID () const
 Return unique PhastNode index (e.g. usefull for mapping a PhastNode to a QTreeWidget item) More...
 
void setColor (osg::Vec3 color)
 Change color of this node and all its children. More...
 
void setAlpha (float alpha)
 Change alpha value of this node and all its children. More...
 
void setVisible (bool visible)
 Change visibility of this node and its subtree. More...
 
void highlight (bool highlighted)
 
 PhastNode (const Magnet &magnet, osg::Vec4 color=osg::Vec4(1.f, 1.f, 1.f, 1.f))
 
 PhastNode (const Target &target, osg::Vec4 color=osg::Vec4(1.f, 1.f, 1.f, 1.f))
 
bool isSetupEntity ()
 
bool isEventEntity ()
 
bool isGroup ()
 
bool isDetector ()
 
bool isCalorimeter ()
 
bool isRich ()
 
bool isTrack ()
 
bool isCluster ()
 
bool isMagnet ()
 
bool isTarget ()
 
Selectable implementation
virtual bool onHighlight (bool highlight)
 
virtual bool onSelect (bool select)
 
virtual const std::string & toolTip (osg::Node *)
 
Pickable implementation

Everything pickable except shadow

virtual bool isPickable (osg::Node *node)
 
- Public Member Functions inherited from TypedTransform
 TypedTransform (std::string className)
 
virtual bool childrenAllowed ()
 
const std::string & getClassName () const
 
int getType () const
 
virtual bool addChild (osg::Node *child)
 
virtual bool insertChild (unsigned int index, osg::Node *child)
 
virtual bool setChild (unsigned int index, osg::Node *child)
 
virtual bool replaceChild (osg::Node *origChild, osg::Node *child)
 
virtual bool removeChildren (unsigned int pos, unsigned int numChildrenToRemove)
 
- Public Member Functions inherited from Selectable
 Selectable ()
 
virtual ~Selectable ()
 
- Public Member Functions inherited from PickingHandler::Pickable
 Pickable ()
 
virtual ~Pickable ()
 

Protected Member Functions

osg::Geode * createHighlightBox (osg::BoundingBox bbox)
 
osg::Node * createWireframe (osg::Node *node)
 
osg::Node * createShadow (osg::Node *)
 
void createSimplifiedGeometry (osg::Vec4)
 
void init (int type, const std::string &name)
 Setup uid, type and name (first call in constructor) More...
 
void assemble ()
 Assemble switch node with geometry nodes (last call in constructor) More...
 
- Protected Member Functions inherited from TypedTransform
void updateType (int type=UNSPECIFIED)
 
- Protected Member Functions inherited from Selectable
bool isSelected () const
 
virtual void onMouseOver (const osgGA::GUIEventAdapter *ea, osg::Node *)
 
virtual void onMouseEnter (const osgGA::GUIEventAdapter *ea, osg::Node *)
 
virtual void onMouseLeave (const osgGA::GUIEventAdapter *ea)
 
- Protected Member Functions inherited from PickingHandler::Pickable
void setToolTip (std::string text)
 This may be used for showing a tooltip. More...
 
void setToolTipPosition (float x, float y, float z)
 

Additional Inherited Members

- Static Public Member Functions inherited from Selectable
static bool selectCurrent (bool select=true)
 
static bool toggleCurrent ()
 
static void resetCurrent ()
 
static Selectable * getCurrent ()
 
- Protected Attributes inherited from TypedTransform
int m_type
 
std::string m_className
 

Detailed Description

Graphical representation of Phast objects (e.g. PaDetector, PaTrack, ...) as OpenSceneGraph node.

Author
Max Hermann <mhermann[at]mail.cern.ch>

Member Enumeration Documentation

Type of this PhastNode. Leaf nodes are exactly of one type which corresponds to the associated Phast class given in their constructor. PhastNode's of type GROUP have all their childrens types or'ed together.

Enumerator
GROUP 
DETECTOR 
CALORIMETER 
RICH 
TRACK 
MAGNET 
TARGET 
CLUSTER 

Constructor & Destructor Documentation

PhastNode::PhastNode ( )

Constructor for a GROUP node.

PhastNode::PhastNode ( const PaDetect &  det,
osg::Vec4  color = osg::Vec4(1.f,1.f,1.f,1.f) 
)

Constructor for a DETECTOR node.

References OsgGeometry::createBox(), and OsgGeometry::createBoxWireframe().

PhastNode::PhastNode ( const PaCalorimeter &  cal,
osg::Vec4  color = osg::Vec4(1.f,1.f,1.f,1.f) 
)

Constructor for a CALORIMETER node.

References OsgGeometry::createBox(), OsgGeometry::createBoxArray(), and OsgGeometry::createBoxWireframe().

PhastNode::PhastNode ( const PaRich &  rich,
osg::Vec4  color = osg::Vec4(1.f,1.f,1.f,1.f) 
)
PhastNode::PhastNode ( const PaTrack &  track,
osg::Vec4  color = osg::Vec4(1.f,1.f,1.f,1.f) 
)

Constructor for a TRACK node.

References OsgGeometry::createLineStrip(), and OsgGeometry::setLineState().

PhastNode::PhastNode ( const PaCaloClus &  cluster)

Constructor for a CLUSTER node, a special node showing the energy deposit in a Calorimeter Cluster.

References OsgGeometry::createCross3D(), OsgGeometry::createQuad(), and QPhastInterface::getCalorimeter().

PhastNode::PhastNode ( const Magnet &  magnet,
osg::Vec4  color = osg::Vec4(1.f,1.f,1.f,1.f) 
)
PhastNode::PhastNode ( const Target &  target,
osg::Vec4  color = osg::Vec4(1.f,1.f,1.f,1.f) 
)

Member Function Documentation

void PhastNode::assemble ( )
protected

Assemble switch node with geometry nodes (last call in constructor)

osg::Geode * PhastNode::createHighlightBox ( osg::BoundingBox  bbox)
protected
osg::Node* PhastNode::createShadow ( osg::Node *  )
inlineprotected
void PhastNode::createSimplifiedGeometry ( osg::Vec4  )
inlineprotected
osg::Node * PhastNode::createWireframe ( osg::Node *  node)
protected
std::string PhastNode::getName ( ) const
inline

Return name (matches Phast object's name if node corresponds to a Phast object)

Referenced by EventMultiViewer::requestView().

int PhastNode::getUID ( ) const
inline

Return unique PhastNode index (e.g. usefull for mapping a PhastNode to a QTreeWidget item)

Referenced by SetupTreeWidget::addGroup(), SelectionDispatcher::highlight(), and ParticleTreeWidget::updateContent().

void PhastNode::highlight ( bool  highlighted)
void PhastNode::init ( int  type,
const std::string &  name 
)
protected

Setup uid, type and name (first call in constructor)

bool PhastNode::isCalorimeter ( )
inline
bool PhastNode::isCluster ( )
inline

References CLUSTER, and TypedTransform::m_type.

bool PhastNode::isDetector ( )
inline

References DETECTOR, and TypedTransform::m_type.

bool PhastNode::isEventEntity ( )
inline
bool PhastNode::isGroup ( )
inline
bool PhastNode::isMagnet ( )
inline

References TypedTransform::m_type, and MAGNET.

virtual bool PhastNode::isPickable ( osg::Node *  node)
inlinevirtual

Reimplemented from PickingHandler::Pickable.

bool PhastNode::isRich ( )
inline

References TypedTransform::m_type, and RICH.

bool PhastNode::isSetupEntity ( )
inline

Convenience getters for Type (Remember: A GROUP has the types of all its children!)

References CALORIMETER, DETECTOR, TypedTransform::m_type, MAGNET, RICH, and TARGET.

Referenced by SelectionDispatcher::highlight().

bool PhastNode::isTarget ( )
inline

References TypedTransform::m_type, and TARGET.

bool PhastNode::isTrack ( )
inline

References TypedTransform::m_type, and TRACK.

bool PhastNode::onHighlight ( bool  highlight)
virtual
bool PhastNode::onSelect ( bool  select)
virtual

Implements Selectable.

void PhastNode::setAlpha ( float  alpha)

Change alpha value of this node and all its children.

References ChangeColorVisitor::changeOnlyAlpha(), ChangeColorVisitor::setAlpha(), and setAlpha().

Referenced by SetupTreeWidget::changeSetupAlpha(), and setAlpha().

void PhastNode::setColor ( osg::Vec3  color)

Change color of this node and all its children.

References ChangeColorVisitor::getNumberOfChangedDrawables(), and setColor().

Referenced by setColor().

void PhastNode::setVisible ( bool  visible)

Change visibility of this node and its subtree.

References setVisible().

Referenced by setVisible(), and SetupTreeWidget::updateItem().

const std::string & PhastNode::toolTip ( osg::Node *  )
virtual

Reimplemented from Selectable.