00001 /*************************************************************************** 00002 voxelizer.h - description 00003 ------------------- 00004 begin : Sun Mar 9 2003 00005 copyright : (C) 2003 by Moritz Franosch 00006 email : mail@Franosch.org 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef VOXELIZER_H 00019 #define VOXELIZER_H 00020 00021 00022 #include <list> 00023 00024 #include "compound.h" 00025 #include "voxel.h" 00026 00027 00028 class SPH; 00029 00030 00035 class Voxelizer { 00036 00037 private: 00038 00039 Compound voxels; // all voxels that the voxelizer generates 00040 00048 void add_and_recurse(SPH& sph, 00049 const Particle::vector_t& p1, 00050 const Particle::vector_t& p2, 00051 const double d_min); 00052 00062 /* 00063 void add_subvoxel(SPH& sph, 00064 const Particle::vector_t& p1, 00065 const Particle::vector_t& p2, 00066 const Particle::vector_t& p3, 00067 const Particle::vector_t& p4, 00068 const Particle::vector_t& pn); 00069 */ 00070 00074 /* 00075 double get_largest_height(SPH& sph, 00076 const Particle::vector_t& p0, 00077 const Particle::vector_t& pn); 00078 */ 00079 00080 public: 00081 00090 Voxelizer(SPH& sph, const double d_min); 00091 00094 void reset(); 00095 00100 bool next(); 00101 00104 bool at_end() const; 00105 00108 const Geometry& get_voxel() const; 00109 00112 void to_xml(std::ostream& o); 00113 00114 }; 00115 00116 00119 std::ostream& operator<<(std::ostream& o, Voxelizer& voxelizer); 00120 00121 00122 #endif // VOXELIZER_H