VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
rangeLineVisualizer.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2013 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrfGuiCore/vrfGuiCore.h>
14 #include <vrvCore/DtSceneObjectAgent.hpp>
15 
16 namespace makVrv
17 {
18  class DtModelAgent;
19  class DtProjectedWidgetModelAgent;
20  class DtWidgetLabelAgent;
21 }
22 
23 class DtAttachableRangeLineTextUpdaterAgent;
24 
29 {
30 public:
35  makVrv::DtStateListener& listener, makVrv::DtSceneObjectAgent*, int modelSet);
36 
39 
41  virtual const makVrv::DtStateVisualizer::TypeInfo& typeInfo() const;
42 
45 
48 
49 protected:
51  virtual void createModelAgents();
52 
54  virtual void destroyModelAgents();
55 
58  virtual void setVisualizerDefinition(const makVrv::DtVisualizerDefinition& visDef);
59 
62  virtual void setSceneObjectID( makVrv::DtUniqueID ) override;
63 
65  virtual void setModelDefinitionForAgents();
66 
68  // Set / Get the text color. Can use 0.0-1.0 or 0-255
69  virtual void setTextColor(float r, float g, float b, float a);
70  virtual void getTextColor(float& r, float& g, float& b, float& a) const;
72 
74  // Set / Get the size of the box the text is positioned in, in pixels.
75  virtual void setTextBoxSize( unsigned int textWidth, unsigned int textHeight );
76  virtual void getTextBoxSize( unsigned int& textWidth, unsigned int& textHeight ) const;
78 
80  // Set / Get a pixel offset from the top of the line for the text box.
81  virtual void setOriginOffset( int offsetX, int offsetY );
82  virtual void getOriginOffset( int& offsetX, int& offsetY ) const;
84 
86  // Set / Get the horizontal alignment of the text within the text box.
87  // Values come from DtWidgetLabel
88  virtual void setHorizontalAlignment (unsigned int horizontalAlignment );
89  virtual unsigned int horizontalAlignment() const;
91 
93  // Set / Get the name of the font to use for the height text.
94  virtual void setTextFont( std::string textFont) ;
95  virtual std::string textFont() const;
97 
99  // Set / Get the point size of the font used for height text
100  virtual void setTextFontSize( unsigned int textFontSize );
101  virtual unsigned int textFontSize() const;
103 
105  // Set / Get whether or not to compute range to next point
106  virtual void setComputeToNextPoint( bool ) ;
107  virtual bool computeToNextPoint() const;
109 
110 protected:
111  makVrv::DtProjectedWidgetModelAgent* myRangeLineTextModelAgent;
112  makVrv::DtWidgetLabelAgent* myRangeLineTextWidgetAgent;
113  DtAttachableRangeLineTextUpdaterAgent* myRangeLineTextUpdaterAgent;
114  makVrv::DtSceneObjectAgent* myRangeLineTextObjectAgent;
115 
116  unsigned int myTextBoxSize[2]; // default is 150 x 25 pixels
117  unsigned int myTextHorizontalAlignment; // default is center
118  std::string myTextFont; // default is "FreeMono.otf"
119  unsigned int myTextFontSize; // default is 14
120  float myTextColor[4]; // default is 1., 1., 0., 1.
121  int myOriginOffset[2]; // default is 30, -30
123 };
124 
virtual DtObserverMode::ModelSets modelSet()
Return the visualizer&#39;s model set enum.
virtual void getTextColor(float &r, float &g, float &b, float &a) const
virtual bool computeToNextPoint() const
makVrv::DtWidgetLabelAgent * myRangeLineTextWidgetAgent
Definition: rangeLineVisualizer.h:112
makVrv::DtStateVisualizerCreatorTemplate< DtRangeLineTextVisualizer > DtRangeLineTextVisualizerCreator
Definition: rangeLineVisualizer.h:126
static const makVrv::DtVisualizerSchema & theRangeLineTextSchema()
Schema for this visualizer.
Definition: DtStateVisualizer.h:305
virtual const makVrv::DtStateVisualizer::TypeInfo & typeInfo() const
Get this instances type info.
float myTextColor[4]
Definition: rangeLineVisualizer.h:120
virtual void setTextFontSize(unsigned int textFontSize)
The DtBaseConnection is an abstract class.
Definition: DtBaseConnection.h:38
virtual unsigned int horizontalAlignment() const
DtAttachableRangeLineTextUpdaterAgent * myRangeLineTextUpdaterAgent
Definition: rangeLineVisualizer.h:113
makVrv::DtProjectedWidgetModelAgent * myRangeLineTextModelAgent
Definition: rangeLineVisualizer.h:111
unsigned int myTextFontSize
Definition: rangeLineVisualizer.h:119
unsigned int myTextBoxSize[2]
Definition: rangeLineVisualizer.h:116
virtual void setOriginOffset(int offsetX, int offsetY)
Contains makVrv:DtStateVisualizer class.
DtBaseConnection & simulation()
Get the connection for this visualizer.
Definition: DtStateVisualizer.h:170
virtual void createModelAgents()
Creates all the agents needed to display the range line text.
virtual void setComputeToNextPoint(bool)
virtual void getTextBoxSize(unsigned int &textWidth, unsigned int &textHeight) const
virtual void getOriginOffset(int &offsetX, int &offsetY) const
virtual void setTextFont(std::string textFont)
bool myComputeToNextPoint
Definition: rangeLineVisualizer.h:122
std::string myTextFont
Definition: rangeLineVisualizer.h:118
The DtStateVisualizer is an abstract class. Developers derive from this to create logic that &quot;directs...
Definition: DtStateVisualizer.h:32
virtual ~DtRangeLineTextVisualizer()
Destructor.
A definition of a visualizer. Visualizer definition are always members of a visualizer definition set...
Definition: DtVisualizerDefinition.h:22
virtual void setModelDefinitionForAgents()
No-op.
int myOriginOffset[2]
Definition: rangeLineVisualizer.h:121
makVrv::DtSceneObjectAgent * myRangeLineTextObjectAgent
Definition: rangeLineVisualizer.h:114
virtual void setHorizontalAlignment(unsigned int horizontalAlignment)
virtual void setVisualizerDefinition(const makVrv::DtVisualizerDefinition &visDef)
Stores variables from visual definition to use when creating visualizer.
virtual void destroyModelAgents()
Destroyes all the agents.
virtual void setTextColor(float r, float g, float b, float a)
virtual unsigned int textFontSize() const
DtRangeLineTextVisualizer(makVrv::DtBaseConnection &simulation, makVrv::DtStateListener &listener, int modelSet)
Constructor.
DtRangeLineTextVisualizer will display the text of a range between two points on a line...
Definition: rangeLineVisualizer.h:28
The DtStateListener is an abstract class. Subclasses implement functionality that will allow data to ...
Definition: DtStateListener.h:25
Definition: DtVisualizerSchema.h:19
Struct to hold metadata about each functional visualizer type This allows users of the factory to get...
Definition: DtStateVisualizer.h:56
virtual void setSceneObjectID(makVrv::DtUniqueID) override
Set the scene object id of the line object visualizing this range.
virtual std::string textFont() const
DtStateListener & listener()
Definition: DtStateVisualizer.h:159
unsigned int myTextHorizontalAlignment
Definition: rangeLineVisualizer.h:117
static const makVrv::DtStateVisualizer::TypeInfo & theTypeInfo()
Get this class&#39;s type info.
virtual void setTextBoxSize(unsigned int textWidth, unsigned int textHeight)

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)