GuiLevel.cpp

Go to the documentation of this file.
00001 // -*- c-basic-offset: 4 -*-
00010  /*  This is free software; you can redistribute it and/or
00011  *  modify it under the terms of the GNU General Public
00012  *  License as published by the Free Software Foundation; either
00013  *  version 2 of the License, or (at your option) any later version.
00014  *
00015  *  This software is distributed in the hope that it will be useful,
00016  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  *  Lesser General Public License for more details.
00019  *
00020  *  You should have received a copy of the GNU General Public
00021  *  License along with this software; if not, write to the Free Software
00022  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00023  *
00024  */
00025 
00026 #include "GuiLevel.h"
00027 #include "panodata/StandardImageVariableGroups.h"
00028 
00029 GuiLevel GetMinimumGuiLevel(HuginBase::PanoramaData& pano)
00030 {
00031     if(pano.getNrOfImages()>0)
00032     {
00033         for(size_t i=0;i<pano.getNrOfImages();i++)
00034         {
00035             const HuginBase::SrcPanoImage& img=pano.getImage(i);
00036             if(img.getX()!=0 || img.getY()!=0 || img.getZ()!=0 || img.getShear().squareLength()>0)
00037             {
00038                 return GUI_EXPERT;
00039             };
00040         }
00041         HuginBase::StandardImageVariableGroups variable_group(pano);
00042         if(variable_group.getStacks().getNumberOfParts()<pano.getNrOfImages())
00043         {
00044             return GUI_ADVANCED;
00045         };
00046         for(size_t i=0;i<pano.getNrOfImages();i++)
00047         {
00048             const HuginBase::SrcPanoImage& img=pano.getImage(i);
00049             if(img.getRadialVigCorrCenterShift().squareLength()>0)
00050             {
00051                 return GUI_ADVANCED;
00052             };
00053             HuginBase::MaskPolygonVector masks=img.getMasks();
00054             for(size_t j=0; j<masks.size(); j++)
00055             {
00056                 if(masks[j].getMaskType()==HuginBase::MaskPolygon::Mask_Stack_negative ||
00057                     masks[j].getMaskType()==HuginBase::MaskPolygon::Mask_Stack_positive)
00058                 {
00059                     return GUI_ADVANCED;
00060                 };
00061             };
00062         };
00063     };
00064     return GUI_SIMPLE;
00065 };

Generated on 28 Nov 2014 for Hugintrunk by  doxygen 1.4.7