VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtStippledPrimitiveStyle.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2023 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
14 
15 #include <matrix/vlVector.h>
16 
17 #include <vector>
18 #include <map>
19 
20 namespace makVrv
21 {
22 
23  class DtOverlayResourceProvider;
24  struct DtObserverRenderData;
25 
29  {
30  public:
31 
34  unsigned int vertexCount );
35 
37  virtual ~DtStippledPrimitiveStyle();
38 
40  virtual void add( unsigned int* );
41 
43  virtual void remove( unsigned int index );
44 
47  virtual void render(int mode, unsigned int groupCount, bool geocentric,
48  float geocentricAlpha, const double cameraLocation[3],
49  const DtObserverRenderData& observerRenderData,
50  const double positionMatrix[16], const double projectionMatrix[16],
51  const int viewport[4], int offset) override;
52 
54  virtual void update( int renderMode );
55 
56 
59 
61  virtual void set3DVertexPosition( unsigned int index, unsigned int vertex,
62  float x, float y, float z, float w = 0 );
63 
65  virtual void set3DVertexQuadPositions(unsigned int index,
66  float x, float y, float z, float w);
67 
69  virtual void get3DVertexPosition( unsigned int index, unsigned int vertex,
70  float& x, float& y, float& z, float& w ) const;
71 
73  virtual void set2DVertexPosition( unsigned int index, unsigned int vertex,
74  float x, float y );
75 
77  virtual void get2DVertexPosition( unsigned int index, unsigned int vertex,
78  float& x, float& y ) const;
79 
81  virtual void set2DOffsetRotation( unsigned int index,
82  unsigned int vertIndex, float angle );
83 
85  virtual void get2DOffsetRotation( unsigned int index,
86  unsigned int vertIndex, float& angle ) const;
87 
89  virtual void setColor( unsigned int index, unsigned int vertIndex,
90  float r, float g, float b, float a );
91 
93  virtual void getColor( unsigned int index, unsigned int vertIndex,
94  float& r, float& g, float& b, float& a ) const;
95 
97  virtual void setUVCoordinates( unsigned int index,
98  unsigned int vertIndex, float u, float v );
99 
101  virtual void getUVCoordinates( unsigned int index,
102  unsigned int vertIndex, float& u, float& v ) const;
103 
110  virtual void projectUVCoordinates(unsigned int index, const DtVector& origin,
111  const DtVector& axisU, const DtVector& axisV, float scale) override;
112 
114 
115 
118 
121  virtual void setFillParameters( unsigned int index, unsigned int fullStipplePattern[32] = 0 ) override;
122 
125  virtual void getFillParameters( unsigned int index, unsigned int fullStipplePattern[32] = 0 ) const ;
126 
134  virtual void setFillPatternFrequency(unsigned int index, float frequency) override;
135 
138  virtual void setTextureHandle( unsigned int index, DtTextureInterface* newTextureHandle );
139 
142  virtual DtTextureInterface* findTextureHandle( unsigned int index ) const;
143 
146  virtual void setGroup( unsigned int index, float zFactor );
147 
150  virtual float group( unsigned int index ) const;
151 
154  virtual void setVisible( unsigned int index, bool visible );
155 
158  virtual bool visible (unsigned int index) const;
159 
161 
162  protected:
163 
165  virtual float* vertexData() const;
166 
168  virtual unsigned int vertexDataSize() const;
169 
170  protected:
171 
173  {
174  unsigned int group;
175  unsigned int* indexPtr;
176  unsigned int quadStipple[32];
177  bool visible;
178  };
179 
183  {
184  bool operator()( const StippledPrimitiveInfo& left, const StippledPrimitiveInfo& right )
185  {
186  return (left.group < right.group);
187  }
188  };
189 
191 
193  {
194  unsigned int key[32];
195  bool operator<(const StipplePattern& b) const;
196  };
197 
198  typedef std::vector<DtOffsetColoredVertex> VertexList;
199  typedef std::vector<StippledPrimitiveInfo> StippledPrimitiveInfoList;
200  typedef std::map< StipplePattern, std::vector<unsigned int> > StippleIndexMap;
201 
207 
209 
210  };
211 
212 }
unsigned int * indexPtr
Definition: DtStippledPrimitiveStyle.h:175
bool mySortDirty
Definition: DtStippledPrimitiveStyle.h:190
std::vector< StippledPrimitiveInfo > StippledPrimitiveInfoList
Definition: DtStippledPrimitiveStyle.h:199
The abstract base class for the various primitive styles.
Definition: DtPrimitiveStyle.h:25
voidpf uLong int origin
Definition: ioapi.h:42
StippleIndexMap myStippleIndexMap
Definition: DtStippledPrimitiveStyle.h:206
Interface for a texture. Used to pass in a texture to vrvGraphics.
Definition: DtTextureInterface.h:24
DtProjected2DFlatEffect * myEffect
Definition: DtStippledPrimitiveStyle.h:208
Definition: DtStippledPrimitiveStyle.h:172
bool visible
Definition: DtStippledPrimitiveStyle.h:177
DtOverlayResourceProvider & myResourceProvider
Definition: DtStippledPrimitiveStyle.h:202
The overlay resource provider class provides resources for overlay drawing classes.
Definition: DtOverlayResourceProvider.h:28
#define DT_DLL_VRVGRAPHICS
Contains DLL export macros.
Definition: vrvGraphics.h:19
StippledPrimitiveInfoList mySortedStipplePrimitives
Definition: DtStippledPrimitiveStyle.h:205
unsigned int group
Definition: DtStippledPrimitiveStyle.h:174
DT_DLL_vrfutil double angle(double vec1[3], double vec2[3])
Contains the makVrv::DtFlat2DRenderer class declaration.
Definition: DtStippledPrimitiveStyle.h:192
const char int mode
Definition: ioapi.h:38
std::map< StipplePattern, std::vector< unsigned int > > StippleIndexMap
Definition: DtStippledPrimitiveStyle.h:200
StippledPrimitiveInfoList myStipplePrimitives
Definition: DtStippledPrimitiveStyle.h:204
An effect for rendering 2D flat colored quads.
Definition: DtProjected2DFlatEffect.h:19
voidpf uLong offset
Definition: ioapi.h:42
Definition: DtCommonRenderData.h:32
VertexList myStippleVertices
Definition: DtStippledPrimitiveStyle.h:203
bool operator()(const StippledPrimitiveInfo &left, const StippledPrimitiveInfo &right)
Definition: DtStippledPrimitiveStyle.h:184
A style for drawing quads with a stipple pattern.
Definition: DtStippledPrimitiveStyle.h:28
Contains the makVrv::DtPrimitiveStyle class declaration.
Sorts primitives by their group, used to make sure the indices are in the correct order...
Definition: DtStippledPrimitiveStyle.h:182
std::vector< DtOffsetColoredVertex > VertexList
Definition: DtStippledPrimitiveStyle.h:198

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)