GL Studio C++ Runtime API
gls_schematic_poly_line_interconnect.h
Go to the documentation of this file.
1#ifndef _GLSSCHEMATICPOLYLINEINTERCONNECT_H
2#define _GLSSCHEMATICPOLYLINEINTERCONNECT_H
3/*! \file
4 \brief The disti::GlsSchematicPolyLineInterconnect class.
5
6 \par Copyright Information
7
8 Copyright (c) 2017 by The DiSTI Corporation.<br>
9 11301 Corporate Blvd; Suite 100<br>
10 Orlando, Florida 32817<br>
11 USA<br>
12 <br>
13 All rights reserved.<br>
14
15 This Software contains proprietary trade secrets of DiSTI and may not be
16reproduced, in whole or part, in any form, or by any means of electronic,
17mechanical, or otherwise, without the written permission of DiSTI. Said
18permission may be derived through the purchase of applicable DiSTI product
19licenses which detail the distribution rights of this content and any
20Derivative Works based on this or other copyrighted DiSTI Software.
21
22 NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
23AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
24PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
25AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
26IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
27PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
28
29 LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
30IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
31INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
32DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
33INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
34INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBILITY
35OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
36EXCEED FIVE DOLLARS (US$5.00).
37
38 The aforementioned terms and restrictions are governed by the laws of the
39State of Florida and the United States of America.
40*/
41
42#include "glpolygon.h"
44
45#ifdef GLES
46# include "gls_triangle_storage.h"
47#else
48# include "gls_display_list.h"
49#endif
50
51/// Provides support for creating DLLs.
52#if( defined( GLSGEN_EXPORT_GLSSCHEMATICPOLYLINEINTERCONNECT ) || defined( GLSGEN_IMPORT_GLSSCHEMATICPOLYLINEINTERCONNECT ) || defined( GLS_EXPORT_GENERATED ) || defined( GLS_IMPORT_GENERATED ) ) \
53 && defined( _MSC_VER )
54# if defined( GLSGEN_EXPORT_GLSSCHEMATICPOLYLINEINTERCONNECT ) || defined( GLS_EXPORT_GENERATED )
55# define GLSGEN_GLSSCHEMATICPOLYLINEINTERCONNECT_EXPORT __declspec( dllexport )
56# else
57# define GLSGEN_GLSSCHEMATICPOLYLINEINTERCONNECT_EXPORT __declspec( dllimport )
58# endif
59#else
60# define GLSGEN_GLSSCHEMATICPOLYLINEINTERCONNECT_EXPORT
61#endif
62///////////////////////////////////////////////////////////////////////////////
63
64/// Automatically link the runtime library plugin (on Windows).
65#define LIB_BASE_NAME "gls_schematic_poly_line_interconnect"
66#include "gls_auto_lib.h"
67#undef LIB_BASE_NAME
68
69namespace disti
70{
71// SetValue enumerations
72enum
73{
74 GLS_SCHEMATICPOLYLINEINTERCONNECT_FIRST_VALUE = GLS_LAST_INITIALIZER + 1,
75 GLS_SCHEMATICPOLYLINEINTERCONNECT_ORIENTATION,
76 GLS_SCHEMATICPOLYLINEINTERCONNECT_LINE_THICKNESS,
77 GLS_SCHEMATICPOLYLINEINTERCONNECT_ROUNDED_CORNERS,
78 GLS_SCHEMATICPOLYLINEINTERCONNECT_CORNER_RADIUS,
79 GLS_SCHEMATICPOLYLINEINTERCONNECT_FORCE_EXACT_CORNER_RADIUS,
80 GLS_SCHEMATICPOLYLINEINTERCONNECT_CORNER_SEGMENTS,
81 GLS_SCHEMATICPOLYLINEINTERCONNECT_INTERCONNECT_TEXTURE_REPEAT_LENGTH,
82 GLS_SCHEMATICPOLYLINEINTERCONNECT_FLOW_TEXTURE_INDEX,
83 GLS_SCHEMATICPOLYLINEINTERCONNECT_FLOW_TEXTURE_REPEAT_LENGTH,
84 GLS_SCHEMATICPOLYLINEINTERCONNECT_SHOW_FLOW,
85 GLS_SCHEMATICPOLYLINEINTERCONNECT_FLOW_RATE,
86 GLS_SCHEMATICPOLYLINEINTERCONNECT_SHOW_FLOW_BLINK,
87 GLS_SCHEMATICPOLYLINEINTERCONNECT_FLOW_BLINK_RATE,
88 GLS_SCHEMATICPOLYLINEINTERCONNECT_FLOW_BLINK_START_COLOR,
89 GLS_SCHEMATICPOLYLINEINTERCONNECT_FLOW_BLINK_END_COLOR,
90 GLS_SCHEMATICPOLYLINEINTERCONNECT_USE_DISPLAY_LIST,
91 GLS_SCHEMATICPOLYLINEINTERCONNECT_LAST_VALUE = GLS_SCHEMATICPOLYLINEINTERCONNECT_USE_DISPLAY_LIST
92};
93
94#ifdef GLES
95class GlsGloFileAttribute;
96#endif
97
98/** Runtime implementation of a GlsSchematicPolyLineInterconnect */
100{
101private:
104
105public:
106 DISTI_DEPRECATED( "This identifier is forbidden by the C++ standard. Use BaseClass instead." )
107 typedef GLPolygon _BaseClass; ///< Deprecated typedef for the base class.
108 typedef GLPolygon BaseClass; ///< Typedef for the base class.
109 friend class GlsSchematicPolyLineInterconnectEditor;
110
112
113 /// Copy constructor
114 /// \param that The object to copy from.
115 /// \param generateNames Whether or not to generate an instance name for this object.
117
118 /** Destructs a GlsSchematicPolyLineInterconnect object */
120
121 /// \return A pointer to a new GlsSchematicPolyLineInterconnect object.
123
124 //////////////////////////////////////////////////
125 // Overridden base class methods
126 //////////////////////////////////////////////////
127
132
133#ifndef GLES
136#endif
137
141
143
145
147
148 virtual GLSGEN_GLSSCHEMATICPOLYLINEINTERCONNECT_EXPORT void Scale( float px, float py, float pz, Vertex* anchor, int handleBar = 0 ) DISTI_METHOD_OVERRIDE;
149
150 virtual GLSGEN_GLSSCHEMATICPOLYLINEINTERCONNECT_EXPORT void GetExtents( float& x, float& y, float& z, float& x1, float& y1, float& z1 ) DISTI_METHOD_OVERRIDE;
151
152 virtual GLSGEN_GLSSCHEMATICPOLYLINEINTERCONNECT_EXPORT bool Hit( float x, float y, float z, float scale, const Vector& directionVector, Vector* collisionPoint ) DISTI_METHOD_OVERRIDE;
153
154 virtual GLSGEN_GLSSCHEMATICPOLYLINEINTERCONNECT_EXPORT void Rotate( const Vector& orig, float angle, const Vector& axis ) DISTI_METHOD_OVERRIDE;
155
157
159
162
163 //////////////////////////////////////////////////
164 // GlsSchematicPolyLineInterconnect specific operations
165 //////////////////////////////////////////////////
166
167 /** set the i and j orientation vectors that orient the 2-D schematic in 3 space
168 * \param iVector new iVector
169 * \param jVector new jVector
170 * \pre i and j should be orhogonal
171 */
173
174 /** get the i and j orientation vectors that orient the 2-D schematic in 3 space
175 * \param iVector [out] iVector
176 * \param jVector [out] jVector
177 */
178 virtual void GLSGEN_GLSSCHEMATICPOLYLINEINTERCONNECT_EXPORT GetOrientationVectors( Vector& iVector /*out*/, Vector& jVector /*out*/ );
179
180 /** set the line thickness in logical units
181 * \param lineThickness new line thickness in logical units
182 * \pre lineThickness > 0.0f
183 */
184 virtual void GLSGEN_GLSSCHEMATICPOLYLINEINTERCONNECT_EXPORT SetLineThickness( const float lineThickness );
185
186 /** get the line thickness in logical units
187 * \return the line thickness in logical units
188 */
190
191 /** set rounded corners
192 * \param roundedCorners true for rounded corners
193 */
194 virtual void GLSGEN_GLSSCHEMATICPOLYLINEINTERCONNECT_EXPORT SetRoundedCorners( const bool roundedCorners );
195
196 /** get rounded corners
197 * \return rounded corners
198 */
200
201 /** set the corner radius in logical units
202 * \param cornerRadius new corner radisu in logical units
203 * \pre cornerRadius > 0.0f
204 */
205 virtual void GLSGEN_GLSSCHEMATICPOLYLINEINTERCONNECT_EXPORT SetCornerRadius( const float cornerRadius );
206
207 /** get the corner radius in logical units
208 * \return the corner radius in logical units
209 */
211
212 /** set force exact corner radius
213 * \param forceExactCornerRadius true to force rounded corners to use the exact corner radius
214 * specified by SetCornerRadius(). If true, a corner that cannot be made
215 * with this radius will not be rounded.
216 */
217 virtual void GLSGEN_GLSSCHEMATICPOLYLINEINTERCONNECT_EXPORT SetForceExactCornerRadius( const bool forceExactCornerRadius );
218
219 /** get force exact corner radius state
220 * \return force exact corner radius state
221 */
223
224 /** set the number of segments used in rounded corners
225 * \param cornerSegments number of segments to use in rounded corners
226 * \pre 2 <= cornerSegments <= 100
227 */
228 virtual void GLSGEN_GLSSCHEMATICPOLYLINEINTERCONNECT_EXPORT SetCornerSegments( const unsigned int cornerSegments );
229
230 /** get the number of segments used in rounded corners
231 * \return the number of segments used in rounded corners
232 */
234
235 /** set the interconnect texture index
236 * \param interconnectTextureIndex new interconnect texture index else NO_TEXTURE if no interconnect texture
237 */
238 virtual void GLSGEN_GLSSCHEMATICPOLYLINEINTERCONNECT_EXPORT SetInterconnectTextureIndex( const int interconnectTextureIndex );
239
240 /** get the interconnect texture index else NO_TEXTURE if no interconnect texture
241 * \return the interconnect texture index else NO_TEXTURE if no interconnect texture
242 */
244
245 /** set the number of logical units per interconnect texture repeat ( >0.0 )
246 * NOTE: number of actual repeats for the whole interconnect is always rounded
247 * to the nearest whole number so that adjacent interconnect's textures lineup
248 * \param interconnectTextureRepeatLength new interconnect texture repeat length
249 * \pre interconnectTextureRepeatLength > 0.0f
250 */
251 virtual void GLSGEN_GLSSCHEMATICPOLYLINEINTERCONNECT_EXPORT SetInterconnectTextureRepeatLength( const float interconnectTextureRepeatLength );
252
253 /** get the number of logical units per interconnect texture repeat ( >0.0 )
254 * \return the number of logical units per interconnect texture repeat ( >0.0 )
255 */
257
258 /** set the flow texture index
259 * \param flowTextureIndex new flow texture index else NO_TEXTURE if no flow texture
260 */
261 virtual void GLSGEN_GLSSCHEMATICPOLYLINEINTERCONNECT_EXPORT SetFlowTextureIndex( const int flowTextureIndex );
262
263 /** get the flow texture index else NO_TEXTURE if no flow texture
264 * \return the flow texture index else NO_TEXTURE if no flow texture
265 */
267
268 /** set the number of logical units per flow texture repeat ( >0.0 )
269 * NOTE: number of actual repeats for the whole interconnect is always rounded
270 * to the nearest whole number so that adjacent interconnect's textures lineup
271 * \param flowTextureRepeatLength new flow texture repeat length
272 * \pre flowTextureRepeatLength > 0.0f
273 */
274 virtual void GLSGEN_GLSSCHEMATICPOLYLINEINTERCONNECT_EXPORT SetFlowTextureRepeatLength( const float flowTextureRepeatLength );
275
276 /** get the number of logical units per flow texture repeat ( >0.0 )
277 * \return the number of logical units per flow texture repeat ( >0.0 )
278 */
280
281 /** set whether or not the flow is displayed
282 * \param showFlow true to show flow else false
283 */
285
286 /** get whether or not the flow is displayed
287 * \return true if flow is show else false
288 */
290
291 /** set the flow rate in "flow textures" / second
292 * \param flowRate flow rate in "flow textures" / second
293 */
295
296 /** get the flow rate in "flow textures" / second
297 * \return the flow rate in "flow textures" / second
298 */
300
301 /** set whether or not the flow blink is displayed (NOTE: normal flow is not drawn if flow blink is true)
302 * \param showFlowBlink true to show flow blink else false
303 */
304 virtual void GLSGEN_GLSSCHEMATICPOLYLINEINTERCONNECT_EXPORT SetShowFlowBlink( const bool showFlowBlink );
305
306 /** get whether or not the flow blink is displayed (NOTE: normal flow is not drawn if flow blink is true)
307 * \return true if flow blink is shown else false
308 */
310
311 /** set the flow blink rate in hz
312 * \param flowBlinkRate flow blink rate in hz
313 */
314 virtual void GLSGEN_GLSSCHEMATICPOLYLINEINTERCONNECT_EXPORT SetFlowBlinkRate( const float flowBlinkRate );
315
316 /** get the flow blink rate in hz
317 * \return the flow blink rate in hz
318 */
320
321 /** set the flow blink start color
322 * \param startColor flow blink start color
323 */
325
326 /** get the flow blink start color
327 * \return the flow blink start color
328 */
330
331 /** set the flow blink end color
332 * \param endColor flow blink end color
333 */
335
336 /** get the flow blink end color
337 * \return the flow blink end color
338 */
340
341#ifndef GLES
342 /** enable/disable using display list for drawing
343 * \param useDisplayList true to use display list
344 */
345 virtual void GLSGEN_GLSSCHEMATICPOLYLINEINTERCONNECT_EXPORT SetUseDisplayList( const bool useDisplayList );
346
347 /** get use display list
348 * \return true if using display list for drawing
349 */
351#endif
352
353 /** set the last segment chamfer distance (NOTE: not controllable in editor, usually used by the GlsSchematicTeeInterconnect plugin at runtime)
354 * \param endingChamferDistance distance from end of last line segment to start chamfer ( 0.0f to disable )
355 * \pre endingChamferDistance >= 0.0f
356 */
357 virtual void GLSGEN_GLSSCHEMATICPOLYLINEINTERCONNECT_EXPORT SetEndingChamferDistance( const float endingChamferDistance );
358
359 /** get the last segment chamfer distance (NOTE: not controllable in editor, usually used by the GlsSchematicTeeInterconnect plugin at runtime)
360 * \return distance from end of last line segment to start chamfer ( 0.0f to disable )
361 */
363
364protected:
365 /** helper struct for storing computed verts for interconnect */
367 {
368 float _leftX; ///< Left side X coord in 2D plane.
369 float _leftY; ///< Left side Y coord in 2D plane.
370 float _rightX; ///< Right side X coord in 2D plane.
371 float _rightY; ///< Right side Y coord in 2D plane.
372
373 float _interconnectU; ///< Corresponding U texture coord for interconnect texture.
374 float _flowU; ///< Corresponding U texture coord for flow texture.
375
376 /// Constructor
377 /// \param leftX Left side X coord in 2D plane.
378 /// \param leftY Left side Y coord in 2D plane.
379 /// \param rightX Right side X coord in 2D plane.
380 /// \param rightY Right side Y coord in 2D plane.
381 /// \param interconnectU Corresponding U texture coord for interconnect texture.
382 /// \param flowU Corresponding U texture coord for flow texture.
383 inline InterconnectVertex( const float leftX = 0.0f, const float leftY = 0.0f, const float rightX = 0.0f, const float rightY = 0.0f,
384 const float interconnectU = 0.0f, const float flowU = 0.0f )
385 : _leftX( leftX )
386 , _leftY( leftY )
387 , _rightX( rightX )
388 , _rightY( rightY )
389 , _interconnectU( interconnectU )
390 , _flowU( flowU )
391 {}
392 };
393
394 /** array of InterconnectVertex */
396
397 /** helper struct for storing info for corners in the poly line */
399 {
400 Vector _v0; ///< Corner flows from _v0, _v1, _v2.
401 Vector _v1; ///< Corner flows from _v0, _v1, _v2.
402 Vector _v2; ///< Corner flows from _v0, _v1, _v2.
403 bool _isRounded; ///< True if the corner is to be rounded.
404 Vector _center; ///< Center of circle making round corner.
405 float _radius; ///< Radius of circle making round corner.
406 double _startTheta; ///< Starting theta for arc in circle making round corner.
407 double _endTheta; ///< Ending theta for arc in circle making round corner.
408 bool _isLeftTurn; ///< True if corners is a left turn else false.
409 Vector _tangent_v0_v1; ///< Tangent point of corner circle on v0, v1.
410 Vector _tangent_v1_v2; ///< Tangent point of corner circle on v1, v2.
411 };
412
413 /** array of CornerCircle */
415
416 /** array of Vector */
418
419 /** notify that vertices have changed
420 */
422
423 /** notify that the orientation vectors have changed
424 */
426
427 /** get the rotation matrix for the current _orientation vectors
428 * \return the rotation matrix for the current _orientation vectors
429 */
431
432 /** flag line to be rebuilt on next draw */
434
435 /** rebuild the polyline */
437
438#ifdef GLES
439 /** prepare and bake the geometry in _interconnectQuads to a VBO as quads and an outline
440 * \param drawFlowUVs true to draw with flow UV's else false to draw with interconnect UV's
441 */
442 virtual void GLSGEN_GLSSCHEMATICPOLYLINEINTERCONNECT_EXPORT BakeInterconnectGeometry( const bool drawFlowUVs );
443
444 /** Bakes the VBOS
445 */
446 void BakeVBOs();
447#else
448 /** emit the geomentry in _interconnectQuads to OpenGL as quads and an outline
449 * \param drawFlowUVs true to draw with flow UV's else false to draw with interconnect UV's
450 */
451 virtual void EmitInterconnectGeometry( const bool drawFlowUVs );
452
453 /** turn on/off preview Path drawing ( useful for debugging and when the object is selected in the editor )
454 * \param enablePreviewPath true to enable else false
455 */
456 virtual void EnablePreviewPath( const bool enablePreviewPath );
457
458 /** emit the preview path geometry to GL -- mainly used fir debugging and when the line is selected in the editor */
460#endif
461
462 /** Eliminate adjacent vertices that are not unique between each other
463 * \param numVertices number of input vertices
464 * \param vertices input vertices
465 * \return array of unique verts
466 */
467 virtual VectorArray GLSGEN_GLSSCHEMATICPOLYLINEINTERCONNECT_EXPORT GetUniqueVerts( const unsigned int numVertices, Vertex* vertices );
468
469 /** Find a corner circle that will fit the corner defined by v0 -> v1 -> v2
470 * \param v0 starting point
471 * \param v1 corner point
472 * \param v2 ending point
473 * \param desiredCornerRadius desired radius for corner circle
474 * \param minRadius minimum radius for ccorner circle
475 * \param forceExactCornerRadius true if the corner can only be rounded with a radius equal to the desiredCornerRadius
476 * else false to allow a smaller radius to be used if needed (>minRadius)
477 * \param c [out] receives corner info
478 * \param forceCircle [optional, defaults to false] true to force a rounded corner to be found
479 * (used to avoid lack of precision issues when the circle is tangent at the midpoint of either v0 -> v1, or v1 -> v2
480 * \return true if a rounded corner was found
481 */
482 virtual bool GLSGEN_GLSSCHEMATICPOLYLINEINTERCONNECT_EXPORT FindCornerCircle( const Vector& v0, const Vector& v1, const Vector& v2, const float desiredCornerRadius, const float minRadius,
483 const bool forceExactCornerRadius, CornerCircle& c, bool forceCircle = false );
484
485 /// Compute the length of the path described by the given corner array.
486 /// \param cornerCircles The corners in question.
487 /// \return The length of the computed path.
489
490 /// Add a line segment to the given array of interconnect verts.
491 /// \param interconnectVerts Receives line segment is start and finish are not virtually the same point.
492 /// \param start Starting point of line segment.
493 /// \param finish Finish point of line segment.
494 /// \param lineThickness Thickness of line segment.
495 /// \param curLength Current length of path at the starting point.
496 /// \param totalLength Total length of path that contains the line segment.
497 /// \param numInterconnectRepeats Number of interconnect texture repeats over entire path that contains the line segment.
498 /// \param numFlowRepeats Number of flow texture repeats over entire path that contains the line segment.
499 /// \param lastSegmentInPath [optional, defaults to false] true if this line segment is the last in the path.
500 /// \return The length of the resulting segment.
501 virtual float GLSGEN_GLSSCHEMATICPOLYLINEINTERCONNECT_EXPORT AddInterconnectLineSegment( InterconnectVertexArray& interconnectVerts, const Vector& start, const Vector& finish, float lineThickness,
502 float curLength, const float totalLength,
503 const unsigned int numInterconnectRepeats, const unsigned int numFlowRepeats,
504 const bool lastSegmentInPath = false );
505
506 /// Add a rounded to the given array of interconnect verts.
507 /// \param interconnectVerts Receives line segment is start and finish are not virtually the same point.
508 /// \param c Info for rounded corner to add.
509 /// \param lineThickness Thickness of line segment.
510 /// \param curLength Current length of path at the starting point.
511 /// \param totalLength Total length of path that contains the line segment.
512 /// \param numInterconnectRepeats Number of interconnect texture repeats over entire path that contains the line segment.
513 /// \param numFlowRepeats Number of flow texture repeats over entire path that contains the line segment.
514 /// \return The size of the resulting corner.
516 float curLength, const float totalLength,
517 const unsigned int numInterconnectRepeats, const unsigned int numFlowRepeats );
518#ifdef GLES
519 /** Set a single attribute from the GLO file.
520 * \param data The attribute to set and its associated data.
521 */
523#endif
524
525 Vector _orientation[ 2 ]; /**< Two orthogonal vectors defining the orientation */
526 float _lineThickness; /**< thickness of line in logical units ( >0.0 )*/
527 bool _roundedCorners; /**< true for rounded corners */
528 float _cornerRadius; /**< radius for rounded corners ( >0.0 )*/
529 bool _forceExactCornerRadius; /**< true to force rounded corners to use the exact corner radius
530 * specified by _cornerRadius. If true, a corner that cannot be made with this radius
531 * will not be rounded. */
532 unsigned int _cornerSegments; /**< number of segments to use in rounded corners (2 <= cornerSegments <= 100) */
533 float _interconnectTextureRepeatLength; /**< number of logical units per interconnect texture repeat ( >0.0 )
534 * NOTE: number of actual repeats for the whole interconnect is always rounded
535 * to the nearest whole number so that adjacent interconnect's textures lineup */
536 int _flowTextureIndex; /**< texture index for flow texture else NO_TEXTURE */
537 float _flowTextureRepeatLength; /**< number of logical units per flow texture repeat ( >0.0 )
538 * NOTE: number of actual repeats for the whole interconnect is always rounded
539 * to the nearest whole number so that adjacent interconnect's textures lineup */
540 bool _showFlow; /**< true to draw flow in interconnect else false */
541 float _flowRate; /**< the flow rate in "flow textures" / second */
542 bool _showFlowBlink; /**< true to draw the flow blink else false (NOTE: normal flow is not drawn if flow blink is true) */
543 float _flowBlinkRate; /**< rate of flow blink in hz >= 0.0 */
544 GlsColor _flowBlinkStartColor; /**< starting color for flow blink */
545 GlsColor _flowBlinkEndColor; /**< ending color for flow blink */
546
547 bool _needsRebuild; /**< true if the line needs to be rebuilt */
548 double _lastCalculateTime; /**< last time stamp given to Calculate() method */
549 InterconnectVertexArray _interconnectVerts; /**< 2D verts and texture coords computed for interconnect */
550
551#ifndef GLES
552 bool _useDisplayList; /**< true to draw using display lists */
553 GlsDisplayList _interconnectDisplayList; /**< display list for drawing interconnect (if using display lists) */
554 GlsDisplayList _flowDisplayList; /**< display list for drawing flow (if using display lists) */
555#endif
556
557 float _endingChamferDistance; /**< distance from end of last line segment to start chamfer ( 0.0f to disable ) ( >= 0.0f ) */
558
559 bool _drawPreviewPath; /**< true to draw the preview path (mainly used in editor) */
560 VectorArray _previewPathPoints; /**< points in preview path */
561 CornerCircleArray _previewCornerCircles; /**< corners in preview path */
562
563#ifdef GLES
564 GlsTriangleStrip2D _interconnectTris; /**< Triangle strip for the interconnect */
565 GlsTriangleStrip2D _flowTris; /**< Triangle strip for the flows */
566#endif
567};
568
569} // namespace disti
570
571#endif
Definition: cull.h:50
Definition: events.h:113
Definition: display.h:96
Definition: dynamic_array.h:79
The Polygon class. Implements Polygons.
Definition: glpolygon.h:56
Definition: gls_color.h:54
Definition: gls_display_list.h:51
Definition: gls_glo_file.h:1243
Definition: gls_schematic_poly_line_interconnect.h:100
virtual InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL) DISTI_METHOD_OVERRIDE
virtual void CalculateTextureCoordinates() DISTI_METHOD_OVERRIDE
virtual void SetFlowTextureIndex(const int flowTextureIndex)
float _endingChamferDistance
Definition: gls_schematic_poly_line_interconnect.h:557
virtual void SetShowFlow(const bool showFlow)
virtual void SetFlowTextureRepeatLength(const float flowTextureRepeatLength)
virtual void SetLineThickness(const float lineThickness)
virtual void SetAvailableAttributes(unsigned int value) DISTI_METHOD_OVERRIDE
virtual void SetRoundedCorners(const bool roundedCorners)
virtual void Draw() DISTI_METHOD_OVERRIDE
virtual void GetCppInterfaceDescriptionFree(InterfaceListType *array) DISTI_METHOD_OVERRIDE
float _flowTextureRepeatLength
Definition: gls_schematic_poly_line_interconnect.h:537
virtual GlsMatrixType GetOrientationMatrix()
GlsDisplayList _interconnectDisplayList
Definition: gls_schematic_poly_line_interconnect.h:553
virtual float AddInterconnectRoundedCorner(InterconnectVertexArray &interconnectVerts, const CornerCircle &c, float lineThickness, float curLength, const float totalLength, const unsigned int numInterconnectRepeats, const unsigned int numFlowRepeats)
bool _roundedCorners
Definition: gls_schematic_poly_line_interconnect.h:527
virtual void SetFlowRate(const float flowRate)
GlsColor _flowBlinkStartColor
Definition: gls_schematic_poly_line_interconnect.h:544
InterconnectVertexArray _interconnectVerts
Definition: gls_schematic_poly_line_interconnect.h:549
bool _forceExactCornerRadius
Definition: gls_schematic_poly_line_interconnect.h:529
virtual DisplayObject * CloneObject(bool generateNames=false) DISTI_METHOD_OVERRIDE
virtual void SetOrientationVectors(const Vector &iVector, const Vector &jVector)
bool _needsRebuild
Definition: gls_schematic_poly_line_interconnect.h:547
virtual void SetInterconnectTextureIndex(const int interconnectTextureIndex)
virtual void SetCornerRadius(const float cornerRadius)
GlsDisplayList _flowDisplayList
Definition: gls_schematic_poly_line_interconnect.h:554
CornerCircleArray _previewCornerCircles
Definition: gls_schematic_poly_line_interconnect.h:561
DynamicArray< CornerCircle > CornerCircleArray
Definition: gls_schematic_poly_line_interconnect.h:414
virtual bool Hit(float x, float y, float z, float scale, const Vector &directionVector, Vector *collisionPoint) DISTI_METHOD_OVERRIDE
virtual void PreDraw(const OpenGLMatrices &parentMatrices, Culler &culler) DISTI_METHOD_OVERRIDE
virtual void SetEndingChamferDistance(const float endingChamferDistance)
virtual void SetUseDisplayList(const bool useDisplayList)
virtual void EmitInterconnectGeometry(const bool drawFlowUVs)
float _interconnectTextureRepeatLength
Definition: gls_schematic_poly_line_interconnect.h:533
float _flowBlinkRate
Definition: gls_schematic_poly_line_interconnect.h:543
float _cornerRadius
Definition: gls_schematic_poly_line_interconnect.h:528
virtual DisplayObject * handle(DisplayEvent *ev) DISTI_METHOD_OVERRIDE
virtual Vertex WorldVertex(unsigned int i) DISTI_METHOD_OVERRIDE
virtual void SetFlowBlinkEndColor(const GlsColor &endColor)
virtual void SetValue(int spec, va_list &args) DISTI_METHOD_OVERRIDE
void DeleteVertexAt(unsigned int index) DISTI_METHOD_OVERRIDE
virtual float AddInterconnectLineSegment(InterconnectVertexArray &interconnectVerts, const Vector &start, const Vector &finish, float lineThickness, float curLength, const float totalLength, const unsigned int numInterconnectRepeats, const unsigned int numFlowRepeats, const bool lastSegmentInPath=false)
virtual void SetFlowBlinkRate(const float flowBlinkRate)
Vector _orientation[2]
Definition: gls_schematic_poly_line_interconnect.h:525
virtual void Rotate(const Vector &orig, float angle, const Vector &axis) DISTI_METHOD_OVERRIDE
float _lineThickness
Definition: gls_schematic_poly_line_interconnect.h:526
virtual void EnablePreviewPath(const bool enablePreviewPath)
virtual void SetFlowBlinkStartColor(const GlsColor &startColor)
virtual float GetInterconnectTextureRepeatLength()
bool _showFlowBlink
Definition: gls_schematic_poly_line_interconnect.h:542
virtual void Calculate(double time) DISTI_METHOD_OVERRIDE
static DisplayObject * CreateInstance()
virtual void CopyGeometry(DisplayObject *src) DISTI_METHOD_OVERRIDE
virtual void SetVertices(unsigned int nPoints, Vertex *vertices) DISTI_METHOD_OVERRIDE
virtual bool FindCornerCircle(const Vector &v0, const Vector &v1, const Vector &v2, const float desiredCornerRadius, const float minRadius, const bool forceExactCornerRadius, CornerCircle &c, bool forceCircle=false)
virtual void SetShowFlowBlink(const bool showFlowBlink)
DynamicArray< InterconnectVertex > InterconnectVertexArray
Definition: gls_schematic_poly_line_interconnect.h:395
virtual unsigned int GetCornerSegments()
virtual void SetInterconnectTextureRepeatLength(const float interconnectTextureRepeatLength)
float _flowRate
Definition: gls_schematic_poly_line_interconnect.h:541
virtual void CopyProperties(DisplayObject *src) DISTI_METHOD_OVERRIDE
virtual VectorArray GetUniqueVerts(const unsigned int numVertices, Vertex *vertices)
virtual void Scale(float px, float py, float pz, Vertex *anchor, int handleBar=0) DISTI_METHOD_OVERRIDE
bool _useDisplayList
Definition: gls_schematic_poly_line_interconnect.h:552
double _lastCalculateTime
Definition: gls_schematic_poly_line_interconnect.h:548
virtual float ComputePathLength(CornerCircleArray &cornerCircles)
virtual void GetExtents(float &x, float &y, float &z, float &x1, float &y1, float &z1) DISTI_METHOD_OVERRIDE
virtual void GetOrientationVectors(Vector &iVector, Vector &jVector)
VectorArray _previewPathPoints
Definition: gls_schematic_poly_line_interconnect.h:560
virtual void SetCornerSegments(const unsigned int cornerSegments)
GlsColor _flowBlinkEndColor
Definition: gls_schematic_poly_line_interconnect.h:545
bool _drawPreviewPath
Definition: gls_schematic_poly_line_interconnect.h:559
int _flowTextureIndex
Definition: gls_schematic_poly_line_interconnect.h:536
unsigned int _cornerSegments
Definition: gls_schematic_poly_line_interconnect.h:532
virtual void SetForceExactCornerRadius(const bool forceExactCornerRadius)
bool _showFlow
Definition: gls_schematic_poly_line_interconnect.h:540
DynamicArray< Vector > VectorArray
Definition: gls_schematic_poly_line_interconnect.h:417
void InsertVertexAt(unsigned int index) DISTI_METHOD_OVERRIDE
Definition: gls_triangle_storage.h:58
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:544
Definition: vertex.h:85
Definition: vertex.h:420
The disti::GLPolygon class. Implements Polygons.
The gls_auto_lib.
Macros and helper code to determine what subset of C++11/14/17 is available.
#define DISTI_SPECIAL_MEM_FUN_DELETE
Macro to wrap function deletion, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:235
#define DISTI_DEPRECATED(msg)
Defines whether this compiler supports the C++14 deprecated attribute.
Definition: gls_cpp_lang_support.h:457
#define DISTI_METHOD_OVERRIDE
Macro to wrap the override keyword, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:214
The disti::GlsDisplayList class.
#define GLSGEN_GLSSCHEMATICPOLYLINEINTERCONNECT_EXPORT
Provides support for creating DLLs.
Definition: gls_schematic_poly_line_interconnect.h:60
The disti::GlsTriangleStrip2D class.
Force inclusion of the DirectShow library.
Definition: bmpimage.h:47
Definition: gls_schematic_poly_line_interconnect.h:399
float _radius
Radius of circle making round corner.
Definition: gls_schematic_poly_line_interconnect.h:405
bool _isRounded
True if the corner is to be rounded.
Definition: gls_schematic_poly_line_interconnect.h:403
Vector _v0
Corner flows from _v0, _v1, _v2.
Definition: gls_schematic_poly_line_interconnect.h:400
Vector _tangent_v1_v2
Tangent point of corner circle on v1, v2.
Definition: gls_schematic_poly_line_interconnect.h:410
bool _isLeftTurn
True if corners is a left turn else false.
Definition: gls_schematic_poly_line_interconnect.h:408
Vector _v1
Corner flows from _v0, _v1, _v2.
Definition: gls_schematic_poly_line_interconnect.h:401
Vector _v2
Corner flows from _v0, _v1, _v2.
Definition: gls_schematic_poly_line_interconnect.h:402
Vector _tangent_v0_v1
Tangent point of corner circle on v0, v1.
Definition: gls_schematic_poly_line_interconnect.h:409
double _startTheta
Starting theta for arc in circle making round corner.
Definition: gls_schematic_poly_line_interconnect.h:406
Vector _center
Center of circle making round corner.
Definition: gls_schematic_poly_line_interconnect.h:404
double _endTheta
Ending theta for arc in circle making round corner.
Definition: gls_schematic_poly_line_interconnect.h:407
Definition: gls_schematic_poly_line_interconnect.h:367
float _leftY
Left side Y coord in 2D plane.
Definition: gls_schematic_poly_line_interconnect.h:369
InterconnectVertex(const float leftX=0.0f, const float leftY=0.0f, const float rightX=0.0f, const float rightY=0.0f, const float interconnectU=0.0f, const float flowU=0.0f)
Definition: gls_schematic_poly_line_interconnect.h:383
float _leftX
Left side X coord in 2D plane.
Definition: gls_schematic_poly_line_interconnect.h:368
float _rightY
Right side Y coord in 2D plane.
Definition: gls_schematic_poly_line_interconnect.h:371
float _rightX
Right side X coord in 2D plane.
Definition: gls_schematic_poly_line_interconnect.h:370
float _flowU
Corresponding U texture coord for flow texture.
Definition: gls_schematic_poly_line_interconnect.h:374
float _interconnectU
Corresponding U texture coord for interconnect texture.
Definition: gls_schematic_poly_line_interconnect.h:373