VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtTriangleRenderer.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2011 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
13 
15 
16 #include <vector>
17 
18 namespace makVrv
19 {
20 
21  class DtBufferObject;
22  class DtTriangleProxy;
23  class DtPrimitiveStyle;
24 
28  {
29  public:
30 
31  enum Styles
32  {
33  Style_Flat = 0,
35  //Style_Textured,
36  Styles_End
37  };
38 
39  friend class DtTriangleProxy;
40 
42  DtTriangleRenderer( DtOverlayResourceProvider& resourceProvider );
43 
45  virtual ~DtTriangleRenderer();
46 
48  virtual int numberOfPrimitives() const;
49 
51  virtual void render( bool geocentric, float geocentricAlpha,
52  const double location[3], const double positionMatrix[16] );
53 
55  virtual void releaseResources();
56 
58  virtual bool isRenderModeSupported( int mode );
59 
61  DtTriangleProxy* allocateProxy(Styles = Style_Flat);
62 
63  protected:
64 
66  void add( DtTriangleProxy* toAdd );
67 
69  void remove( const DtTriangleProxy* const proxy,
70  bool isBeingDeleted = false );
71 
73  void dirty( DtTriangleProxy* proxy );
74 
76  void updateRenderData();
77 
78  protected:
79 
80  typedef std::vector<DtTriangleProxy*> TriangleProxyList;
81 
82  DtPrimitiveStyle* myStyles[Styles_End];
85 
86  };
87 
88 
93  {
94  public:
95 
96  friend class DtTriangleRenderer;
97 
99  ~DtTriangleProxy();
100 
102  void setGroup( float order );
103 
105  float group() const;
106 
108  void set3DPositions(
109  float x1, float y1, float z1, float w1,
110  float x2, float y2, float z2, float w2,
111  float x3, float y3, float z3, float w3 );
112 
116  void set3DPosition( float x, float y, float z, float w );
117 
119  void set3DPosition( unsigned int index, float x, float y, float z,
120  float w );
121 
123  void get3DPosition( unsigned int index, float& x, float& y, float& z,
124  float& w );
125 
127  void set2DPositions( float x1, float y1, float x2, float y2, float x3, float y3 );
128 
130  void set2DPosition( unsigned int index, float x, float y );
131 
133  void get2DPosition( unsigned int index, float& x, float& y ) const;
134 
136  void setStyle( int style );
137 
139  int style() const;
140 
142  void setColor( unsigned int vertIndex, float r, float g, float b,
143  float a );
144 
146  void setColor( float r, float g, float b, float a );
147 
149  void getColor( float& r, float& g, float& b, float& a ) const;
150 
152  void setFillParameters( unsigned int fill,
153  unsigned int fullStipplePattern[32] = 0 );
154 
156  void setIndex( unsigned int index );
157 
159  unsigned int index() const;
160 
161  protected:
162 
164  DtTriangleProxy( DtTriangleRenderer& renderer, unsigned int style );
165 
166  protected:
167 
169  unsigned int myIndex;
170  unsigned char myStyle;
172 
173  };
174 
175 }

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)