Hugin trunk 0.1
Loading...
Searching...
No Matches
GuiLevel.cpp
Go to the documentation of this file.
1// -*- c-basic-offset: 4 -*-
10 /* This is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public
12 * License as published by the Free Software Foundation; either
13 * version 2 of the License, or (at your option) any later version.
14 *
15 * This software is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public
21 * License along with this software. If not, see
22 * <http://www.gnu.org/licenses/>.
23 *
24 */
25
26#include "GuiLevel.h"
28
30{
31 if(pano.getNrOfImages()>0)
32 {
33 for(size_t i=0;i<pano.getNrOfImages();i++)
34 {
35 const HuginBase::SrcPanoImage& img=pano.getImage(i);
36 if(img.getX()!=0 || img.getY()!=0 || img.getZ()!=0 || img.getShear().squareLength()>0)
37 {
38 return GUI_EXPERT;
39 };
40 }
42 if(variable_group.getStacks().getNumberOfParts()<pano.getNrOfImages())
43 {
44 return GUI_ADVANCED;
45 };
46 for(size_t i=0;i<pano.getNrOfImages();i++)
47 {
48 const HuginBase::SrcPanoImage& img=pano.getImage(i);
49 if(img.getRadialVigCorrCenterShift().squareLength()>0)
50 {
51 return GUI_ADVANCED;
52 };
53 HuginBase::MaskPolygonVector masks=img.getMasks();
54 for(size_t j=0; j<masks.size(); j++)
55 {
56 if(masks[j].getMaskType()==HuginBase::MaskPolygon::Mask_Stack_negative ||
58 {
59 return GUI_ADVANCED;
60 };
61 };
62 };
63 };
64 return GUI_SIMPLE;
65};
GuiLevel GetMinimumGuiLevel(HuginBase::PanoramaData &pano)
returns the requiered GuiLevel for the given panorama to work correctly
Definition GuiLevel.cpp:29
declaration of helper for work with different GuiLevels
GuiLevel
Definition GuiLevel.h:32
@ GUI_EXPERT
Definition GuiLevel.h:35
@ GUI_ADVANCED
Definition GuiLevel.h:34
@ GUI_SIMPLE
Definition GuiLevel.h:33
Somewhere to specify what variables belong to what.
Model for a panorama.
virtual const SrcPanoImage & getImage(std::size_t nr) const =0
get a panorama image, counting starts with 0
virtual std::size_t getNrOfImages() const =0
number of images.
All variables of a source image.
std::vector< MaskPolygon > MaskPolygonVector
Definition Mask.h:150
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.
Definition threshold.h:41