00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef __NEOWTKBORDERAREA_H
00028 #define __NEOWTKBORDERAREA_H
00029
00030
00031 #include "base.h"
00032 #include "object.h"
00033
00034 #include <neoengine/material.h>
00035
00036 #ifdef HAVE_NEOCHUNKIO
00037 # include <neochunkio/complex.h>
00038 # include "chunktype.h"
00039 #endif
00040
00041
00048 namespace NeoWTK
00049 {
00050
00051
00052
00053 class Area;
00054
00055
00057 class BorderAreaChunk;
00058
00059
00068 class NEOWTK_API BorderArea : public Object
00069 {
00070 #ifdef HAVE_NEOCHUNKIO
00071 friend class BorderAreaChunk;
00072 #endif
00073
00074 public:
00075
00080 enum BORDERAREA
00081 {
00082 TOP_LEFT_CORNER = 0,
00083 TOP_RIGHT_CORNER = 1,
00084 BOTTOM_LEFT_CORNER = 2,
00085 BOTTOM_RIGHT_CORNER = 3,
00086
00087 TOP_BORDER = 4,
00088 LEFT_BORDER = 5,
00089 RIGHT_BORDER = 6,
00090 BOTTOM_BORDER = 7,
00091
00092 CENTER = 8,
00093
00094 NUMAREAS = 9
00095 };
00096
00097
00098
00099 protected:
00100
00102 NeoEngine::MaterialPtr m_pkMaterial;
00103
00104
00105 public:
00106
00113 BorderArea( Object *pkParent, Area *pkCenter = 0, BorderArea *pkObject = 0, bool bCreateAreas = true );
00114
00117 virtual ~BorderArea();
00118
00125 virtual bool Render( NeoEngine::Frustum *pkFrustum = 0, bool bForce = false );
00126
00132 virtual const Coord &SetSize( const Coord &rkSize );
00133
00138 virtual void SetMaterial( const NeoEngine::MaterialPtr &pkMat );
00139
00144 virtual Area *GetArea( BORDERAREA eArea );
00145
00151 virtual void RecalcAreas();
00152
00157 virtual void SetCenterArea( Area *pkCenter );
00158
00165 virtual Object *Duplicate( Object *pkParent = 0, Object *pkObject = 0 );
00166 };
00167
00168
00169 #ifdef HAVE_NEOCHUNKIO
00170
00171
00177 class NEOWTK_API BorderAreaChunk : public ObjectChunk
00178 {
00179 public:
00180
00187 BorderAreaChunk( unsigned short usType, const NeoEngine::HashString &rstrType, const NeoEngine::HashString &rstrID = "" ) : ObjectChunk( usType, rstrType, rstrID ) {}
00188
00192 virtual ~BorderAreaChunk() {}
00193
00200 virtual int ParseData( unsigned int uiFlags, NeoEngine::FileManager *pkFileManager );
00201
00209 static NeoChunkIO::Chunk *Allocator( unsigned short usType, const NeoEngine::HashString &rstrType, const NeoEngine::HashString &rstrID ) { return new BorderAreaChunk( usType, rstrType, rstrID ); }
00210 };
00211
00212
00213 #endif
00216 };
00219 #endif