OverviewOutlinesTool.cpp

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

Generated on 2 Aug 2015 for Hugintrunk by  doxygen 1.4.7