#ifndef __SHADOW_MASKS_HEADER__ #define __SHADOW_MASKS_HEADER__ #include "../../components/base/basicTypes.h" #include "../../hardware/soc/general/3DLRF.h" #include "../../components/base/basicLogCollection.h" #if defined( WIN32 ) || defined( __GUI__ ) #include "../../gui/gui.h" #endif typedef struct{ private: int16_t m_x; int16_t m_y; public: void setX( int a ){ m_x = a; }; void setY( int a ){ m_y = a; }; int16_t x( void ){ return m_x; }; int16_t y( void ){ return m_y; }; } simplePoint; #if defined( WIN32 ) || defined( __GUI__ ) typedef struct{ uint8_t color[3]; QPoint *points; uint16_t count; } simplePolygone; typedef std::vector vectorMasking; typedef std::vector vectorQPoly; #else typedef struct{ uint8_t color[3]; simplePoint *points; uint16_t count; } simplePolygone; typedef std::vector vectorMasking; #endif typedef struct{ uint16_t start; uint16_t stop; } raySegment; typedef struct{ uint16_t column; uint16_t count; raySegment *zones; } rawRay; typedef std::vector vectorZoneMask; class ShadowMask{ private: basicLogCollection *m_pLog; vectorZoneMask m_vZoneMask; bool m_bActive; vectorMasking m_vVectorMask; bool m_bRasterized; #if defined( WIN32 ) || defined( __GUI__ ) CSTR m_pRasterFileName; CSTR m_pVertexFileName; #endif public: ShadowMask(); ~ShadowMask(); #if defined( WIN32 ) || defined( __GUI__ ) bool loadRastered(CSTR fName = NULL); bool saveRastered(CSTR fName = NULL); #endif #if defined( __linux__ ) && !defined( __GUI__ ) bool saveVertexes(CSTR fName = NULL); bool loadVertexes(CSTR fName = NULL); #endif bool getMPoly( vectorMasking &VM ); bool getZoneMask(vectorZoneMask &ZM); simplePolygone *getPoly(int id); bool addPoly( simplePolygone *SP ); bool clear( void ); bool deletePoly( int ID ); uint8_t getPolyCount( void ){ return ( m_vVectorMask.size() & 0xFF ); }; uint16_t getRayCount( void ){ return ( m_vZoneMask.size() & 0xFFFF ); }; #if defined( WIN32 ) || defined( __GUI__ ) bool rasterizeVertexes( void ); bool getQPoly( vectorQPoly &VM ); bool addVertex( uint16_t polyID, QPoint SP ); bool addVertex( uint16_t polyID, uint32_t SP ); // Binary Data to Vertex #endif bool isOutside( uint16_t x, uint16_t y ); bool isOutside( simplePoint ); bool isActive( void ){ return m_bActive; }; void setActive( bool tVal ); bool addRay( uint16_t column, raySegment RS ); bool addRay( uint16_t column, uint32_t RS ); // Binary Data to RaySegment }; #endif