CEDRIC  Revision_backup-2009-02
PhastGeometryBuilder.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * Copyright (C) 2008 Boris Iven, Max Hermann
4  *
5  * This file is part of the "CEDRIC Event Display" application.
6  *
7  *****************************************************************************/
8 
9 #ifndef PHASTGEOMETRYBUILDER_H
10 #define PHASTGEOMETRYBUILDER_H
11 
12 #include <string>
13 
14 #include <osg/ref_ptr>
15 #include <osg/Vec3f>
16 #include <osg/Node>
17 #include <osg/ShapeDrawable>
18 #include <osgText/Text>
19 
20 #include "PhastNode.h"
21 
22 class PaDetect;
23 class PaCalorimeter;
24 class PaRich;
25 class PaTrack;
26 class PaEvent;
27 
40 {
41 public:
43  virtual ~PhastGeometryBuilder();
44 
46  static void setShadowDistance( float dist ) { PhastNode::setShadowDistance(dist); }
47 
51  osg::ref_ptr<osg::Node> create( const PaDetect& det , osg::Vec3 color=osg::Vec3(1,1,1) );
53  osg::ref_ptr<osg::Node> create( const PaCalorimeter& cal , osg::Vec3 color=osg::Vec3(1,1,1) );
55  osg::ref_ptr<osg::Node> create( const PaRich& rich , osg::Vec3 color=osg::Vec3(1,1,1) );
56 
58  osg::ref_ptr<osg::Node> create( const PaEvent& event );
60  osg::ref_ptr<osg::Node> create( const PaTrack& track, osg::Vec3 color=osg::Vec3(1,1,1) );
62 
63 protected:
65  osg::ref_ptr<osgText::Text> createLabel( const std::string& label, osg::Node* node=0 );
66 
68  void setBlendState( osg::Node* node, bool enable );
69 };
70 
71 #endif
osg::ref_ptr< osgText::Text > createLabel(const std::string &label, osg::Node *node=0)
Returns a Text placed on the upper right of the nodes bounding sphere (if one is given) ...
Definition: PhastGeometryBuilder.cpp:99
static void setShadowDistance(float dist)
Must be set BEFORE creating any geometry with shadow.
Definition: PhastGeometryBuilder.h:46
osg::ref_ptr< osg::Node > create(const PaDetect &det, osg::Vec3 color=osg::Vec3(1, 1, 1))
virtual ~PhastGeometryBuilder()
Definition: PhastGeometryBuilder.cpp:37
void setBlendState(osg::Node *node, bool enable)
Enable/Disable blending.
Definition: PhastGeometryBuilder.cpp:41
PhastGeometryBuilder()
Definition: PhastGeometryBuilder.cpp:32
Collection of functions to create OSG geometry (nodes) for Phast classes (detectors/tracks).
Definition: PhastGeometryBuilder.h:39