| 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/// Automatically link the runtime library plugin (on Windows).
60#define LIB_BASE_NAME "gls_clipping_group"
61#include "gls_auto_lib.h"
62#undef LIB_BASE_NAME
63
64 namespace disti
65{
66#ifdef GLES
67 class GlsGloFile;
68#endif
69
70// SetValue enumerations
71 enum
72{
73 GLS_CLIPPING_GROUP_STATE = GLS_LAST_INITIALIZER + 1,
74 GLS_CLIPPING_GROUP_CLIPPING_ACTIVE,
75 GLS_CLIPPING_GROUP_BOTTOM_LEFT_CORNER,
76 GLS_CLIPPING_GROUP_TOP_RIGHT_CORNER,
77 GLS_CLIPPING_GROUP_SHOW_OUTLINE
78};
79
80/** Runtime implementation of a GlsClippingGroup */
81 class GlsClippingGroup : public Group
82{
83 public:
84 friend class GlsClippingGroupEditor;
85 DISTI_DEPRECATED( "This identifier is forbidden by the C++ standard. Use BaseClass instead." )
86 typedef Group _BaseClass; ///< Deprecated typedef for the base class.
87 typedef Group BaseClass; ///< Typedef for the base class.
88
89 /** Construct a new GlsClippingGroup.
90 * \param generateInstance Whether or not to generate an instance name for this clipping group
91 */
92 GLSGEN_GLSCLIPPINGGROUP_EXPORT explicit GlsClippingGroup( bool generateInstance = false );
93
94 /** Copy an existing clipping group's properties and clone its children to construct a new clipping group.
95 * \param clippingGroup The clipping group whose properties to copy and whose children to clone.
96 * \param generateInstance Whether or not to generate an instance name for this clipping group
97 */
98 GLSGEN_GLSCLIPPINGGROUP_EXPORT GlsClippingGroup( const GlsClippingGroup& clippingGroup, bool generateInstance );
99
100 /** Destructs a GlsClippingGroup object */
101 virtual GLSGEN_GLSCLIPPINGGROUP_EXPORT ~GlsClippingGroup();
102
103 /// \return A pointer to a new GlsClippingGroup object.
104 static GLSGEN_GLSCLIPPINGGROUP_EXPORT DisplayObject* CreateInstance();
105
106 virtual GLSGEN_GLSCLIPPINGGROUP_EXPORT void SetAvailableAttributes( unsigned int value ) DISTI_METHOD_OVERRIDE;
107 virtual GLSGEN_GLSCLIPPINGGROUP_EXPORT DisplayObject* CloneObject( bool generateNames = false ) DISTI_METHOD_OVERRIDE;
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() 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() { 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() { 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() { 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() { 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
disti::DisplayObject
Definition: display.h:96
disti::DynamicArray
Definition: dynamic_array.h:79
disti::GlsClippingGroup
Definition: gls_clipping_group.h:82
disti::GlsClippingGroup::SetAvailableAttributes
virtual void SetAvailableAttributes(unsigned int value) DISTI_METHOD_OVERRIDE
disti::GlsClippingGroup::Draw
virtual void Draw() DISTI_METHOD_OVERRIDE
disti::GlsClippingGroup::GetClipRegionCorners
void GetClipRegionCorners(Vector &tlc, Vector &trc, Vector &brc, Vector &blc)
disti::GlsClippingGroup::_showOutline
bool _showOutline
Outline always visible in editor.
Definition: gls_clipping_group.h:181
disti::GlsClippingGroup::CloneObject
virtual DisplayObject * CloneObject(bool generateNames=false) DISTI_METHOD_OVERRIDE
disti::GlsClippingGroup::SetFromGloData
virtual void SetFromGloData(GlsGloFileAttribute &data) DISTI_METHOD_OVERRIDE
disti::GlsClippingGroup::SetValue
virtual void SetValue(int spec, va_list &args) DISTI_METHOD_OVERRIDE
disti::GlsClippingGroup::Blc
void Blc(const Vector &value)
disti::GlsClippingGroup::Blc
Vector Blc()
Definition: gls_clipping_group.h:139
disti::GlsClippingGroup::Trc
Vector Trc()
Definition: gls_clipping_group.h:147
disti::GlsClippingGroup::_blc
Vector _blc
Bottom Left Corner.
Definition: gls_clipping_group.h:179
disti::GlsClippingGroup::CreateInstance
static DisplayObject * CreateInstance()
disti::GlsClippingGroup::_clippingActive
bool _clippingActive
Whether or not to call clipping is active.
Definition: gls_clipping_group.h:178
disti::GlsClippingGroup::ClippingActive
bool ClippingActive()
Definition: gls_clipping_group.h:131
disti::GlsClippingGroup::ShowOutline
bool ShowOutline()
Definition: gls_clipping_group.h:155
disti::GlsClippingGroup::Pick3D
virtual DisplayObject * Pick3D(const Vector &winLoc, const Vector &logicalCoords, float scale, const Vector &directionVector, Vector &collisionWinLoc, const OpenGLMatrices &drawnMatrices) DISTI_METHOD_OVERRIDE
disti::GlsClippingGroup::ClippingActive
void ClippingActive(bool value)
disti::GlsClippingGroup::CopyProperties
virtual void CopyProperties(DisplayObject *src) DISTI_METHOD_OVERRIDE
disti::GlsClippingGroup::ShowOutline
void ShowOutline(bool value)
disti::GlsClippingGroup::Trc
void Trc(const Vector &value)
disti::GlsClippingGroup::_trc
Vector _trc
Top Right Corner.
Definition: gls_clipping_group.h:180
disti::GlsGloFileAttribute
Definition: gls_glo_file.h:1243
disti::Group
Definition: group.h:53
disti::OpenGLMatrices
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:544
disti::VertexNoColor
Definition: vertex.h:85
gls_auto_lib.h
The gls_auto_lib.
GLSGEN_GLSCLIPPINGGROUP_EXPORT
#define GLSGEN_GLSCLIPPINGGROUP_EXPORT
Provides support for creating DLLs.
Definition: gls_clipping_group.h:55
DISTI_DEPRECATED
#define DISTI_DEPRECATED(msg)
Defines whether this compiler supports the C++14 deprecated attribute.
Definition: gls_cpp_lang_support.h:488
DISTI_METHOD_OVERRIDE
#define DISTI_METHOD_OVERRIDE
Macro to wrap the override keyword, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:222
group.h
The disti::Group class. Implements groups of objects.
disti
Definition: bmpimage.h:47