VR-Forces 4.1.1 Class Documentation
DtProjectedTextModelInstance.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2008 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: DtProjectedTextModelInstance.h,v $ $Revision: 1.10 $ $State: Exp $
7 ******************************************************************************/
8 
12 
13 #ifndef DtAttachableProjectedTextModelInstance_H_
14 #define DtAttachableProjectedTextModelInstance_H_
15 
16 #include <vrvOsg/vrvOsg.h>
18 
19 #include <osg/Group>
20 #include <osg/Geode>
21 #include <osg/Geometry>
22 #include <osg/Switch>
23 #include <osgText/Text>
24 
25 namespace makVrv
26 {
27  class DtDe;
28  class DtChannel;
29 
34  : public DtOsgModelInstance
35  {
36  public:
38  DtProjectedTextModelInstance(DtDe& de, const std::string& uniqueName);
39 
42 
45  virtual void addToConnector( DtOsgSceneConnector* connector );
46 
49  virtual bool removeFromConnector( DtOsgSceneConnector* connector );
50 
51  virtual void setColor( const osg::Vec4& color );
52  virtual void setFontName( const std::string& fontName );
53  virtual void setFontSize( double size );
54  virtual void setText( const std::string& text );
55 
56  virtual void setPosition( int vtx, const DtVector& position );
57 
59  virtual void setVisible(bool visible) {}
60 
61  protected:
62 
63  DtChannel* findChannelWithLocation( const osg::Vec3d& location ) const;
64  bool locationInChannel( DtChannel* channel, const osg::Vec3d& location ) const;
65  void getChannelDimensions( DtChannel* channel, double& startX, double& startY,
66  double& endX, double& endY ) const;
67 
68  protected:
69 
70  osg::ref_ptr<osgText::Text> myTextDrawable;
71  osg::ref_ptr<osg::Geode> myTextGeode;
72 
73  std::string myFontName;
74  osg::Vec4 myColor;
75  double mySize;
76 
77  std::string myUniqueName;
78  };
79 }
80 
81 #endif
82 

Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)