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) 2023 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 
173  protected:
174 
176  virtual void updateDecalProjectorWithTriangles();
177 
180  virtual void slot_pickerDestroyed();
181 
183  virtual void connectToPicker();
184 
187  void disconnectFromPicker();
188 
189  protected:
190 
192  struct Point
193  {
194  float x = 0;
195  float y = 0;
196  float z = 0;
197  float w = 0;
198  float offsetX = 0;
199  float offsetY = 0;
200  };
201 
204  struct Triangle
205  {
206  Point myPoints[3];
207 
208  void set3DPosition(unsigned int index, float x, float y, float z, float w);
209 
210  void get3DPosition(unsigned int index, float& x, float& y,
211  float& z, float& w) const;
212 
213  void get2DPosition(unsigned int index, float& x, float& y) const;
214 
215  void set2DPosition(unsigned int index, float x, float y);
216 
217  void set2DPositions(float x1, float y1, float x2, float y2, float x3, float y3);
218  };
219 
220  typedef std::vector<float> VertexList;
221 
223 
225  bool myLineTopology; // true if geometry topology is lines instead of triangles
226 
231  unsigned long long myUserData;
233 
236  float myCenterPoint[2];
237  double my3DCenterPoint[3];
238  unsigned int myFillParam;
239  unsigned int myFullStipplePattern[32];
242  int myGroup;
243  std::vector<Triangle> myTriangles;
244 
246  };
247 
250  {
251  public:
253  virtual DtDecalProjectorPolygonInterface* create(DtDe& de, DtChannel* channel, DtModelSetId modelSet, bool isOutline, bool isSimpleLine) override;
254  };
255 }
256 
unsigned long long myUserData
Definition: DtDecalProjectorPolygon.h:231
bool myPickerConnected
Definition: DtDecalProjectorPolygon.h:230
This structure is used to hold staging triangle point information.
Definition: DtDecalProjectorPolygon.h:192
int myGroup
Definition: DtDecalProjectorPolygon.h:242
bool myPickerDestroyed
Definition: DtDecalProjectorPolygon.h:229
voidpf uLong int origin
Definition: ioapi.h:42
Creator.
Definition: DtDecalProjectorPolygonInterface.h:41
unsigned int myFillParam
Definition: DtDecalProjectorPolygon.h:238
DtWidgetPicker * myPicker
Definition: DtDecalProjectorPolygon.h:227
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:204
std::vector< float > VertexList
Definition: DtDecalProjectorPolygon.h:220
bool myEventsEnabled
Definition: DtDecalProjectorPolygon.h:228
The DtPickableDecalProjector is a pickable widget used to pick a decal projector interface.
Definition: DtPickableWidget.h:362
creator for DtDecalProjectorPolygon
Definition: DtDecalProjectorPolygon.h:249
FillType myFillType
Definition: DtDecalProjectorPolygon.h:240
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:245
#define DT_DLL_VRVGRAPHICS
Contains DLL export macros.
Definition: vrvGraphics.h:19
FillType
Definition: DtFilledPolygonInterface.h:30
VertexList my3DVertices
Definition: DtDecalProjectorPolygon.h:235
A convex polygon drawn using lines.
Definition: DtDecalProjectorPolygonInterface.h:25
VertexList myVertices
Definition: DtDecalProjectorPolygon.h:234
std::vector< Triangle > myTriangles
Definition: DtDecalProjectorPolygon.h:243
float myOutlineWidth
Definition: DtDecalProjectorPolygon.h:241
bool myLineTopology
Definition: DtDecalProjectorPolygon.h:225
bool myIsOutline
Definition: DtDecalProjectorPolygon.h:224
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:72
A variable vertex convex filled 2D polygon.
Definition: DtDecalProjectorPolygon.h:28
DtPickableDecalProjector * myPickableDecalProjector
Definition: DtDecalProjectorPolygon.h:232
DtModelSetId
Definition: DtModelSetEnums.h:19
DtOverlayRendererInterface * myRenderer
Definition: DtDecalProjectorPolygon.h:222
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 Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)