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);
126 virtual GLSGEN_GLSNINEPATCH_EXPORT
void SetValue(
int spec,va_list &args);
127 GLSGEN_GLSNINEPATCH_EXPORT
GlsNinePatch(
bool generateInstance=
false);
130 static GLSGEN_GLSNINEPATCH_EXPORT
DisplayObject* CreateInstance();
140 virtual GLSGEN_GLSNINEPATCH_EXPORT
void Calculate(
double time);
145 virtual GLSGEN_GLSNINEPATCH_EXPORT
void Draw(
void);
175 GLSGEN_GLSNINEPATCH_EXPORT
void TextureEdge(Edge index,
float value);
176 GLSGEN_GLSNINEPATCH_EXPORT
void LeftTextureEdge(
float value) {
TextureEdge( LEFT, value ); }
177 GLSGEN_GLSNINEPATCH_EXPORT
void RightTextureEdge(
float value) {
TextureEdge( RIGHT, value ); }
178 GLSGEN_GLSNINEPATCH_EXPORT
void TopTextureEdge(
float value) {
TextureEdge( TOP, value ); }
179 GLSGEN_GLSNINEPATCH_EXPORT
void BottomTextureEdge(
float value) {
TextureEdge( BOTTOM, value ); }
185 GLSGEN_GLSNINEPATCH_EXPORT
void VertexEdge(Edge index,
float value);
186 GLSGEN_GLSNINEPATCH_EXPORT
void LeftVertexEdge(
float value) {
VertexEdge( LEFT, value ); }
187 GLSGEN_GLSNINEPATCH_EXPORT
void RightVertexEdge(
float value) {
VertexEdge( RIGHT, value ); }
188 GLSGEN_GLSNINEPATCH_EXPORT
void TopVertexEdge(
float value) {
VertexEdge( TOP, value ); }
189 GLSGEN_GLSNINEPATCH_EXPORT
void BottomVertexEdge(
float value) {
VertexEdge( BOTTOM, value ); }
195 virtual GLSGEN_GLSNINEPATCH_EXPORT
float TextureEdge(Edge index);
196 GLSGEN_GLSNINEPATCH_EXPORT
float LeftTextureEdge() {
return TextureEdge( LEFT ); }
197 GLSGEN_GLSNINEPATCH_EXPORT
float RightTextureEdge() {
return TextureEdge( RIGHT ); }
198 GLSGEN_GLSNINEPATCH_EXPORT
float TopTextureEdge() {
return TextureEdge( TOP ); }
199 GLSGEN_GLSNINEPATCH_EXPORT
float BottomTextureEdge() {
return TextureEdge( BOTTOM ); }
205 virtual GLSGEN_GLSNINEPATCH_EXPORT
float VertexEdge(Edge index);
206 GLSGEN_GLSNINEPATCH_EXPORT
float LeftVertexEdge() {
return VertexEdge( LEFT ); }
207 GLSGEN_GLSNINEPATCH_EXPORT
float RightVertexEdge() {
return VertexEdge( RIGHT ); }
208 GLSGEN_GLSNINEPATCH_EXPORT
float TopVertexEdge() {
return VertexEdge( TOP ); }
209 GLSGEN_GLSNINEPATCH_EXPORT
float BottomVertexEdge() {
return VertexEdge( BOTTOM ); }
242 GLSGEN_GLSNINEPATCH_EXPORT
void TextureBLC(
const float x,
const float y );
249 GLSGEN_GLSNINEPATCH_EXPORT
void TextureTRC(
const float x,
const float y );
265 GLSGEN_GLSNINEPATCH_EXPORT
void Height(
const float& value);
269 GLSGEN_GLSNINEPATCH_EXPORT
void Width(
const float& value);
277 GLSGEN_GLSNINEPATCH_EXPORT
float Width(
void)
const {
return _width; }
350 virtual GLS_EXPORT
void SetFromGloData(GlsGloFileAttribute &data);
407 GlsVertexArray _vertArray;
408 GlsIndexArray _indexArray;
virtual void PolygonMode(int mode)
Definition: gls_nine_patch.h:159
float _height
Definition: gls_nine_patch.h:385
unsigned int _referenceTexHeight
Definition: gls_nine_patch.h:412
virtual void SetFillColor(const glsColor &color)
void SetNeedsTextureRecalculate(void)
virtual void CopyProperties(DisplayObject *src)
Vector _textureTRC
Definition: gls_nine_patch.h:383
virtual void GetTransformedExtents(Vector &min, Vector &max, const GlsMatrixType &matrix, bool resetMinMax)
bool _needsRecalculate
Definition: gls_nine_patch.h:399
Definition: dynamic_array.h:63
bool CenterVisible()
Definition: gls_nine_patch.h:214
Vertex _patchVerts[16]
Definition: gls_nine_patch.h:370
virtual glsColor GetFillColor(void)
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:289
void CalculatePatchVerts()
virtual void PreDraw(const OpenGLMatrices ¤t, Culler &culler)
Vector TextureBLC(void) const
Definition: gls_nine_patch.h:255
Vector _normal
Definition: gls_nine_patch.h:381
virtual int PolygonMode(void)
Definition: gls_nine_patch.h:153
Vector _radii[2]
Definition: gls_nine_patch.h:379
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:400
void TextureEdge(Edge index, float value)
const Vector HeightVector(void) const
Definition: gls_nine_patch.h:236
Vector _patchTex[16]
Definition: gls_nine_patch.h:373
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:403
Vector TextureTRC(void) const
Definition: gls_nine_patch.h:260
virtual InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL)
float _vertexEdge[4]
Definition: gls_nine_patch.h:396
unsigned int ReferenceTextureHeight()
float Height(void) const
Definition: gls_nine_patch.h:273
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:382
unsigned int _referenceTexWidth
Definition: gls_nine_patch.h:411
Definition: gls_nine_patch.h:90
bool _centerVisible
Definition: gls_nine_patch.h:398
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:277
Definition: gls_nine_patch.h:101
float _width
Definition: gls_nine_patch.h:384
void CalculateRadiiUnit(void)
glsColor _objectColor
Definition: gls_nine_patch.h:402
virtual void UpdateBoundingVolume(void)
virtual const Vector * GetPatchTex()
bool _guidesVisible
Definition: gls_nine_patch.h:401
virtual const Vertex * GetPatchVerts()
unsigned int _texHeight
Definition: gls_nine_patch.h:404
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:231
Definition: bmpimage.h:46
The disti::GlsDisplayList class.
unsigned int ReferenceTextureWidth()
float _textureEdge[4]
Definition: gls_nine_patch.h:391