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  DISTI_DEPRECATED( "This identifier is forbidden by the C++ standard. Use BaseClass instead." )
85  typedef Group _BaseClass;
86  typedef Group BaseClass;
87 
88  /** Construct a new GlsClippingGroup.
89  * \param generateInstance Whether or not to generate an instance name for this clipping group
90  */
91  GLSGEN_GLSCLIPPINGGROUP_EXPORT explicit GlsClippingGroup( bool generateInstance = false );
92 
93  /** Copy an existing clipping group's properties and clone its children to construct a new clipping group.
94  * \param clippingGroup The clipping group whose properties to copy and whose children to clone.
95  * \param generateInstance Whether or not to generate an instance name for this clipping group
96  */
97  GLSGEN_GLSCLIPPINGGROUP_EXPORT GlsClippingGroup( const GlsClippingGroup& clippingGroup, bool generateInstance );
98 
99  /** Destructs a GlsClippingGroup object */
100  virtual GLSGEN_GLSCLIPPINGGROUP_EXPORT ~GlsClippingGroup();
101 
102  static GLSGEN_GLSCLIPPINGGROUP_EXPORT DisplayObject* CreateInstance();
103 
104  virtual GLSGEN_GLSCLIPPINGGROUP_EXPORT void SetAvailableAttributes( unsigned int value ) DISTI_METHOD_OVERRIDE;
105 
106  virtual GLSGEN_GLSCLIPPINGGROUP_EXPORT DisplayObject* CloneObject( bool generateNames = false ) DISTI_METHOD_OVERRIDE;
107 
108  virtual GLSGEN_GLSCLIPPINGGROUP_EXPORT void CopyProperties( DisplayObject* src ) DISTI_METHOD_OVERRIDE;
109 
110 #ifndef GLES
111  virtual GLSGEN_GLSCLIPPINGGROUP_EXPORT InterfaceListType* GetCppInterfaceDescription( InterfaceListType* addToThisList = NULL ) DISTI_METHOD_OVERRIDE;
112  virtual GLSGEN_GLSCLIPPINGGROUP_EXPORT void GetCppInterfaceDescriptionFree( InterfaceListType* array ) DISTI_METHOD_OVERRIDE;
113 #endif
114 
115  virtual GLSGEN_GLSCLIPPINGGROUP_EXPORT void Draw( void ) DISTI_METHOD_OVERRIDE;
116 
117  virtual GLSGEN_GLSCLIPPINGGROUP_EXPORT DisplayObject* Pick3D( const Vector& winLoc,
118  const Vector& logicalCoords,
119  float scale,
120  const Vector& directionVector,
121  Vector& collisionWinLoc /*Returned*/,
122  const OpenGLMatrices& drawnMatrices ) DISTI_METHOD_OVERRIDE;
123 
124  virtual GLSGEN_GLSCLIPPINGGROUP_EXPORT void SetValue( int spec, va_list& args ) DISTI_METHOD_OVERRIDE;
125 
126  //////////////////////////////////////////////////
127  // GlsClippingGroup specific operations
128  //////////////////////////////////////////////////
129 
130  /** \return If clipping is active for this group */
131  GLSGEN_GLSCLIPPINGGROUP_EXPORT bool ClippingActive( void ) { return _clippingActive; }
132 
133  /** Sets if clipping is active for this group
134  * \param value The new clipping value
135  */
136  GLSGEN_GLSCLIPPINGGROUP_EXPORT void ClippingActive( bool value );
137 
138  /** \return Gets bottom left corner of clip region */
139  GLSGEN_GLSCLIPPINGGROUP_EXPORT Vector Blc( void ) { return _blc; }
140 
141  /** Sets new bottom left corner for the clip region
142  * \param value The new blc
143  */
144  GLSGEN_GLSCLIPPINGGROUP_EXPORT void Blc( const Vector& value );
145 
146  /** \return Gets top right corner of clip region */
147  GLSGEN_GLSCLIPPINGGROUP_EXPORT Vector Trc( void ) { return _trc; }
148 
149  /** Sets new top right corner for the clip region
150  * \param value The new trc
151  */
152  GLSGEN_GLSCLIPPINGGROUP_EXPORT void Trc( const Vector& value );
153 
154  /** \return If clip region should always be drawn in the editor */
155  GLSGEN_GLSCLIPPINGGROUP_EXPORT bool ShowOutline( void ) { return _showOutline; }
156 
157  /** Sets if clip region should always be drawn in the editor
158  * \param value The new show value
159  */
160  GLSGEN_GLSCLIPPINGGROUP_EXPORT void ShowOutline( bool value );
161 
162 protected:
163  /** Get the four corners of the clip region transformed by the current DCS and offset by the group's location
164  * \param tlc [out] receives top left corner
165  * \param trc [out] receives top right corner
166  * \param brc [out] receives bottom right corner
167  * \param blc [out] receives bottom left corner
168  */
169  GLSGEN_GLSCLIPPINGGROUP_EXPORT void GetClipRegionCorners( Vector& tlc, Vector& trc, Vector& brc, Vector& blc );
170 
171 #ifdef GLES
172  /** Set a single attribute from the GLO file.
173  * \param data The attribute to set and its associated data.
174  */
175  virtual GLSGEN_GLSCLIPPINGGROUP_EXPORT void SetFromGloData( GlsGloFileAttribute& data ) DISTI_METHOD_OVERRIDE;
176 #endif
177 
178  bool _clippingActive; /*< Whether or not to call clipping is active */
179  Vector _blc; /*< Bottom Left Corner */
180  Vector _trc; /*< Top Right Corner */
181  bool _showOutline; /*< Outline always visible in editor */
182 
183 private:
184  // Deleted copy assignment; use CloneObject() or the copy constructor instead.
185  void operator=( const GlsClippingGroup& ); // = delete
186 };
187 
188 } // namespace disti
189 
190 #endif
virtual void SetAvailableAttributes(unsigned int value) DISTI_METHOD_OVERRIDE
#define DISTI_DEPRECATED(msg)
Defines whether this compiler supports the C++14 deprecated attribute.
Definition: gls_cpp_lang_support.h:436
Definition: dynamic_array.h:66
The disti::Group class. Implements groups of objects.
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:471
virtual InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL) DISTI_METHOD_OVERRIDE
Definition: display.h:98
virtual void SetValue(int spec, va_list &args) DISTI_METHOD_OVERRIDE
Vector Blc(void)
Definition: gls_clipping_group.h:139
virtual DisplayObject * CloneObject(bool generateNames=false) DISTI_METHOD_OVERRIDE
Definition: gls_glo_file.h:988
Definition: gls_clipping_group.h:80
bool ShowOutline(void)
Definition: gls_clipping_group.h:155
bool ClippingActive(void)
Definition: gls_clipping_group.h:131
void GetClipRegionCorners(Vector &tlc, Vector &trc, Vector &brc, Vector &blc)
virtual void Draw(void) DISTI_METHOD_OVERRIDE
virtual void CopyProperties(DisplayObject *src) DISTI_METHOD_OVERRIDE
The gls_auto_lib.
Vector Trc(void)
Definition: gls_clipping_group.h:147
Definition: group.h:52
Definition: vertex.h:84
virtual void GetCppInterfaceDescriptionFree(InterfaceListType *array) DISTI_METHOD_OVERRIDE
Definition: bmpimage.h:46
GlsClippingGroup(bool generateInstance=false)
virtual DisplayObject * Pick3D(const Vector &winLoc, const Vector &logicalCoords, float scale, const Vector &directionVector, Vector &collisionWinLoc, const OpenGLMatrices &drawnMatrices) DISTI_METHOD_OVERRIDE