00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef CORRESPONDENCERENDERER_H_
00024 #define CORRESPONDENCERENDERER_H_
00025
00026 #include <gui/AbstractRenderer.h>
00027
00028 #include <geometry/point.h>
00029 #include <vector>
00030 #include <utility>
00031 #include <GL/gl.h>
00032 #include <GL/glu.h>
00033 #include <iostream>
00034
00035 class CorrespondenceRenderer: public AbstractRenderer {
00036 public:
00037 CorrespondenceRenderer(const std::vector< std::pair<Point2D, Point2D> > *correspondences, const std::vector< double > *m_distances = 0);
00038
00039
00040
00041
00042
00043
00044
00045 inline void setReferenceDepth(float depth)
00046 {m_referenceDepth = depth;}
00047
00048 inline void setDataDepth(float depth)
00049 {m_dataDepth = depth;}
00050
00051 inline void setColors(const std::vector<Color>& _colors)
00052 {m_colors = _colors;}
00053 inline void setColor(unsigned int _index, float _red, float _green, float _blue, float _alpha = 1.0f)
00054 {if(_index < m_colors.size()) m_colors[_index] = Color(_red, _green, _blue, _alpha);}
00055
00056 void setCorrespondences(const std::vector< std::pair<Point2D, Point2D> > *correspondences, const std::vector< double > *m_distances = 0);
00057
00058 inline const std::vector< std::pair<Point2D, Point2D> > * getCorrespondences() const
00059 {return m_correspondences;}
00060
00061 inline const std::vector< double > * getDistances() const
00062 {return m_distances;}
00063
00064 virtual void render();
00065
00066 protected:
00067 const std::vector< std::pair<Point2D, Point2D> > *m_correspondences;
00068 const std::vector< double > *m_distances;
00069 std::vector<Color> m_colors;
00070 float m_referenceDepth;
00071 float m_dataDepth;
00072 double m_maxDistance;
00073 };
00074
00075 #endif