Jafar
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
AngleCovVisitor.hpp
00001 /* $Id$ */
00002 
00003 #ifndef _JAFAR_GEOM_ANGLE_COV_VISITOR_HPP_
00004 #define _JAFAR_GEOM_ANGLE_COV_VISITOR_HPP_
00005 
00006 #include "AtomVisitor.hpp"
00007 #include "AngleCov.hpp"
00008 
00009 namespace jafar {
00010   namespace geom {
00011     template<int dimension>
00012     class AngleCovVisitor : public AtomVisitor<dimension>
00013     {
00014       public:
00015         AngleCovVisitor() : m_angle(0.0), m_angleCov(0.0) {}
00016         double angle() const { return m_angle; }
00017         double angleCov() const { return m_angleCov; }
00018       protected:
00019         double m_angle, m_angleCov;
00020     };
00021     template<class _AtomT_>
00022     class AngleCovVisitorImpl : public AngleCovVisitor<_AtomT_::Dimension>
00023     {
00024       public:
00025         AngleCovVisitorImpl(const _AtomT_* atom) : m_atom(atom)
00026         {
00027         }
00028         virtual void visit( const geom::Point<_AtomT_::Dimension>& point)
00029         {
00030           this->m_angle = 0;
00031           this->m_angleCov = 0;
00032         }
00033         virtual void visit( const geom::Line<_AtomT_::Dimension>& line)
00034         {
00035           angleCov( *m_atom, line, this->m_angle, this->m_angleCov );
00036         }
00037         virtual void visit( const geom::HyperPlane<_AtomT_::Dimension>& plan)
00038         {
00039           angleCov( *m_atom, plan, this->m_angle, this->m_angleCov );
00040         }
00041         virtual void visit( const geom::Segment<_AtomT_::Dimension>& segment)
00042         {
00043           angleCov( *m_atom, segment, this->m_angle, this->m_angleCov );
00044         }
00045         virtual void visit( const geom::Facet<_AtomT_::Dimension>& facet)
00046         {
00047           angleCov( *m_atom, facet, this->m_angle, this->m_angleCov );
00048         }
00049       private:
00050         const _AtomT_* m_atom;
00051     };
00052     
00053   }
00054 }
00055 
00056 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Wed Oct 15 2014 00:37:19 for Jafar by doxygen 1.7.6.1
LAAS-CNRS