40 #ifndef _GLS_NINE_PATCH_H
41 #define _GLS_NINE_PATCH_H
46 #include "gls_vertex_array.h"
47 #include "gls_index_array.h"
53 #if (defined(GLSGEN_EXPORT_GLSNINEPATCH) || \
54 defined(GLSGEN_IMPORT_GLSNINEPATCH) || \
55 defined(GLS_EXPORT_GENERATED) || \
56 defined(GLS_IMPORT_GENERATED)) \
58 # if defined(GLSGEN_EXPORT_GLSNINEPATCH) || defined(GLS_EXPORT_GENERATED)
59 # define GLSGEN_GLSNINEPATCH_EXPORT __declspec(dllexport)
61 # define GLSGEN_GLSNINEPATCH_EXPORT __declspec(dllimport)
64 # define GLSGEN_GLSNINEPATCH_EXPORT
68 #define LIB_BASE_NAME "gls_nine_patch"
77 GLS_NINE_PATCH_FIRST_VALUE = GLS_LAST_INITIALIZER+1,
78 GLS_NINE_PATCH_CENTER_VISIBLE,
80 GLS_NINE_PATCH_TEXTURE_EDGES,
82 GLS_NINE_PATCH_TEXTURE_POINTS,
84 GLS_NINE_PATCH_REFERENCE_TEXTURE_WIDTH_HEIGHT
87 #define GLS_NINE_PATCH_ARRAY_SIZE 16
92 friend class GlsNinePatchEditor;
115 virtual GLSGEN_GLSNINEPATCH_EXPORT
void Scale(
float px,
float py,
float pz,
Vertex *anchor,
int handleBar);
116 virtual GLSGEN_GLSNINEPATCH_EXPORT
void Rotate(
const Vector &orig,
float angle,
const Vector &axis);
117 virtual GLSGEN_GLSNINEPATCH_EXPORT
bool Hit(
float x,
float y,
float z,
float scale,
const Vector& directionVector,
Vector *collisionPoint);
119 virtual GLSGEN_GLSNINEPATCH_EXPORT
void GetExtents(
float &minx,
float &miny,
float &minz,
float &maxx,
float &maxy,
float &maxz);
124 virtual GLSGEN_GLSNINEPATCH_EXPORT
void SetValue(
int spec,va_list &args);
125 GLSGEN_GLSNINEPATCH_EXPORT
GlsNinePatch(
bool generateInstance=
false);
128 static GLSGEN_GLSNINEPATCH_EXPORT
DisplayObject* CreateInstance();
138 virtual GLSGEN_GLSNINEPATCH_EXPORT
void Calculate(
double time);
143 virtual GLSGEN_GLSNINEPATCH_EXPORT
void Draw(
void);
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 ); }
193 virtual GLSGEN_GLSNINEPATCH_EXPORT
float TextureEdge(Edge index);
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; }
348 virtual GLS_EXPORT
void SetFromGloData(GlsGloFileAttribute &data);
405 GlsVertexArray _vertArray;
406 GlsIndexArray _indexArray;
virtual void PolygonMode(int mode)
Definition: gls_nine_patch.h:157
float _height
Definition: gls_nine_patch.h:383
unsigned int _referenceTexHeight
Definition: gls_nine_patch.h:410
virtual void SetFillColor(const glsColor &color)
void SetNeedsTextureRecalculate(void)
virtual void CopyProperties(DisplayObject *src)
Vector _textureTRC
Definition: gls_nine_patch.h:381
virtual void GetTransformedExtents(Vector &min, Vector &max, const GlsMatrixType &matrix, bool resetMinMax)
bool _needsRecalculate
Definition: gls_nine_patch.h:397
Definition: dynamic_array.h:63
bool CenterVisible()
Definition: gls_nine_patch.h:212
Vertex _patchVerts[16]
Definition: gls_nine_patch.h:368
virtual glsColor GetFillColor(void)
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:281
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:379
virtual int PolygonMode(void)
Definition: gls_nine_patch.h:151
Vector _radii[2]
Definition: gls_nine_patch.h:377
The Polygon class. Implements Polygons.
Definition: glpolygon.h:56
virtual void Scale(float px, float py, float pz, Vertex *anchor, int handleBar)
bool _needsTextureRecalculate
Definition: gls_nine_patch.h:398
void TextureEdge(Edge index, float value)
const Vector HeightVector(void) const
Definition: gls_nine_patch.h:234
Vector _patchTex[16]
Definition: gls_nine_patch.h:371
virtual void GetExtents(float &minx, float &miny, float &minz, float &maxx, float &maxy, float &maxz)
virtual void GetCppInterfaceDescriptionFree(InterfaceListType *array)
The disti::GLPolygon class. Implements Polygons.
virtual void CopyGeometry(DisplayObject *srcArg)
unsigned int _texWidth
Definition: gls_nine_patch.h:401
Vector TextureTRC(void) const
Definition: gls_nine_patch.h:258
virtual InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL)
float _vertexEdge[4]
Definition: gls_nine_patch.h:394
unsigned int ReferenceTextureHeight()
float Height(void) const
Definition: gls_nine_patch.h:271
void CalculateTextureResize(const int tw, const int th)
virtual void Calculate(double time)
void DrawPatches(bool texture)
void VertexEdge(Edge index, float value)
void CalculateTextureVerts()
VertexNoColor Vector
Definition: gls_font_base.h:68
virtual DisplayObject * CloneObject(bool generateNames=false)
virtual void SetAvailableAttributes(unsigned int value)
Vector _textureBLC
Definition: gls_nine_patch.h:380
unsigned int _referenceTexWidth
Definition: gls_nine_patch.h:409
Definition: gls_nine_patch.h:90
bool _centerVisible
Definition: gls_nine_patch.h:396
virtual Vertex * Vertices()
void SetNeedsRecalculate(void)
Definition: gls_color.h:54
virtual void SetValue(int spec, va_list &args)
float Width(void) const
Definition: gls_nine_patch.h:275
Definition: gls_nine_patch.h:101
float _width
Definition: gls_nine_patch.h:382
void CalculateRadiiUnit(void)
glsColor _objectColor
Definition: gls_nine_patch.h:400
virtual void UpdateBoundingVolume(void)
virtual const Vector * GetPatchTex()
bool _guidesVisible
Definition: gls_nine_patch.h:399
virtual const Vertex * GetPatchVerts()
unsigned int _texHeight
Definition: gls_nine_patch.h:402
Definition: display_types.h:94
virtual bool Hit(float x, float y, float z, float scale, const Vector &directionVector, Vector *collisionPoint)
virtual void Rotate(const Vector &orig, float angle, const Vector &axis)
Macros and helper code to determine what subset of C++11/14/17 is available.
const Vector WidthVector(void) const
Definition: gls_nine_patch.h:229
Definition: bmpimage.h:46
The disti::GlsDisplayList class.
unsigned int ReferenceTextureWidth()
float _textureEdge[4]
Definition: gls_nine_patch.h:389