40 #ifndef _GLSPOLYLINE_H
41 #define _GLSPOLYLINE_H
48 #include "gls_vertex_array.h"
52 #if (defined(GLSGEN_EXPORT_GLSPOLYLINE) || \
53 defined(GLSGEN_IMPORT_GLSPOLYLINE) || \
54 defined(GLS_EXPORT_GENERATED) || \
55 defined(GLS_IMPORT_GENERATED)) \
57 # if defined(GLSGEN_EXPORT_GLSPOLYLINE) || defined(GLS_EXPORT_GENERATED)
58 # define GLSGEN_GLSPOLYLINE_EXPORT __declspec(dllexport)
60 # define GLSGEN_GLSPOLYLINE_EXPORT __declspec(dllimport)
63 # define GLSGEN_GLSPOLYLINE_EXPORT
67 #define LIB_BASE_NAME "gls_poly_line"
76 GLS_POLY_LINE_FIRST_VALUE = GLS_LAST_INITIALIZER+1,
77 GLS_POLY_LINE_THICKNESS,
79 GLS_POLY_LINE_HALO_COLOR,
80 GLS_POLY_LINE_HALO_THICKNESS,
82 GLS_POLY_LINE_LAST_INITIALIZER = GLS_POLY_LINE_NORMAL
100 friend class GlsPolyLineEditor;
112 GLSGEN_GLSPOLYLINE_EXPORT
GlsPolyLine(
const GlsPolyLine& that,
const bool generateNames );
117 static GLSGEN_GLSPOLYLINE_EXPORT
DisplayObject* CreateInstance();
121 virtual GLSGEN_GLSPOLYLINE_EXPORT
void GetExtents(
float &minx,
float &miny,
float &minz,
float &maxx,
float &maxy,
float &maxz);
136 virtual GLSGEN_GLSPOLYLINE_EXPORT
void Draw(
void);
141 virtual GLSGEN_GLSPOLYLINE_EXPORT
void Scale(
float px,
float py,
float pz,
Vertex *anchor,
int handleBar);
146 virtual GLSGEN_GLSPOLYLINE_EXPORT
void Rotate(
const Vector &orig,
float angle,
const Vector &axis);
148 virtual GLSGEN_GLSPOLYLINE_EXPORT
bool Hit(
float x,
float y,
float z,
float scale,
const Vector& directionVector,
Vector *collisionPoint);
150 virtual GLSGEN_GLSPOLYLINE_EXPORT
void SetValue(
int spec,va_list &args);
161 virtual GLSGEN_GLSPOLYLINE_EXPORT
void PolygonEnd(
const int end);
170 GLSGEN_GLSPOLYLINE_EXPORT
void Thickness(
const float &val);
175 GLSGEN_GLSPOLYLINE_EXPORT
float Thickness(
void) {
return _thickness; }
181 GLSGEN_GLSPOLYLINE_EXPORT
void Halo(
const bool &val);
184 GLSGEN_GLSPOLYLINE_EXPORT
bool Halo(
void) {
return _halo; }
195 GLSGEN_GLSPOLYLINE_EXPORT
void HaloThickness(
const float &val);
200 GLSGEN_GLSPOLYLINE_EXPORT
float HaloThickness(
void) {
return _haloThickness; _needsRecalculate =
true; }
209 virtual GLSGEN_GLSPOLYLINE_EXPORT
void SetVertices(
unsigned int nPoints,
Vertex *vertices);
212 virtual GLSGEN_GLSPOLYLINE_EXPORT
void DeleteVertex(
unsigned int index);
221 GLSGEN_GLSPOLYLINE_EXPORT
void SetFromGloData( GlsGloFileAttribute& data );
222 void BakeVBO( GlsVertexArray &vbo, GlsPolyLineTriangleList& vertices,
glsColor color );
223 GlsVertexArray _gles_triangles;
224 GlsVertexArray _gles_haloTriangles;
227 GlsPolyLineTriangleList _triangles;
233 float _haloThickness;
234 GlsPolyLineTriangleList _haloTriangles;
236 bool _needsRecalculate;
238 unsigned int _endCapIndex;
251 void ComputeSegments(GlsPolyLineTriangleList &array,
float thickness,
bool calculatingHalos =
false);
253 void ComputeCorner(GlsPolyLineTriangleList &array,
float thickness,
float cornerRadius,
const Vector &refVert,
const Vector &v1,
const Vector &v2,
const Vector &v3,
const Vector &v4,
const Vector &l1,
const Vector &l2,
bool calculatingHalos =
false);
256 void DrawTriangles(GlsPolyLineTriangleList &array);
virtual void PreDraw(const OpenGLMatrices &parentMatrices, Culler &culler)
void ComputeSegments(void)
Definition: gls_poly_line.h:85
The disti::DynamicArray class. A templated array of objects capable of dynamically growing...
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:281
Vector texCoord
Definition: gls_poly_line.h:88
virtual void GetExtents(float &minx, float &miny, float &minz, float &maxx, float &maxy, float &maxz)
virtual void SetRecalculate(void)
The Polygon class. Implements Polygons.
Definition: glpolygon.h:56
virtual void SetVertices(unsigned int nPoints, Vertex *vertices)
glsColor HaloColor(void)
Definition: gls_poly_line.h:190
Vector GlobalNormal(void)
Definition: gls_poly_line.h:178
The disti::GLPolygon class. Implements Polygons.
virtual bool Hit(float x, float y, float z, float scale, const Vector &directionVector, Vector *collisionPoint)
virtual void SetValue(int spec, va_list &args)
virtual void Scale(float px, float py, float pz, Vertex *anchor, int handleBar)
Definition: gls_poly_line.h:98
virtual void SetAvailableAttributes(unsigned int value)
void ComputeCorner(GlsPolyLineTriangleList &array, float thickness, float cornerRadius, const Vector &refVert, const Vector &v1, const Vector &v2, const Vector &v3, const Vector &v4, const Vector &l1, const Vector &l2, bool calculatingHalos=false)
virtual void CopyProperties(DisplayObject *src)
Vector vertex
Definition: gls_poly_line.h:87
float HaloThickness(void)
Definition: gls_poly_line.h:200
Definition: gls_poly_line.h:92
virtual void SetFillColor(const glsColor &color)
virtual void Rotate(float angle, int axis=Z_AXIS)
virtual InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL)
Definition: gls_color.h:54
virtual void GetCppInterfaceDescriptionFree(InterfaceListType *array)
virtual void DeleteVertex(unsigned int index)
void Scale(int handleBar, float px, float py, Vertex *anchor=NULL)
Definition: display.h:1111
virtual void Rotate(const Vector &orig, float angle, const Vector &axis)
virtual void SetColor(const glsColor &color)
bool Halo(void)
Definition: gls_poly_line.h:184
void VerticesChanged(void)
Macros and helper code to determine what subset of C++11/14/17 is available.
float Thickness(void)
Definition: gls_poly_line.h:175
Definition: bmpimage.h:46
void SetFillColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
Definition: display.h:663
virtual int PolygonEnd(void)
virtual void CopyGeometry(DisplayObject *srcArg)
virtual void SetColor(const glsColor &color)
virtual DisplayObject * CloneObject(bool generateNames=false)
Vector normal
Definition: gls_poly_line.h:89
The disti::GLTriMesh class. Implements Triangle Meshes.