OverviewOutlinesTool.cpp

Go to the documentation of this file.
00001 // -*- c-basic-offset: 4 -*-
00022 #include <GL/glew.h>
00023 #ifdef __WXMAC__
00024 #include <OpenGL/gl.h>
00025 #include <OpenGL/glu.h>
00026 #else
00027 #include <GL/gl.h>
00028 #include <GL/glu.h>
00029 #endif
00030 #ifdef __APPLE__
00031   #include <GLUT/glut.h>
00032 #endif
00033 
00034 #include "OverviewOutlinesTool.h"
00035 #include "GLViewer.h"
00036 
00037 #include "GreatCircles.h"
00038 #include <cfloat>
00039 
00040 const double OverviewOutlinesTool::res=10;
00041 const double OverviewOutlinesTool::mindist=2;
00042 
00043 OverviewOutlinesTool::OverviewOutlinesTool(ToolHelper * helper, GLViewer * viewer) : thelper(helper),
00044     dirty_meshes(true), preview(viewer),
00045     display_list_number_canvas(glGenLists(1)),
00046     display_list_number_crop(glGenLists(1)),
00047     display_list_number_canvas_outline(glGenLists(1)),
00048     display_list_number_crop_outline(glGenLists(1))
00049 {
00050     thelper->GetPanoramaPtr()->addObserver(this);
00051 }
00052 
00053 OverviewOutlinesTool::~OverviewOutlinesTool()
00054 {
00055 }
00056 
00057 void OverviewOutlinesTool::panoramaChanged(HuginBase::Panorama &pano)
00058 {
00059 
00060     dirty_meshes = true;
00061     thelper->GetVisualizationStatePtr()->ForceRequireRedraw();
00062     
00063 }
00064 
00065 
00066 struct Rec {
00067     Rec(double left, double top, double right, double bottom) : left(left), top(top), right(right), bottom(bottom) {}
00068     Rec() {}
00069     double left;
00070     double top;
00071     double right;
00072     double bottom;
00073 };
00074 
00075 //#define WIREFRAME
00076 
00077 void PanosphereOverviewOutlinesTool::Activate()
00078 {
00079     static_cast<PanosphereOverviewToolHelper*>(helper)->NotifyMe(PanosphereOverviewToolHelper::DRAW_OVER_IMAGES_FRONT, this);
00080     static_cast<PanosphereOverviewToolHelper*>(helper)->NotifyMe(PanosphereOverviewToolHelper::DRAW_OVER_IMAGES_BACK, this);
00081 //    helper->NotifyMe(ToolHelper::DRAW_OVER_IMAGES, this);
00082 }
00083 
00084 
00085 void PlaneOverviewOutlinesTool::Activate()
00086 {
00087     (helper)->NotifyMe(ToolHelper::DRAW_OVER_IMAGES, this);
00088 }
00089 
00090 void PlaneOverviewOutlinesTool::AfterDrawImagesEvent()
00091 {
00092     draw();
00093 }
00094 
00095 void PanosphereOverviewOutlinesTool::AfterDrawImagesBackEvent()
00096 {
00097     draw();
00098 }
00099 
00100 void PanosphereOverviewOutlinesTool::AfterDrawImagesFrontEvent()
00101 {
00102     draw();
00103 }
00104 
00105 void PanosphereOverviewOutlinesTool::drawBackground()
00106 {
00107 
00108     double radius = static_cast<PanosphereOverviewVisualizationState*>(helper->GetVisualizationStatePtr())->getSphereRadius();
00109     GLUquadric* grid = gluNewQuadric();
00110     gluSphere(grid, radius+1,40,20);
00111 
00112 }
00113 
00114 void PlaneOverviewOutlinesTool::drawBackground()
00115 {
00116 
00117     glBegin(GL_QUADS);
00118 
00119     double end = 1000000;
00120 
00121     glVertex3f(-end, end, 0);
00122     glVertex3f( end, end, 0);
00123     glVertex3f( end,-end, 0);
00124     glVertex3f(-end,-end, 0);
00125 
00126     glEnd();
00127 
00128 }
00129 
00130 void OverviewOutlinesTool::draw()
00131 {
00132 
00133     if (!(preview->m_visualization_state)) {
00134         return;
00135     }
00136 
00137 
00138     if (dirty_meshes) {
00139 
00140 //    std::cout << "outlines after draw images\n";
00141 //        vigra::Rect2D trect = preview->m_visualization_state->GetVisibleArea();
00142 //        double hscale, wscale;
00143 //        hscale = (float) thelper->GetVisualizationStatePtr()->GetOptions()->getHeight() / (float) preview->m_visualization_state->GetOptions()->getHeight();
00144 //        wscale =  (float) thelper->GetVisualizationStatePtr()->GetOptions()->getWidth() / (float) preview->m_visualization_state->GetOptions()->getWidth();
00145 //        std::cerr << "outlines " << hscale << " " << wscale << std::endl;
00146 //        std::cerr << "outlines " << trect.left() << " " << trect.top() << " " << trect.right() << " " << trect.bottom() << std::endl;
00147 //        vigra::Rect2D rect(trect.left() * wscale, trect.top() * hscale, trect.right() * wscale, trect.bottom() * hscale);
00148 //        std::cerr << "outlines " << rect.left() << " " << rect.top() << " " << rect.right() << " " << rect.bottom() << std::endl;
00149 
00150         vigra::Rect2D rect = preview->m_visualization_state->GetVisibleArea();
00151 
00152         glNewList(display_list_number_canvas,GL_COMPILE);
00153         DrawRect(rect.left(), rect.top(), rect.right(), rect.bottom(),false);
00154         glEndList();
00155         glNewList(display_list_number_canvas_outline,GL_COMPILE);
00156         DrawRect(rect.left(), rect.top(), rect.right(), rect.bottom(),true, 4.0);
00157         glEndList();
00158 
00159         vigra::Rect2D roi = thelper->GetViewStatePtr()->GetOptions()->getROI();
00160         glNewList(display_list_number_crop,GL_COMPILE);
00161         DrawRect(roi.left(), roi.top(), roi.right(), roi.bottom(),false);
00162         glEndList();
00163         glNewList(display_list_number_crop_outline,GL_COMPILE);
00164         DrawRect(roi.left(), roi.top(), roi.right(), roi.bottom(),true, 2.0);
00165         glEndList();
00166 
00167         dirty_meshes = false;
00168         
00169 //    std::cout << "outlines adi " << rect.left() << " " << rect.top() << " " << rect.right() << " " << rect.bottom() << std::endl;
00170 //    std::cout << "outlines adi " << roi.left() << " " << roi.top() << " " << roi.right() << " " << roi.bottom() << std::endl;
00171     }
00172 
00173     if (thelper->GetVisualizationStatePtr()->RequireRecalculateViewport()) {
00174 
00175         vigra::Rect2D rect = preview->m_visualization_state->GetVisibleArea();
00176         glNewList(display_list_number_canvas_outline,GL_COMPILE);
00177         DrawRect(rect.left(), rect.top(), rect.right(), rect.bottom(),true, 4.0);
00178         glEndList();
00179 
00180         vigra::Rect2D roi = thelper->GetViewStatePtr()->GetOptions()->getROI();
00181         glNewList(display_list_number_crop_outline,GL_COMPILE);
00182         DrawRect(roi.left(), roi.top(), roi.right(), roi.bottom(),true, 2.0);
00183         glEndList();
00184 
00185     }
00186 
00187 
00188     glDisable(GL_TEXTURE_2D);
00189 
00190     glEnable(GL_BLEND);
00191     glColor4f(0, 0, 0, 0.50f);
00192     glBlendFunc(GL_ZERO, GL_SRC_ALPHA);
00193     drawBackground();
00194 
00195 
00196     glColor4f(1.0f, 1.0f, 1.0f, 0.20f);
00197     glBlendFunc(GL_DST_COLOR, GL_SRC_ALPHA);
00198     glCallList(display_list_number_canvas);
00199 
00200 //    std::cout << "outlines " << roi.left() << " " << roi.top() << " " << roi.right() << " " << roi.bottom() << std::endl;
00201 
00202     glColor4f(1.0f, 1.0f, 1.0f, 0.66f);
00203     glBlendFunc(GL_DST_COLOR, GL_SRC_ALPHA);
00204     glCallList(display_list_number_crop);
00205 
00206     glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
00207     glColor4f(0.8f, 0.8f, 0.8f, 0.5f);
00208     glCallList(display_list_number_canvas_outline);
00209     glColor4f(0.8f, 0.8f, 0.8f, 0.6f);
00210     glCallList(display_list_number_crop_outline);
00211 
00212     glEnable(GL_TEXTURE_2D);
00213     glDisable(GL_BLEND);
00214     glColor4f(1,1,1,1);
00215 
00216 }
00217 
00218 void OverviewOutlinesTool::DrawRect(double left, double top, double right, double bottom, bool outline, double line_width)
00219 {
00220 
00221     vigra::Size2D size = thelper->GetVisualizationStatePtr()->GetOptions()->getSize();
00222     double mlength = (size->y > size->x) ? size->y : size->x;
00223 
00224     double fov = thelper->GetVisualizationStatePtr()->GetOptions()->getHFOV();
00225     
00226     //since res was initially estimated for size of 360x100;
00227     //TODO make res scale dependent
00228     double tres = res * mlength / fov;
00229     double tmindist = mindist * mlength / fov;
00230 
00231 //    std::cerr << "outlines " << mlength << std::endl;
00232 //    std::cerr << "outlines " << right << std::endl;
00233 
00234     double safety = 1;
00235     left += safety;
00236     top += safety;
00237     right -= safety;
00238     bottom -= safety;
00239 
00240     HuginBase::PTools::Transform transform;
00241     HuginBase::SrcPanoImage image;
00242 //    image.setSize(vigra::Size2D(360,180));
00243     image.setSize(size);
00244     image.setHFOV(fov);
00245     switch(thelper->GetVisualizationStatePtr()->GetOptions()->getProjection()) {
00246         case HuginBase::PanoramaOptions::EQUIRECTANGULAR:
00247             image.setProjection(HuginBase::BaseSrcPanoImage::EQUIRECTANGULAR);
00248             break;
00249         case HuginBase::PanoramaOptions::RECTILINEAR:
00250             image.setProjection(HuginBase::BaseSrcPanoImage::RECTILINEAR);
00251             break;
00252     }
00253     
00254     transform.createTransform(image, *(preview->m_visualization_state->GetOptions()));
00255 
00256     HuginBase::PanoramaOptions::ProjectionFormat proj = thelper->GetViewStatePtr()->GetOptions()->getProjection();
00257 
00258     switch(proj) {
00259 
00260         case HuginBase::PanoramaOptions::SINUSOIDAL:
00261         case HuginBase::PanoramaOptions::LAMBERT:
00262         case HuginBase::PanoramaOptions::LAMBERT_AZIMUTHAL:
00263         case HuginBase::PanoramaOptions::HAMMER_AITOFF:
00264         case HuginBase::PanoramaOptions::FULL_FRAME_FISHEYE:
00265         case HuginBase::PanoramaOptions::ALBERS_EQUAL_AREA_CONIC:
00266         case HuginBase::PanoramaOptions::ORTHOGRAPHIC:
00267         case HuginBase::PanoramaOptions::EQUISOLID:
00268         case HuginBase::PanoramaOptions::THOBY_PROJECTION:
00269 
00270             {
00271 
00272             //in this case just the divide the base rectangle by a certain amount of steps
00273 
00274             float steps = 40;
00275 
00276             double wstep = (float)(right - left) / steps;
00277             double hstep = (float)(bottom - top) / steps;
00278             
00279             for(int w = 0 ; w < steps ; w++) {
00280             for(int h = 0 ; h < steps ; h++) {
00281 
00282                 //if outline is needed just consider edge cases
00283                 if (outline) {
00284                     if (!(w == 0 || h == 0 || w == steps - 1 || steps - 1)) {
00285                         continue;
00286                     }
00287                 }
00288 
00289                 Rect rec(left + w * wstep, top + h * hstep, left + (w+1) * wstep, top + (h+1)* hstep);
00290                 Rect tr = rec.transformImgCoord(&transform);
00291 
00292                //this section should be added to avoid certain problems with these projections 
00293                //(just disregard edges with lengths larger than some value with respect to the radius of the sphere)
00294                //TODO this was commented when support for mosaic plane was added, make this work again
00295                 // double edge1 = (tr.val[0][0]-tr.val[1][0])*(tr.val[0][0]-tr.val[1][0]) + (tr.val[0][1]-tr.val[1][1])*(tr.val[0][1]-tr.val[1][1]);
00296                 // double edge2 = (tr.val[1][0]-tr.val[2][0])*(tr.val[1][0]-tr.val[2][0]) + (tr.val[1][1]-tr.val[2][1])*(tr.val[1][1]-tr.val[2][1]);
00297                 // double edge3 = (tr.val[2][0]-tr.val[3][0])*(tr.val[2][0]-tr.val[3][0]) + (tr.val[2][1]-tr.val[3][1])*(tr.val[2][1]-tr.val[3][1]);
00298                 // double edge4 = (tr.val[3][0]-tr.val[0][0])*(tr.val[3][0]-tr.val[0][0]) + (tr.val[3][1]-tr.val[0][1])*(tr.val[3][1]-tr.val[0][1]);
00299 
00300 //                double maxlimit = (radius/2.0)*(radius/2.0);
00301 //                if (
00302 //                        proj == HuginBase::PanoramaOptions::SINUSOIDAL ||
00303 //                        proj == HuginBase::PanoramaOptions::ALBERS_EQUAL_AREA_CONIC
00304 //                    )
00305 //                if (edge1 > maxlimit || edge2 > maxlimit || edge3 > maxlimit || edge4 > maxlimit) {
00306 //                    continue;
00307 //                }
00308 
00309                 if (outline) {
00310 
00311 //                    glBegin(GL_LINES);
00312                     bool edges[4] = {false,false,false,false};
00313                     if (w == 0) {
00314                         edges[0] = true;
00315                     }
00316                     if (w == steps - 1) {
00317                         edges[2] = true;
00318                     }
00319                     if (h == 0) {
00320                         edges[3] = true;
00321                     }
00322                     if (h == steps - 1) {
00323                         edges[1] = true;
00324                     }
00325                     for (int i = 0 ; i < 4 ; i++) {
00326                         if (edges[i]) {
00327 
00328 
00329                             //draw a line with the help of the GreatCircles class so that a mesh is drawn instead of just a line
00330                             int plus = i+1;
00331                             if (plus == 4) plus = 0;
00332                             hugin_utils::FDiff2D cd1(tr.val[i][0], tr.val[i][1]);
00333                             hugin_utils::FDiff2D cd2(tr.val[plus][0], tr.val[plus][1]);
00334                             GreatCircleArc::LineSegment line;
00335                             line.vertices[0] = cd1;
00336                             line.vertices[1] = cd2;
00337                             line.doGL(line_width, thelper->GetVisualizationStatePtr());
00338 
00339 
00340 //                            for (int j = 0 ; j < 2 ; j++) {
00341 //                                int plus = i+j;
00342 //                                if (plus == 4) plus = 0;
00343 //                                double x,y,z;
00344 //                                double tx,ty;
00345 //                                tx = tr.val[plus][0];
00346 //                                ty = tr.val[plus][1];
00352 //                                hugin_utils::FDiff2D cd(tx,ty);
00353 //                                MeshManager::MeshInfo::Coord3D coord = thelper->GetVisualizationStatePtr()->GetMeshManager()->GetCoord3D(cd);
00354 //                                glVertex3f(coord.x,coord.y,coord.z);
00355 //                            }
00356 
00357                         }
00358                     }
00359 //                    glEnd();
00360                        
00361                 } else {
00362 
00363                     //in this case draw the mesh
00364 
00365                     #ifdef WIREFRAME
00366                     glBegin(GL_LINE_LOOP);
00367                     #else
00368                     glBegin(GL_POLYGON);
00369                     #endif
00370                     for (int s = 0 ; s < 4 ; s++) {
00371                         double tx,ty;
00372                         tx = tr.val[s][0];
00373                         ty = tr.val[s][1];
00374 //                        ty = ty - 90;
00375 //                        tx = tx - 180;
00376 //                        ty *= -1;
00377                         hugin_utils::FDiff2D cd(tx,ty);
00378                         MeshManager::MeshInfo::Coord3D coord = thelper->GetVisualizationStatePtr()->GetMeshManager()->GetCoord3D(cd);
00379                         glVertex3f(coord.x,coord.y,coord.z);
00380                     }
00381                     glEnd();
00382 
00383                 }
00384 
00385             }
00386             }
00387 
00388             }
00389 
00390         break;
00391 
00392         case HuginBase::PanoramaOptions::RECTILINEAR:
00393         case HuginBase::PanoramaOptions::EQUIRECTANGULAR:
00394         case HuginBase::PanoramaOptions::CYLINDRICAL:
00395         case HuginBase::PanoramaOptions::STEREOGRAPHIC:
00396         case HuginBase::PanoramaOptions::MERCATOR:
00397         case HuginBase::PanoramaOptions::TRANSVERSE_MERCATOR:
00398         case HuginBase::PanoramaOptions::MILLER_CYLINDRICAL:
00399         case HuginBase::PanoramaOptions::PANINI:
00400         case HuginBase::PanoramaOptions::EQUI_PANINI:
00401         case HuginBase::PanoramaOptions::BIPLANE:
00402         case HuginBase::PanoramaOptions::TRIPLANE:
00403         case HuginBase::PanoramaOptions::GENERAL_PANINI:
00404         case HuginBase::PanoramaOptions::ARCHITECTURAL:
00405 
00406             //stack to keep the rectangles to be divided
00407             std::vector<Rec> stack;
00408 
00409             stack.push_back(Rec(left,top,right,bottom));
00410             //if outline needs to be obtained, after each rectangle another rectangle is pushed back 
00411             if (outline) {
00412                 stack.push_back(Rec(true, true, true, true));
00413             }
00414             
00415             while(stack.size() > 0) {
00416 
00417                 Rec edge;
00418                 if (outline) {
00419                     edge = stack[stack.size() - 1];
00420                     stack.pop_back();
00421                 }
00422 
00423                 Rec top_rec = stack[stack.size() - 1];
00424                 stack.pop_back();
00425 
00426                 if (outline) {
00427                     if (!(edge.left || edge.top || edge.right || edge.bottom )) {
00428                         continue;
00429                     }
00430                 }
00431 
00432                 Rect rect(top_rec.left, top_rec.top, top_rec.right, top_rec.bottom);
00433 
00434                 Rect tr = rect.transformImgCoord(&transform);
00435 
00436                 double edge1 = (tr.val[0][0]-tr.val[1][0])*(tr.val[0][0]-tr.val[1][0]) + (tr.val[0][1]-tr.val[1][1])*(tr.val[0][1]-tr.val[1][1]);
00437                 double edge2 = (tr.val[1][0]-tr.val[2][0])*(tr.val[1][0]-tr.val[2][0]) + (tr.val[1][1]-tr.val[2][1])*(tr.val[1][1]-tr.val[2][1]);
00438                 double edge3 = (tr.val[2][0]-tr.val[3][0])*(tr.val[2][0]-tr.val[3][0]) + (tr.val[2][1]-tr.val[3][1])*(tr.val[2][1]-tr.val[3][1]);
00439                 double edge4 = (tr.val[3][0]-tr.val[0][0])*(tr.val[3][0]-tr.val[0][0]) + (tr.val[3][1]-tr.val[0][1])*(tr.val[3][1]-tr.val[0][1]);
00440 
00441 //                std::cout << "outlines  " << top_rec.left << " " << top_rec.top << " " << top_rec.right << " " << top_rec.bottom << std::endl;
00442 //                std::cout << "outlines  " << edge1 << " " << edge2 << " " << edge3 << " " << edge4 << std::endl;
00443 
00444 //                std::cout << "outlines  " << tr.val[0][0] << " " << tr.val[0][1] << std::endl;
00445 //                std::cout << "outlines  " << tr.val[1][0] << " " << tr.val[1][1] << std::endl;
00446 //                std::cout << "outlines  " << tr.val[2][0] << " " << tr.val[2][1] << std::endl;
00447 //                std::cout << "outlines  " << tr.val[3][0] << " " << tr.val[3][1] << std::endl;
00448 
00449                 double ressq = tres * tres;
00450 
00451                 bool divide_ver = false;
00452                 bool divide_hor = false;
00453 
00454                 //decide whether to divide the current rectangle
00455                 if (
00456                         (edge1 > ressq || edge3 > ressq) 
00457                             && 
00458                         abs(top_rec.top - top_rec.bottom) > tmindist
00459                     ) {
00460 
00461                         divide_ver = true;
00462 
00463                 } else if (
00464                             (edge2 > ressq || edge4 > ressq) 
00465                                 && 
00466                             abs(top_rec.left - top_rec.right) > tmindist
00467                         ) {
00468 
00469                         divide_hor = true;
00470 
00471                 }
00472 
00473                 if (divide_ver) {
00474 
00475                     stack.push_back(Rec(top_rec.left,top_rec.top,top_rec.right,(top_rec.top+top_rec.bottom)/2.0));
00476                     if (outline) {
00477                         stack.push_back(Rec(edge.left, edge.top, edge.right, false));
00478                     }
00479                     stack.push_back(Rec(top_rec.left,(top_rec.top+top_rec.bottom)/2.0,top_rec.right,top_rec.bottom));
00480                     if (outline) {
00481                         stack.push_back(Rec(edge.left, false, edge.right, edge.bottom));
00482                     }
00483                 }
00484 
00485                 if (divide_hor) {
00486 
00487                     stack.push_back(Rec(top_rec.left,top_rec.top,(top_rec.left+top_rec.right)/2.0,top_rec.bottom));
00488                     if (outline) {
00489                         stack.push_back(Rec(edge.left, edge.top, false, edge.bottom));
00490                     }
00491                     stack.push_back(Rec((top_rec.left+top_rec.right)/2.0,top_rec.top,top_rec.right,top_rec.bottom));
00492                     if (outline) {
00493                         stack.push_back(Rec(false, edge.top, edge.right, edge.bottom));
00494                     }
00495                 
00496                 } 
00497 
00498                 if (!(divide_ver || divide_hor)) {
00499 
00500                     //draw it
00501                     
00502                     if (outline) {
00503 //                        glBegin(GL_LINES);
00504                         bool edges[4];
00505                         edges[0] = edge.left!=0;
00506                         edges[1] = edge.bottom!=0;
00507                         edges[2] = edge.right!=0;
00508                         edges[3] = edge.top!=0;
00509                         for (int i = 0 ; i < 4 ; i++) {
00510                             if (edges[i]) {
00511 //                            std::cout << "outlines line!!" << i << "\n";
00512 //                            std::cout << "outlines  " << top_rec.left << " " << top_rec.top << " " << top_rec.right << " " << top_rec.bottom << std::endl;
00513 
00514                             int plus = i+1;
00515                             if (plus == 4) plus = 0;
00516                             hugin_utils::FDiff2D cd1(tr.val[i][0], tr.val[i][1]);
00517                             hugin_utils::FDiff2D cd2(tr.val[plus][0], tr.val[plus][1]);
00518                             GreatCircleArc::LineSegment line;
00519                             line.vertices[0] = cd1;
00520                             line.vertices[1] = cd2;
00521                             line.doGL(line_width, thelper->GetVisualizationStatePtr());
00522                             
00523 //                            MeshManager::MeshInfo::Coord3D coord1 = thelper->GetVisualizationStatePtr()->GetMeshManager()->GetCoord3D(cd1);
00524 //                            MeshManager::MeshInfo::Coord3D coord2 = thelper->GetVisualizationStatePtr()->GetMeshManager()->GetCoord3D(cd2);
00525 //                            glVertex3f(coord1.x,coord1.y,coord1.z);
00526 //                            glVertex3f(coord2.x,coord2.y,coord2.z);
00527 
00528             
00529 //                            for (int j = 0 ; j < 2 ; j++) {
00530 //                                int plus = i+j;
00531 //                                if (plus == 4) plus = 0;
00532 //                                double x,y,z;
00533 //                                double tx,ty;
00534 //                                tx = tr.val[plus][0];
00535 //                                ty = tr.val[plus][1];
00539 
00540 //                                
00541 //                                hugin_utils::FDiff2D cd(tx,ty);
00542 //                                MeshManager::MeshInfo::Coord3D coord = thelper->GetVisualizationStatePtr()->GetMeshManager()->GetCoord3D(cd);
00543 //                                glVertex3f(coord.x,coord.y,coord.z);
00544 //                            }
00545                             }
00546                         }
00547 //                        glEnd();
00548                     } else {
00549                         #ifdef WIREFRAME
00550                         glBegin(GL_LINE_LOOP);
00551                         #else
00552                         glBegin(GL_POLYGON);
00553                         #endif
00554                         for (int s = 0 ; s < 4 ; s++) {
00555                             double tx,ty;
00556                             tx = tr.val[s][0];
00557                             ty = tr.val[s][1];
00558 //                            ty = ty - 90;
00559 //                            tx = tx - 180;
00560 //                            ty *= -1;
00561                             hugin_utils::FDiff2D cd(tx,ty);
00562                             MeshManager::MeshInfo::Coord3D coord = thelper->GetVisualizationStatePtr()->GetMeshManager()->GetCoord3D(cd);
00563                             glVertex3f(coord.x,coord.y,coord.z);
00564                         }
00565                         glEnd();
00566                     }
00567                 }
00568 
00569             }
00570 
00571         break;
00572 
00573     }
00574 
00575 }
00576 
00577 
00578 

Generated on 8 Feb 2016 for Hugintrunk by  doxygen 1.4.7