ColGridCell.h

00001 //---------------------------------------------------------------------------
00002 //                              GridCell
00003 //---------------------------------------------------------------------------
00004 //  Copyright (C):
00005 //---------------------------------------------------------------------------
00006 //CVSId: "@(#)$Id: ColGridCell.h,v 1.3 2004/06/09 12:23:17 weller Exp $"
00007 
00008 
00009 #ifndef GridCell_H
00010 #define GridCell_H
00011 #if defined(__sgi) || defined(_WIN32)
00012 #pragma once
00013 #endif
00014 
00015 
00016 //---------------------------------------------------------------------------
00017 //  Includes
00018 //---------------------------------------------------------------------------
00019 
00020 #include <set>
00021 
00022 #include <ColGridObj.h>
00023 #include <col_import_export.h>
00024 
00025 //---------------------------------------------------------------------------
00026 //  Forward References
00027 //---------------------------------------------------------------------------
00028 
00029 namespace col {
00030 
00031 class Grid;
00032 
00033 //---------------------------------------------------------------------------
00034 //   Types
00035 //---------------------------------------------------------------------------
00036 
00037 //      Compare function needed for 'set' from 'STL' 
00038 struct COL_EXPORTIMPORT GridObjLtstr
00039 {
00040   bool operator()(const GridObj* s1, const GridObj* s2) const
00041   {
00042     return s1 < s2;
00043   }
00044 };
00045 
00046 //---------------------------------------------------------------------------
00047 //  The Class
00048 //---------------------------------------------------------------------------
00049 
00050 class COL_EXPORTIMPORT GridCell
00051 {
00052 
00053 public:
00054 
00055     GridCell( float xLow, float yLow, float zLow, Grid* grid );
00056     virtual ~GridCell();
00057 
00058     void    addObj( GridObj* object );
00059     void removeObj( GridObj* object );
00060 
00061     std::set<GridObj*, GridObjLtstr>* getObjSet( void ) { return( m_gridObjs ); }
00062     
00063 //---------------------------------------------------------------------------
00064 //  Instance variables
00065 //---------------------------------------------------------------------------
00066 
00067 protected:
00068 
00069     Grid *  m_gridP;
00070     float   m_low[3];
00071 
00072     std::set<GridObj*, GridObjLtstr>*   m_gridObjs;
00073 
00074 //---------------------------------------------------------------------------
00075 //  Private Instance methods
00076 //---------------------------------------------------------------------------
00077 
00078     // prohibit copy constructor (move to 'public' if you need one)
00079     explicit GridCell( const GridCell &source );
00080 
00081     // prohibit assignment
00082     GridCell& operator = ( const GridCell &source );
00083 };
00084 
00085 
00086 }   //  namespace col
00087 
00088 
00089 #endif /* GridCell_H */
00090 

Generated on Tue Oct 16 18:12:21 2007 for CollDet by  doxygen 1.5.2