GL Studio C++ Runtime API
gls_clipping_group.h
Go to the documentation of this file.
1 /*! \file
2  \brief The disti::GlsClippingGroup class.
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
14 reproduced, in whole or part, in any form, or by any means of electronic,
15 mechanical, or otherwise, without the written permission of DiSTI. Said
16 permission may be derived through the purchase of applicable DiSTI product
17 licenses which detail the distribution rights of this content and any
18 Derivative Works based on this or other copyrighted DiSTI Software.
19 
20  NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
21 AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
22 PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
23 AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
24 IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
25 PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
26 
27  LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
28 IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
29 INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
30 DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
31 INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
32 INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBILITY
33 OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
34 EXCEED FIVE DOLLARS (US$5.00).
35 
36  The aforementioned terms and restrictions are governed by the laws of the
37 State of Florida and the United States of America.
38 
39 */
40 
41 #ifndef INCLUDED_GLS_CLIPPING_GROUP_H
42 #define INCLUDED_GLS_CLIPPING_GROUP_H
43 
44 #include "group.h"
45 
46 //////////////////// Provides support for creating DLLs ////////////////////////
47 #if( defined( GLSGEN_EXPORT_GLSCLIPPINGGROUP ) || defined( GLSGEN_IMPORT_GLSCLIPPINGGROUP ) || defined( GLS_EXPORT_GENERATED ) || defined( GLS_IMPORT_GENERATED ) ) \
48  && defined( _MSC_VER )
49 # if defined( GLSGEN_EXPORT_GLSCLIPPINGGROUP ) || defined( GLS_EXPORT_GENERATED )
50 # define GLSGEN_GLSCLIPPINGGROUP_EXPORT __declspec( dllexport )
51 # else
52 # define GLSGEN_GLSCLIPPINGGROUP_EXPORT __declspec( dllimport )
53 # endif
54 #else
55 # define GLSGEN_GLSCLIPPINGGROUP_EXPORT
56 #endif
57 ///////////////////////////////////////////////////////////////////////////////
58 
59 #define LIB_BASE_NAME "gls_clipping_group"
60 #include "gls_auto_lib.h"
61 #undef LIB_BASE_NAME
62 
63 namespace disti
64 {
65 #ifdef GLES
66 class GlsGloFile;
67 #endif
68 
69 // SetValue enumerations
70 enum
71 {
72  GLS_CLIPPING_GROUP_STATE = GLS_LAST_INITIALIZER + 1,
73  GLS_CLIPPING_GROUP_CLIPPING_ACTIVE,
74  GLS_CLIPPING_GROUP_BOTTOM_LEFT_CORNER,
75  GLS_CLIPPING_GROUP_TOP_RIGHT_CORNER,
76  GLS_CLIPPING_GROUP_SHOW_OUTLINE
77 };
78 
79 /** Runtime implementation of a GlsClippingGroup */
80 class GlsClippingGroup : public Group
81 {
82 public:
83  friend class GlsClippingGroupEditor;
84  typedef Group _BaseClass;
85 
86  /** Construct a new GlsClippingGroup.
87  * \param generateInstance Whether or not to generate an instance name for this clipping group
88  */
89  GLSGEN_GLSCLIPPINGGROUP_EXPORT explicit GlsClippingGroup( bool generateInstance = false );
90 
91  /** Copy an existing clipping group's properties and clone its children to construct a new clipping group.
92  * \param clippingGroup The clipping group whose properties to copy and whose children to clone.
93  * \param generateInstance Whether or not to generate an instance name for this clipping group
94  */
95  GLSGEN_GLSCLIPPINGGROUP_EXPORT GlsClippingGroup( const GlsClippingGroup& clippingGroup, bool generateInstance );
96 
97  /** Destructs a GlsClippingGroup object */
98  virtual GLSGEN_GLSCLIPPINGGROUP_EXPORT ~GlsClippingGroup();
99 
100  static GLSGEN_GLSCLIPPINGGROUP_EXPORT DisplayObject* CreateInstance();
101 
102  virtual GLSGEN_GLSCLIPPINGGROUP_EXPORT void SetAvailableAttributes( unsigned int value );
103 
104  virtual GLSGEN_GLSCLIPPINGGROUP_EXPORT DisplayObject* CloneObject( bool generateNames = false );
105 
106  virtual GLSGEN_GLSCLIPPINGGROUP_EXPORT void CopyProperties( DisplayObject* src );
107 
108 #ifndef GLES
109  virtual GLSGEN_GLSCLIPPINGGROUP_EXPORT InterfaceListType* GetCppInterfaceDescription( InterfaceListType* addToThisList = NULL );
110  virtual GLSGEN_GLSCLIPPINGGROUP_EXPORT void GetCppInterfaceDescriptionFree( InterfaceListType* array );
111 #endif
112 
113  virtual GLSGEN_GLSCLIPPINGGROUP_EXPORT void Draw( void );
114 
115  virtual GLSGEN_GLSCLIPPINGGROUP_EXPORT DisplayObject* Pick3D( const Vector& winLoc,
116  const Vector& logicalCoords,
117  float scale,
118  const Vector& directionVector,
119  Vector& collisionWinLoc /*Returned*/,
120  const OpenGLMatrices& drawnMatrices );
121 
122  virtual GLSGEN_GLSCLIPPINGGROUP_EXPORT void SetValue( int spec, va_list& args );
123 
124  //////////////////////////////////////////////////
125  // GlsClippingGroup specific operations
126  //////////////////////////////////////////////////
127 
128  /** \return If clipping is active for this group */
129  GLSGEN_GLSCLIPPINGGROUP_EXPORT bool ClippingActive( void ) { return _clippingActive; }
130 
131  /** Sets if clipping is active for this group
132  * \param value The new clipping value
133  */
134  GLSGEN_GLSCLIPPINGGROUP_EXPORT void ClippingActive( bool value );
135 
136  /** \return Gets bottom left corner of clip region */
137  GLSGEN_GLSCLIPPINGGROUP_EXPORT Vector Blc( void ) { return _blc; }
138 
139  /** Sets new bottom left corner for the clip region
140  * \param value The new blc
141  */
142  GLSGEN_GLSCLIPPINGGROUP_EXPORT void Blc( const Vector& value );
143 
144  /** \return Gets top right corner of clip region */
145  GLSGEN_GLSCLIPPINGGROUP_EXPORT Vector Trc( void ) { return _trc; }
146 
147  /** Sets new top right corner for the clip region
148  * \param value The new trc
149  */
150  GLSGEN_GLSCLIPPINGGROUP_EXPORT void Trc( const Vector& value );
151 
152  /** \return If clip region should always be drawn in the editor */
153  GLSGEN_GLSCLIPPINGGROUP_EXPORT bool ShowOutline( void ) { return _showOutline; }
154 
155  /** Sets if clip region should always be drawn in the editor
156  * \param value The new show value
157  */
158  GLSGEN_GLSCLIPPINGGROUP_EXPORT void ShowOutline( bool value );
159 
160 protected:
161  /** Get the four corners of the clip region transformed by the current DCS and offset by the group's location
162  * \param tlc [out] receives top left corner
163  * \param trc [out] receives top right corner
164  * \param brc [out] receives bottom right corner
165  * \param blc [out] receives bottom left corner
166  */
167  GLSGEN_GLSCLIPPINGGROUP_EXPORT void GetClipRegionCorners( Vector& tlc, Vector& trc, Vector& brc, Vector& blc );
168 
169 #ifdef GLES
170  /** Set a single attribute from the GLO file.
171  * \param data The attribute to set and its associated data.
172  */
173  virtual GLSGEN_GLSCLIPPINGGROUP_EXPORT void SetFromGloData( GlsGloFileAttribute& data );
174 #endif
175 
176  bool _clippingActive; /*< Whether or not to call clipping is active */
177  Vector _blc; /*< Bottom Left Corner */
178  Vector _trc; /*< Top Right Corner */
179  bool _showOutline; /*< Outline always visible in editor */
180 
181 private:
182  // Deleted copy assignment; use CloneObject() or the copy constructor instead.
183  void operator=( const GlsClippingGroup& ); // = delete
184 };
185 
186 } // namespace disti
187 
188 #endif
virtual DisplayObject * CloneObject(bool generateNames=false)
Definition: dynamic_array.h:62
The disti::Group class. Implements groups of objects.
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:278
virtual void SetValue(int spec, va_list &args)
virtual void SetAvailableAttributes(unsigned int value)
Definition: display.h:97
Vector Blc(void)
Definition: gls_clipping_group.h:137
Definition: gls_glo_file.h:835
Definition: gls_clipping_group.h:80
bool ShowOutline(void)
Definition: gls_clipping_group.h:153
bool ClippingActive(void)
Definition: gls_clipping_group.h:129
void GetClipRegionCorners(Vector &tlc, Vector &trc, Vector &brc, Vector &blc)
virtual void CopyProperties(DisplayObject *src)
virtual void GetCppInterfaceDescriptionFree(InterfaceListType *array)
The gls_auto_lib.
Vector Trc(void)
Definition: gls_clipping_group.h:145
Definition: group.h:52
virtual DisplayObject * Pick3D(const Vector &winLoc, const Vector &logicalCoords, float scale, const Vector &directionVector, Vector &collisionWinLoc, const OpenGLMatrices &drawnMatrices)
Definition: vertex.h:83
virtual void Draw(void)
Definition: bmpimage.h:46
GlsClippingGroup(bool generateInstance=false)
virtual InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL)