GL Studio C++ Runtime API
rso_interface_1.h
Go to the documentation of this file.
1/*! \file
2 \brief Defines the RSO interface, which provides a generic way of accessing RSOs and other content, disti::RSOInterface1.
3
4 \par Copyright Information
5
6 Copyright (c) 2017 by The DiSTI Corporation.<br>
7 11301 Corporate Blvd; Suite 100<br>
8 Orlando, Florida 32817<br>
9 USA<br>
10 <br>
11 All rights reserved.<br>
12
13 This Software contains proprietary trade secrets of DiSTI and may not be
14reproduced, in whole or part, in any form, or by any means of electronic,
15mechanical, or otherwise, without the written permission of DiSTI. Said
16permission may be derived through the purchase of applicable DiSTI product
17licenses which detail the distribution rights of this content and any
18Derivative Works based on this or other copyrighted DiSTI Software.
19
20 NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
21AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
22PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
23AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
24IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
25PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
26
27 LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
28IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
29INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
30DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
31INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
32INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBILITY
33OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
34EXCEED FIVE DOLLARS (US$5.00).
35
36 The aforementioned terms and restrictions are governed by the laws of the
37State of Florida and the United States of America.
38
39*/
40#ifndef _RSO_INTERFACE_1_H
41#define _RSO_INTERFACE_1_H
42
43// !!! NOTICE !!!
44// To maintain compatibility with existing RSOs this header cannot be changed.
45
46namespace disti
47{
48////////////////////////////////////////////////////////////////////////////////
49// In order for the RSO to be discovered in a .DLL or .so file,
50// The following "C" funtions need to be defined.
51// They are only comments here.
52////////////////////////////////////////////////////////////////////////////////
53// RSOInterface1* GetRSOInterface1_ClassNameHere()
54// Optionally:
55// const char* GlsDefaultClassName()
56////////////////////////////////////////////////////////////////////////////////
57
58/** The RSOInterface1 class defines an abstract interface to an RSO instance.
59 */
61{
62public:
63 ////////////////////////////////////////////////////////////////////////////////
64 // Forward declaration of support classes
65 ////////////////////////////////////////////////////////////////////////////////
66 class Vector;
67 class MatrixD;
68 class OpenGLMatrices;
69 class PlaneClass;
70 class Culler;
71 class Event;
72 class LocationEvent;
73 class MouseEvent;
74 class KeyboardEvent;
75 class ObjectEvent;
77 class ResourceFilter;
78
79public:
80 ////////////////////////////////////////////////////////////////////////////////
81 /// The RSO Interface methods
82 ////////////////////////////////////////////////////////////////////////////////
83
84 /// Perform component simulation.
85 /// Any non-drawing activities can be performed here.
86 /// Call this before PreDraw()
87 /// \param time The current application time in seconds.
88 virtual void Calculate( double time ) = 0;
89
90 /// Calculate transformations and perform culling
91 /// Call this before Draw()
92 /// \param current The current state of the OpenGL matrices.
93 /// \param culler The current culler state.
94 virtual void PreDraw( const OpenGLMatrices& current, Culler& culler ) = 0;
95
96 /// Draw the object via OpenGL
97 /// Call this after PreDraw()
98 virtual void Draw() = 0;
99
100 /// Set the string value for a given named resource.
101 /// \param resourceName The name of the resource to set.
102 /// \param resourceVal The new string value to set for the resource.
103 virtual void SetResource( const char* resourceName, const char* resourceVal ) = 0;
104
105 /// Get the string value for the given resource
106 /// \param resourceName The name of the resource whose value is to be returned.
107 /// \return The string value for the given resource, or empty string if not found.
108 virtual const char* GetResource( const char* resourceName ) = 0;
109
110 /// Get a list of the resources for the component.
111 /// Each resource is separated by a newline ('\n') with the output controlled by filter.
112 /// filter may be NULL in which case the default values are used.
113 /// \param filter The filter parameters to use.
114 /// \return A string containing the list of resource data that passes the filter.
115 virtual const char* GetResources( ResourceFilter* filter = 0 ) = 0;
116
117 /// Allow the object to handle an event
118 /// \param ev The event to handle.
119 /// \return True if the event was handled by the component.
120 virtual bool HandleInput( Event* ev ) = 0;
121
122 /// Allow for handling events from inside the object.
123 /// The emitted event handler will be passed events that are from inside the component
124 /// \param handler pointer to the EmittedEventHandler object to use or NULL to remove the current event handler.
125 /// \return true if this component may emit events, false if this component will never emit events.
126 virtual bool SetEmittedEventHandler( EmittedEventHandler* handler ) = 0;
127
128 /// Pick3D returns true if the RSO was picked.
129 /// \param winLoc Device coordinates for the mouse click. Z value should be set to 0 to ensure pick ray starts at near clip plane.
130 /// \param logicalCoords The start of the pick ray in logical coordinates. Should be calculated from the winLoc using this->WindowToLogical(winLoc, logicalCoords, &directionVector).
131 /// \param scale Current window scale. Affects picking radius of outlines. Initial value should typically be 1.0.
132 /// \param directionVector The direction of the pick ray in logical coordinates. Should be calculated from the winLoc using this->WindowToLogical(winLoc, logicalCoords, &directionVector).
133 /// \param collisionWinLoc Returns where the pick vector intersects the object that is hit in device coordinates.
134 /// \param drawnMatrices The matrices used to draw the object, including matrices set by parents that may have
135 /// dynamically rotated, translated or scaled this object. Initial value should typically be a default OpenGLMatrices() object.
136 /// \return True if the object was picked.
137 virtual bool Pick3D( const Vector& winLoc,
138 const Vector& logicalCoords,
139 float scale,
140 const Vector& directionVector,
141 Vector& collisionWinLoc,
142 const OpenGLMatrices& drawnMatrices )
143 = 0;
144
145 /// Get the bounding sphere for the component in the components coordinate system
146 /// \param center If the method returns true, contains the center point of the sphere. If the method returns false, value is undefined.
147 /// \param radius If the method returns true, contains the radius of the sphere. If the method returns false, value is undefined.
148 /// \returns true if the bounding sphere was returned, false if the bounding sphere is not available.
149 virtual bool GetBoundingSphere( Vector* center, float* radius ) = 0;
150
151 /// Get the extents of the component when drawn with the given transformation matrix, as a coordinate system-aligned box
152 /// \param min If the method returns true, contains the point corresponding with the 1st corner of the box. If the method returns false, value is undefined.
153 /// \param max If the method returns true, contains the point corresponding with the 2nd corner of the box. If the method returns false, value is undefined.
154 /// \param transform Transformation matrix from A to B where A is the component's coordinate system and B is the coordinate system to compute the bounding box in. (If NULL then identity matrix is assumed)
155 /// \returns true if the extents were calculated, false if the extents could not be calculated.
156 virtual bool GetBoundingBox( Vector* min, Vector* max, const MatrixD* transform = 0 ) = 0;
157
158 /// \return A new instance of the RSO that is a clone of this object or NULL if not possible.
160
161 /// Safely delete the object.
162 virtual void DeleteInstance() = 0;
163
164protected:
165 /// Protected destructor so it can't be deleted directly.
166 virtual ~RSOInterface1() {}
167
168public:
169 ////////////////////////////////////////////////////////////////////////////////
170 // Supporting classes
171 ////////////////////////////////////////////////////////////////////////////////
172
173 /** Vector */
174 class Vector
175 {
176 public:
177 float _x; ///< The X component.
178 float _y; ///< The Y component.
179 float _z; ///< The Z component.
180
181 Vector()
182 : _x( 0 )
183 , _y( 0 )
184 , _z( 0 )
185 {}
186
187 /// Set all three components.
188 /// \param x The new X component to set.
189 /// \param y The new Y component to set.
190 /// \param z The new Z component to set.
191 inline void Set( float x, float y, float z )
192 {
193 _x = x;
194 _y = y;
195 _z = z;
196 }
197
198 /// \return The X component.
199 inline float X() { return _x; }
200
201 /// \return The Y component.
202 inline float Y() { return _y; }
203
204 /// \return The Z component.
205 inline float Z() { return _z; }
206 };
207
208 /** MatrixD contains the data for a 4x4 matrix */
210 {
211 public:
212 double _data[ 4 * 4 ]; ///< Raw column-major matrix data.
213
214 // Uninitialized data
215 MatrixD()
216 {}
217
218 /// Constructor
219 /// \param data A double array to copy from.
220 MatrixD( double* data )
221 {
222 _data[ 0 ] = data[ 0 ];
223 _data[ 1 ] = data[ 1 ];
224 _data[ 2 ] = data[ 2 ];
225 _data[ 3 ] = data[ 3 ];
226 _data[ 4 ] = data[ 4 ];
227 _data[ 5 ] = data[ 5 ];
228 _data[ 6 ] = data[ 6 ];
229 _data[ 7 ] = data[ 7 ];
230 _data[ 8 ] = data[ 8 ];
231 _data[ 9 ] = data[ 9 ];
232 _data[ 10 ] = data[ 10 ];
233 _data[ 11 ] = data[ 11 ];
234 _data[ 12 ] = data[ 12 ];
235 _data[ 13 ] = data[ 13 ];
236 _data[ 14 ] = data[ 14 ];
237 _data[ 15 ] = data[ 15 ];
238 }
239 };
240
241 /** OpenGLMatrices is used to pass the current OpenGL matrices to PreDraw */
243 {
244 public:
245 int* _viewPort; ///< Pointer to viewport array size 4.
246 MatrixD* _projMatrix; ///< The projection matrix.
247 MatrixD* _modelMatrix; ///< The modelview matrix.
248
250 : _viewPort( 0 )
251 , _projMatrix( 0 )
252 , _modelMatrix( 0 )
253 {}
254
255 /// Constructor
256 /// \param viewPort The new viewport array.
257 /// \param projMatrix The new projection matrix.
258 /// \param modelMatrix The new modelview matrix.
259 OpenGLMatrices( int* viewPort, MatrixD* projMatrix, MatrixD* modelMatrix )
260 : _viewPort( viewPort )
261 , _projMatrix( projMatrix )
262 , _modelMatrix( modelMatrix )
263 {}
264 };
265
266 /** The PlaneClass is used to define the clipping planes for culling */
268 {
269 public:
270 float _a; ///< Coefficient to describe a 3D plane: aX + bY + cZ + d = 0
271 float _b; ///< Coefficient to describe a 3D plane: aX + bY + cZ + d = 0
272 float _c; ///< Coefficient to describe a 3D plane: aX + bY + cZ + d = 0
273 float _d; ///< Coefficient to describe a 3D plane: aX + bY + cZ + d = 0
274
275 PlaneClass()
276 : _a( 0 )
277 , _b( 0 )
278 , _c( 0 )
279 , _d( 0 )
280 {}
281
282 /// Set all components.
283 /// \param a The A component to set.
284 /// \param b The B component to set.
285 /// \param c The C component to set.
286 /// \param d The D component to set.
287 inline void Set( float a, float b, float c, float d )
288 {
289 _a = a;
290 _b = b;
291 _c = c;
292 _d = d;
293 }
294
295 /// \return The A component.
296 inline float A() { return _a; }
297
298 /// \return The B component.
299 inline float B() { return _b; }
300
301 /// \return The C component.
302 inline float C() { return _c; }
303
304 /// \return The D component.
305 inline float D() { return _d; }
306 };
307
308 /** Defines culling parameters for PreDraw */
309 class Culler
310 {
311 public:
312 bool _enabled; ///< Whether or not culling is enabled.
313 PlaneClass _planes[ 6 ]; ///< Array of six clipping planes to define the frustum.
314
315 Culler()
316 : _enabled( false )
317 {}
318 };
319
320 /** Base class for events */
321 class Event
322 {
323 public:
324 /** Event Type Enum */
325 typedef enum
326 {
327 EVENT_MOUSE = 0, /**< A Mouse (or touch screen) event */
328 EVENT_KEYBOARD, /**< A Keyboard event */
329 EVENT_TIMER, /**< Unused */
330 EVENT_OBJECT, /**< An event emitted by an object */
331 EVENT_KEYBOARD_UP /**< A Keyboard up event (uses KeyboardEvent class) */
333
334 /** Event Subtype Enum */
335 typedef enum
336 {
337 MOUSE_DOWN = 0, /**< A Mouse button was pushed down */
338 MOUSE_UP, /**< A Mouse button was released */
339 MOUSE_MOVE, /**< The mouse moved */
340 MOUSE_DRAG, /**< The mouse moved while a button was held down */
341 MOUSE_LEAVE, /**< The mouse exited the object */
342 MOUSE_ENTER, /**< The mouse entered the object */
343 MOUSE_WHEEL_MINUS, /**< The mouse wheel was turned in the negative direction */
344 MOUSE_WHEEL_PLUS /**< The mouse wheel was turned in the positive direction */
346
347 unsigned short _eventType; /**< Major event code. see EventTypeEnum */
348 unsigned short _eventSubtype; /**< Minor event code. see EventSubtypeEnum */
349
350 /**
351 Special Key State
352 */
353 typedef enum
354 {
355 NONE_STATE = 0,
356 SHIFT_STATE = 0x00010000,
357 CAPS_LOCK_STATE = 0x00020000,
358 CTRL_STATE = 0x00040000,
359 ALT_STATE = 0x00080000,
360 NUM_LOCK_STATE = 0x00100000,
361 META_STATE = 0x00400000,
362 SCROLL_LOCK_STATE = 0x00800000,
363 BUTTON1_STATE = 0x01000000,
364 BUTTON2_STATE = 0x02000000,
365 BUTTON3_STATE = 0x04000000
367
368 Event()
369 : _eventType( 0 )
370 , // Derived classes MUST set the appropriate event type
372 {}
373
374 virtual ~Event() {}
375
376 /// \return The type of this event.
377 inline unsigned short EventType() { return _eventType; }
378
379 /// Set the primary type of this event. i.e. EVENT_MOUSE
380 /// \param value The new primary type to set.
381 inline void EventType( unsigned short value ) { _eventType = value; }
382
383 /// \return The subtype of this event.
384 inline unsigned short EventSubType() { return _eventSubtype; }
385
386 /// Set the secondary type of this event. i.e. MOUSE_DOWN
387 /// \param value The new secondary type to set.
388 inline void EventSubType( unsigned short value ) { _eventSubtype = value; }
389 };
390
391 /** An event associated with a specific location in the application window.
392 * Base class for MouseEvent and KeyboardEvent.
393 */
394 class LocationEvent : public Event
395 {
396 public:
397 Vector _winLoc; /**< Location of the event in window coordinates
398 * x and y window coordinates in pixels.
399 * z is from 0.0 -> 1.0 and represents the depth.
400 * z == 0 is at the near cliping plane.
401 * z == 0.5 represents half way between near
402 * and far cliping planes.
403 */
405 {}
406
407 /// \return The window coordinates of the this event.
408 inline Vector WinLoc() { return _winLoc; }
409
410 /// Sets the window coordinates of this event.
411 /// \param value The new window coordinates to set.
412 inline void WinLoc( Vector value ) { _winLoc = value; }
413 };
414
415 /** An event containing mouse input. */
417 {
418 public:
419 /** Mouse Button Type */
420 typedef enum
421 {
422 MOUSE_LBUTTON = 1, /**< Mask that matches only left mouse button */
423 MOUSE_MBUTTON = 2, /**< Mask that matches only middle mouse button */
424 MOUSE_RBUTTON = 4, /**< Mask that matches only right mouse button */
425 MOUSE_BUTTON_ANY = 7 /**< Mask that matches any mouse button */
427
428 unsigned char _buttonMask; /**< bitfield: which button was pressed for this event ( MouseButtonType )*/
429 unsigned char _clicks; /**< # of times a button was pressed */
430 int _modifiers; /**< bitfield: which buttons or modifiers were depressed before event ( \sa SpecialKeyState) */
431
432 MouseEvent()
433 : _buttonMask( 0 )
434 , _clicks( 0 )
435 , _modifiers( NONE_STATE )
436 {
438 }
439
440 /// \return The current button mask of this event.
441 inline unsigned char ButtonMask() { return _buttonMask; }
442
443 /// Set the button mask for this event. i.e. Which buttons are down.
444 /// \param value The new button mask to set.
445 inline void ButtonMask( unsigned char value ) { _buttonMask = value; }
446
447 /// \return The number of clicks associated with this event.
448 inline unsigned char Clicks() { return _clicks; }
449
450 /// Set the number of clicks associated with this event. i.e. single or double click
451 /// \param value The new number of clicks to set
452 inline void Clicks( unsigned char value ) { _clicks = value; }
453
454 /// \return The current keyboard modifers of this event.
455 inline int Modifiers() { return _modifiers; }
456
457 /// Set the keyboard modifers for this event. e.g. control being held.
458 /// \param value The new keyboard modifers to set.
459 inline void Modifiers( int value ) { _modifiers = value; }
460 };
461
462 /** An event containing keyboard input */
464 {
465 public:
466 ///< \details The KeySymCodeEnum enumeration. Used by keysym (use ascii letters for all other keys):
467 enum
468 {
469 KEY_Button = 0xfee8,
470 KEY_BackSpace = 0xff08,
471 KEY_Tab = 0xff09,
472 KEY_Enter = 0xff0d,
473 KEY_Pause = 0xff13,
474 KEY_Scroll_Lock = 0xff14,
475 KEY_Escape = 0xff1b,
476 KEY_Home = 0xff50,
477 KEY_Left = 0xff51,
478 KEY_Up = 0xff52,
479 KEY_Right = 0xff53,
480 KEY_Down = 0xff54,
481 KEY_Page_Up = 0xff55,
482 KEY_Page_Down = 0xff56,
483 KEY_End = 0xff57,
484 KEY_Print = 0xff61,
485 KEY_Insert = 0xff63,
486 KEY_Menu = 0xff67,
487 KEY_Num_Lock = 0xff7f,
488 KEY_KP = 0xff80,
489 KEY_KP_Enter = 0xff8d,
490 KEY_KP_Last = 0xffbd,
491 KEY_F = 0xffbd,
492 KEY_F_Last = 0xffe0,
493 KEY_Shift_L = 0xffe1,
494 KEY_Shift_R = 0xffe2,
495 KEY_Control_L = 0xffe3,
496 KEY_Control_R = 0xffe4,
497 KEY_Caps_Lock = 0xffe5,
498 KEY_Meta_L = 0xffe7,
499 KEY_Meta_R = 0xffe8,
500 KEY_Alt_L = 0xffe9,
501 KEY_Alt_R = 0xffea,
502 KEY_Delete = 0xffff
504
505 int _keysym; /**< Code for key that was pressed ( \sa KeySymCodeEnum) */
506 int _modifiers; /**< bitfield: which modifiers or buttons were pressed ( \sa SpecialKeyState) */
507
509 : _keysym( 0 )
510 , _modifiers( 0 )
511 {
513 }
514
515 /// \return The key symbol code for this event.
516 inline int KeySym() { return _keysym; }
517
518 /// Set the key symbol associated with this event.
519 /// \param value The new symbol to set.
520 inline void KeySym( int value ) { _keysym = value; }
521
522 /// \return The current keyboard modifiers for this event.
523 inline int Modifiers() { return _modifiers; }
524
525 /// Set the keyboard modifiers for this event, e.g. shift is held.
526 /// \param value The new modifiers to set.
527 inline void Modifiers( int value ) { _modifiers = value; }
528 };
529
530 /** An event that is emitted from a simulation object */
531 class ObjectEvent : public Event
532 {
533 public:
534 char* _initiator; /**< The qualified name of the object that initiated the event */
535 char* _eventName; /**< String event name */
536 char* _eventData; /**< Any additional data for this event. A NULL terminated string */
537
539 : _initiator( 0 )
540 , _eventName( 0 )
541 , _eventData( 0 )
542 {
544 }
545
546 virtual ~ObjectEvent()
547 {
548 if( _initiator )
549 {
550 delete _initiator;
551 _initiator = 0;
552 }
553 if( _eventName )
554 {
555 delete _eventName;
556 _eventName = 0;
557 }
558 if( _eventData )
559 {
560 delete _eventData;
561 _eventData = 0;
562 }
563 }
564
565 /// \return The initiator name.
566 inline const char* Initiator() const
567 {
568 return _initiator;
569 }
570
571 /// Set the initiator name.
572 /// \param value The new name to set.
573 virtual void Initiator( const char* value )
574 {
575 if( _initiator )
576 {
577 delete[] _initiator;
578 _initiator = 0;
579 }
580 if( value )
581 {
582 _initiator = new char[ RSOInterface1::strlen( value ) + 1 ];
584 }
585 }
586
587 /// \return The event name.
588 inline const char* EventName() const
589 {
590 return _eventName;
591 }
592
593 /// Set the event name.
594 /// \param value The new name to set.
595 virtual void EventName( const char* value )
596 {
597 if( _eventName )
598 {
599 delete[] _eventName;
600 _eventName = 0;
601 }
602 if( value )
603 {
604 _eventName = new char[ RSOInterface1::strlen( value ) + 1 ];
606 }
607 }
608
609 /// \return The event data.
610 inline const char* EventData() const
611 {
612 return _eventData;
613 }
614
615 /// Set the event data.
616 /// \param value The new string data to set.
617 virtual void EventData( const char* value )
618 {
619 if( _eventData )
620 {
621 delete[] _eventData;
622 _eventData = 0;
623 }
624 if( value )
625 {
626 _eventData = new char[ RSOInterface1::strlen( value ) + 1 ];
628 }
629 }
630 };
631
632 /** The emitted event handler is an object provided by the
633 container to handle events emitted from the component.
634 */
636 {
637 protected:
638 virtual ~EmittedEventHandler() {}
639
640 public:
641 /// Called by the component to pass an event
642 /// to the container. Most containers will only handle ObjectEvents.
643 /// \param ev The event to handle
644 /// \return int Reserved. Currently always -1.
645 virtual int HandleEvent( Event* ev ) = 0;
646 };
647
648 /** The resource filter is a parameter to the GetResources method */
650 {
651 protected:
652 virtual ~ResourceFilter() {}
653
654 public:
655 /// \return The levels of qualification to show in the name.
656 virtual int LevelsUp() const = 0;
657
658 /// How many levels of qualification to show in the name.
659 /// -1 means full qualification.
660 /// Default: -1
661 /// \param value The new levels of qualification to show.
662 virtual void LevelsUp( int value ) = 0;
663
664 /// \return The number of levels of children to show.
665 virtual int GroupLevelsDown() const = 0;
666
667 /// How many levels of children to show.
668 /// 0 means don't show any children properties
669 /// -1 means all the way down.
670 /// Default: -1
671 /// \param value The new levels of children to show.
672 virtual void GroupLevelsDown( int value ) = 0;
673
674 /// \return True if only a list of names will be returned.
675 virtual bool NamesOnly() const = 0;
676
677 /// If true, only a list of names will be returned.
678 /// Values will not be returned.
679 /// The format changes to not include the ":".
680 /// Default: false
681 /// \param value The new names only flag.
682 virtual void NamesOnly( bool value ) = 0;
683
684 /// Manage the list of excluded attributes.
685 /// \param str The name of the new exclude item to add.
686 virtual void AddExclude( const char* str ) = 0;
687
688 /// \return The number of entries in the exclude list.
689 /// Default: 0
690 virtual int ExcludeCount() const = 0;
691
692 /// Returns NULL if index >= ExcludeCount() or index < -1
693 /// \param index The index of the exlcusion item to return.
694 /// \return The name of the item associated with the index.
695 virtual const char* GetExclude( int index ) const = 0;
696
697 /// Manage the list of included attributes.
698 /// \param str The name of the new include item to add.
699 virtual void AddInclude( const char* str ) = 0;
700
701 /// \return The number of entries in the include list.
702 /// Default: 0
703 virtual int IncludeCount() const = 0;
704
705 /// Returns NULL if index >= IncludeCount() or index < -1.
706 /// \param index The index of the inclusion item to return.
707 /// \return The name of the item associated with the index.
708 virtual const char* GetInclude( int index ) const = 0;
709
710 /// Check a name against the filters.
711 /// Exclude list takes precedence.
712 /// \param name The name to check against the filter.
713 /// \return True if the name passes the filter (to be included in the result).
714 virtual bool PassFilter( const char* name ) const = 0;
715 };
716
717 ////////////////////////////////////////////////////////////////////////////////
718 // Support class utility methods
719 ////////////////////////////////////////////////////////////////////////////////
720
721 /// Return the length of the given C string.
722 /// \param str The string whose length is to be computed.
723 /// \return The length of the string in bytes.
724 static inline unsigned int strlen( const char* str )
725 {
726 unsigned int i = 0;
727 while( str[ i ] != '\0' )
728 {
729 i++;
730 }
731 return i;
732 }
733
734 /// Copy the given C string from src to dest.
735 /// \param dest The destination memory region.
736 /// \param src The source memory region.
737 /// \return The destination memory region.
738 static inline char* strcpy( char* dest, const char* src )
739 {
740 unsigned int i = 0;
741 while( ( dest[ i ] = src[ i ] ) != '\0' )
742 {
743 i++;
744 }
745 return dest;
746 }
747};
748
749} // end namespace disti
750
751#endif
Definition: rso_interface_1.h:310
bool _enabled
Whether or not culling is enabled.
Definition: rso_interface_1.h:312
PlaneClass _planes[6]
Array of six clipping planes to define the frustum.
Definition: rso_interface_1.h:313
Definition: rso_interface_1.h:636
virtual int HandleEvent(Event *ev)=0
Definition: rso_interface_1.h:322
unsigned short _eventType
Definition: rso_interface_1.h:347
unsigned short EventSubType()
Definition: rso_interface_1.h:384
unsigned short EventType()
Definition: rso_interface_1.h:377
unsigned short _eventSubtype
Definition: rso_interface_1.h:348
EventSubtypeEnum
Definition: rso_interface_1.h:336
@ MOUSE_DOWN
Definition: rso_interface_1.h:337
@ MOUSE_ENTER
Definition: rso_interface_1.h:342
@ MOUSE_UP
Definition: rso_interface_1.h:338
@ MOUSE_DRAG
Definition: rso_interface_1.h:340
@ MOUSE_MOVE
Definition: rso_interface_1.h:339
@ MOUSE_WHEEL_PLUS
Definition: rso_interface_1.h:344
@ MOUSE_LEAVE
Definition: rso_interface_1.h:341
@ MOUSE_WHEEL_MINUS
Definition: rso_interface_1.h:343
EventTypeEnum
Definition: rso_interface_1.h:326
@ EVENT_MOUSE
Definition: rso_interface_1.h:327
@ EVENT_KEYBOARD_UP
Definition: rso_interface_1.h:331
@ EVENT_OBJECT
Definition: rso_interface_1.h:330
@ EVENT_TIMER
Definition: rso_interface_1.h:329
@ EVENT_KEYBOARD
Definition: rso_interface_1.h:328
void EventType(unsigned short value)
Definition: rso_interface_1.h:381
void EventSubType(unsigned short value)
Definition: rso_interface_1.h:388
SpecialKeyState
Definition: rso_interface_1.h:354
Definition: rso_interface_1.h:464
void Modifiers(int value)
Definition: rso_interface_1.h:527
int KeySym()
Definition: rso_interface_1.h:516
int _keysym
Definition: rso_interface_1.h:505
int Modifiers()
Definition: rso_interface_1.h:523
int _modifiers
Definition: rso_interface_1.h:506
void KeySym(int value)
Definition: rso_interface_1.h:520
enum disti::RSOInterface1::KeyboardEvent::@6 KeySymCodeEnum
<
Definition: rso_interface_1.h:395
Vector _winLoc
Definition: rso_interface_1.h:397
void WinLoc(Vector value)
Definition: rso_interface_1.h:412
Vector WinLoc()
Definition: rso_interface_1.h:408
Definition: rso_interface_1.h:210
double _data[4 *4]
Raw column-major matrix data.
Definition: rso_interface_1.h:212
MatrixD(double *data)
Definition: rso_interface_1.h:220
Definition: rso_interface_1.h:417
void Modifiers(int value)
Definition: rso_interface_1.h:459
MouseButtonType
Definition: rso_interface_1.h:421
@ MOUSE_BUTTON_ANY
Definition: rso_interface_1.h:425
@ MOUSE_LBUTTON
Definition: rso_interface_1.h:422
@ MOUSE_RBUTTON
Definition: rso_interface_1.h:424
@ MOUSE_MBUTTON
Definition: rso_interface_1.h:423
int Modifiers()
Definition: rso_interface_1.h:455
int _modifiers
Definition: rso_interface_1.h:430
void Clicks(unsigned char value)
Definition: rso_interface_1.h:452
unsigned char _buttonMask
Definition: rso_interface_1.h:428
unsigned char Clicks()
Definition: rso_interface_1.h:448
void ButtonMask(unsigned char value)
Definition: rso_interface_1.h:445
unsigned char ButtonMask()
Definition: rso_interface_1.h:441
unsigned char _clicks
Definition: rso_interface_1.h:429
Definition: rso_interface_1.h:532
virtual void EventName(const char *value)
Definition: rso_interface_1.h:595
const char * EventData() const
Definition: rso_interface_1.h:610
char * _eventName
Definition: rso_interface_1.h:535
virtual void Initiator(const char *value)
Definition: rso_interface_1.h:573
const char * Initiator() const
Definition: rso_interface_1.h:566
char * _initiator
Definition: rso_interface_1.h:534
const char * EventName() const
Definition: rso_interface_1.h:588
virtual void EventData(const char *value)
Definition: rso_interface_1.h:617
char * _eventData
Definition: rso_interface_1.h:536
Definition: rso_interface_1.h:243
MatrixD * _projMatrix
The projection matrix.
Definition: rso_interface_1.h:246
MatrixD * _modelMatrix
The modelview matrix.
Definition: rso_interface_1.h:247
OpenGLMatrices(int *viewPort, MatrixD *projMatrix, MatrixD *modelMatrix)
Definition: rso_interface_1.h:259
int * _viewPort
Pointer to viewport array size 4.
Definition: rso_interface_1.h:245
Definition: rso_interface_1.h:268
float A()
Definition: rso_interface_1.h:296
void Set(float a, float b, float c, float d)
Definition: rso_interface_1.h:287
float _a
Coefficient to describe a 3D plane: aX + bY + cZ + d = 0.
Definition: rso_interface_1.h:270
float C()
Definition: rso_interface_1.h:302
float D()
Definition: rso_interface_1.h:305
float _c
Coefficient to describe a 3D plane: aX + bY + cZ + d = 0.
Definition: rso_interface_1.h:272
float _b
Coefficient to describe a 3D plane: aX + bY + cZ + d = 0.
Definition: rso_interface_1.h:271
float _d
Coefficient to describe a 3D plane: aX + bY + cZ + d = 0.
Definition: rso_interface_1.h:273
float B()
Definition: rso_interface_1.h:299
Definition: rso_interface_1.h:650
virtual int GroupLevelsDown() const =0
virtual void AddInclude(const char *str)=0
virtual void GroupLevelsDown(int value)=0
virtual int ExcludeCount() const =0
virtual void LevelsUp(int value)=0
virtual const char * GetExclude(int index) const =0
virtual void AddExclude(const char *str)=0
virtual const char * GetInclude(int index) const =0
virtual int LevelsUp() const =0
virtual bool PassFilter(const char *name) const =0
virtual bool NamesOnly() const =0
virtual void NamesOnly(bool value)=0
virtual int IncludeCount() const =0
Definition: rso_interface_1.h:175
float _z
The Z component.
Definition: rso_interface_1.h:179
float Y()
Definition: rso_interface_1.h:202
float _x
The X component.
Definition: rso_interface_1.h:177
float _y
The Y component.
Definition: rso_interface_1.h:178
float X()
Definition: rso_interface_1.h:199
void Set(float x, float y, float z)
Definition: rso_interface_1.h:191
float Z()
Definition: rso_interface_1.h:205
Definition: rso_interface_1.h:61
virtual bool SetEmittedEventHandler(EmittedEventHandler *handler)=0
static unsigned int strlen(const char *str)
Definition: rso_interface_1.h:724
virtual void SetResource(const char *resourceName, const char *resourceVal)=0
static char * strcpy(char *dest, const char *src)
Definition: rso_interface_1.h:738
virtual void Draw()=0
virtual bool HandleInput(Event *ev)=0
virtual bool GetBoundingSphere(Vector *center, float *radius)=0
virtual void DeleteInstance()=0
Safely delete the object.
virtual const char * GetResource(const char *resourceName)=0
virtual RSOInterface1 * CloneObject()=0
virtual void PreDraw(const OpenGLMatrices &current, Culler &culler)=0
virtual const char * GetResources(ResourceFilter *filter=0)=0
virtual bool Pick3D(const Vector &winLoc, const Vector &logicalCoords, float scale, const Vector &directionVector, Vector &collisionWinLoc, const OpenGLMatrices &drawnMatrices)=0
virtual bool GetBoundingBox(Vector *min, Vector *max, const MatrixD *transform=0)=0
virtual ~RSOInterface1()
Protected destructor so it can't be deleted directly.
Definition: rso_interface_1.h:166
virtual void Calculate(double time)=0
The RSO Interface methods.
Force inclusion of the DirectShow library.
Definition: bmpimage.h:47