Hugintrunk
0.1
|
An ImageVariableGroup is a collection of image variables that can have some shared variable values. More...
#include <ImageVariableGroup.h>
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< ImageVariableEnum > | m_variables |
The set of variables which make up this group. More... | |
const PanoramaData & | m_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 |
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.
Definition at line 67 of file ImageVariableGroup.h.
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().
|
virtual |
destructor
Definition at line 40 of file ImageVariableGroup.cpp.
std::size_t HuginBase::ConstImageVariableGroup::getNumberOfParts | ( | ) | const |
get the number of parts.
Definition at line 261 of file ImageVariableGroup.cpp.
References m_num_parts.
Referenced by CheckProjectFile(), PanoOperation::ChangeLensOperation::GetInternalCommand(), PanoOperation::ChangeStackOperation::GetInternalCommand(), PanoOperation::AssignStacksOperation::GetInternalCommand(), HuginBase::ConstStandardImageVariableGroups::getLens(), GetMinimumGuiLevel(), getPartsSet(), PanoOperation::NewLensOperation::IsEnabled(), PanoOperation::ChangeLensOperation::IsEnabled(), PanoOperation::NewStackOperation::IsEnabled(), PanoOperation::ChangeStackOperation::IsEnabled(), main(), ImagesTreeCtrl::panoramaImagesChanged(), OptimizePhotometricPanel::runOptimizer(), HuginBase::LensDB::SaveLensDataFromPano(), and HuginBase::SmartOptimise::smartOptimize().
unsigned int HuginBase::ConstImageVariableGroup::getPartNumber | ( | unsigned int | imageNr | ) | const |
Get a part number from an image number.
Definition at line 44 of file ImageVariableGroup.cpp.
References DEBUG_ASSERT, HuginBase::PanoramaData::getNrOfImages(), m_image_part_numbers, and m_pano.
Referenced by AutoPanoSiftStack::automatch(), AutoPanoSiftMultiRowStack::automatch(), PossiblePano::GeneratePanorama(), PanoOperation::LoadLensOperation::GetInternalCommand(), HuginBase::ConstStandardImageVariableGroups::getLens(), LensCalFrame::GetPanorama(), main(), PanoCommand::wxAddImagesCmd::processPanorama(), PanoCommand::UpdateCropFactorCmd::processPanorama(), PanoCommand::ChangePartNumberCmd::processPanorama(), ImagesTreeCtrl::UpdateImageText(), and HuginBase::Panorama::updateMasks().
UIntSetVector HuginBase::ConstImageVariableGroup::getPartsSet | ( | ) | const |
return a vector which contains a HuginBase::UIntSet for each group with the corresponding images numbers
Definition at line 51 of file ImageVariableGroup.cpp.
References getNumberOfParts(), and m_image_part_numbers.
Referenced by HuginBase::getHDRStacks(), PanoOperation::LoadLensOperation::GetInternalCommand(), PanoOperation::ChangeStackOperation::GetInternalCommand(), HuginBase::getSortedStacks(), main(), ImagesTreeCtrl::panoramaImagesChanged(), PanoCommand::wxLoadPTProjectCmd::processPanorama(), and MaskEditorPanel::UpdateCrop().
bool HuginBase::ConstImageVariableGroup::getVarLinkedInPart | ( | ImageVariableEnum | variable, |
std::size_t | part | ||
) | const |
Get the linked status of a particular variable for a given part number.
variable | the variable to check |
part | the part number to check |
Referenced by main(), and OptimizePhotometricPanel::runOptimizer().
|
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 | ( | ) |
Update the part numbers, call this when the panorama changes.
Definition at line 266 of file ImageVariableGroup.cpp.
References setPartNumbers().
Referenced by processImg(), PanoCommand::wxApplyTemplateCmd::processPanorama(), PanoCommand::ChangePartImagesLinkingCmd::processPanorama(), HuginBase::ConstStandardImageVariableGroups::update(), and HuginBase::StandardImageVariableGroups::update().
|
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().
|
protected |
Definition at line 127 of file ImageVariableGroup.h.
Referenced by getNumberOfParts().
|
protected |
The panorama this group works on.
Definition at line 120 of file ImageVariableGroup.h.
Referenced by getPartNumber().
|
protected |
The set of variables which make up this group.
Definition at line 117 of file ImageVariableGroup.h.