VR-Forces 5.0.3 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtPickableWidget.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2021 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
13 
15 
16 #include <vrvUtil/signalslib.h>
17 
18 namespace makVrv
19 {
20 
21  class DtDe;
22  class DtQuad;
23  class DtBoundingBox;
24  class DtLineSegment;
25  class DtWidgetPicker;
26  class DtTriangleProxy;
27 
30 
33 
35  template <>
36  inline const char* creatorTypeName<DtPickableWidget>(void) { return "DtPickableWidgetCreator"; }
37 
41  {
43 
44  public:
45 
47  virtual ~DtPickableWidget() = 0;
48 
50  DtPickableWidget() = delete;
51 
54  const DtPickableWidget &other) = delete;
55 
57  DtPickableWidget &operator=(
58  const DtPickableWidget &other) = delete;
59 
60  public:
61 
63  static unsigned int idFromColor( unsigned int );
64 
66  virtual void setUserData( unsigned long long data );
67 
69  virtual unsigned long long userData() const;
70 
74  inline unsigned int id() const { return myId; };
75 
77  boost::signalslib::signal<void (int x, int y)> signal_mouseEnter;
78 
81  boost::signalslib::signal<void ()> signal_mouseLeave;
82 
84  boost::signalslib::signal<void (int x, int y)> signal_mouseMove;
85 
87  boost::signalslib::signal<void (int x, int y, int button)> signal_mousePress;
88 
90  boost::signalslib::signal<void (int x, int y, int button)> signal_mouseRelease;
91 
93  boost::signalslib::signal<void (int x, int y, int button)> signal_mouseDoubleClick;
94 
96  boost::signalslib::signal<void (int x, int y, int wheel)> signal_mouseWheel;
97 
98  protected:
99 
101  DtPickableWidget( DtDe& de, DtWidgetPicker& picker );
102 
103  protected:
104 
107  unsigned int myId;
108  unsigned long long myUserData;
109 
110  };
111 
114 
117 
119  template <>
120  inline const char* creatorTypeName<DtPickableQuad>(void) { return "DtPickableQuadCreator"; }
121 
122 
126  {
128 
129  public:
130 
132  virtual ~DtPickableQuad();
133 
135  DtPickableQuad() = delete;
136 
139  const DtPickableQuad &other) = delete;
140 
142  DtPickableQuad &operator=(
143  const DtPickableQuad &other) = delete;
144 
145  public:
146 
151  virtual void setPosition( float x, float y, float z, float w );
152 
154  virtual void setRotation( float angle );
155 
158  virtual void setPoints( const float points[8] );
159 
162  virtual void setPointsByMinimumAltitude( const float points[8], double altitude );
163 
169  virtual void setIsForcedPointsByAltitudeEnabled(bool isEnabled);
170 
173  virtual void setAltitudeForForcedPoints(double altitude);
174 
176  virtual void clearAltitudeSpecificConfigurations();
177 
179  virtual void setGroup( float group );
180 
181  protected:
182 
184  DtPickableQuad( DtDe& de, DtWidgetPicker& picker );
185 
186  protected:
187 
189 
190  };
191 
194 
197 
199  template <>
200  inline const char* creatorTypeName<DtPickableLine>(void) { return "DtPickableLineCreator"; }
201 
206  {
208  public:
209 
211  virtual ~DtPickableLine();
212 
214  DtPickableLine() = delete;
215 
218  const DtPickableLine &other) = delete;
219 
221  DtPickableLine &operator=(
222  const DtPickableLine &other) = delete;
223 
224  public:
225 
230  virtual void set3DPosition( int index0or1, float x, float y, float z, float w );
231 
233  virtual void set2DPosition( int index0or1, float x, float y );
234 
236  virtual void set3DDirection( unsigned int vertexIndex, float x, float y, float z );
237 
239  virtual void setDirection2DLength( unsigned int vertexIndex, float length );
240 
242  virtual void setGroup( float group );
243 
248  virtual void setWidth( float w );
249 
250  protected:
251 
253  DtPickableLine( DtDe& de, DtWidgetPicker& picker );
254 
255  protected:
256 
258 
259  };
260 
263 
266 
268  template <>
269  inline const char* creatorTypeName<DtPickableTriangle>(void) { return "DtPickableTriangleCreator"; }
270 
275  {
277 
278  public:
279 
281  virtual ~DtPickableTriangle();
282 
284  DtPickableTriangle() = delete;
285 
288  const DtPickableTriangle &other) = delete;
289 
291  DtPickableTriangle &operator=(
292  const DtPickableTriangle &other) = delete;
293 
294  public:
295 
297  void set3DPosition( float x, float y, float z, float w );
298 
300  void set3DPosition( unsigned int index, float x, float y, float z, float w );
301 
304  void set2DPosition( unsigned int index, float x, float y );
305 
307  void setGroup( float order );
308 
309  protected:
310 
312  DtPickableTriangle( DtDe& de, DtWidgetPicker& picker );
313 
314  protected:
315 
317 
318  };
319 
320 }
unsigned long long myUserData
Definition: DtPickableWidget.h:108
const char * creatorTypeName< DtPickableTriangle >(void)
template specialization for the creator (pass the class being created to the creatorTypeName template...
Definition: DtPickableWidget.h:269
friend DtPickableQuadCreator
Definition: DtPickableWidget.h:127
The DtPickableQuad is a pickable widget that matches the Quad interface.
Definition: DtPickableWidget.h:125
boost::signalslib::signal< void()> signal_mouseLeave
Emitted whenever a mouse leaves over a widget, called before it enters another widget.
Definition: DtPickableWidget.h:81
unsigned int myId
Definition: DtPickableWidget.h:107
The DtPickableLine is a pickable widget that matches the TriangleProxy interface. ...
Definition: DtPickableWidget.h:274
const char * creatorTypeName< DtPickableQuad >(void)
template specialization for the creator (pass the class being created to the creatorTypeName template...
Definition: DtPickableWidget.h:120
A non-visible interactive widget.
Definition: DtPickableWidget.h:40
const char * creatorTypeName< DtPickableLine >(void)
template specialization for the creator (pass the class being created to the creatorTypeName template...
Definition: DtPickableWidget.h:200
DtVirtualBaseClassCreator< DtPickableWidget, DtWidgetPicker & > DtPickableWidgetCreator
DtPickableWidgetCreator.
Definition: DtPickableWidget.h:29
boost::signalslib::signal< void(int x, int y, int button)> signal_mouseDoubleClick
Emitted when a mouse button is doubled clicked over a widget.
Definition: DtPickableWidget.h:93
boost::signalslib::signal< void(int x, int y, int button)> signal_mousePress
Emitted whenever a mouse button is pressed over a widget. If a press.
Definition: DtPickableWidget.h:87
DtVirtualBaseClassCreator< DtPickableQuad, DtWidgetPicker & > DtPickableQuadCreator
DtPickableQuadCreator.
Definition: DtPickableWidget.h:113
Variadic templated creator class for defining a DtVirtualBaseClass creator that is automatically regi...
Definition: DtVirtualBaseClassCreator.h:22
#define DT_DLL_VRVGRAPHICS
Contains DLL export macros.
Definition: vrvGraphics.h:19
A class which represents a single line segment.
Definition: DtLineSegment.h:22
A flyweight class for controlling a triangle owned by the triangle renderer.
Definition: DtTriangleRenderer.h:112
DT_DLL_vrfutil double angle(double vec1[3], double vec2[3])
DtVirtualBaseClassCreator< DtPickableLine, DtWidgetPicker & > DtPickableLineCreator
DtPickableLineCreator.
Definition: DtPickableWidget.h:193
The DtPickableLine is a pickable widget that matches the LineSegment interface.
Definition: DtPickableWidget.h:205
boost::signalslib::signal< void(int x, int y)> signal_mouseMove
Emitted whenever a mouse moves over a widget, including when it enters.
Definition: DtPickableWidget.h:84
DtLineSegment * myLine
Definition: DtPickableWidget.h:257
DtTriangleProxy * myProxy
Definition: DtPickableWidget.h:316
DtVirtualBaseClassCreator< DtPickableTriangle, DtWidgetPicker & > DtPickableTriangleCreator
DtPickableTriangleCreator.
Definition: DtPickableWidget.h:262
friend DtPickableTriangleCreator
Definition: DtPickableWidget.h:276
DtDe & myDe
Definition: DtPickableWidget.h:105
const char * creatorTypeName< DtPickableWidget >(void)
template specialization for the creator (pass the class being created to the creatorTypeName template...
Definition: DtPickableWidget.h:36
A single 2D quadrilateral. None of this class&#39;s member functions are virtual because: ...
Definition: DtQuad.h:28
boost::signalslib::signal< void(int x, int y, int wheel)> signal_mouseWheel
Emitted when a mouse wheel is scrolled over a widget.
Definition: DtPickableWidget.h:96
DtQuad * myQuad
Definition: DtPickableWidget.h:188
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:70
friend DtPickableLineCreator
Definition: DtPickableWidget.h:207
friend DtPickableWidgetCreator
Definition: DtPickableWidget.h:42
boost::signalslib::signal< void(int x, int y, int button)> signal_mouseRelease
Emitted whenever a mouse button is released over a widget.
Definition: DtPickableWidget.h:90
DtWidgetPicker & myPicker
Definition: DtPickableWidget.h:106
The picker class which allocates and does picking operations on widgets.
Definition: DtWidgetPicker.h:45

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)