GL Studio 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) 2015 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) || \
48  defined(GLSGEN_IMPORT_GLSCLIPPINGGROUP) || \
49  defined(GLS_EXPORT_GENERATED) || \
50  defined(GLS_IMPORT_GENERATED)) \
51  && defined(_MSC_VER)
52 # if defined(GLSGEN_EXPORT_GLSCLIPPINGGROUP) || defined(GLS_EXPORT_GENERATED)
53 # define GLSGEN_GLSCLIPPINGGROUP_EXPORT __declspec(dllexport)
54 # else
55 # define GLSGEN_GLSCLIPPINGGROUP_EXPORT __declspec(dllimport)
56 # endif
57 #else
58 # define GLSGEN_GLSCLIPPINGGROUP_EXPORT
59 #endif
60 ///////////////////////////////////////////////////////////////////////////////
61 
62 #define LIB_BASE_NAME "gls_clipping_group"
63 #include "gls_auto_lib.h"
64 #undef LIB_BASE_NAME
65 
66 namespace disti
67 {
68 
69 #ifdef GLES
70 class GlsGloFile;
71 #endif
72 
73 // SetValue enumerations
74 enum {
75  GLS_CLIPPING_GROUP_STATE = GLS_LAST_INITIALIZER+1,
76  GLS_CLIPPING_GROUP_CLIPPING_ACTIVE,
77  GLS_CLIPPING_GROUP_BOTTOM_LEFT_CORNER,
78  GLS_CLIPPING_GROUP_TOP_RIGHT_CORNER,
79  GLS_CLIPPING_GROUP_SHOW_OUTLINE
80 };
81 
82 /** Runtime implementation of a GlsClippingGroup */
83 class GlsClippingGroup : public Group
84 {
85 public:
86 
87  friend class GlsClippingGroupEditor;
88  typedef Group _BaseClass;
89 
90  /** Construct a new GlsClippingGroup.
91  * \param generateInstance Whether or not to generate an instance name for this clipping group
92  */
93  GLSGEN_GLSCLIPPINGGROUP_EXPORT explicit GlsClippingGroup(bool generateInstance=false);
94 
95  /** Copy an existing clipping group's properties and clone its children to construct a new clipping group.
96  * \param clippingGroup The clipping group whose properties to copy and whose children to clone.
97  * \param generateInstance Whether or not to generate an instance name for this clipping group
98  */
99  GLSGEN_GLSCLIPPINGGROUP_EXPORT GlsClippingGroup( const GlsClippingGroup& clippingGroup, bool generateInstance );
100 
101  /** Destructs a GlsClippingGroup object */
102  virtual GLSGEN_GLSCLIPPINGGROUP_EXPORT ~GlsClippingGroup();
103 
104  static GLSGEN_GLSCLIPPINGGROUP_EXPORT DisplayObject* CreateInstance();
105 
106  virtual GLSGEN_GLSCLIPPINGGROUP_EXPORT void SetAvailableAttributes(unsigned int value);
107 
108  virtual GLSGEN_GLSCLIPPINGGROUP_EXPORT DisplayObject* CloneObject(bool generateNames = false);
109 
110  virtual GLSGEN_GLSCLIPPINGGROUP_EXPORT void CopyProperties(DisplayObject *src);
111 
112 #ifndef GLES
113  virtual GLSGEN_GLSCLIPPINGGROUP_EXPORT InterfaceListType* GetCppInterfaceDescription(InterfaceListType* addToThisList= NULL );
114  virtual GLSGEN_GLSCLIPPINGGROUP_EXPORT void GetCppInterfaceDescriptionFree(InterfaceListType* array);
115 #endif
116 
117  virtual GLSGEN_GLSCLIPPINGGROUP_EXPORT void Draw(void);
118 
119  virtual GLSGEN_GLSCLIPPINGGROUP_EXPORT DisplayObject* Pick3D(const Vector& winLoc,
120  const Vector& logicalCoords,
121  float scale,
122  const Vector& directionVector,
123  Vector& collisionWinLoc /*Returned*/,
124  const OpenGLMatrices& drawnMatrices);
125 
126  virtual GLSGEN_GLSCLIPPINGGROUP_EXPORT void SetValue(int spec,va_list &args);
127 
128  //////////////////////////////////////////////////
129  // GlsClippingGroup specific operations
130  //////////////////////////////////////////////////
131 
132  /** \return If clipping is active for this group */
133  GLSGEN_GLSCLIPPINGGROUP_EXPORT bool ClippingActive(void) { return _clippingActive; }
134 
135  /** Sets if clipping is active for this group
136  * \param value The new clipping value
137  */
138  GLSGEN_GLSCLIPPINGGROUP_EXPORT void ClippingActive(bool value);
139 
140  /** \return Gets bottom left corner of clip region */
141  GLSGEN_GLSCLIPPINGGROUP_EXPORT Vector Blc(void) { return _blc; }
142 
143  /** Sets new bottom left corner for the clip region
144  * \param value The new blc
145  */
146  GLSGEN_GLSCLIPPINGGROUP_EXPORT void Blc(const Vector &value);
147 
148  /** \return Gets top right corner of clip region */
149  GLSGEN_GLSCLIPPINGGROUP_EXPORT Vector Trc(void) { return _trc; }
150 
151  /** Sets new top right corner for the clip region
152  * \param value The new trc
153  */
154  GLSGEN_GLSCLIPPINGGROUP_EXPORT void Trc(const Vector &value);
155 
156  /** \return If clip region should always be drawn in the editor */
157  GLSGEN_GLSCLIPPINGGROUP_EXPORT bool ShowOutline(void) { return _showOutline; }
158 
159  /** Sets if clip region should always be drawn in the editor
160  * \param value The new show value
161  */
162  GLSGEN_GLSCLIPPINGGROUP_EXPORT void ShowOutline(bool value);
163 
164 protected:
165  /** Get the four corners of the clip region transformed by the current DCS and offset by the group's location
166  * \param tlc [out] receives top left corner
167  * \param trc [out] receives top right corner
168  * \param brc [out] receives bottom right corner
169  * \param blc [out] receives bottom left corner
170  */
171  GLSGEN_GLSCLIPPINGGROUP_EXPORT void GetClipRegionCorners( Vector &tlc, Vector &trc, Vector &brc, Vector &blc );
172 
173 #ifdef GLES
174  /** Set a single attribute from the GLO file.
175  * \param data The attribute to set and its associated data.
176  */
177  virtual void SetFromGloData(GlsGloFileAttribute &data);
178 #endif
179 
180  bool _clippingActive; /*< Whether or not to call clipping is active */
181  Vector _blc; /*< Bottom Left Corner */
182  Vector _trc; /*< Top Right Corner */
183  bool _showOutline; /*< Outline always visible in editor */
184 
185 private:
186  // Deleted copy assignment; use CloneObject() or the copy constructor instead.
187  void operator=( const GlsClippingGroup& ); // = delete
188 };
189 
190 } // namespace disti
191 
192 #endif
193 
virtual DisplayObject * CloneObject(bool generateNames=false)
Definition: dynamic_array.h:63
The disti::Group class. Implements groups of objects.
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:289
virtual void SetValue(int spec, va_list &args)
virtual void SetAvailableAttributes(unsigned int value)
Definition: display.h:98
Vector Blc(void)
Definition: gls_clipping_group.h:141
Definition: gls_clipping_group.h:83
bool ShowOutline(void)
Definition: gls_clipping_group.h:157
bool ClippingActive(void)
Definition: gls_clipping_group.h:133
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:149
Definition: group.h:53
virtual DisplayObject * Pick3D(const Vector &winLoc, const Vector &logicalCoords, float scale, const Vector &directionVector, Vector &collisionWinLoc, const OpenGLMatrices &drawnMatrices)
Definition: vertex.h:84
virtual void Draw(void)
Definition: bmpimage.h:46
GlsClippingGroup(bool generateInstance=false)
virtual InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL)