VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtTriangleRenderer.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 
15 
16 #include <vector>
17 
18 #include <tbb/mutex.h>
19 
20 namespace makVrv
21 {
22 
23  class DtBufferObject;
24  class DtTriangleProxy;
25  class DtPrimitiveStyle;
26 
30  {
31  public:
32 
33  enum Styles
34  {
35  Style_Flat = 0,
37  //Style_Textured,
38  Styles_End
39  };
40 
41  friend class DtTriangleProxy;
42 
44  DtTriangleRenderer( DtOverlayResourceProvider& resourceProvider );
45 
47  virtual ~DtTriangleRenderer();
48 
50  virtual int numberOfPrimitives() const;
51 
53  virtual void render( bool geocentric, float geocentricAlpha
54  , const double location[3]
55  , const double positionMatrix[16]
56  , const double projectionMatrix[16]);
57 
59  virtual void releaseResources();
60 
62  virtual bool isRenderModeSupported( int mode );
63 
65  DtTriangleProxy* allocateProxy(Styles = Style_Flat);
66 
67  protected:
68 
70  void add( DtTriangleProxy* toAdd );
71 
73  void remove( const DtTriangleProxy* const proxy,
74  bool isBeingDeleted = false );
75 
77  void dirty( DtTriangleProxy* proxy );
78 
80  void updateRenderData();
81 
82  protected:
83 
84  typedef std::vector<DtTriangleProxy*> TriangleProxyList;
85 
86  DtPrimitiveStyle* myStyles[Styles_End];
89 
90  tbb::mutex myUpdateMutex;
91 
92  };
93 
94 
99  {
100  public:
101 
102  friend class DtTriangleRenderer;
103 
105  ~DtTriangleProxy();
106 
108  void setGroup( float order );
109 
111  float group() const;
112 
114  void set3DPositions(
115  float x1, float y1, float z1, float w1,
116  float x2, float y2, float z2, float w2,
117  float x3, float y3, float z3, float w3 );
118 
122  void set3DPosition( float x, float y, float z, float w );
123 
125  void set3DPosition( unsigned int index, float x, float y, float z,
126  float w );
127 
129  void get3DPosition( unsigned int index, float& x, float& y, float& z,
130  float& w );
131 
133  void set2DPositions( float x1, float y1, float x2, float y2, float x3, float y3 );
134 
136  void set2DPosition( unsigned int index, float x, float y );
137 
139  void get2DPosition( unsigned int index, float& x, float& y ) const;
140 
142  void setStyle( int style );
143 
145  int style() const;
146 
148  void setColor( unsigned int vertIndex, float r, float g, float b,
149  float a );
150 
152  void setColor( float r, float g, float b, float a );
153 
155  void getColor( float& r, float& g, float& b, float& a ) const;
156 
158  void setFillParameters( unsigned int fill,
159  unsigned int fullStipplePattern[32] = 0 );
160 
162  void setIndex( unsigned int index );
163 
165  unsigned int index() const;
166 
167  protected:
168 
170  DtTriangleProxy( DtTriangleRenderer& renderer, unsigned int style );
171 
172  protected:
173 
175  unsigned int myIndex;
176  unsigned char myStyle;
178 
179  };
180 
181 }
DtTriangleRenderer * myParent
Definition: DtTriangleRenderer.h:174
Styles
Definition: DtTriangleRenderer.h:33
The abstract base class for the various primitive styles.
Definition: DtPrimitiveStyle.h:21
Triangle without patterns.
Definition: DtTriangleRenderer.h:36
bool myDirtyBit
Definition: DtTriangleRenderer.h:177
The triangle renderer.
Definition: DtTriangleRenderer.h:29
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
A flyweight class for controlling a triangle owned by the triangle renderer.
Definition: DtTriangleRenderer.h:98
Abstract primitive rendering base class.
Definition: DtPrimitiveRenderer.h:18
TriangleProxyList myDirtyList
Definition: DtTriangleRenderer.h:88
TriangleProxyList myTriangles
Definition: DtTriangleRenderer.h:87
unsigned int myIndex
Definition: DtTriangleRenderer.h:175
const char int mode
Definition: ioapi.h:38
tbb::mutex myUpdateMutex
Definition: DtTriangleRenderer.h:90
unsigned char myStyle
Definition: DtTriangleRenderer.h:176
std::vector< DtTriangleProxy * > TriangleProxyList
Definition: DtTriangleRenderer.h:84

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)