VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtDecalProjectorPolygon.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright (c) 2025 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
13 
15 
16 namespace makVrv
17 {
18  class DtChannel;
19  class DtDecalProjectorPolygonCreator;
20  class DtDecalProjectorComponentInterface;
21  class DtOverlayRendererInterface;
22  class DtPickableDecalProjector;
23  class DtWidgetPicker;
24  class DtTextureInterface;
25 
29  {
30  public:
31 
33 
36  DtWidgetPicker& picker, bool isOutline, bool lineTopology);
37 
39  DtDecalProjectorPolygon(DtDe& de, DtChannel* channel, DtModelSetId modelSet,
40  bool isOutline, bool lineTopology);
41 
43  virtual ~DtDecalProjectorPolygon();
44 
48  virtual void setFillType(FillType type);
49 
51  virtual FillType fillType() const;
52 
56  virtual void setFillParameter(unsigned int param, unsigned int fullStipplePattern[32] = 0) override;
57 
59  virtual void clearFillPattern();
60 
62  virtual void getFillParameter(unsigned int& paramOut, unsigned int fullStipplePatternOut[32]) const override;
63 
69  virtual void setFillPatternFrequency(float frequency) override;
70 
73  virtual void setFillTexture(DtTextureInterface* textureHandle) override;
74 
79  virtual void setEventsEnabled(bool enabled, unsigned long long = 0);
80 
82  bool eventsEnabled() const;
83 
86  virtual void setVertexCount(unsigned int vertexCount);
87 
89  virtual unsigned int vertexCount() const;
90 
92  virtual void set2DPositions(const std::vector<float>& vertices);
93 
96  virtual void set2DPosition(unsigned int vertexIndex, float x, float y);
97 
99  virtual void set2DCentroidPosition(float x, float y);
100 
102  virtual void get2DPosition(unsigned int vertexIndex, float& x, float& y) const;
103 
105  virtual void set3DPosition(unsigned int vertexIndex, float x, float y, float z, float w);
106 
108  virtual void set3DCentroidPosition(float x, float y, float z, float w);
109 
111  virtual void get3DPosition(unsigned int index, float& x, float& y, float& z, float& w) const;
112 
113  void set3DDirectionAndLength(unsigned int index, float x, float y, float z, float l);
114 
121  virtual void projectUVCoordinates(const DtVector& origin,
122  const DtVector& axisU, const DtVector& axisV, float scale = 1.0f) override;
123 
125  virtual void setStipple(unsigned int stipplePattern);
126 
128  virtual void setOutlineWidth(float width);
129 
131  virtual void setVertexColor(unsigned int index, float r, float g, float b, float a);
132 
134  virtual void getVertexColor(unsigned int index, float& r, float& g, float& b, float& a);
135 
137  virtual void setCentroidColor(float r, float g, float b, float a);
138 
140  virtual void setColor(float r, float g, float b, float a);
141 
143  virtual void getColor(float& r, float& g, float& b, float& a) const;
144 
146  virtual int group() const;
147 
149  virtual void setGroup(int);
150 
153  virtual void triangulate() override;
154 
158  virtual void triangulationComplete(bool crossingLines) override;
159 
166  virtual void set2DPositionsTriangles(const std::vector<float>& vertices);
167 
171  virtual void setVertexCountTriangles(unsigned int vertexCount);
172 
176  virtual void setIsNormalisedScreenCoordinates( bool isNormalisedScreenCoords ) override;
177  protected:
178 
180  virtual void updateDecalProjectorWithTriangles();
181 
184  virtual void slot_pickerDestroyed();
185 
187  virtual void connectToPicker();
188 
191  void disconnectFromPicker();
192 
193  protected:
194 
196  struct Point
197  {
198  float x = 0;
199  float y = 0;
200  float z = 0;
201  float w = 0;
202  float offsetX = 0;
203  float offsetY = 0;
204  };
205 
208  struct Triangle
209  {
210  Point myPoints[3];
211 
212  void set3DPosition(unsigned int index, float x, float y, float z, float w);
213 
214  void get3DPosition(unsigned int index, float& x, float& y,
215  float& z, float& w) const;
216 
217  void get2DPosition(unsigned int index, float& x, float& y) const;
218 
219  void set2DPosition(unsigned int index, float x, float y);
220 
221  void set2DPositions(float x1, float y1, float x2, float y2, float x3, float y3);
222  };
223 
224  typedef std::vector<float> VertexList;
225 
227 
229  bool myLineTopology; // true if geometry topology is lines instead of triangles
230 
235  unsigned long long myUserData;
237 
240  float myCenterPoint[2];
241  double my3DCenterPoint[3];
242  unsigned int myFillParam;
243  unsigned int myFullStipplePattern[32];
246  int myGroup;
247  std::vector<Triangle> myTriangles;
248 
250  };
251 
254  {
255  public:
257  virtual DtDecalProjectorPolygonInterface* create(DtDe& de, DtChannel* channel, DtModelSetId modelSet, bool isOutline, bool isSimpleLine) override;
258  };
259 }
260 
unsigned long long myUserData
Definition: DtDecalProjectorPolygon.h:235
bool myPickerConnected
Definition: DtDecalProjectorPolygon.h:234
This structure is used to hold staging triangle point information.
Definition: DtDecalProjectorPolygon.h:196
int myGroup
Definition: DtDecalProjectorPolygon.h:246
bool myPickerDestroyed
Definition: DtDecalProjectorPolygon.h:233
voidpf uLong int origin
Definition: ioapi.h:42
Creator.
Definition: DtDecalProjectorPolygonInterface.h:41
unsigned int myFillParam
Definition: DtDecalProjectorPolygon.h:242
DtWidgetPicker * myPicker
Definition: DtDecalProjectorPolygon.h:231
Interface for a texture. Used to pass in a texture to vrvGraphics.
Definition: DtTextureInterface.h:24
This structure is used to hold staging triangle information. This mostly mimics the use of DtTriangle...
Definition: DtDecalProjectorPolygon.h:208
std::vector< float > VertexList
Definition: DtDecalProjectorPolygon.h:224
bool myEventsEnabled
Definition: DtDecalProjectorPolygon.h:232
The DtPickableDecalProjector is a pickable widget used to pick a decal projector interface.
Definition: DtPickableWidget.h:362
creator for DtDecalProjectorPolygon
Definition: DtDecalProjectorPolygon.h:253
FillType myFillType
Definition: DtDecalProjectorPolygon.h:244
A class which represents a component for a decal projector.
Definition: DtDecalProjectorComponentInterface.h:43
The abstract Channel Class.
Definition: DtChannel.h:35
DtDecalProjectorComponentInterface * myDecalProjectorComponent
Definition: DtDecalProjectorPolygon.h:249
#define DT_DLL_VRVGRAPHICS
Contains DLL export macros.
Definition: vrvGraphics.h:19
FillType
Definition: DtFilledPolygonInterface.h:30
VertexList my3DVertices
Definition: DtDecalProjectorPolygon.h:239
A convex polygon drawn using lines.
Definition: DtDecalProjectorPolygonInterface.h:25
VertexList myVertices
Definition: DtDecalProjectorPolygon.h:238
std::vector< Triangle > myTriangles
Definition: DtDecalProjectorPolygon.h:247
float myOutlineWidth
Definition: DtDecalProjectorPolygon.h:245
bool myLineTopology
Definition: DtDecalProjectorPolygon.h:229
bool myIsOutline
Definition: DtDecalProjectorPolygon.h:228
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
A variable vertex convex filled 2D polygon.
Definition: DtDecalProjectorPolygon.h:28
DtPickableDecalProjector * myPickableDecalProjector
Definition: DtDecalProjectorPolygon.h:236
DtModelSetId
Definition: DtModelSetEnums.h:19
DtOverlayRendererInterface * myRenderer
Definition: DtDecalProjectorPolygon.h:226
The DtOverlayRendererInterface implements the overlay concept. An overlay is a 2D scene that is drawn...
Definition: DtOverlayRendererInterface.h:80
The picker class which allocates and does picking operations on widgets.
Definition: DtWidgetPicker.h:53

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)