![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /********************************************************************* 00002 ** Copyright (c) 1999 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 /********************************************************************* 00006 ** $RCSfile: grpGrid.h,v $ $Revision: 1.7 $ $State: Exp $ 00007 *********************************************************************/ 00008 00009 #ifndef grpGrid_H_ 00010 #define grpGrid_H_ 00011 00012 #include "ctdb/ctdbDefines.h" 00013 // \file grpGrid.h 00014 // Contains the DtGroupGrid class declaration. 00015 00016 // forward declarations 00017 class DtGroup; 00018 class DtTerrainReader; 00019 00020 class DT_DLL_ctdb DtGroupGrid 00021 { 00022 public: 00023 00024 // default constructor 00025 DtGroupGrid(); 00026 00027 // additional constructor 00028 DtGroupGrid(int numWide, int numHigh, DtTerrainReader* reader); 00029 00030 // destructor 00031 virtual ~DtGroupGrid(); 00032 00033 // If a copy constructor is implemented, the assignment operator should 00034 // also be implemented. Should generally implement both of them anyway to 00035 // avoid memory problems due to inappropriate compiler provided defaults. 00036 // Access varies so need to put proper access keyword above these 00037 // declarations. 00038 00039 virtual DtTerrainReader* reader() const; 00040 00041 virtual void addToGroup(int x, int y, DtGroup* g); 00042 00043 00044 virtual DtGroup* make_hierarchy(); 00045 00046 00047 virtual int grpnum_from_xy(int x, int y); 00048 00049 public: 00050 00051 static int div2roundup(int i); 00052 00053 protected: 00054 00055 // copy constructor 00056 DtGroupGrid(const DtGroupGrid& orig); 00057 00058 // assignment operator 00059 DtGroupGrid& operator=(const DtGroupGrid& orig); 00060 00061 00062 protected: 00063 00064 int nwide; 00065 int nhigh; 00066 int ngrps; 00067 00068 DtGroup** myGroup; 00069 DtTerrainReader* myReader; 00070 00071 }; 00072 00073 inline DtTerrainReader* DtGroupGrid::reader() const 00074 { 00075 return myReader; 00076 } 00077 00078 #endif