VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtFlatPrimitiveStyle.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 
14 
15 #include <vector>
16 
17 namespace makVrv
18 {
19 
20  class DtOverlayResourceProvider;
21 
25  {
26  public:
27 
30  unsigned int vertexCountPerPrimitve );
31 
33  virtual ~DtFlatPrimitiveStyle();
34 
36  virtual void add( unsigned int* index );
37 
39  virtual void remove( unsigned int index );
40 
42  virtual void render( int mode, unsigned int groupCount, bool geocentric,
43  float geocentricAlpha, const double cameraLocation[3],
44  const double positionMatrix[16],
45  const double projectionMatrix[16],
46  int offset);
47 
49  virtual void update( int renderMode );
50 
53 
55  virtual void set3DVertexPosition( unsigned int index, unsigned int vertex,
56  float x, float y, float z, float w = 0 );
57 
59  virtual void set3DVertexQuadPositions(unsigned int index,
60  float x, float y, float z, float w);
61 
63  virtual void get3DVertexPosition( unsigned int index, unsigned int vertex,
64  float& x, float& y, float& z, float& w ) const;
65 
67  virtual void set2DVertexPosition( unsigned int index, unsigned int vertex,
68  float x, float y );
69 
71  virtual void get2DVertexPosition( unsigned int index, unsigned int vertex,
72  float& x, float& y ) const;
73 
75  virtual void set2DOffsetRotation( unsigned int index,
76  unsigned int vertIndex, float angle );
77 
79  virtual void get2DOffsetRotation( unsigned int index,
80  unsigned int vertIndex, float& angle ) const;
81 
83  virtual void setColor( unsigned int index, unsigned int vertIndex,
84  float r, float g, float b, float a );
85 
87  virtual void getColor( unsigned int index, unsigned int vertIndex,
88  float& r, float& g, float& b, float& a ) const;
89 
91  virtual void setUVCoordinates( unsigned int index,
92  unsigned int vertIndex, float u, float v );
93 
95  virtual void getUVCoordinates( unsigned int index,
96  unsigned int vertIndex, float& u, float& v ) const;
97 
99 
100 
103 
106  virtual void setFillParameters( unsigned int index, void* fill,
107  unsigned int fullStipplePattern[32] = 0 );
108 
111  virtual void getFillParameters( unsigned int index, void*& fill,
112  unsigned int fullStipplePattern[32] = 0 ) const;
113 
116  virtual void setGroup( unsigned int index, float zFactor );
117 
120  virtual float group( unsigned int index ) const;
121 
124  virtual void setVisible( unsigned int index, bool visible );
125 
128  virtual bool visible (unsigned int index) const;
129 
131 
132  protected:
133 
135  virtual float* vertexData() const;
136 
138  virtual unsigned int vertexDataSize() const;
139 
140  protected:
142  {
143  unsigned int group;
144  unsigned int* indexPtr;
145  bool visible;
146  };
147 
151  {
152  bool operator()( const FlatPrimitiveInfo& left, const FlatPrimitiveInfo& right )
153  {
154  return (left.group < right.group);
155  }
156  };
157 
159 
160  typedef std::vector<FlatPrimitiveInfo> FlatPrimitiveInfoList;
161  typedef std::vector<unsigned int> FlatIndexList;
162  typedef std::vector<DtOffsetColoredVertex> QuadVertexList;
163 
167 
171 
172  };
173 
174 }
bool mySortDirty
Definition: DtFlatPrimitiveStyle.h:158
Definition: DtFlatPrimitiveStyle.h:141
DtOverlayResourceProvider & myResourceProvider
Definition: DtFlatPrimitiveStyle.h:168
bool operator()(const FlatPrimitiveInfo &left, const FlatPrimitiveInfo &right)
Definition: DtFlatPrimitiveStyle.h:152
unsigned int group
Definition: DtFlatPrimitiveStyle.h:143
The abstract base class for the various primitive styles.
Definition: DtPrimitiveStyle.h:21
FlatIndexList myFlatIndices
Definition: DtFlatPrimitiveStyle.h:166
Sorts flat primitives by their group, used to make sure the indices are in the correct order...
Definition: DtFlatPrimitiveStyle.h:150
DtProjected2DFlatEffect * myEffect
Definition: DtFlatPrimitiveStyle.h:170
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])
std::vector< FlatPrimitiveInfo > FlatPrimitiveInfoList
Definition: DtFlatPrimitiveStyle.h:160
std::vector< unsigned int > FlatIndexList
Definition: DtFlatPrimitiveStyle.h:161
Contains the makVrv::DtFlat2DRenderer class declaration.
A style for rendering a 2D quad with only a flat color.
Definition: DtFlatPrimitiveStyle.h:24
FlatPrimitiveInfoList myFlatPrimitives
Definition: DtFlatPrimitiveStyle.h:164
std::vector< DtOffsetColoredVertex > QuadVertexList
Definition: DtFlatPrimitiveStyle.h:162
bool visible
Definition: DtFlatPrimitiveStyle.h:145
const char int mode
Definition: ioapi.h:38
QuadVertexList myVertices
Definition: DtFlatPrimitiveStyle.h:169
An effect for rendering 2D flat colored quads.
Definition: DtProjected2DFlatEffect.h:19
voidpf uLong offset
Definition: ioapi.h:42
FlatPrimitiveInfoList mySortedFlatPrimitives
Definition: DtFlatPrimitiveStyle.h:165
Contains the makVrv::DtPrimitiveStyle class declaration.
unsigned int * indexPtr
Definition: DtFlatPrimitiveStyle.h:144

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)