40 #ifndef INCLUDED_DISTI_DISPLAY_H
41 #define INCLUDED_DISTI_DISPLAY_H
70 class CallbackMethodCallerBase;
71 class GlsResourceFilter;
72 class DisplayObjectEditor;
76 class GlsGloFileAttribute;
81 GLS_EXPORT
void InitializeLibrary(
const char* unlockString = NULL,
const DisplayFrame* frame = NULL,
bool checkLicense =
false );
86 GLS_EXPORT
const char* LicenseUnlockedBy();
88 typedef DisplayObject* DisplayObjectPtr;
89 typedef DynamicArray<DisplayObjectPtr> DisplayObjectArray;
90 typedef DynamicArray<int> DynamicIntArray;
101 friend class DisplayObjectEditor;
117 GLS_EXPORT
DisplayObject(
const DisplayObject&
object,
const bool generateNames );
133 GLS_ATTRIBUTES_BASIC = 1,
134 GLS_ATTRIBUTES_DYNAMIC = 2,
135 GLS_ATTRIBUTES_APPEARANCE = 4,
136 GLS_ATTRIBUTES_GEOMETRY = 8,
137 GLS_ATTRIBUTES_SPECIALIZED = 16,
138 GLS_ATTRIBUTES_ALL = ~0,
139 GLS_ATTRIBUTES_NONE = 0
154 virtual GLS_EXPORT
void AlphaMode(
int mode );
160 virtual GLS_EXPORT
int AlphaMode(
void );
165 virtual GLS_EXPORT
bool AntiAlias(
void );
170 virtual GLS_EXPORT
void AntiAlias(
bool alias );
186 virtual GLS_EXPORT
void SetBlendColor(
const GlsColor& color );
201 GLS_EXPORT
void GetBlendColor(
unsigned char& r,
unsigned char& g,
unsigned char& b,
unsigned char& a );
221 GLS_EXPORT
void SetBlendColor(
unsigned char r,
unsigned char g,
unsigned char b,
unsigned char a );
229 virtual GLS_EXPORT
bool Blinking(
void );
234 virtual GLS_EXPORT
void Blinking(
const bool blink );
239 virtual GLS_EXPORT
float BlinkRate(
void );
244 virtual GLS_EXPORT
void BlinkRate(
const float rate );
288 virtual GLS_EXPORT
void Calculate(
double time );
334 virtual DisplayObject*
CloneObject(
bool generateNames =
false ) = 0;
345 GLS_EXPORT
void GetColor(
unsigned char c4[] );
354 GLS_EXPORT
void GetColor(
unsigned char& r,
unsigned char& g,
unsigned char& b,
unsigned char& a );
379 virtual GLS_EXPORT
void CopyGeometry( DisplayObject* src );
420 inline bool Culled()
const {
return _culled; }
421 inline void Culled(
bool val ) { _culled = val; }
468 void GLS_EXPORT
DcsMatrix(
const GlsMatrixType& matrix );
481 virtual GLS_EXPORT
void DeleteVertex(
unsigned int indexAfter ) DISTI_FINAL
492 virtual GLS_EXPORT
int DepthTest(
void );
497 virtual GLS_EXPORT
void DepthTest(
unsigned char zbuf );
501 virtual void Draw(
void ) = 0;
535 virtual GLS_EXPORT
void DynamicRotate(
float x,
float y,
float z );
548 virtual GLS_EXPORT
float DynamicRotation(
int axis );
549 virtual GLS_EXPORT
Vector DynamicRotation();
562 virtual GLS_EXPORT
void DynamicScale(
float x,
float y,
float z );
578 virtual GLS_EXPORT
void DynamicTranslate(
float x,
float y,
float z,
bool relative =
false );
599 virtual GLS_EXPORT
void DynamicTranslateAxis(
float amount,
int axis,
bool relative );
601 virtual GLS_EXPORT
void DynamicTranslate(
float amount,
int axis,
bool relative =
false );
618 GLS_EXPORT DisplayObjectEditor*
Editor();
624 GLS_EXPORT
const DisplayObjectEditor*
Editor()
const;
630 GLS_EXPORT
void Editor( DisplayObjectEditor* editor );
642 virtual GLS_EXPORT
void GetExtents(
float& x,
float& y,
float& z,
float& x1,
float& y1,
float& z1 );
657 GLS_EXPORT
void GetFillColor(
unsigned char& r,
unsigned char& g,
658 unsigned char& b,
unsigned char& a );
723 virtual GLS_EXPORT
bool Hit(
float x,
float y,
float z,
float scale,
const Vector& directionVector,
Vector* collisionPoint );
744 virtual GLS_EXPORT
bool HitUtil(
float x,
float y,
float z,
float scale,
Vertex* vertices,
unsigned int vertex_cnt,
const Vector& directionVector,
Vector* collisionPoint );
761 virtual GLS_EXPORT
void InsertVertex(
unsigned int indexAfter ) DISTI_FINAL
807 virtual GLS_EXPORT
float LineWidth(
void );
812 virtual GLS_EXPORT
void LineWidth(
float width );
829 virtual GLS_EXPORT
void Location(
float x,
float y,
float z );
841 virtual GLS_EXPORT
void GetLocation(
float& x,
float& y,
float& z );
888 virtual GLS_EXPORT
void SetNormals(
unsigned int nPoints,
Vector* vertices );
894 GLS_EXPORT
void VaSetNormals(
unsigned int nPoints, ... );
965 virtual GLS_EXPORT DisplayObject*
Pick3D(
const Vector& winLoc,
966 const Vector& logicalCoords,
968 const Vector& directionVector,
976 inline unsigned char Pickable() {
return _pickable; }
982 virtual GLS_EXPORT
void Pickable(
unsigned char pick );
988 virtual GLS_EXPORT
int PolygonOffset(
void )
const;
994 virtual GLS_EXPORT
void PolygonOffset(
const int offset );
1006 virtual GLS_EXPORT
void PolygonEnd(
const int end );
1039 virtual GLS_EXPORT
void ReallocateVertices(
unsigned int numVertices,
bool initializeNew,
bool copyOld );
1047 virtual GLS_EXPORT
float RelativeAngle(
const float x,
const float y );
1109 virtual GLS_EXPORT
void RotationPoint(
float x,
float y,
float z );
1122 virtual GLS_EXPORT
void Rotate(
float angle,
int axis =
Z_AXIS );
1130 virtual GLS_EXPORT
void Rotate(
const Vector& origin,
float angle,
int axis =
Z_AXIS );
1138 virtual GLS_EXPORT
void Rotate(
const Vector& orig,
float angle,
const Vector& axis );
1155 virtual GLS_EXPORT
void Scale(
float px,
float py,
float pz,
Vertex* anchor,
int handleBar = 0 );
1162 GLS_EXPORT
void Set(
int spec, ... );
1191 #if !defined( GLES )
1210 virtual GLS_EXPORT
int Shading(
void );
1216 virtual GLS_EXPORT
void Shading(
const int shading );
1235 virtual GLS_EXPORT
void SetTexCoords(
unsigned int nPoints,
Vector* new_tex_coord,
bool isVectorArray =
true );
1284 virtual GLS_EXPORT
void TextureIndex(
int textureIndex );
1348 virtual GLS_EXPORT
void Translate(
float tr[] );
1355 virtual GLS_EXPORT
void Translate(
float x,
float y,
float z );
1388 virtual GLS_EXPORT
void SetVertexColor(
unsigned int vertex,
unsigned char CurrentFillColor[] );
1420 virtual GLS_EXPORT
void VaListSetVertices(
unsigned int nPoints, va_list args );
1427 virtual GLS_EXPORT
void VaListSetNormals(
unsigned int nPoints, va_list args );
1453 virtual GLS_EXPORT
void Visibility(
const bool vis );
1497 Vector* directionVector = NULL,
1511 const Vector* directionVector,
1533 GLS_EXPORT
void GeometryRefresh();
1538 bool _geometryRefresh;
1540 GLS_EXPORT
void ApplyTextureMinMagSettings();
1541 GLS_EXPORT
void ApplyTextureEnvModeSettings();
1542 GLS_EXPORT
bool SetupTextureIsNeeded();
1570 bool _needCalcDrawMatrix;
1634 virtual GLS_EXPORT
int ColorMaterialMode(
void );
1681 inline void LastDrawMatrixLocation(
const Vertex& loc ) { _lastDrawMatrixLocation = loc; }
1684 inline const Vertex& LastDrawMatrixLocation() {
return _lastDrawMatrixLocation; }
1697 GLS_EXPORT
void PickSetup(
float x,
float y,
float z,
Vertex* vertices,
unsigned int vertex_cnt,
const Vector& directionVector );
1750 GLS_EXPORT
virtual bool IsVisibleInScene(
const DisplayObject* obj = NULL )
const;
1757 GLS_EXPORT
virtual void SetValue(
int spec, va_list& args );
1760 void CopyGeometryInternal(
const DisplayObject* src );
1761 void CopyPropertiesInternal(
const DisplayObject* src );
1762 void CopyHierarchyPropertiesInternal(
const DisplayObject* src,
bool copyName );
1766 Vector _boundingVolumeCenter;
1768 float _boundingVolumeRadius;
1775 float _dynamicTranslate[ 3 ];
1780 float _dynamicScale[ 3 ];
1784 char* _instanceName;
1788 Vertex _lastDrawMatrixLocation;
1790 bool _lightingEnabled;
1792 bool _needCalculate;
1798 Group* _parentGroup;
1802 unsigned char _pickable;
1804 float _rotation[ 3 ];
1816 GLS_EXPORT
void DisplayColorMaterialModeError(
const int mode );
1817 GLS_EXPORT
int DisplayColorMaterialModeError();
1819 void CommonConstructorInit(
float x,
float y,
float z );
1822 void OnDCSMatrixChanged();
1825 void OnVerticesChanged();
1828 void OnTextureCoordsChanged();
1831 DisplayObject& operator=(
const DisplayObject& that );
GlsMatrixType * _drawMatrix
Definition: display.h:1565
float Y(void) const
Definition: display.h:847
GlsColor _textureBlendColor
Definition: display.h:1604
bool InsideVertexExtents(float x, float y, unsigned int nVerts, Vertex *verts, float tolerance)
Definition: display_frame.h:85
void RestoreLighting(void)
virtual void CalculateMatrices(const OpenGLMatrices &newMatrices)
void * UserData(void) const
Definition: display.h:1377
void SetColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
Definition: display.h:374
void SetTexCoords(unsigned int nPoints, Vertex *new_tex_coord)
Definition: display.h:1241
bool GetTexturePointTransformationMatrix(GlsMatrixType &world2tex)
Vector * _normals
Definition: display.h:1584
virtual const Vertex & Location(void) const
DistiAttribDict & Attributes()
Definition: display.h:180
virtual void CopyGeometry(DisplayObject *src)
virtual void UpdateBoundingVolume(void)
CallbackMethodCallerBase * CallbackCaller() const
Definition: display.h:311
#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)
virtual float BlinkRate(void)
virtual void SetVertices(unsigned int nPoints, Vertex *vertices)
void VaSetTexCoords(unsigned int nPoints,...)
void SetupPolyDrawStyle(void)
virtual void SetVertexColor(unsigned int vertex, unsigned char CurrentFillColor[])
Vertex _location
Definition: display.h:1578
GlsMatrixType & DcsMatrix()
Definition: display.h:462
virtual void CalculateParentBoundingBox(void)
void SetFillColor(unsigned char c4[])
Definition: display.h:684
Definition: gls_state_manager_es20_interface.h:65
virtual void SetBlendColor(const GlsColor &color)
virtual void GetRotationPoint(Vertex &v)
Definition: dynamic_array.h:66
bool BoundingVolumeHit(const Vector &start, const Vector &direction)
The disti::DynamicArray class. A templated array of objects capable of dynamically growing...
GlsMatrixType * ModelMatrix()
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:296
bool SetupLineStyle(void)
void CalculateCollisionPoint(const Vector &pickLoc, const Vector &directionVector, Vector *collisionPoint)
Defines a base class which editor objects can derive.
virtual int TextureMagnificationFilter(void)
void NotifyAttributeChanged(const AttributeName &name) override
float MagnitudeSquared() const
Definition: vertex.h:335
virtual Vertex WorldVertex(unsigned int i)
virtual void PreDraw(const OpenGLMatrices ¤t, Culler &culler)
virtual float LineWidth(void)
virtual bool IsVisibleInScene(const DisplayObject *obj=NULL) const
void ApplyTextureSettings(int textureIndex=-1)
virtual int AlphaMode(void)
virtual void CalculateTextureCoordinates(void)
int GetApplicableTextureIndex()
virtual void GetCppInterfaceDescriptionFree(InterfaceListType *array)
The GlsMatrixAffine class.
unsigned char _lineStippleMultiplier
Definition: display.h:1572
virtual void CopyProperties(DisplayObject *src)
unsigned short _lineStipplePattern
Definition: display.h:1574
bool _visible
Definition: display.h:1632
DisplayFrame * Parent(void) const
Definition: display.h:935
virtual void VaListSetTexCoords(unsigned int nPoints, va_list args)
unsigned char _textureMagFilter
Definition: display.h:1610
virtual void SetValue(int spec, va_list &args)
unsigned char _textureMinFilter
Definition: display.h:1612
bool Visible(void) const
Definition: display.h:1443
virtual void SetTexCoords(unsigned int nPoints, Vector *new_tex_coord, bool isVectorArray=true)
bool Visibility(void) const
Definition: display.h:1448
virtual void GetResources(std::ostream &outstr, GlsResourceFilter *filter=NULL)
virtual void CopyHierarchyProperties(DisplayObject *src, bool copyName)
Definition: gls_state_manager_interface.h:67
Vector * Normals()
Definition: display.h:882
virtual void InsertVertexAt(unsigned int index)
virtual int MaterialIndex()
bool ApplyDynamicRotation(void)
bool CullTest(const GlsMatrixType *matrix, const Culler &culler)
Definition: display.h:427
virtual float ObjectHeight(void)
static void SetManualBlinkElapsedTime(double elapsedTime)
float _lineWidth
Definition: display.h:1576
DisplayObject(float x, float y, float z)
virtual bool HitUtil(float x, float y, float z, float scale, Vertex *vertices, unsigned int vertex_cnt, const Vector &directionVector, Vector *collisionPoint)
float Z(void) const
Definition: display.h:850
weak reference and related classes
The disti::GlsStateManager factory class. Creates an instance of a state manager that manages the GL ...
virtual DisplayObject * Pick3D(const Vector &winLoc, const Vector &logicalCoords, float scale, const Vector &directionVector, Vector &collisionWinLoc, const OpenGLMatrices &drawnMatrices)
bool SphereOutsideFrustum(const Vector ¢er, const float radius) const
Definition: cull.h:96
virtual void VaListSetNormals(unsigned int nPoints, va_list args)
static void UseManualBlinkElapsedTime(bool useManualTime)
Vector _texturePoints[4]
Definition: display.h:1616
GlsMatrixType * _projMatrix
Definition: display.h:1597
const Vector & BoundingVolumeCenter() const
Definition: display.h:259
Definition: gls_glo_file.h:988
void SetupDepthTest(void)
void SetColor(unsigned char c4[])
Definition: display.h:365
virtual Vector WorldRotationPoint(void)
virtual void Translate(float tr[])
unsigned char _polygonMode
Definition: display.h:1593
float _blinkRate
Definition: display.h:1554
void DynamicRotate(float angle, int axis)
virtual void ReallocateVertices(unsigned int numVertices, bool initializeNew, bool copyOld)
Definition: gls_glo_file.h:81
Vector * _texCoord
Definition: display.h:1601
Definition: gls_painter.h:51
void DCSToLogical(Vector dcsPoint, Vector &logicalPoint, const GlsMatrixType *dcsMatrix=NULL)
void LogicalToDCS(Vector logicalPoint, Vector &objectLocal, const Vector *directionVector, const Vector &planeNormal=Vector(0, 0, 1), const Vector &planePoint=Vector(), const GlsMatrixType *dcsMatrix=NULL)
virtual int Shading(void)
virtual Vector DynamicScale()
unsigned int _nTex_vertices
Definition: display.h:1587
bool _blinking
Definition: display.h:1552
virtual ~DisplayObject(void)
void Transform(Vector &v) const
Definition: gls_matrix_affine.h:271
virtual void FinishObject()
Definition: display.h:698
VertexNoColor Vector
Definition: gls_font_base.h:66
virtual GlsColor GetFillColor(void)
GlsMatrixType * _modelMatrix
Definition: display.h:1582
virtual Vertex * Vertices()
Definition: display.h:1395
virtual float ObjectDepth(void)
const GlsMatrixType * DrawMatrix()
Definition: display.h:506
GlsMatrixType * ProjMatrix()
bool NeedCalcDrawMatrix()
Definition: display.h:510
virtual int TextureIndex(void)
GL Studio Enumerations and constants.
bool _attributesAdded
Definition: display.h:1550
float X(void) const
Definition: display.h:844
virtual void SetNormals(unsigned int nPoints, Vector *vertices)
virtual DistiAttributeBase & Resource(const char *name)
The disti::Vertex class. A class for manipulating 3D vertices.
virtual void SetOrigin(const Vertex &vert)
virtual Vector * GetTexturePoints(void)
Generally useful defines, macros, enumerations and function prototypes.
virtual void DynamicRotateRelative(float angle, int axis)
virtual int TextureMappingTechnique(void)
virtual bool Hit(float x, float y, float z, float scale, const Vector &directionVector, Vector *collisionPoint)
virtual DynamicArray< int > & MaterialIndices()
void UserData(void *data)
Definition: display.h:1382
unsigned char _shading
Definition: display.h:1599
void Y(const float y)
Definition: display.h:856
unsigned char _textureRepeat
Definition: display.h:1622
int _polygonOffset
Definition: display.h:1595
void PickSetup(float x, float y, float z, Vertex *vertices, unsigned int vertex_cnt, const Vector &directionVector)
bool Culled() const
Definition: display.h:420
void X(const float x)
Definition: display.h:853
Definition: disti_metadata.h:186
void CalcDrawMatrixIfExists()
Definition: display.h:1657
virtual bool CullBackFace(void)
GlsColor _color
Definition: display.h:1556
int _textureIndex
Definition: display.h:1606
Vector * GetTextureCoordinates(void)
Definition: display.h:1273
Definition: gls_color.h:53
void Z(const float z)
Definition: display.h:859
virtual void Rotate(float angle, int axis=Z_AXIS)
char * InstanceName(void)
virtual void GetTransformedExtents(Vector &min, Vector &max, const GlsMatrixType &matrix, bool resetMinMax=true)
virtual InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL)
unsigned char _textureMap
Definition: display.h:1614
Definition: disti_metadata.h:668
Definition: weak_referenceable_mixin.h:52
#define MAX(A, B)
Definition: util.h:167
unsigned int _nVertices
Definition: display.h:1589
virtual void GetCenter(Vector ¢er)
void VaSetNormals(unsigned int nPoints,...)
Vector * TextureCoordinates(void)
Definition: display.h:1266
Definition: callback_caller_base.h:55
virtual int DepthTest(void)
virtual DisplayObject * CloneObject(bool generateNames=false)=0
virtual void SetPainter(GlsPainter *painter)
void VaSetVertices(unsigned int nPoints,...)
unsigned char _depthTest
Definition: display.h:1563
virtual float RelativeAngle(const float x, const float y)
The disti::Culler class. Implements view frustum culling.
virtual void Scale(float px, float py, float pz, Vertex *anchor, int handleBar=0)
virtual void GenerateInstanceName(void)
bool LogicalToWindow(const Vector &logical, Vector &winLoc, const OpenGLMatrices &alternateMatrices=OpenGLMatrices())
Definition: disti_metadata.h:458
unsigned char Pickable()
Definition: display.h:976
virtual bool AntiAlias(void)
virtual void SetColor(const GlsColor &color)
unsigned char _polygonEnd
Definition: display.h:1591
GlsMatrixType _dcsMatrix
Definition: display.h:1560
virtual void GetLocation(Vertex &v)
void PickCleanup(Vertex *vertices, unsigned int vertex_cnt)
virtual GlsColor GetColor()
virtual void TranslateVertices(float x, float y, float z)
virtual void Draw(void)=0
int _alphaMode
Definition: display.h:1546
virtual Vector DynamicTranslation()
void NeedCalculate(bool val)
Definition: display.h:1687
virtual void DeleteVertexAt(unsigned int index)
const Vertex & RotationPoint() const
Definition: display.h:1093
virtual bool Blinking(void)
The GlsPainter interface.
Vertex * _vertices
Definition: display.h:1626
void AllocateModelMatrix()
bool NeedCalculate()
Definition: display.h:877
virtual GlsPainter * GetPainter()
virtual bool LightingEnabled()
void * _userData
Definition: display.h:1624
virtual void SetAvailableAttributes(unsigned int value)
Definition: gls_resources.h:50
bool _antiAlias
Definition: display.h:1548
unsigned int NumberOfVertices() const
Definition: display.h:899
virtual bool TextureRepeat(void)
float BoundingVolumeRadius() const
Definition: display.h:276
bool WindowToLogical(const Vector &winLoc, Vector &logical, Vector *directionVector=NULL, const OpenGLMatrices &alternateMatrices=OpenGLMatrices())
bool SetupAntiAlias(void)
AvailableAttributesEnum
Definition: display.h:131
void GetExtentsDCS(Vector &min, Vector &max)
virtual void DeleteVertex(unsigned int indexAfter) final
Definition: display.h:481
virtual void InsertVertex(unsigned int indexAfter) final
Definition: display.h:761
Definition: disti_metadata.h:85
virtual bool GetPlaneVectorPoints(Vertex &p1, Vertex &p2, Vertex &p3, Vertex &planeVector)
int GetApplicableTextureRepeat()
void RestoreLineStyle(void)
Definition: bmpimage.h:46
virtual int LineStippleMultiplier(void)
virtual void GetExtents(float &x, float &y, float &z, float &x1, float &y1, float &z1)
virtual int PolygonMode(void)
virtual void VaListSetVertices(unsigned int nPoints, va_list args)
virtual int TextureMinificationFilter(void)
DisplayObjectEditor * Editor()
void SetFillColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
Definition: display.h:678
virtual int PolygonEnd(void)
virtual GlsColor GetBlendColor()
virtual int LineStipplePattern(void)
bool _cullBackFace
Definition: display.h:1558
virtual void CalcDrawMatrix()
void RestoreAntiAlias(void)
Group * ParentGroup(void) const
Definition: display.h:945
virtual float ObjectWidth(void)
int * _viewMatrix
Definition: display.h:1630
virtual DisplayObject * handle(DisplayEvent *ev)
virtual void DynamicTranslate(float x, float y, float z, bool relative=false)
Definition: editor_object_base.h:48