//****************************************************************************** // (above is 80 chars long) // VoxLimitMCAExtractor.h // // FixMe: // 1> Lock the grid volume to be stepped over for reading. // 2> Provide a reset(GridBox&) member func. // // Copyright (C) 2000 by Andrew H. Cox. All Rights Reserved. // #if defined(_MSC_VER) #pragma once #pragma warning( disable : 4786 ) #pragma intrinsic( abs ) #endif // defined(_MSC_VER) #if !defined(VoxLimitMCAExtractor_h__1F9DB2E1_59E9_11D4_81A8_525400DC8C30__INCLUDED_) #define VoxLimitMCAExtractor_h__1F9DB2E1_59E9_11D4_81A8_525400DC8C30__INCLUDED_ #include #include "VoxI_IndexedTriSetBuilder.h" namespace Vox_1F9D{ //typedef std::vector VertexPtrVector; //****************************************************************************** class LimitMCAExtractor { Grid& grid_; VertIndex& index_; public: LimitMCAExtractor(Grid& grid, VertIndex& index) : grid_(grid), index_(index) {} void extract ( const Word_32 dest_index_stamp, const Word_32 position_stamp, const GridBox& bbox, IndexedTriSetBuilderI& builder, VertexPtrVector& out_verts); }; //****************************************************************************** // GetDestIndex // // Functor which maps from a GridPoint to an index in the generated indexed tri // set. It also submits it to the indexed tri set builder, from which it // retreives the corresponding index for storage in the VertIndex and to be // returned to the caller. // Each Vertex is also pushed onto the output list as well. class GetDestIndex { public: GetDestIndex( const Word_32 dest_index_stamp, const Word_32 position_stamp, VertIndex& vertexes, IndexedTriSetBuilderI& builder, VertexPtrVector& out_verts) : voxel_level_(vertexes.vertex_level()), dest_index_stamp_(dest_index_stamp), position_stamp_(position_stamp), vertexes_(vertexes), builder_(builder), out_verts_(out_verts) {} Word_32 operator () (const GridPoint& far_corner, unsigned corner_index); private: const Word_32 voxel_level_; const Word_32 dest_index_stamp_; const Word_32 position_stamp_; VertIndex& vertexes_; IndexedTriSetBuilderI& builder_; VertexPtrVector& out_verts_; }; } // namespace Vox_1F9D #endif // VoxLimitMCAExtractor_h__1F9DB2E1_59E9_11D4_81A8_525400DC8C30__INCLUDED_