VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOsgChannelCompassInstance.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
15 #include <osg/Vec2>
16 #include <osg/ref_ptr>
17 
18 namespace osg
19 {
20  class Texture;
21 }
22 
23 namespace makVrv
24 {
25  class DtDe;
26  class DtChannel;
27  class DtChannelConfiguration;
28  class DtChannelManager;
29  class DtOsgChannel;
30  class DtOverlayRenderer;
31  class DtQuad;
32  class DtWindowConfiguration;
33  class DtLineSegment;
34 
39  {
40  public:
41 
44 
46  virtual ~DtOsgChannelCompassInstance();
47 
49  DtOsgChannelCompassInstance() = delete;
50 
53 
55  DtOsgChannelCompassInstance &operator=(const DtOsgChannelCompassInstance &other) = delete;
56 
58  virtual void setVisible(bool isVisible);
59 
61  virtual bool visible();
62 
64  virtual void setChannelName( const std::string& deName,
65  const std::string& winName, const std::string& channelName );
66 
69  virtual void setModelDefinition( const std::string& modelDefinition );
70 
73  virtual void updateCompass( bool force);
74 
75  void updateLetter( bool &dirtyFlag, const std::string& filename,
76  int tickIndex, DtQuad* letterQuad,
77  osg::ref_ptr<osg::Texture>& letterTexture, bool& force );
78 
80  virtual void setNorthLetterFilename( const std::string& filename );
81 
83  virtual void setSouthLetterFilename( const std::string& filename );
84 
86  virtual void setEastLetterFilename( const std::string& filename );
87 
89  virtual void setWestLetterFilename( const std::string& filename );
90 
92  virtual void setStarFilename(const std::string& filename);
93 
95  virtual void setDarkTickColor( float r, float g, float b, float a );
96 
98  virtual void setLightTickColor( float r, float g, float b, float a );
99 
102  virtual void setPixelRatio(float pixelRatio);
103 
104  protected:
105 
106  virtual void slot_channelCreated(DtChannelManager*, DtChannel*);
107 
108  virtual void slot_channelToBeDestroyed(DtChannelManager*, DtChannel*);
109 
110  virtual void slot_channelConfigurationModified( const std::string& deName,
111  const std::string& winName, const std::string& oldChannelName,
112  const DtChannelConfiguration& config);
113 
114  virtual void slot_windowConfigurationModified( const std::string& deName,
115  const std::string& winName, const DtWindowConfiguration& config );
116 
117  // Create the compass frame
118  void createCompass();
119 
120  // delete / clear the DtQuad and DtFilledPolygons, if they exist
121  void destroyCompass();
122 
123  // Calculates a frame position based on Location enum, margins, current window size
124  // and channel parameters
125  osg::Vec2 calcCenterPosition();
126 
127  void slot_update();
128 
129  DtLineSegment* createDarkSide( DtOverlayRenderer& overlay );
130  DtLineSegment* createLightSide( DtOverlayRenderer& overlay );
131 
132  // This type can be used to provide a list of vertices to the polygon objects
133  typedef std::vector<float> VertexList;
134 
136  static void rotate(const DtOsgChannelCompassInstance::VertexList& in,
137  double rad, DtOsgChannelCompassInstance::VertexList& out );
138 
140  static void translate( const DtOsgChannelCompassInstance::VertexList& in,
141  const osg::Vec2& translation, DtOsgChannelCompassInstance::VertexList& out );
142 
143  static void scale( const DtOsgChannelCompassInstance::VertexList& in,
145 
146  protected:
147 
148  struct TickMark
149  {
151  : lightSide(0)
152  , darkSide(0)
153  {
154  // intentional noop
155  }
156 
159  };
160 
164 
166 
172 
178  osg::Vec2 myCenterPosition;
179 
180  // Set to true at beginning and whenever the letter filename changes
186 
187  // NW, NE, SW, SE +, if missing, E, S, and W
188  TickMark myLargeTickMarks[7];
189 
190  // Every 15 degrees, skipping the 4 letters and 4 large tick marks
191  TickMark mySmallTickMarks[16];
192 
194 
198  };
199 }
200 
Diagonal crossing liens.
Definition: DtTacticalGraphicUtilities.h:93
osg::ref_ptr< osg::Texture > myWestTexture
Definition: DtOsgChannelCompassInstance.h:170
Definition: DtOsgChannelCompassInstance.h:148
osg::ref_ptr< osg::Texture > mySouthTexture
Definition: DtOsgChannelCompassInstance.h:168
osg::ref_ptr< osg::Texture > myNorthTexture
Definition: DtOsgChannelCompassInstance.h:167
DtOsgChannel * myChannel
Definition: DtOsgChannelCompassInstance.h:165
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
bool mySouthLetterDirty
Definition: DtOsgChannelCompassInstance.h:182
TickMark myMagneticNorthMark
Definition: DtOsgChannelCompassInstance.h:196
TickMark myTrueNorthMark
Definition: DtOsgChannelCompassInstance.h:195
float myPixelRatio
Definition: DtOsgChannelCompassInstance.h:193
Interface for a DtChannelCompassInstance An object that draws a 2D compass.
Definition: DtChannelCompassInstance.h:21
TickMark()
Definition: DtOsgChannelCompassInstance.h:150
DtDe & myDe
Definition: DtOsgChannelCompassInstance.h:161
This owns a list of channel configurations.
Definition: DtWindowConfiguration.h:28
Contains makVrv::DtChannelCompassInstance class.
bool myWestLetterDirty
Definition: DtOsgChannelCompassInstance.h:184
This class provides the OSG-specific implementation of a DtChannel.
Definition: DtOsgChannel.h:77
osg::ref_ptr< osg::Texture > myEastTexture
Definition: DtOsgChannelCompassInstance.h:169
osg::ref_ptr< osg::Texture > myStarTexture
Definition: DtOsgChannelCompassInstance.h:171
The abstract Channel Class.
Definition: DtChannel.h:30
DtLineSegment * darkSide
Definition: DtOsgChannelCompassInstance.h:158
A class which represents a single line segment.
Definition: DtLineSegment.h:21
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
DtQuad * mySouthLetter
Definition: DtOsgChannelCompassInstance.h:174
bool myStarDirty
Definition: DtOsgChannelCompassInstance.h:185
vrvGraphics-based implementation of a 2D compass
Definition: DtOsgChannelCompassInstance.h:38
Base class for handling DtChannels.
Definition: DtChannelManager.h:32
std::vector< float > VertexList
Definition: DtOsgChannelCompassInstance.h:133
A single 2D quadrilateral.
Definition: DtQuad.h:24
TickMark myDaggerMark
Definition: DtOsgChannelCompassInstance.h:197
Base class to provide boost signal/slot management.
DtSignalConnectionManager myPixelRatioConnection
Definition: DtOsgChannelCompassInstance.h:163
DtQuad * myStarQuad
Definition: DtOsgChannelCompassInstance.h:177
Configuration for a single channel Serialized and sent to remote displays as necessary to configure r...
Definition: DtChannelConfiguration.h:26
DtLineSegment * lightSide
Definition: DtOsgChannelCompassInstance.h:157
Contains DLL export macros.
bool myEastLetterDirty
Definition: DtOsgChannelCompassInstance.h:183
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
DtQuad * myEastLetter
Definition: DtOsgChannelCompassInstance.h:175
bool myNorthLetterDirty
Definition: DtOsgChannelCompassInstance.h:181
DtQuad * myWestLetter
Definition: DtOsgChannelCompassInstance.h:176
DtQuad * myNorthLetter
Definition: DtOsgChannelCompassInstance.h:173
DtSignalConnectionManager myConnections
Definition: DtOsgChannelCompassInstance.h:162
osg::Vec2 myCenterPosition
Definition: DtOsgChannelCompassInstance.h:178
The DtOverlayRenderer implements the overlay concept.
Definition: DtOverlayRenderer.h:23

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)