VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOsgWindowTextInstance.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2022 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
15 #include <vrvCore/DtWindowText.h>
16 
18 
19 #include <vrvGraphics/DtFont.h>
21 
22 #include <osg/Vec2>
23 #include <osg/Matrix>
24 namespace makVrv
25 {
26  class DtDe;
27  class DtTextProxy;
28  class DtChannelManager;
29  class DtChannel;
30 
35  {
36  public:
39 
41  virtual ~DtOsgWindowTextInstance();
42 
44  virtual void setVisible(bool isVisible);
45 
47  virtual void setTopLeftCorner( float x, float y );
48 
50  virtual void setColor(float r,float g,float b,float a);
51 
53  virtual void setText(const std::string& textString);
54 
59  virtual void setFont(const std::string& fontFilePath, float sizeInPoints);
60 
62  virtual void setTextBoxWidth(unsigned int widthInPixels);
63 
65  virtual void setAlignment(DtWindowText::TextAlignment alignment);
66 
68  virtual bool visible() const;
69 
72  virtual void setTransform( DtMatrix3<double> transform );
73 
75  virtual void update();
76 
79  virtual void setGroup( int groupId );
80 
85  virtual void setChannelOverlay( const std::string& displayName,
86  const std::string& windowName, const std::string& channelName ) override;
87 
89  void createText();
90  protected:
93  virtual void setClipBox( DtVector2<double> bottomLeftLocation, DtVector2<double> topRightLocation );
94 
97  virtual void slot_releaseResources();
98 
100  virtual void slot_channelToBeDestroyed(DtChannelManager*, DtChannel*);
101 
103  virtual void slot_onViewCreated();
104 
107  virtual bool clipTextPosition( osg::Vec2 position );
108 
110  float myColorR, myColorG, myColorB, myColorA;
111  std::string myFontFile;
112  std::string myTextString;
113  std::string myDisplayName;
114  std::string myWindowName;
115  std::string myChannelName;
117  float mySize;
118  float myWidth;
119  osg::Vec2 myTopLeftPosition; // this is our "vertex" location
121  osg::Vec2 myClipBoxTopRight;
127  osg::Matrix myTransform;
128  int myGroup;
129 
131  };
132 
135  {
136  public:
139 
142  virtual DtWindowTextInstance* create();
143  };
144 }
An OSG Implementation of DtWindowTextInstance. Uses a vrvGraphics DtTextProxy to implement 2D text...
Definition: DtOsgWindowTextInstance.h:34
std::string myFontFile
Definition: DtOsgWindowTextInstance.h:111
Creator for DtWindowTextInstance, will throw if you create on it. osg creator is registered in vrvOsg...
Definition: DtWindowTextInstance.h:78
float myColorR
Definition: DtOsgWindowTextInstance.h:110
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
Interface for a DtWindowTextInstance An object that draws a 2D text.
Definition: DtWindowTextInstance.h:24
osg::Vec2 myTopLeftPosition
Definition: DtOsgWindowTextInstance.h:119
Contains the makVrv::DtTextRenderer class declaration.
A class for controlling text owned by the TextRenderer.
Definition: DtTextRenderer.h:197
Contains makVrv::DtWindowText class.
bool myGeometryDirty
Definition: DtOsgWindowTextInstance.h:125
float myWidth
Definition: DtOsgWindowTextInstance.h:118
bool myIsVisible
Definition: DtOsgWindowTextInstance.h:124
TextAlignement
Definition: DtFont.h:33
int myGroup
Definition: DtOsgWindowTextInstance.h:128
The abstract Channel Class.
Definition: DtChannel.h:35
bool myUseChannelOverlay
Definition: DtOsgWindowTextInstance.h:126
std::string myWindowName
Definition: DtOsgWindowTextInstance.h:114
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
osg::Vec2 myClipBoxTopRight
Definition: DtOsgWindowTextInstance.h:121
float mySize
Definition: DtOsgWindowTextInstance.h:117
Creator for DtOsgWindowTextInstance.
Definition: DtOsgWindowTextInstance.h:134
boost::shared_ptr< DtFont > DtFontSP
Definition: DtFontManager.h:20
DtSignalConnectionManager myConnections
Definition: DtOsgWindowTextInstance.h:130
DtTextProxy * myText
Definition: DtOsgWindowTextInstance.h:123
Base class for handling DtChannels. Derived classes should override the tick() method and advance the...
Definition: DtChannelManager.h:32
Base class to provide boost signal/slot management.
DtFontSP myFont
Definition: DtOsgWindowTextInstance.h:116
Contains makVrv::DtFont class.
DtDe & myDe
Definition: DtOsgWindowTextInstance.h:109
Contains DLL export macros.
Contains makVrv::DtWindowTextInstance class.
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:70
DtFont::TextAlignement myAlignment
Definition: DtOsgWindowTextInstance.h:122
std::string myTextString
Definition: DtOsgWindowTextInstance.h:112
std::string myChannelName
Definition: DtOsgWindowTextInstance.h:115
std::string myDisplayName
Definition: DtOsgWindowTextInstance.h:113
osg::Vec2 myClipBoxBottomLeft
Definition: DtOsgWindowTextInstance.h:120
TextAlignment
Definition: DtWindowText.h:41
osg::Matrix myTransform
Definition: DtOsgWindowTextInstance.h:127

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)