VR-Forces 4.8 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) 2010 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: DtOsgChannelCompassInstance.h,v $ $Revision: 1.17 $ $State: Exp $
7 ******************************************************************************/
8 
12 
13 #pragma once
14 
15 #include <vrvOsg/vrvOsg.h>
18 #include <osg/Vec2>
19 #include <osg/ref_ptr>
20 
21 namespace osg
22 {
23  class Texture;
24 }
25 
26 namespace makVrv
27 {
28  class DtDe;
29  class DtChannel;
30  class DtChannelConfiguration;
31  class DtChannelManager;
32  class DtOsgChannel;
33  class DtOverlayRenderer;
34  class DtQuad;
35  class DtWindowConfiguration;
36  class DtLineSegment;
37 
42  {
43  public:
46 
48  virtual ~DtOsgChannelCompassInstance();
49 
51  virtual void setVisible(bool isVisible);
52 
54  virtual bool visible();
55 
57  virtual void setChannelName( const std::string& deName,
58  const std::string& winName, const std::string& channelName );
59 
62  virtual void setModelDefinition( const std::string& modelDefinition );
63 
66  virtual void updateCompass( bool force);
67 
68  void updateLetter( bool &dirtyFlag, const std::string& filename,
69  int tickIndex, DtQuad* letterQuad,
70  osg::ref_ptr<osg::Texture>& letterTexture, bool& force );
71 
73  virtual void setNorthLetterFilename( const std::string& filename );
74 
76  virtual void setSouthLetterFilename( const std::string& filename );
77 
79  virtual void setEastLetterFilename( const std::string& filename );
80 
82  virtual void setWestLetterFilename( const std::string& filename );
83 
85  virtual void setDarkTickColor( float r, float g, float b, float a );
86 
88  virtual void setLightTickColor( float r, float g, float b, float a );
89 
92  virtual void setPixelRatio(float pixelRatio);
93 
94  protected:
95 
96  virtual void slot_channelCreated(DtChannelManager*, DtChannel*);
97 
98  virtual void slot_channelToBeDestroyed(DtChannelManager*, DtChannel*);
99 
100  virtual void slot_channelConfigurationModified( const std::string& deName,
101  const std::string& winName, const std::string& oldChannelName,
102  const DtChannelConfiguration& config);
103 
104  virtual void slot_windowConfigurationModified( const std::string& deName,
105  const std::string& winName, const DtWindowConfiguration& config );
106 
107  // Create the compass frame
108  void createCompass();
109 
110  // delete / clear the DtQuad and DtFilledPolygons, if they exist
111  void destroyCompass();
112 
113  // Calculates a frame position based on Location enum, margins, current window size
114  // and channel parameters
115  osg::Vec2 calcCenterPosition();
116 
117  void slot_update();
118 
119  DtLineSegment* createDarkSide( DtOverlayRenderer& overlay );
120  DtLineSegment* createLightSide( DtOverlayRenderer& overlay );
121 
122  // This type can be used to provide a list of vertices to the polygon objects
123  typedef std::vector<float> VertexList;
124 
126  static void rotate(const DtOsgChannelCompassInstance::VertexList& in,
127  double rad, DtOsgChannelCompassInstance::VertexList& out );
128 
130  static void translate( const DtOsgChannelCompassInstance::VertexList& in,
131  const osg::Vec2& translation, DtOsgChannelCompassInstance::VertexList& out );
132 
133  static void scale( const DtOsgChannelCompassInstance::VertexList& in,
135 
136  protected:
137 
138  struct TickMark
139  {
142  };
143 
147 
149 
154 
159  osg::Vec2 myCenterPosition;
160 
161  // Set to true at beginning and whenever the letter filename changes
166 
167  // NW, NE, SW, SE +, if missing, E, S, and W
168  TickMark myLargeTickMarks[7];
169 
170  // Every 15 degrees, skipping the 4 letters and 4 large tick marks
171  TickMark mySmallTickMarks[16];
172 
174  };
175 }
176 
Diagonal crossing liens.
Definition: DtTacticalGraphicUtilities.h:93
osg::ref_ptr< osg::Texture > myWestTexture
Definition: DtOsgChannelCompassInstance.h:153
Definition: DtOsgChannelCompassInstance.h:138
osg::ref_ptr< osg::Texture > mySouthTexture
Definition: DtOsgChannelCompassInstance.h:151
osg::ref_ptr< osg::Texture > myNorthTexture
Definition: DtOsgChannelCompassInstance.h:150
DtOsgChannel * myChannel
Definition: DtOsgChannelCompassInstance.h:148
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
bool mySouthLetterDirty
Definition: DtOsgChannelCompassInstance.h:163
float myPixelRatio
Definition: DtOsgChannelCompassInstance.h:173
Interface for a DtChannelCompassInstance An object that draws a 2D compass.
Definition: DtChannelCompassInstance.h:24
DtDe & myDe
Definition: DtOsgChannelCompassInstance.h:144
This owns a list of channel configurations.
Definition: DtWindowConfiguration.h:31
Contains makVrv::DtChannelCompassInstance class.
bool myWestLetterDirty
Definition: DtOsgChannelCompassInstance.h:165
This class provides the OSG-specific implementation of a DtChannel.
Definition: DtOsgChannel.h:75
osg::ref_ptr< osg::Texture > myEastTexture
Definition: DtOsgChannelCompassInstance.h:152
The abstract Channel Class.
Definition: DtChannel.h:29
DtLineSegment * darkSide
Definition: DtOsgChannelCompassInstance.h:141
A class which represents a single line segment.
Definition: DtLineSegment.h:21
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:24
DtQuad * mySouthLetter
Definition: DtOsgChannelCompassInstance.h:156
vrvGraphics-based implementation of a 2D compass
Definition: DtOsgChannelCompassInstance.h:41
Base class for handling DtChannels.
Definition: DtChannelManager.h:35
std::vector< float > VertexList
Definition: DtOsgChannelCompassInstance.h:123
A single 2D quadrilateral.
Definition: DtQuad.h:24
Base class to provide boost signal/slot management.
DtSignalConnectionManager myPixelRatioConnection
Definition: DtOsgChannelCompassInstance.h:146
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:140
Contains DLL export macros.
bool myEastLetterDirty
Definition: DtOsgChannelCompassInstance.h:164
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
DtQuad * myEastLetter
Definition: DtOsgChannelCompassInstance.h:157
bool myNorthLetterDirty
Definition: DtOsgChannelCompassInstance.h:162
DtQuad * myWestLetter
Definition: DtOsgChannelCompassInstance.h:158
DtQuad * myNorthLetter
Definition: DtOsgChannelCompassInstance.h:155
DtSignalConnectionManager myConnections
Definition: DtOsgChannelCompassInstance.h:145
osg::Vec2 myCenterPosition
Definition: DtOsgChannelCompassInstance.h:159
The DtOverlayRenderer implements the overlay concept.
Definition: DtOverlayRenderer.h:23

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)