ControlPoint.cpp

Go to the documentation of this file.
00001 // -*- c-basic-offset: 4 -*-
00025 #include "ControlPoint.h"
00026 
00027 
00028 namespace HuginBase {
00029 
00030     
00031 bool ControlPoint::operator==(const ControlPoint & o) const
00032 {
00033     return (image1Nr == o.image1Nr &&
00034             image2Nr == o.image2Nr &&
00035             x1 == o.x1 && y1 == o.y1 &&
00036             x2 == o.x2 && y2 == o.y2 &&
00037             mode == o.mode &&
00038             error == o.error);
00039 }
00040 
00041 
00042 void ControlPoint::mirror()
00043 {
00044     unsigned int ti;
00045     double td;
00046     ti =image1Nr; image1Nr = image2Nr, image2Nr = ti;
00047     td = x1; x1 = x2 ; x2 = td;
00048     td = y1; y1 = y2 ; y2 = td;
00049 }
00050 
00051 
00052 std::string ControlPoint::modeNames[] = { "x_y", "x", "y" };
00053 
00054 const std::string& ControlPoint::getModeName(OptimizeMode mode) const
00055 {
00056     return modeNames[mode];
00057 }
00058 
00059 const std::string ControlPoint::getCPString() const
00060 {
00061     std::ostringstream s;
00062     s << modeNames[mode];
00063     if(image1Nr<=image2Nr)
00064     {
00065         s << " " << image1Nr << ": " << x1 << "," << y1 << "|" << image2Nr << ": " << x2 << "," <<y2;
00066     }
00067     else
00068     {
00069         s << " " << image2Nr << ": " << x2 << "," << y2 << "|" << image1Nr << ": " << x1 << "," <<y1;
00070     }
00071     return s.str();
00072 };
00073 
00074 #if 0
00075 ControlPoint::ControlPoint(Panorama & pano, const QDomNode & node)
00076 {
00077     setFromXML(node,pano);
00078 }
00079 #endif
00080     
00081 
00082 } // namespace

Generated on 29 Nov 2014 for Hugintrunk by  doxygen 1.4.7