40 #ifndef _GLS_NINE_PATCH_H
41 #define _GLS_NINE_PATCH_H
53 #if( defined( GLSGEN_EXPORT_GLSNINEPATCH ) || defined( GLSGEN_IMPORT_GLSNINEPATCH ) || defined( GLS_EXPORT_GENERATED ) || defined( GLS_IMPORT_GENERATED ) ) \
54 && defined( _MSC_VER )
55 # if defined( GLSGEN_EXPORT_GLSNINEPATCH ) || defined( GLS_EXPORT_GENERATED )
56 # define GLSGEN_GLSNINEPATCH_EXPORT __declspec( dllexport )
58 # define GLSGEN_GLSNINEPATCH_EXPORT __declspec( dllimport )
61 # define GLSGEN_GLSNINEPATCH_EXPORT
65 #define LIB_BASE_NAME "gls_nine_patch"
74 GLS_NINE_PATCH_FIRST_VALUE = GLS_LAST_INITIALIZER + 1,
75 GLS_NINE_PATCH_CENTER_VISIBLE,
77 GLS_NINE_PATCH_TEXTURE_EDGES,
79 GLS_NINE_PATCH_TEXTURE_POINTS,
81 GLS_NINE_PATCH_REFERENCE_TEXTURE_WIDTH_HEIGHT
84 #define GLS_NINE_PATCH_ARRAY_SIZE 16
89 friend class GlsNinePatchEditor;
96 DISTI_DEPRECATED(
"This identifier is forbidden by the C++ standard. Use BaseClass instead." )
113 virtual GLSGEN_GLSNINEPATCH_EXPORT
void Scale(
float px,
float py,
float pz,
Vertex* anchor,
int handleBar ) DISTI_METHOD_OVERRIDE;
114 virtual GLSGEN_GLSNINEPATCH_EXPORT
void Rotate(
const Vector& orig,
float angle,
const Vector& axis ) DISTI_METHOD_OVERRIDE;
115 virtual GLSGEN_GLSNINEPATCH_EXPORT
bool Hit(
float x,
float y,
float z,
float scale,
const Vector& directionVector,
Vector* collisionPoint ) DISTI_METHOD_OVERRIDE;
116 virtual GLSGEN_GLSNINEPATCH_EXPORT
Vertex*
Vertices() DISTI_METHOD_OVERRIDE;
117 virtual GLSGEN_GLSNINEPATCH_EXPORT
void GetExtents(
float& minx,
float& miny,
float& minz,
float& maxx,
float& maxy,
float& maxz ) DISTI_METHOD_OVERRIDE;
122 virtual GLSGEN_GLSNINEPATCH_EXPORT
void SetValue(
int spec, va_list& args ) DISTI_METHOD_OVERRIDE;
123 GLSGEN_GLSNINEPATCH_EXPORT
GlsNinePatch(
bool generateInstance = false );
126 static GLSGEN_GLSNINEPATCH_EXPORT
DisplayObject* CreateInstance();
127 virtual GLSGEN_GLSNINEPATCH_EXPORT
void SetAvailableAttributes(
unsigned int value ) DISTI_METHOD_OVERRIDE;
136 virtual GLSGEN_GLSNINEPATCH_EXPORT
void Calculate(
double time ) DISTI_METHOD_OVERRIDE;
141 virtual GLSGEN_GLSNINEPATCH_EXPORT
void Draw(
void ) DISTI_METHOD_OVERRIDE;
142 virtual GLSGEN_GLSNINEPATCH_EXPORT
void SetFillColor( const
GlsColor& color ) DISTI_METHOD_OVERRIDE;
155 virtual GLSGEN_GLSNINEPATCH_EXPORT
void PolygonMode(
int mode ) DISTI_METHOD_OVERRIDE {}
173 GLSGEN_GLSNINEPATCH_EXPORT
void TextureEdge(
Edge index,
float value );
174 GLSGEN_GLSNINEPATCH_EXPORT
void LeftTextureEdge(
float value ) {
TextureEdge( LEFT, value ); }
175 GLSGEN_GLSNINEPATCH_EXPORT
void RightTextureEdge(
float value ) {
TextureEdge( RIGHT, value ); }
176 GLSGEN_GLSNINEPATCH_EXPORT
void TopTextureEdge(
float value ) {
TextureEdge( TOP, value ); }
177 GLSGEN_GLSNINEPATCH_EXPORT
void BottomTextureEdge(
float value ) {
TextureEdge( BOTTOM, value ); }
183 GLSGEN_GLSNINEPATCH_EXPORT
void VertexEdge(
Edge index,
float value );
184 GLSGEN_GLSNINEPATCH_EXPORT
void LeftVertexEdge(
float value ) {
VertexEdge( LEFT, value ); }
185 GLSGEN_GLSNINEPATCH_EXPORT
void RightVertexEdge(
float value ) {
VertexEdge( RIGHT, value ); }
186 GLSGEN_GLSNINEPATCH_EXPORT
void TopVertexEdge(
float value ) {
VertexEdge( TOP, value ); }
187 GLSGEN_GLSNINEPATCH_EXPORT
void BottomVertexEdge(
float value ) {
VertexEdge( BOTTOM, value ); }
194 GLSGEN_GLSNINEPATCH_EXPORT
float LeftTextureEdge() {
return TextureEdge( LEFT ); }
195 GLSGEN_GLSNINEPATCH_EXPORT
float RightTextureEdge() {
return TextureEdge( RIGHT ); }
196 GLSGEN_GLSNINEPATCH_EXPORT
float TopTextureEdge() {
return TextureEdge( TOP ); }
197 GLSGEN_GLSNINEPATCH_EXPORT
float BottomTextureEdge() {
return TextureEdge( BOTTOM ); }
203 virtual GLSGEN_GLSNINEPATCH_EXPORT
float VertexEdge(
Edge index );
204 GLSGEN_GLSNINEPATCH_EXPORT
float LeftVertexEdge() {
return VertexEdge( LEFT ); }
205 GLSGEN_GLSNINEPATCH_EXPORT
float RightVertexEdge() {
return VertexEdge( RIGHT ); }
206 GLSGEN_GLSNINEPATCH_EXPORT
float TopVertexEdge() {
return VertexEdge( TOP ); }
207 GLSGEN_GLSNINEPATCH_EXPORT
float BottomVertexEdge() {
return VertexEdge( BOTTOM ); }
240 GLSGEN_GLSNINEPATCH_EXPORT
void TextureBLC(
const float x,
const float y );
247 GLSGEN_GLSNINEPATCH_EXPORT
void TextureTRC(
const float x,
const float y );
263 GLSGEN_GLSNINEPATCH_EXPORT
void Height(
const float& value );
267 GLSGEN_GLSNINEPATCH_EXPORT
void Width(
const float& value );
275 GLSGEN_GLSNINEPATCH_EXPORT
float Width(
void )
const {
return _width; }
float _height
Definition: gls_nine_patch.h:382
unsigned int _referenceTexHeight
Definition: gls_nine_patch.h:409
virtual void SetValue(int spec, va_list &args) DISTI_METHOD_OVERRIDE
virtual void GetTransformedExtents(Vector &min, Vector &max, const GlsMatrixType &matrix, bool resetMinMax) DISTI_METHOD_OVERRIDE
void SetNeedsTextureRecalculate(void)
#define DISTI_DEPRECATED(msg)
Defines whether this compiler supports the C++14 deprecated attribute.
Definition: gls_cpp_lang_support.h:436
virtual void Calculate(double time) DISTI_METHOD_OVERRIDE
Edge
Definition: gls_nine_patch.h:158
Vector _textureTRC
Definition: gls_nine_patch.h:380
bool _needsRecalculate
Definition: gls_nine_patch.h:396
Definition: dynamic_array.h:66
bool CenterVisible()
Definition: gls_nine_patch.h:212
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:473
void CalculatePatchVerts()
virtual void PreDraw(const OpenGLMatrices ¤t, Culler &culler)
Vector TextureBLC(void) const
Definition: gls_nine_patch.h:253
Vector _normal
Definition: gls_nine_patch.h:378
Vector _radii[2]
Definition: gls_nine_patch.h:376
The Polygon class. Implements Polygons.
Definition: glpolygon.h:55
bool _needsTextureRecalculate
Definition: gls_nine_patch.h:397
virtual GlsColor GetFillColor(void) DISTI_METHOD_OVERRIDE
virtual void PolygonMode(int mode) DISTI_METHOD_OVERRIDE
Definition: gls_nine_patch.h:155
virtual void CopyGeometry(DisplayObject *srcArg) DISTI_METHOD_OVERRIDE
void TextureEdge(Edge index, float value)
const Vector HeightVector(void) const
Definition: gls_nine_patch.h:234
virtual void Draw(void) DISTI_METHOD_OVERRIDE
The disti::GLPolygon class. Implements Polygons.
virtual void Rotate(const Vector &orig, float angle, const Vector &axis) DISTI_METHOD_OVERRIDE
unsigned int _texWidth
Definition: gls_nine_patch.h:400
Vector TextureTRC(void) const
Definition: gls_nine_patch.h:258
float _vertexEdge[4]
Definition: gls_nine_patch.h:393
unsigned int ReferenceTextureHeight()
float Height(void) const
Definition: gls_nine_patch.h:271
Definition: gls_glo_file.h:988
void CalculateTextureResize(const int tw, const int th)
virtual void SetAvailableAttributes(unsigned int value) DISTI_METHOD_OVERRIDE
virtual bool Hit(float x, float y, float z, float scale, const Vector &directionVector, Vector *collisionPoint) DISTI_METHOD_OVERRIDE
virtual void UpdateBoundingVolume(void) DISTI_METHOD_OVERRIDE
void DrawPatches(bool texture)
void VertexEdge(Edge index, float value)
void CalculateTextureVerts()
VertexNoColor Vector
Definition: gls_font_base.h:66
Vector _textureBLC
Definition: gls_nine_patch.h:379
Definition: gls_vertex_array.h:58
unsigned int _referenceTexWidth
Definition: gls_nine_patch.h:408
Definition: gls_nine_patch.h:87
bool _centerVisible
Definition: gls_nine_patch.h:395
Definition: gls_color.h:53
GlsColor _objectColor
Definition: gls_nine_patch.h:399
virtual DisplayObject * CloneObject(bool generateNames=false) DISTI_METHOD_OVERRIDE
Vector _patchTex[16]
Definition: gls_nine_patch.h:370
virtual void GetCppInterfaceDescriptionFree(InterfaceListType *array) DISTI_METHOD_OVERRIDE
void SetNeedsRecalculate(void)
float Width(void) const
Definition: gls_nine_patch.h:275
Definition: gls_nine_patch.h:100
float _width
Definition: gls_nine_patch.h:381
void CalculateRadiiUnit(void)
virtual void CopyProperties(DisplayObject *src) DISTI_METHOD_OVERRIDE
virtual const Vector * GetPatchTex()
bool _guidesVisible
Definition: gls_nine_patch.h:398
virtual const Vertex * GetPatchVerts()
virtual int PolygonMode(void) DISTI_METHOD_OVERRIDE
Definition: gls_nine_patch.h:149
An object for managing vertices, texture coordinates, colors and normals for GLPolygon and other disp...
unsigned int _texHeight
Definition: gls_nine_patch.h:401
Definition: display_types.h:87
virtual Vertex * Vertices() DISTI_METHOD_OVERRIDE
Definition: gls_index_array.h:52
Macros and helper code to determine what subset of C++11/14/17 is available.
Vertex _patchVerts[16]
Definition: gls_nine_patch.h:367
The disti::GlsIndexArray class, for managing index buffers.
const Vector WidthVector(void) const
Definition: gls_nine_patch.h:229
virtual void GetExtents(float &minx, float &miny, float &minz, float &maxx, float &maxy, float &maxz) DISTI_METHOD_OVERRIDE
Definition: bmpimage.h:46
virtual void Scale(float px, float py, float pz, Vertex *anchor, int handleBar) DISTI_METHOD_OVERRIDE
virtual InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL) DISTI_METHOD_OVERRIDE
The disti::GlsDisplayList class.
virtual void SetFillColor(const GlsColor &color) DISTI_METHOD_OVERRIDE
unsigned int ReferenceTextureWidth()
float _textureEdge[4]
Definition: gls_nine_patch.h:388