Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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  }
41  HuginBase::StandardImageVariableGroups variable_group(pano);
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 ||
57  masks[j].getMaskType()==HuginBase::MaskPolygon::Mask_Stack_positive)
58  {
59  return GUI_ADVANCED;
60  };
61  };
62  };
63  };
64  return GUI_SIMPLE;
65 };
declaration of helper for work with different GuiLevels
ImageVariableGroup & getStacks()
Get the ImageVariableGroup representing the group of stack variables.
GuiLevel GetMinimumGuiLevel(HuginBase::PanoramaData &pano)
returns the requiered GuiLevel for the given panorama to work correctly
Definition: GuiLevel.cpp:29
Somewhere to specify what variables belong to what.
Model for a panorama.
Definition: PanoramaData.h:81
virtual const SrcPanoImage & getImage(std::size_t nr) const =0
get a panorama image, counting starts with 0
std::vector< MaskPolygon > MaskPolygonVector
Definition: Mask.h:147
GuiLevel
Definition: GuiLevel.h:31
virtual std::size_t getNrOfImages() const =0
number of images.
std::size_t getNumberOfParts() const
get the number of parts.
All variables of a source image.
Definition: SrcPanoImage.h:194