Go to the documentation of this file.00001 #ifndef OPENTISSUE_COLLISION_SPATIAL_HASHING_HASH_QUERIES_SPATIAL_HASHING_POINT_DATA_QUERY_H
00002 #define OPENTISSUE_COLLISION_SPATIAL_HASHING_HASH_QUERIES_SPATIAL_HASHING_POINT_DATA_QUERY_H
00003
00004
00005
00006
00007
00008
00009
00010 #include <OpenTissue/configuration.h>
00011
00012 #include <OpenTissue/collision/spatial_hashing/spatial_hashing_query.h>
00013
00014 namespace OpenTissue
00015 {
00016 namespace spatial_hashing
00017 {
00018
00019 template<typename hash_grid, typename collision_policy>
00020 class PointDataQuery
00021 : public Query< PointDataQuery<hash_grid,collision_policy>, hash_grid, collision_policy >
00022 {
00023 public:
00024
00025 template< typename data_iterator >
00026 void first_pass(data_iterator begin,data_iterator end )
00027 {
00028 for(data_iterator data=begin;data!=end;++data)
00029 {
00030 typename hash_grid::point_type p = position(*data);
00031 get_cell(p).add( *data );
00032 }
00033 }
00034
00035
00036 template< typename data_iterator >
00037 void remove_data(data_iterator begin,data_iterator end )
00038 {
00039 for(data_iterator data=begin;data!=end;++data)
00040 {
00041 typename hash_grid::point_type p = position(*data);
00042 get_cell(p).remove( *data );
00043 }
00044 }
00045
00046 };
00047
00048 }
00049
00050 }
00051
00052
00053 #endif