MrepSkeleton2d.hpp

00001 // This file is part of the imaging2 class library.
00002 //
00003 // University of Innsbruck, Infmath Imaging, 2009.
00004 // http://infmath.uibk.ac.at
00005 //
00006 // All rights reserved.
00007 
00008 
00009 #ifndef SHAPE_MREP_MREPSKELETON2D_H
00010 #define SHAPE_MREP_MREPSKELETON2D_H
00011 
00012 #include <shape/mrep/MrepModel.hpp>
00013 #include <shape/mrep/Position2d.hpp>
00014 #include <shape/mrep/MrepAtom.hpp>
00015 #include <shape/mrep/MrepConnection.hpp>
00016 #include <shape/mrep/MrepModel.hpp>
00017 
00018 
00019 namespace imaging
00020 {
00024   class MrepSkeleton2d : public MrepModel< Position2d, MrepAtom, MrepConnection<2> >
00025   {
00026     float_t atom_rotation(size_t atom_index) const;
00027       
00028     void set_subtree_geometry(size_t atom_index, float_t rotation, const std::vector< ublas::fixed_vector<float_t, 2> > & atom_centers);
00029 
00030   public:
00031     MrepSkeleton2d() : MrepModel< Position2d, MrepAtom, MrepConnection<2> >() {}
00032     MrepSkeleton2d(const Position2d & position,
00033                 size_t n_atoms = 0, size_t n_connections = 0) :
00034       MrepModel< Position2d, MrepAtom, MrepConnection<2> >(position, n_atoms, n_connections) {}
00035     
00037     ublas::fixed_vector<float_t, 2> atom_center(size_t atom_index) const;
00038     
00040     void set_atom_center(size_t atom_index, const ublas::fixed_vector<float_t, 2> & center);
00041     
00043     void set_atom_radius(size_t atom_index, float_t radius);
00044 
00045     void get_geometry(std::vector< ublas::fixed_vector<float_t, 2> > & atom_centers,
00046       std::vector<float_t> & atom_radii) const;
00047     
00048     void set_geometry(const std::vector< ublas::fixed_vector<float_t, 2> > & atom_centers,
00049       const std::vector<float_t> & atom_radii);
00050     
00052     float_t atom_radius(size_t atom_index) const
00053     {
00054       return _atoms[atom_index].radius();
00055     }
00056     
00057     float_t compute_tangent_angle(size_t atom_1, size_t atom_2) const;
00058   };
00059 
00060 }
00061 
00062 #endif

Generated on Tue Feb 10 10:01:30 2009 for imaging2 by  doxygen 1.5.5