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;
111 virtual GLSGEN_GLSNINEPATCH_EXPORT
void Scale(
float px,
float py,
float pz,
Vertex* anchor,
int handleBar );
112 virtual GLSGEN_GLSNINEPATCH_EXPORT
void Rotate(
const Vector& orig,
float angle,
const Vector& axis );
113 virtual GLSGEN_GLSNINEPATCH_EXPORT
bool Hit(
float x,
float y,
float z,
float scale,
const Vector& directionVector,
Vector* collisionPoint );
115 virtual GLSGEN_GLSNINEPATCH_EXPORT
void GetExtents(
float& minx,
float& miny,
float& minz,
float& maxx,
float& maxy,
float& maxz );
120 virtual GLSGEN_GLSNINEPATCH_EXPORT
void SetValue(
int spec, va_list& args );
121 GLSGEN_GLSNINEPATCH_EXPORT
GlsNinePatch(
bool generateInstance =
false );
124 static GLSGEN_GLSNINEPATCH_EXPORT
DisplayObject* CreateInstance();
134 virtual GLSGEN_GLSNINEPATCH_EXPORT
void Calculate(
double time );
139 virtual GLSGEN_GLSNINEPATCH_EXPORT
void Draw(
void );
153 virtual GLSGEN_GLSNINEPATCH_EXPORT
void PolygonMode(
int mode ) {}
169 GLSGEN_GLSNINEPATCH_EXPORT
void TextureEdge( Edge index,
float value );
170 GLSGEN_GLSNINEPATCH_EXPORT
void LeftTextureEdge(
float value ) {
TextureEdge( LEFT, value ); }
171 GLSGEN_GLSNINEPATCH_EXPORT
void RightTextureEdge(
float value ) {
TextureEdge( RIGHT, value ); }
172 GLSGEN_GLSNINEPATCH_EXPORT
void TopTextureEdge(
float value ) {
TextureEdge( TOP, value ); }
173 GLSGEN_GLSNINEPATCH_EXPORT
void BottomTextureEdge(
float value ) {
TextureEdge( BOTTOM, value ); }
179 GLSGEN_GLSNINEPATCH_EXPORT
void VertexEdge( Edge index,
float value );
180 GLSGEN_GLSNINEPATCH_EXPORT
void LeftVertexEdge(
float value ) {
VertexEdge( LEFT, value ); }
181 GLSGEN_GLSNINEPATCH_EXPORT
void RightVertexEdge(
float value ) {
VertexEdge( RIGHT, value ); }
182 GLSGEN_GLSNINEPATCH_EXPORT
void TopVertexEdge(
float value ) {
VertexEdge( TOP, value ); }
183 GLSGEN_GLSNINEPATCH_EXPORT
void BottomVertexEdge(
float value ) {
VertexEdge( BOTTOM, value ); }
189 virtual GLSGEN_GLSNINEPATCH_EXPORT
float TextureEdge( Edge index );
190 GLSGEN_GLSNINEPATCH_EXPORT
float LeftTextureEdge() {
return TextureEdge( LEFT ); }
191 GLSGEN_GLSNINEPATCH_EXPORT
float RightTextureEdge() {
return TextureEdge( RIGHT ); }
192 GLSGEN_GLSNINEPATCH_EXPORT
float TopTextureEdge() {
return TextureEdge( TOP ); }
193 GLSGEN_GLSNINEPATCH_EXPORT
float BottomTextureEdge() {
return TextureEdge( BOTTOM ); }
199 virtual GLSGEN_GLSNINEPATCH_EXPORT
float VertexEdge( Edge index );
200 GLSGEN_GLSNINEPATCH_EXPORT
float LeftVertexEdge() {
return VertexEdge( LEFT ); }
201 GLSGEN_GLSNINEPATCH_EXPORT
float RightVertexEdge() {
return VertexEdge( RIGHT ); }
202 GLSGEN_GLSNINEPATCH_EXPORT
float TopVertexEdge() {
return VertexEdge( TOP ); }
203 GLSGEN_GLSNINEPATCH_EXPORT
float BottomVertexEdge() {
return VertexEdge( BOTTOM ); }
236 GLSGEN_GLSNINEPATCH_EXPORT
void TextureBLC(
const float x,
const float y );
243 GLSGEN_GLSNINEPATCH_EXPORT
void TextureTRC(
const float x,
const float y );
259 GLSGEN_GLSNINEPATCH_EXPORT
void Height(
const float& value );
263 GLSGEN_GLSNINEPATCH_EXPORT
void Width(
const float& value );
271 GLSGEN_GLSNINEPATCH_EXPORT
float Width(
void )
const {
return _width; }
virtual void PolygonMode(int mode)
Definition: gls_nine_patch.h:153
float _height
Definition: gls_nine_patch.h:378
unsigned int _referenceTexHeight
Definition: gls_nine_patch.h:405
void SetNeedsTextureRecalculate(void)
virtual void CopyProperties(DisplayObject *src)
Vector _textureTRC
Definition: gls_nine_patch.h:376
virtual void GetTransformedExtents(Vector &min, Vector &max, const GlsMatrixType &matrix, bool resetMinMax)
bool _needsRecalculate
Definition: gls_nine_patch.h:392
Definition: dynamic_array.h:62
bool CenterVisible()
Definition: gls_nine_patch.h:208
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:276
void CalculatePatchVerts()
virtual void PreDraw(const OpenGLMatrices ¤t, Culler &culler)
Vector TextureBLC(void) const
Definition: gls_nine_patch.h:249
Vector _normal
Definition: gls_nine_patch.h:374
virtual int PolygonMode(void)
Definition: gls_nine_patch.h:147
Vector _radii[2]
Definition: gls_nine_patch.h:372
The Polygon class. Implements Polygons.
Definition: glpolygon.h:55
virtual void Scale(float px, float py, float pz, Vertex *anchor, int handleBar)
bool _needsTextureRecalculate
Definition: gls_nine_patch.h:393
void TextureEdge(Edge index, float value)
const Vector HeightVector(void) const
Definition: gls_nine_patch.h:230
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:396
Vector TextureTRC(void) const
Definition: gls_nine_patch.h:254
virtual InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL)
float _vertexEdge[4]
Definition: gls_nine_patch.h:389
unsigned int ReferenceTextureHeight()
float Height(void) const
Definition: gls_nine_patch.h:267
Definition: gls_glo_file.h:982
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:66
virtual DisplayObject * CloneObject(bool generateNames=false)
virtual void SetAvailableAttributes(unsigned int value)
Vector _textureBLC
Definition: gls_nine_patch.h:375
Definition: gls_vertex_array.h:58
unsigned int _referenceTexWidth
Definition: gls_nine_patch.h:404
Definition: gls_nine_patch.h:87
virtual GlsColor GetFillColor(void)
bool _centerVisible
Definition: gls_nine_patch.h:391
Definition: gls_color.h:53
GlsColor _objectColor
Definition: gls_nine_patch.h:395
virtual Vertex * Vertices()
Vector _patchTex[16]
Definition: gls_nine_patch.h:366
void SetNeedsRecalculate(void)
virtual void SetValue(int spec, va_list &args)
float Width(void) const
Definition: gls_nine_patch.h:271
Definition: gls_nine_patch.h:98
float _width
Definition: gls_nine_patch.h:377
void CalculateRadiiUnit(void)
virtual void UpdateBoundingVolume(void)
virtual const Vector * GetPatchTex()
bool _guidesVisible
Definition: gls_nine_patch.h:394
virtual const Vertex * GetPatchVerts()
An object for managing vertices, texture coordinates, colors and normals for GLPolygon and other disp...
unsigned int _texHeight
Definition: gls_nine_patch.h:397
Definition: display_types.h:93
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)
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:363
The disti::GlsIndexArray class, for managing index buffers.
const Vector WidthVector(void) const
Definition: gls_nine_patch.h:225
virtual void SetFillColor(const GlsColor &color)
Definition: bmpimage.h:46
The disti::GlsDisplayList class.
unsigned int ReferenceTextureWidth()
float _textureEdge[4]
Definition: gls_nine_patch.h:384