Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

borderarea.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                     borderarea.h  -  Object with border areas
00003                              -------------------
00004     begin                : Sun Mar 2 2003
00005     copyright            : (C) 2003 by Reality Rift Studios
00006     email                : mattias@realityrift.com
00007  ***************************************************************************
00008 
00009  The contents of this file are subject to the Mozilla Public License Version
00010  1.1 (the "License"); you may not use this file except in compliance with
00011  the License. You may obtain a copy of the License at 
00012  http://www.mozilla.org/MPL/
00013 
00014  Software distributed under the License is distributed on an "AS IS" basis,
00015  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00016  for the specific language governing rights and limitations under the
00017  License.
00018 
00019  The Original Code is the NeoEngine, NeoWTK, borderarea.h
00020 
00021  The Initial Developer of the Original Code is Mattias Jansson.
00022  Portions created by Mattias Jansson are Copyright (C) 2003
00023  Reality Rift Studios. All Rights Reserved.
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 // External classes
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

Generated on Wed Jan 21 14:21:20 2004 for NeoWTK by doxygen 1.3.5