Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
HuginBase::ConstImageVariableGroup Class Reference

An ImageVariableGroup is a collection of image variables that can have some shared variable values. More...

#include <ImageVariableGroup.h>

Inheritance diagram for HuginBase::ConstImageVariableGroup:
Inheritance graph

Public Types

enum  ImageVariableEnum
 

Public Member Functions

 ConstImageVariableGroup (std::set< ImageVariableEnum > variables, const PanoramaData &pano)
 constructor More...
 
virtual ~ConstImageVariableGroup ()
 destructor More...
 
unsigned int getPartNumber (unsigned int imageNr) const
 Get a part number from an image number. More...
 
UIntSetVector getPartsSet () const
 return a vector which contains a HuginBase::UIntSet for each group with the corresponding images numbers More...
 
std::size_t getNumberOfParts () const
 get the number of parts. More...
 
bool getVarLinkedInPart (ImageVariableEnum variable, std::size_t part) const
 Get the linked status of a particular variable for a given part number. More...
 
void updatePartNumbers ()
 Update the part numbers, call this when the panorama changes. More...
 

Protected Member Functions

void setPartNumbers ()
 Set the part numbers in m_image_part_numbers, and notify observers of changes. More...
 

Protected Attributes

std::set< ImageVariableEnumm_variables
 The set of variables which make up this group. More...
 
const PanoramaDatam_pano
 The panorama this group works on. More...
 
std::vector< unsigned int > m_image_part_numbers
 The part numbers for each image. More...
 
unsigned int m_num_parts
 

Detailed Description

An ImageVariableGroup is a collection of image variables that can have some shared variable values.

It is useful to group the image variables to those that are shared because of the same setup: for example lens variables, sensor variables, exposures of particular brackets, positions of particular stacks.

We can partition the set of images in a panorama based on shared (linked) values for some of the variables in the group. (For example, we can Partion the images by Lens given that a lens consists of a projection type, horizontal field of view, and distortion coefficents.) The parts are assigned a number. (e.g. Lens number) We can also unlink a variable across a part, if it is part of the group of variables (For example, it might be necessary to unlink the centre shift of a particular lens). Note that if all the variables in a part are unlinked, this is equivalent to each image being in a separate part, which changes the part numbers. We can also switch an image into a different partition by changing what its variables are linked to.

Another object can listen to changes of part allocations in an ImageVariableGroup, it should inherit from ImageVariableGroupObserver, and register itself with the ImageVariableGroup(s) it wants to hear from.

Definition at line 64 of file ImageVariableGroup.h.

Member Enumeration Documentation

Definition at line 67 of file ImageVariableGroup.h.

Constructor & Destructor Documentation

HuginBase::ConstImageVariableGroup::ConstImageVariableGroup ( std::set< ImageVariableEnum variables,
const PanoramaData pano 
)

constructor

Assign the ImageVariableGroup the image variables and the panorama that it should be handling.

Definition at line 31 of file ImageVariableGroup.cpp.

References setPartNumbers().

HuginBase::ConstImageVariableGroup::~ConstImageVariableGroup ( )
virtual

destructor

Definition at line 40 of file ImageVariableGroup.cpp.

Member Function Documentation

std::size_t HuginBase::ConstImageVariableGroup::getNumberOfParts ( ) const
unsigned int HuginBase::ConstImageVariableGroup::getPartNumber ( unsigned int  imageNr) const
UIntSetVector HuginBase::ConstImageVariableGroup::getPartsSet ( ) const
bool HuginBase::ConstImageVariableGroup::getVarLinkedInPart ( ImageVariableEnum  variable,
std::size_t  part 
) const

Get the linked status of a particular variable for a given part number.

Parameters
variablethe variable to check
partthe part number to check
Returns
true if there is only one image in this part or the first image in this part has links. False otherwise.
Note
If there is only one image in the given part, true is returned. This should make sense as variables are linked by default.

Referenced by main(), and OptimizePhotometricPanel::runOptimizer().

void HuginBase::ConstImageVariableGroup::setPartNumbers ( )
protected

Set the part numbers in m_image_part_numbers, and notify observers of changes.

This should be called whenever the images change.

Referenced by ConstImageVariableGroup(), and updatePartNumbers().

void HuginBase::ConstImageVariableGroup::updatePartNumbers ( )

Member Data Documentation

std::vector<unsigned int> HuginBase::ConstImageVariableGroup::m_image_part_numbers
protected

The part numbers for each image.

The image number is used as an index.

Definition at line 125 of file ImageVariableGroup.h.

Referenced by getPartNumber(), getPartsSet(), HuginBase::ImageVariableGroup::linkVariableImage(), and HuginBase::ImageVariableGroup::unlinkVariableImage().

unsigned int HuginBase::ConstImageVariableGroup::m_num_parts
protected

Definition at line 127 of file ImageVariableGroup.h.

Referenced by getNumberOfParts().

const PanoramaData& HuginBase::ConstImageVariableGroup::m_pano
protected

The panorama this group works on.

Definition at line 120 of file ImageVariableGroup.h.

Referenced by getPartNumber().

std::set<ImageVariableEnum> HuginBase::ConstImageVariableGroup::m_variables
protected

The set of variables which make up this group.

Definition at line 117 of file ImageVariableGroup.h.


The documentation for this class was generated from the following files: