VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtQuadRenderer.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 
13 
15 
16 #include <vector>
17 
18 #include <tbb/mutex.h>
19 
20 namespace makVrv
21 {
22 
23  class DtDe;
24  class DtQuadProxy;
25  class DtPrimitiveStyle;
26  class DtOverlayResourceProvider;
27 
30 
33 
35  template <>
36  inline const char* creatorTypeName<DtQuadRenderer>(void) { return "DtQuadRendererCreator"; }
37 
41  {
42  public:
43 
44  enum Styles
45  {
46  Style_Flat = 0,
50  Styles_End
51  };
52 
54  friend class DtQuadProxy;
55 
57  virtual ~DtQuadRenderer();
58 
60  virtual int numberOfPrimitives() const;
61 
63  virtual void render( bool geocentric, float geocentricAlpha,
64  const double location[3], double cameraAltitude
65  , const double positionMatrix[16]
66  , const double projectionMatrix[16]);
67 
69  virtual void releaseResources();
70 
72  virtual bool isRenderModeSupported( int mode );
73 
75  DtQuadProxy* allocateProxy(Styles = Style_Flat);
76 
77  protected:
78 
81 
83  void add( DtQuadProxy* toAdd );
84 
86  void remove( const DtQuadProxy* const proxy, bool isBeingDeleted = false );
87 
89  void dirty( DtQuadProxy* proxy );
90 
91  protected:
92 
93  typedef std::vector<DtQuadProxy*> QuadProxyList;
94 
95  DtPrimitiveStyle* myStyles[Styles_End];
96  bool myStyleDirty[Styles_End];
98 
99  tbb::mutex myUpdateMutex;
100 
101  };
102 
103 
112  {
113  public:
114 
115  friend class DtQuadRenderer;
116 
117  ~DtQuadProxy();
118 
120  void setGroup( float order );
121 
123  float group() const;
124 
126  void set3DPosition( int index, float x, float y, float z, float w);
127 
129  void set3DPosition( float x, float y, float z, float w = 0 );
130 
132  void get3DPosition( float& x, float& y, float& z, float& w ) const;
133 
135  void set2DRotation( float angle );
136 
138  void get2DRotation( float& angle ) const;
139 
141  void setPoints( const float points[8] );
142 
144  void getPoints(float points[8]) const;
145 
148  void setPointsByMinimumAltitude(const float points[8], double altitude);
149 
156  void setIsForcedPointsByAltitudeEnabled(bool isEnabled);
157 
161  void setAltitudeForForcedPoints(double minimumAltitudeForUse);
162 
164  void clearAltitudeSpecificConfigurations();
165 
167  void setBounds( const float bounds[4] );
168 
170  void getBounds( float bounds[4] ) const;
171 
173  void setStyle( int style );
174 
176  int style() const;
177 
179  void setColor( float r, float g, float b, float a );
180 
182  void getColor( float& r, float& g, float& b, float& a ) const;
183 
185  void setStippleParameters( unsigned int fill,
186  unsigned int fullStipplePattern[32] = 0 );
187 
189  void setTextureParameters( void* textureHangle,
190  float left = 0.0f, float right = 1.0f,
191  float bottom = 0.0f, float top = 1.0f );
192 
194  void* textureHandle() const;
195 
197  unsigned int index() const;
198 
200  void setIndex( unsigned int index );
201 
205  void setLodOutAltitude(double lodOutAltitude);
206 
208  double lodOutAltitude() const;
209 
212  void setIsLodOutAltitudeEnabled(bool isLodOutAltitudeEnabled);
213 
215  bool isLodOutAltitudeEnabled() const;
216 
217  protected:
218 
220  DtQuadProxy( DtQuadRenderer& renderer, unsigned char effect );
221 
225  static void getBoundsFromPoints(float bounds[4], const float points[8]);
226 
228  bool hasAltitudeSpecificPoints() const;
229 
231  void updatePointsBasedOnAltitude(double cameraAltitude);
232 
238  bool updateLodVisibility(DtPrimitiveStyle* style, double cameraAltitude);
239 
240  protected:
241 
243  unsigned int myIndex;
244  unsigned char myStyle;
245 
248  {
249  public:
251 
252  DtAltitudeSpecificConfiguration(double altitude, const float points[8])
253  : myAltitude(altitude)
254  {
255  memcpy(myPoints, points, sizeof(float) * 8);
256  }
257 
258  double myAltitude;
259  float myPoints[8];
260  };
261 
262  typedef std::vector<DtAltitudeSpecificConfiguration> DtMinimumAltitudeToPointsVector;
263 
265 
268 
271  };
272 
273 }
const char * creatorTypeName< DtQuadRenderer >(void)
template specialization for the creator (pass the class being created to the creatorTypeName template...
Definition: DtQuadRenderer.h:36
friend DtQuadRendererCreator
Definition: DtQuadRenderer.h:53
QuadProxyList myQuads
Definition: DtQuadRenderer.h:97
DtVirtualBaseClassCreator< DtQuadRenderer, DtOverlayResourceProvider & > DtQuadRendererCreator
creator
Definition: DtQuadRenderer.h:29
double myAltitudeToUseForForcedPoints
Definition: DtQuadRenderer.h:267
double myLodOutAltitude
Definition: DtQuadRenderer.h:269
The abstract base class for the various primitive styles.
Definition: DtPrimitiveStyle.h:21
double myAltitude
Definition: DtQuadRenderer.h:258
Stippled line effect.
Definition: DtQuadRenderer.h:48
DtAltitudeSpecificConfiguration(double altitude, const float points[8])
Definition: DtQuadRenderer.h:252
A class which allocates and draws quads.
Definition: DtQuadRenderer.h:40
Styles
Definition: DtQuadRenderer.h:44
Variadic templated creator class for defining a DtVirtualBaseClass creator that is automatically regi...
Definition: DtVirtualBaseClassCreator.h:22
The overlay resource provider class provies resources for overlay drawing classes.
Definition: DtOverlayResourceProvider.h:23
#define DT_DLL_VRVGRAPHICS
Contains DLL export macros.
Definition: vrvGraphics.h:19
DT_DLL_vrfutil double angle(double vec1[3], double vec2[3])
Abstract primitive rendering base class.
Definition: DtPrimitiveRenderer.h:19
tbb::mutex myUpdateMutex
Definition: DtQuadRenderer.h:99
A class containing altitude-specific properties for the quad proxy.
Definition: DtQuadRenderer.h:247
A flyweight class for controlling a single quad owned by the DtQuadRenderer. None of this class&#39;s mem...
Definition: DtQuadRenderer.h:111
Single textured effect.
Definition: DtQuadRenderer.h:49
bool myIsForcedPointsByMinimumAltitudeEnabled
Definition: DtQuadRenderer.h:266
DtQuadRenderer * myParent
Definition: DtQuadRenderer.h:242
const char int mode
Definition: ioapi.h:38
unsigned int myIndex
Definition: DtQuadRenderer.h:243
unsigned char myStyle
Definition: DtQuadRenderer.h:244
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
bool myIsLodOutAltitudeEnabled
Definition: DtQuadRenderer.h:270
std::vector< DtQuadProxy * > QuadProxyList
Definition: DtQuadRenderer.h:93
DtMinimumAltitudeToPointsVector myAltitudeToPointsMap
Definition: DtQuadRenderer.h:264
std::vector< DtAltitudeSpecificConfiguration > DtMinimumAltitudeToPointsVector
Definition: DtQuadRenderer.h:262
The style contains no line effects.
Definition: DtQuadRenderer.h:47

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)