VR-Forces 4.10 Class Documentation
 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) 2020 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
13 
14 #include <vector>
15 
16 #include <tbb/mutex.h>
17 
18 namespace makVrv
19 {
20 
21  class DtQuadProxy;
22  class DtPrimitiveStyle;
23  class DtOverlayResourceProvider;
24 
28  {
29  public:
30 
31  enum Styles
32  {
33  Style_Flat = 0,
37  Styles_End
38  };
39 
40  friend class DtQuadProxy;
41 
44 
46  virtual ~DtQuadRenderer();
47 
49  virtual int numberOfPrimitives() const;
50 
52  virtual void render( bool geocentric, float geocentricAlpha,
53  const double location[3]
54  , const double positionMatrix[16]
55  , const double projectionMatrix[16]);
56 
58  virtual void releaseResources();
59 
61  virtual bool isRenderModeSupported( int mode );
62 
64  DtQuadProxy* allocateProxy(Styles = Style_Flat);
65 
66  protected:
67 
69  void add( DtQuadProxy* toAdd );
70 
72  void remove( const DtQuadProxy* const proxy, bool isBeingDeleted = false );
73 
75  void dirty( DtQuadProxy* proxy );
76 
78  void updateRenderData();
79 
80  protected:
81 
82  typedef std::vector<DtQuadProxy*> QuadProxyList;
83 
84  DtPrimitiveStyle* myStyles[Styles_End];
87 
88  tbb::mutex myUpdateMutex;
89 
90 
91  };
92 
93 
98  {
99  public:
100 
101  friend class DtQuadRenderer;
102 
103  ~DtQuadProxy();
104 
106  void setGroup( float order );
107 
109  float group() const;
110 
112  void set3DPosition( int index, float x, float y, float z, float w);
113 
115  void set3DPosition( float x, float y, float z, float w = 0 );
116 
118  void get3DPosition( float& x, float& y, float& z, float& w ) const;
119 
121  void set2DRotation( float angle );
122 
124  void get2DRotation( float& angle ) const;
125 
127  void setPoints( const float points[8] );
128 
130  void getPoints( float points[8] ) const;
131 
133  void setBounds( const float bounds[4] );
134 
136  void getBounds( float bounds[4] ) const;
137 
139  void setStyle( int style );
140 
142  int style() const;
143 
145  void setColor( float r, float g, float b, float a );
146 
148  void getColor( float& r, float& g, float& b, float& a ) const;
149 
151  void setStippleParameters( unsigned int fill,
152  unsigned int fullStipplePattern[32] = 0 );
153 
155  void setTextureParameters( void* textureHangle,
156  float left = 0.0f, float right = 1.0f,
157  float bottom = 0.0f, float top = 1.0f );
158 
160  void* textureHandle() const;
161 
163  unsigned int index() const;
164 
166  void setIndex( unsigned int index );
167 
168  protected:
169 
171  DtQuadProxy( DtQuadRenderer& renderer, unsigned char effect );
172 
176  static void getBoundsFromPoints(float bounds[4], const float points[8]);
177 
178  protected:
179 
181  unsigned int myIndex;
182  unsigned char myStyle;
184 
185  };
186 
187 }
QuadProxyList myQuads
Definition: DtQuadRenderer.h:85
The abstract base class for the various primitive styles.
Definition: DtPrimitiveStyle.h:21
Stippled line effect.
Definition: DtQuadRenderer.h:35
A class which allocates and draws quads.
Definition: DtQuadRenderer.h:27
QuadProxyList myDirtyList
Definition: DtQuadRenderer.h:86
Styles
Definition: DtQuadRenderer.h:31
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:18
tbb::mutex myUpdateMutex
Definition: DtQuadRenderer.h:88
A flyweight class for controlling a single quad owned by the DtQuadRenderer.
Definition: DtQuadRenderer.h:97
Single textured effect.
Definition: DtQuadRenderer.h:36
DtQuadRenderer * myParent
Definition: DtQuadRenderer.h:180
const char int mode
Definition: ioapi.h:38
unsigned int myIndex
Definition: DtQuadRenderer.h:181
unsigned char myStyle
Definition: DtQuadRenderer.h:182
bool myDirtyBit
Definition: DtQuadRenderer.h:183
std::vector< DtQuadProxy * > QuadProxyList
Definition: DtQuadRenderer.h:82
The style contains no line effects.
Definition: DtQuadRenderer.h:34

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)