#ifndef __CELL_BLOCK_H__ #define __CELL_BLOCK_H__ #include #include #include #include class CellBlock : public FixedArray { public: CellBlock(); ~CellBlock(); void Add( FixedArray& irPoints ); void Add( Vector3f& irPoint ); void Add( FixedArray& irPoints, FixedArray& irPointWeights); /* void Init( int iSize, BlockCoord& irBlockCoord, Vector3f& irGranularities ); */ void Init( FixedArray& irPoints, Vector3f& irGranularities ); void Init( FixedArray& irPoints, FixedArray& irPointWeights, Vector3f& irGranularities ); void GenerateCells(); int CellIndex( Vector3f& irPoint ); int CellIndex( int iX, int iY, int iZ ); Cell& GetCell( int iX, int iY, int iZ ); void Translate( FixedArray& orCellArray, Vector3i& orSpans ); void TranslateNonEmpty( FixedArray& orCellArray, Vector3i& orSpans ); void ExtractNonEmptyCells( FixedArray& orCellArray ); void ExtractCells( FixedArray& orCellArray ); void ExtractDims( Vector3i& orSpans ); void ExtractBounds( Bounds3f& orBounds ); Bounds3f mBounds; BlockCoord mBlockCoord; Vector3f mGranularities; protected: void SetCellsBlockData(); int CountEmptyCells(); void BoundCellsByGranularities(); }; #endif