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

Model for a panorama. More...

#include <Panorama.h>

Inheritance diagram for HuginBase::Panorama:
Inheritance graph

Public Member Functions

 Panorama ()
 ctor. More...
 
 ~Panorama ()
 dtor. More...
 
Panorama getSubset (const UIntSet &imgs) const
 get a subset of the panorama More...
 
Panorama duplicate () const
 duplicate the panorama More...
 
PanoramaDatagetNewSubset (const UIntSet &imgs) const
 
PanoramaDatagetNewCopy () const
 
PanoramaDatagetUnlinkedSubset (UIntSetVector &imageGroups) const
 get a panorama, which does not contain images linked with positions, the cps are moved to the first image of each linked stacked More...
 
std::size_t getNrOfImages () const
 number of images. More...
 
const SrcPanoImagegetImage (std::size_t nr) const
 get a panorama image, counting starts with 0 More...
 
void setImage (std::size_t nr, const SrcPanoImage &img)
 set a panorama image, counting starts with 0 More...
 
unsigned int addImage (const SrcPanoImage &img)
 the the number for a specific image More...
 
void mergePanorama (const Panorama &newPano)
 merges the panorama with the given pano More...
 
void removeImage (unsigned int nr)
 creates an image, from filename, and a Lens, if needed More...
 
void swapImages (unsigned int img1, unsigned int img2)
 swap images. More...
 
void moveImage (size_t img1, size_t img2)
 moves images. More...
 
SrcPanoImage getSrcImage (unsigned imgNr) const
 get a description of a source image More...
 
void setSrcImage (unsigned int nr, const SrcPanoImage &img)
 set input image parameters More...
 
void setImageFilename (unsigned int img, const std::string &fname)
 set a new image filename More...
 
void activateImage (unsigned int imgNr, bool active=true)
 mark an image as active or inactive. More...
 
UIntSet getActiveImages () const
 get active images More...
 
std::size_t getNrOfCtrlPoints () const
 number of control points More...
 
const ControlPointgetCtrlPoint (std::size_t nr) const
 get a control point, counting starts with 0 More...
 
const CPVectorgetCtrlPoints () const
 get all control point of this Panorama More...
 
std::vector< unsigned int > getCtrlPointsForImage (unsigned int imgNr) const
 return all control points for a given image. More...
 
CPointVector getCtrlPointsVectorForImage (unsigned int imgNr) const
 return a vector of std::pairs with global ctrl point nr and ControlPoint In the class ControlPoint the image with imgNr is always image1 More...
 
void setCtrlPoints (const CPVector &points)
 set all control points (Ippei: Is this supposed to be 'add' method?) More...
 
unsigned int addCtrlPoint (const ControlPoint &point)
 add a new control point. More...
 
void removeCtrlPoint (unsigned int pNr)
 remove a control point. More...
 
void removeDuplicateCtrlPoints ()
 removes duplicates control points More...
 
void changeControlPoint (unsigned int pNr, const ControlPoint &point)
 change a control Point. More...
 
int getNextCPTypeLineNumber () const
 get the number of a control point More...
 
void updateLineCtrlPoints ()
 assign new mode line numbers, if required More...
 
void updateCtrlPointErrors (const CPVector &controlPoints)
 update control points distances. More...
 
void updateCtrlPointErrors (const UIntSet &imgs, const CPVector &cps)
 update control points for a subset of images. More...
 
const std::string getICCProfileDesc () const
 return description of icc profile used for pano More...
 
void setICCProfileDesc (const std::string &newDesc)
 sets the icc profile description for check of same profile More...
 
const int getNrOfBands () const
 return number of bands of first image (without alpha channel) so it can be 1 for grayscale or 3 for rgb images More...
 
void setNrOfBands (const int nrBands)
 sets the number of bands More...
 
VariableMapVector getVariables () const
 get variables of this panorama More...
 
const VariableMap getImageVariables (unsigned int imgNr) const
 Get the variables of an image. More...
 
virtual void updateVariables (const VariableMapVector &vars)
 Set the variables. More...
 
virtual void updateVariables (const UIntSet &imgs, const VariableMapVector &var)
 update variables for some specific images More...
 
virtual void updateVariables (unsigned int imgNr, const VariableMap &var)
 Set variables for a single picture. More...
 
virtual void updateVariable (unsigned int imgNr, const Variable &var)
 update a single variable More...
 
virtual void UpdateFocalLength (UIntSet imgs, double newFocalLength)
 updates the focal length by changing hfov More...
 
virtual void UpdateCropFactor (UIntSet imgs, double newCropFactor)
 updates the crop factor, try to keep focal length constant More...
 
virtual void updateWhiteBalance (double redFactor, double blueFactor)
 update the global white balace of the panorama by multiplying the red and blue factor of each image with given factors More...
 
const double getMaxExposureDifference () const
 returns the maximum exposure value difference of all images in the project More...
 
const bool hasPossibleStacks () const
 return true, if the metadata indicates that the projects is a bracketet project More...
 
void linkPossibleStacks (bool linkPosition)
 create automatically stacks as indicated by metadata More...
 
const OptimizeVectorgetOptimizeVector () const
 return the optimize settings stored inside panorama More...
 
void setOptimizeVector (const OptimizeVector &optvec)
 set optimize setting More...
 
const int getOptimizerSwitch () const
 returns optimizer master switch More...
 
void setOptimizerSwitch (const int newSwitch)
 set optimizer master switch More...
 
const int getPhotometricOptimizerSwitch () const
 return the photometric optimizer master switch More...
 
void setPhotometricOptimizerSwitch (const int newSwitch)
 sets the photometric optimizer master switch More...
 
const PanoramaOptionsgetOptions () const
 returns the options for this panorama More...
 
void setOptions (const PanoramaOptions &opt)
 set new output settings This is not used directly for optimizing/stiching, but it can be feed into runOptimizer() and runStitcher(). More...
 
void printPanoramaScript (std::ostream &o, const OptimizeVector &optvars, const PanoramaOptions &options, const UIntSet &imgs, bool forPTOptimizer, const std::string &stripPrefix="") const
 create an optimizer script More...
 
void printStitcherScript (std::ostream &o, const PanoramaOptions &target, const UIntSet &imgs) const
 create the stitcher script More...
 
void addObserver (PanoramaObserver *o)
 add a panorama observer. More...
 
bool removeObserver (PanoramaObserver *observer)
 remove a panorama observer. More...
 
void clearObservers ()
 remove all panorama observers. More...
 
const bool hasPendingChanges () const
 return if the panorama class has pending changes normally all controls listen to panoramaChanges notification and react only there, but the fast preview window also reacts to changes in the Redraw procedure to handle the tools like drag or crop, use this as workaround (it does not include all changes) More...
 
void changeFinished (bool keepDirty)
 notify observers about changes in this class More...
 
void changeFinished ()
 notify observers about changes in this class More...
 
void imageChanged (unsigned int imgNr)
 mark image for change notification. More...
 
void updateMasksForImage (unsigned int imgNr, MaskPolygonVector newMasks)
 set complete mask list for image with number More...
 
void updateMasks (bool convertPosMaskToNeg=false)
 updates all active masks More...
 
void transferMask (MaskPolygon mask, unsigned int imgNr, const UIntSet &targetImgs)
 transfers given mask from image imgNr to all targetImgs More...
 
void updateOptimizeVector ()
 updates the optimize vector according to master switches More...
 
std::set< size_t > getRefImages ()
 returns set of reference image and images linked with reference images More...
 
void checkRefOptStatus (bool &linkRefImgsYaw, bool &linkRefImgsPitch, bool &linkRefImgsRoll)
 checks if yaw/pitch/roll of reference image can be check, it depends on number and type of control points More...
 
virtual PanoramaDataMementogetNewMemento () const
 get the internal state More...
 
virtual bool setMementoToCopyOf (const PanoramaDataMemento *const memento)
 set the internal state More...
 
PanoramaMemento getMemento () const
 get the internal state More...
 
void setMemento (const PanoramaMemento &memento)
 set the internal state More...
 
bool needsOptimization ()
 true if control points or lens variables have been changed after the last optimisation More...
 
void markAsOptimized (bool optimized=true)
 
bool ReadPTOFile (const std::string &filename, const std::string &prefix="")
 read pto file from the given filename into Panorama object it does some checks on the file and issues warnings to std::cerr More...
 
bool WritePTOFile (const std::string &filename, const std::string &prefix="")
 write data to given pto file More...
 
bool isDirty () const
 true if there are unsaved changes More...
 
virtual void clearDirty ()
 clear dirty flag. More...
 
void setFilePrefix (std::string prefix)
 sets the path prefix of the images reffered with relative paths More...
 
void reset ()
 clear the internal state. More...
 
- Public Member Functions inherited from HuginBase::ManagedPanoramaData
virtual ~ManagedPanoramaData ()
 
- Public Member Functions inherited from HuginBase::PanoramaData
virtual ~PanoramaData ()
 
- Public Member Functions inherited from AppBase::DocumentData
virtual ~DocumentData ()
 

Protected Member Functions

void setDirty (const bool &dirty=true)
 
std::string getFilePrefix () const
 
void adjustVarLinks ()
 adjust the links of the linked variables, must be called when a lens has been changed. More...
 

Private Member Functions

void centerCrop (unsigned int imgNr)
 center the crop for given image and all linked images More...
 
vigra::Rect2D centerCropImage (unsigned int imgNr)
 return the centered crop for given image More...
 
void updateCropMode (unsigned int imgNr)
 update the crop mode in dependence of crop rect and lens projection More...
 

Private Attributes

std::string imgFilePrefix
 
bool dirty
 this indicates that there are unsaved changes More...
 
PanoramaMemento state
 
std::list< PanoramaObserver * > observers
 
UIntSet changedImages
 the images that have been changed since the last changeFinished() More...
 
bool m_forceImagesUpdate
 
std::set< std::string > m_ptoptimizerVarNames
 

Detailed Description

Model for a panorama.

This class contains the properties of a panorama That is:

view and controller classes can get information about these with the getXXX Functions.

Images and Control points are numbered, and const references are handed out. this means that all interaction will be based on image/control point numbers. The references are not stable, they might disappear when other functions of this class are called, so its best to get a new reference whenever you need the object.

This also means that the whole object is not threadsafe and concurrent access has to be synchronized from the outside.

Changes should be made through command objects, not with direct calls.

Todo:
should the changer call the report() functions?
Todo:
should we add constraints for the simple / advanced functionality to the model? I have to think a bit more about that issue. maybe the contraints can be factored out into another class that corrects then when updating. or we could have different models.. SimplePanorama and AdvancedPanorama.

also, it is useful to use the memento pattern for the internal state, so that redo/undo for complex interactions can be implemented without too much pain.

Definition at line 152 of file Panorama.h.

Constructor & Destructor Documentation

HuginBase::Panorama::Panorama ( )

ctor.

Definition at line 41 of file Panorama.cpp.

References m_ptoptimizerVarNames.

HuginBase::Panorama::~Panorama ( )

dtor.

Definition at line 62 of file Panorama.cpp.

References DEBUG_TRACE, and reset().

Member Function Documentation

void HuginBase::Panorama::activateImage ( unsigned int  imgNr,
bool  active = true 
)
virtual

mark an image as active or inactive.

This is only a flag, that can be turned on or off. If an image is marked active, then it should be used for optimizing and stitching.

However, this is not done automatically. One has to use getActiveImages() to get the numbers of the active images, and pass these to the respective functions that do the stitching or optimisation

Implements HuginBase::PanoramaData.

Definition at line 1575 of file Panorama.cpp.

References imageChanged(), HuginBase::PanoramaMemento::images, and state.

Referenced by EnableImages(), main2(), and PanoCommand::SetActiveImagesCmd::processPanorama().

unsigned int HuginBase::Panorama::addCtrlPoint ( const ControlPoint point)
virtual
unsigned int HuginBase::Panorama::addImage ( const SrcPanoImage img)
virtual
void HuginBase::Panorama::addObserver ( PanoramaObserver o)
virtual
void HuginBase::Panorama::adjustVarLinks ( )
protected

adjust the links of the linked variables, must be called when a lens has been changed.

void HuginBase::Panorama::centerCrop ( unsigned int  imgNr)
private

center the crop for given image and all linked images

Definition at line 1184 of file Panorama.cpp.

References centerCropImage(), getNrOfImages(), imageChanged(), HuginBase::PanoramaMemento::images, HuginBase::BaseSrcPanoImage::NO_CROP, and state.

Referenced by changeFinished().

vigra::Rect2D HuginBase::Panorama::centerCropImage ( unsigned int  imgNr)
private

return the centered crop for given image

Definition at line 1167 of file Panorama.cpp.

References HuginBase::PanoramaMemento::images, HuginBase::BaseSrcPanoImage::NO_CROP, hugin_utils::roundi(), and state.

Referenced by centerCrop().

void HuginBase::Panorama::changeControlPoint ( unsigned int  pNr,
const ControlPoint point 
)
virtual
void HuginBase::Panorama::changeFinished ( bool  keepDirty)

notify observers about changes in this class

This needs to be called explicitly by somebody after changes have been made. Allows to compress multiple changes into one notification.

Parameters
keepDirtydo not set dirty flag. useful for changing the dirty flag itself

Definition at line 831 of file Panorama.cpp.

References centerCrop(), changedImages, DEBUG_DEBUG, DEBUG_TRACE, dirty, HuginBase::PanoramaMemento::images, m_forceImagesUpdate, observers, AppBase::DocumentData::setDirty(), state, updateCropMode(), updateMasks(), and updateOptimizeVector().

Referenced by PanoCommand::PanoCommand::execute(), MainFrame::OnIgnoreLineCp(), PanoCommand::PanoCommand::redo(), SetCropToImages(), MainFrame::SetOptimizeIgnoreLineCp(), MainFrame::SetOptimizeOnlyActiveImages(), and PanoCommand::PanoCommand::undo().

void HuginBase::Panorama::changeFinished ( )
inlinevirtual

notify observers about changes in this class

This needs to be called explicitly by somebody after changes have been made. Allows to compress multiple changes into one notification.

Implements HuginBase::ManagedPanoramaData.

Definition at line 564 of file Panorama.h.

void HuginBase::Panorama::checkRefOptStatus ( bool &  linkRefImgsYaw,
bool &  linkRefImgsPitch,
bool &  linkRefImgsRoll 
)
virtual
virtual void HuginBase::Panorama::clearDirty ( )
inlinevirtual

clear dirty flag.

call after save

Reimplemented from AppBase::DocumentData.

Definition at line 645 of file Panorama.h.

References AppBase::DocumentData::clearDirty().

Referenced by PanoCommand::PanoCommand::execute(), and MainFrame::OnSaveProject().

void HuginBase::Panorama::clearObservers ( )
virtual

remove all panorama observers.

Warning
this is a hack. it must not be used on normal Panorama's.

Implements HuginBase::ManagedPanoramaData.

Definition at line 1558 of file Panorama.cpp.

References observers.

Panorama HuginBase::Panorama::duplicate ( ) const
UIntSet HuginBase::Panorama::getActiveImages ( ) const
virtual

get active images

Implements HuginBase::PanoramaData.

Definition at line 1585 of file Panorama.cpp.

References HuginBase::PanoramaMemento::images, and state.

Referenced by PreviewColorPickerTool::CalcCorrection(), PanoPanel::CheckHasImages(), PanoPanel::DoCalcFOV(), PanoPanel::DoCalcOptimalROI(), PanoPanel::DoCalcOptimalWidth(), PreviewEditCPTool::FindCPInRect(), HuginQueue::detail::GenerateFinalArgfile(), GenerateThumbnail(), ToolHelper::GetImagesUnderPos(), HuginQueue::GetStitchingCommandQueue(), HuginQueue::GetStitchingCommandQueueUserOutput(), main(), main2(), ImagesTreeCtrl::OnActivateImage(), GLPreviewFrame::OnAutocrop(), GLPreviewFrame::OnAutocropOutside(), PreviewFrame::OnCenterHorizontally(), GLPreviewFrame::OnCenterHorizontally(), ImageToogleButtonEventHandler::OnChange(), PreviewFrame::OnChangeDisplayedImgs(), GLPreviewFrame::OnCreateCP(), ImagesTreeCtrl::OnDeactivateImage(), PreviewFrame::OnDefaultExposure(), GLPreviewFrame::OnDefaultExposure(), ImageToogleButtonEventHandler::OnEnter(), ImageGroupButtonEventHandler::OnEnter(), PreviewFrame::OnFitPano(), GLPreviewFrame::OnFitPano(), ImageToogleButtonEventHandler::OnLeave(), ImageGroupButtonEventHandler::OnLeave(), OptimizePhotometricPanel::OnOptimizeButton(), OptimizePanel::OnOptimizeButton(), GLPreviewFrame::OnShowAll(), GLPreviewFrame::OnStackAutocrop(), PreviewFrame::panoramaChanged(), GLPreviewFrame::panoramaChanged(), PreviewFrame::panoramaImagesChanged(), ImagesTreeCtrl::panoramaImagesChanged(), GLPreviewFrame::panoramaImagesChanged(), BrowsePTOFilesDialog::ParsePTOFile(), SetCrop(), PanoPanel::StackCheck(), RunStitchPanel::StitchProject(), PanoPanel::UpdateDisplay(), CPListCtrl::UpdateInternalCPList(), PreviewLayoutLinesTool::updateLineInformation(), and PreviewPanel::updatePreview().

const ControlPoint& HuginBase::Panorama::getCtrlPoint ( std::size_t  nr) const
inlinevirtual
const CPVector& HuginBase::Panorama::getCtrlPoints ( ) const
inlinevirtual
std::vector< unsigned int > HuginBase::Panorama::getCtrlPointsForImage ( unsigned int  imgNr) const
virtual

return all control points for a given image.

Implements HuginBase::PanoramaData.

Definition at line 83 of file Panorama.cpp.

References HuginBase::PanoramaMemento::ctrlPoints, and state.

Referenced by main2(), and ImagesTreeCtrl::UpdateImageText().

CPointVector HuginBase::Panorama::getCtrlPointsVectorForImage ( unsigned int  imgNr) const

return a vector of std::pairs with global ctrl point nr and ControlPoint In the class ControlPoint the image with imgNr is always image1

Definition at line 96 of file Panorama.cpp.

References HuginBase::PanoramaMemento::ctrlPoints, HuginBase::ControlPoint::image1Nr, HuginBase::ControlPoint::image2Nr, HuginBase::ControlPoint::mirror(), and state.

Referenced by PanoOperation::CelesteOperation::GetInternalCommand(), and main().

std::string HuginBase::Panorama::getFilePrefix ( ) const
inlineprotected

Definition at line 668 of file Panorama.h.

const std::string HuginBase::Panorama::getICCProfileDesc ( ) const

return description of icc profile used for pano

Definition at line 1598 of file Panorama.cpp.

References HuginBase::PanoramaMemento::iccProfileDesc, and state.

Referenced by PanoCommand::wxAddImagesCmd::processPanorama(), and PanoCommand::wxApplyTemplateCmd::processPanorama().

const SrcPanoImage& HuginBase::Panorama::getImage ( std::size_t  nr) const
inlinevirtual

get a panorama image, counting starts with 0

Implements HuginBase::PanoramaData.

Definition at line 211 of file Panorama.h.

Referenced by HuginLines::_getVerticalLines(), AddGeometricControlPoint(), PreviewEditCPTool::AddLineCP(), PreviewControlPointTool::AfterDrawImagesEvent(), alignStereoWindow(), PanoDetector::AnalyzeImage(), PanoCommand::applyColorBalanceValue(), ApplyLensDBParameters(), ImageVariableDialog::ApplyNewVariables(), ApplyTemplate(), AutoPanoSift::automatch(), AutoPanoKolor::automatch(), AutoPanoSiftStack::automatch(), AutoPanoSiftMultiRowStack::automatch(), PanoDetector::buildMultiRowImageSets(), PreviewColorPickerTool::CalcCorrection(), PreviewColorPickerTool::CalcCorrectionForImage(), Parser::CalculateConstant(), CheckAndAddPoint(), CheckCondition(), CheckLensStacks(), CreateMissingImages(), MaskEditorPanel::DisplayCrop(), PanoOutputDialog::EnableOutputOptions(), CPEditorPanel::estimateAndAddOtherPoint(), CPEditorPanel::EstimatePoint(), FillPlaceholders(), PreviewEditCPTool::FindCPInRect(), ViewState::FinishedDraw(), PossiblePano::GeneratePanorama(), GenerateThumbnail(), HuginQueue::GetAssistantCommandQueueUserDefined(), HuginBase::getCPinMasks(), HuginBase::getCPoutsideLimit_pair(), getDefaultOutputName(), getDefaultProjectName(), PanoOperation::AddImagesSeriesOperation::GetInternalCommand(), PanoOperation::RemoveImageOperation::GetInternalCommand(), PanoOperation::ChangeLensOperation::GetInternalCommand(), PanoOperation::LoadLensOperation::GetInternalCommand(), PanoOperation::SaveLensOperation::GetInternalCommand(), PanoOperation::ResetOperation::GetInternalCommand(), PanoOperation::CelesteOperation::GetInternalCommand(), PanoOperation::ChangeStackOperation::GetInternalCommand(), GetNewProjectFilename(), getRefImages(), MaskEditorPanel::GetRot(), HuginQueue::GetStitchingCommandQueue(), HuginQueue::GetStitchingCommandQueueUserOutput(), getUnlinkedSubset(), ImageVariableDialog::InitValues(), GLPreviewFrame::LoadImages(), loadImgsAndExtractPoints(), main(), main2(), PanoDetector::matchPrealigned(), CPEditorPanel::NewPointChange(), ImagesTreeCtrl::OnBeginEdit(), CPEditorPanel::OnCelesteButton(), ImagesTreeCtrl::OnChar(), ImagesTreeCtrl::OnContextMenu(), GLPreviewFrame::OnCreateCP(), ImagesTreeCtrl::OnEndEdit(), MainFrame::OnFineTuneAll(), ImagesPanel::OnFocalLengthChanged(), ImagesPanel::OnLensTypeChanged(), MainFrame::OnLoadingFailed(), MaskEditorPanel::OnMaskCopy(), MaskEditorPanel::OnMaskLoad(), MaskEditorPanel::OnMaskPaste(), MaskEditorPanel::OnMaskSave(), LensCalFrame::OnSaveLens(), ImagesPanel::OnSelectionChanged(), ImageVariableDialog::OnShowDistortionGraph(), HuginBase::SortVectorByExposure::operator()(), SortVectorByExposure::operator()(), SortImageVectorEV::operator()(), LensCalFrame::Optimize(), ViewState::panoramaChanged(), GLPreviewFrame::panoramaChanged(), PreviewFrame::panoramaImagesChanged(), MaskEditorPanel::panoramaImagesChanged(), CPEditorPanel::panoramaImagesChanged(), GLPreviewFrame::panoramaImagesChanged(), CPEditorPanel::PointFineTune(), HuginQueue::detail::PrintDetailInfo(), PanoDetector::printFilenames(), PrintImageInfo(), PanoCommand::wxAddImagesCmd::processPanorama(), PanoCommand::wxLoadPTProjectCmd::processPanorama(), PanoCommand::wxApplyTemplateCmd::processPanorama(), PanoCommand::wxAddCtrlPointGridCmd::processPanorama(), PanoCommand::DistributeImagesCmd::processPanorama(), PTOCopyMove(), PanoDetector::RansacMatchesInPair(), ReadPanoramaOptionsFromIni(), GenerateSequenceDialog::ReadPTOFile(), AutoCtrlPointCreator::readUpdatedControlPoints(), GLPreviewRenderer::Redraw(), GLPanosphereOverviewRenderer::Redraw(), GLPlaneOverviewRenderer::Redraw(), OptimizePhotometricPanel::runOptimizer(), HuginBase::LensDB::SaveLensDataFromPano(), SaveLensParameters(), ImagesTreeCtrl::SelectAllParameters(), SetCropToImages(), SetGeometricControlPointsOverlap(), SetGeometricControlPointsUnconnected(), MaskEditorPanel::setImage(), CPEditorPanel::setLeftImage(), CPEditorPanel::setRightImage(), transferMask(), ImagesTreeCtrl::UpdateGroupText(), ImagesTreeCtrl::UpdateImageText(), ImagesListMask::UpdateItem(), ImagesTreeCtrl::UpdateItemFont(), PreviewLayoutLinesTool::updateLineInformation(), ImagesPanel::UpdatePreviewImage(), Parser::UpdateSingleVar(), CPEditorPanel::UpdateTransforms(), and PanoDetector::writeKeyfile().

const VariableMap HuginBase::Panorama::getImageVariables ( unsigned int  imgNr) const
virtual

Get the variables of an image.

Should not be used for most GUI stuff, use the getImage(imgNr).get* methods instead for each variable you want.

Todo:
change things using this to use getImage(imgNr).get*() instead.

Implements HuginBase::PanoramaData.

Definition at line 128 of file Panorama.cpp.

References HuginBase::PanoramaMemento::images, and state.

Referenced by PanoOperation::ResetOperation::GetInternalCommand(), CPEditorPanel::panoramaImagesChanged(), SaveLensParameters(), CPEditorPanel::setLeftImage(), and CPEditorPanel::setRightImage().

const double HuginBase::Panorama::getMaxExposureDifference ( ) const

returns the maximum exposure value difference of all images in the project

Definition at line 2120 of file Panorama.cpp.

References HuginBase::PanoramaMemento::images, celeste::max(), celeste::min(), and state.

Referenced by hasPossibleStacks(), and PanoCommand::wxAddImagesCmd::processPanorama().

PanoramaMemento HuginBase::Panorama::getMemento ( ) const
inline

get the internal state

Definition at line 602 of file Panorama.h.

Referenced by getNewMemento(), and PanoCommand::wxApplyTemplateCmd::processPanorama().

PanoramaData* HuginBase::Panorama::getNewCopy ( ) const
inlinevirtual

Implements HuginBase::PanoramaData.

Definition at line 189 of file Panorama.h.

PanoramaDataMemento * HuginBase::Panorama::getNewMemento ( ) const
virtual

get the internal state

Implements HuginBase::ManagedPanoramaData.

Definition at line 1526 of file Panorama.cpp.

References getMemento().

Referenced by PanoCommand::PanoCommand::saveMemento(), and PanoCommand::PanoCommand::saveRedoMemento().

PanoramaData* HuginBase::Panorama::getNewSubset ( const UIntSet imgs) const
inlinevirtual
int HuginBase::Panorama::getNextCPTypeLineNumber ( ) const
virtual

get the number of a control point

get the next unused line number for t3, ... control point creation

Implements HuginBase::PanoramaData.

Definition at line 2010 of file Panorama.cpp.

References HuginBase::PanoramaMemento::ctrlPoints, celeste::max(), and state.

Referenced by CPEditorPanel::panoramaChanged().

const int HuginBase::Panorama::getNrOfBands ( ) const

return number of bands of first image (without alpha channel) so it can be 1 for grayscale or 3 for rgb images

Definition at line 1608 of file Panorama.cpp.

References HuginBase::PanoramaMemento::bands, and state.

Referenced by PanoCommand::wxAddImagesCmd::processPanorama(), and PanoCommand::wxApplyTemplateCmd::processPanorama().

std::size_t HuginBase::Panorama::getNrOfCtrlPoints ( ) const
inlinevirtual
std::size_t HuginBase::Panorama::getNrOfImages ( ) const
inlinevirtual

number of images.

Implements HuginBase::PanoramaData.

Definition at line 205 of file Panorama.h.

Referenced by alignStereoWindow(), PanoCommand::applyColorBalanceValue(), ApplyTemplate(), AutoPanoSift::automatch(), AutoPanoSiftMultiRow::automatch(), AutoPanoSiftMultiRowStack::automatch(), AutoPanoSiftPreAlign::automatch(), centerCrop(), CheckCondition(), CheckLensStacks(), CheckProjectFile(), MeshManager::CheckUpdate(), TextureManager::CheckUpdate(), GLPreviewFrame::CleanButtonColours(), TextureManager::CleanTextures(), ImagesPanel::CPGenerate(), CreateMissingImages(), GenerateSequenceDialog::DoGeneratePanorama(), PanoPanel::DoSendToBatch(), PanoPanel::DoStitch(), PanoPanel::DoUserDefinedStitch(), EnableImages(), PanoOutputDialog::EnableOutputOptions(), FillPlaceholders(), ViewState::FinishedDraw(), GenerateSequenceDialog::GenerateFileList(), HuginQueue::detail::GenerateFinalArgfile(), PossiblePano::GeneratePanorama(), GenerateThumbnail(), HuginQueue::GetAssistantCommandQueue(), HuginQueue::GetAssistantCommandQueueUserDefined(), HuginBase::getCPoutsideLimit_pair(), getDefaultOutputName(), getDefaultProjectName(), ToolHelper::GetImagesUnderPos(), PanoOperation::AddImagesSeriesOperation::GetInternalCommand(), PanoOperation::ResetOperation::GetInternalCommand(), PanoOperation::AssignStacksOperation::GetInternalCommand(), GetNewProjectFilename(), LensCalFrame::GetPanorama(), getRefImages(), HuginBase::getSortedStacks(), getUnlinkedSubset(), GLPreviewFrame::HasNonZeroTranslationPlaneParameters(), PanoOperation::ImageVariablesExpressionOperation::IsEnabled(), PanoOperation::NewLensOperation::IsEnabled(), PanoOperation::ChangeLensOperation::IsEnabled(), PanoOperation::RemoveControlPointsOperation::IsEnabled(), PanoOperation::ResetOperation::IsEnabled(), PanoOperation::NewStackOperation::IsEnabled(), PanoOperation::ChangeStackOperation::IsEnabled(), PanoOperation::AssignStacksOperation::IsEnabled(), GenerateSequenceDialog::IsValidPanorama(), loadImgsAndExtractPoints(), PanoDetector::loadProject(), MainFrame::LoadProjectFile(), main(), main2(), PreviewControlPointTool::MakeTransforms(), PanoDetector::matchMultiRow(), PanoDetector::matchPrealigned(), DragTool::MouseButtonEvent(), moveImage(), ImagesTreeCtrl::OnBeginDrag(), PreviewFrame::OnChangeDisplayedImgs(), ImagesPanel::OnCropFactorChanged(), MainFrame::OnFineTuneAll(), ImagesPanel::OnFocalLengthChanged(), GenerateSequenceDialog::OnGeneratePreview(), ImagesTreeCtrl::OnLeftUp(), MainFrame::OnLoadingFailed(), CPEditorPanel::OnNextImg(), PreviewFrame::OnNumTransform(), GLPreviewFrame::OnNumTransform(), RawImportDialog::OnOk(), OptimizePhotometricPanel::OnOptimizeButton(), OptimizePanel::OnOptimizeButton(), CPEditorPanel::OnPrevImg(), iCPApp::OnRun(), MainFrame::OnSavePTStitcherAs(), PreviewFrame::OnShowAll(), GLPreviewFrame::OnShowAll(), PreviewFrame::OnShowNone(), GLPreviewFrame::OnShowNone(), PreviewFrame::OnStraighten(), GLPreviewFrame::OnStraighten(), GLPreviewFrame::OnToolModeChanging(), PreviewFrame::panoramaChanged(), ImagesTreeCtrl::panoramaChanged(), ViewState::panoramaChanged(), GLPreviewFrame::panoramaChanged(), PreviewFrame::panoramaImagesChanged(), OptimizePhotometricPanel::panoramaImagesChanged(), OptimizePanel::panoramaImagesChanged(), ImagesPanel::panoramaImagesChanged(), ImagesList::panoramaImagesChanged(), ImagesTreeCtrl::panoramaImagesChanged(), MaskEditorPanel::panoramaImagesChanged(), CPEditorPanel::panoramaImagesChanged(), MainFrame::panoramaImagesChanged(), GLPreviewFrame::panoramaImagesChanged(), BrowsePTOFilesDialog::ParsePTOFile(), PanoDetector::printFilenames(), PrintImageInfo(), PanoCommand::wxAddImagesCmd::processPanorama(), PanoCommand::wxLoadPTProjectCmd::processPanorama(), PanoCommand::wxApplyTemplateCmd::processPanorama(), PanoCommand::SetActiveImagesCmd::processPanorama(), PanoCommand::UpdateCropFactorCmd::processPanorama(), PanoCommand::DistributeImagesCmd::processPanorama(), PTOCopyMove(), Project::ReadOptions(), ReadPanoramaOptionsFromIni(), GenerateSequenceDialog::ReadPTOFile(), AutoCtrlPointCreator::readUpdatedControlPoints(), GLPreviewRenderer::Redraw(), GLPanosphereOverviewRenderer::Redraw(), GLPlaneOverviewRenderer::Redraw(), VisualizationState::RequireRecalculateMesh(), GLPreviewFrame::ResetTranslationPlaneParameters(), PanoDetector::run(), MainFrame::RunAssistant(), OptimizePhotometricPanel::runOptimizer(), HuginBase::LensDB::SaveLensDataFromPano(), ImagesTreeCtrl::SelectAllParameters(), SetCrop(), SetGeometricControlPointsOverlap(), SetGeometricControlPointsUnconnected(), ImagesTreeCtrl::SetGroupMode(), ViewState::SetOptions(), VisualizationState::SetScale(), MeshManager::MeshInfo::Update(), GenerateSequenceDialog::UpdateCounters(), UpdateCropFactor(), UpdateFocalLength(), PreviewLayoutLinesTool::updateImageCentres(), PreviewLayoutLinesTool::updateLineInformation(), updateMasks(), updateOptimizeVector(), ImagesPanel::UpdatePreviewImage(), updateWhiteBalance(), ViewState::ViewState(), VisualizationState::VisualizationState(), work_on_triplets(), and WritePTOFile().

const int HuginBase::Panorama::getOptimizerSwitch ( ) const
inlinevirtual
const OptimizeVector& HuginBase::Panorama::getOptimizeVector ( ) const
inlinevirtual
const PanoramaOptions& HuginBase::Panorama::getOptions ( ) const
inlinevirtual

returns the options for this panorama

Note
Is this the most appropriate way to remember which variables need optimisation? Can we have optimisation information in ImageVariables instead now?

Implements HuginBase::PanoramaData.

Definition at line 481 of file Panorama.h.

Referenced by AddGeometricControlPoint(), PreviewEditCPTool::AddLineCP(), PreviewDifferenceTool::AfterDrawImagesEvent(), alignStereoWindow(), PanoCommand::applyColorBalanceValue(), autoCrop(), AutoPanoSiftMultiRow::automatch(), TextureManager::Begin(), PanoPanel::BlenderChanged(), PreviewColorPickerTool::CalcCorrection(), PreviewColorPickerTool::CalcCorrectionForImage(), PanoPanel::CheckFreeSpace(), PanoPanel::CheckGoodSize(), checkRefOptStatus(), AutoCtrlPointCreator::Cleanup(), PanoPanel::DoCalcFOV(), PanoPanel::DoCalcOptimalROI(), PanoPanel::DoCalcOptimalWidth(), PreviewPanel::DrawPreview(), CPEditorPanel::EstimatePoint(), PanoPanel::FileFormatChanged(), FillPlaceholders(), PreviewEditCPTool::FindCPInRect(), ViewState::FinishedDraw(), HuginQueue::detail::GenerateFinalArgfile(), PossiblePano::GeneratePanorama(), GenerateThumbnail(), HuginBase::getCPoutsideLimit_pair(), PanoOperation::ChangeAnchorImageOperation::GetInternalCommand(), PanoOperation::ChangeColorAnchorImageOperation::GetInternalCommand(), PanoOperation::ResetOperation::GetInternalCommand(), LensCalFrame::GetPanorama(), getRefImages(), PreviewEditCPTool::GetSelectedROI(), HuginQueue::GetStitchingCommandQueue(), HuginQueue::GetStitchingCommandQueueUserOutput(), getUnlinkedSubset(), CPEditorPanel::getVerticalCPBias(), PanoPanel::HDRFileFormatChanged(), PanoPanel::HeightChanged(), PanoPanel::HFOVChanged(), main(), main2(), PanoDetector::matchMultiRow(), GLPreviewFrame::OnAutocrop(), GLPreviewFrame::OnAutocropOutside(), PanoPanel::OnBlenderOptions(), PreviewFrame::OnChangeFOV(), GLPreviewFrame::OnChangeFOV(), GLPreviewFrame::OnCreateCP(), PreviewFrame::OnDecreaseExposure(), GLPreviewFrame::OnDecreaseExposure(), PreviewFrame::OnDefaultExposure(), GLPreviewFrame::OnDefaultExposure(), PanoPanel::OnEdgeFillChanged(), PanoPanel::OnEdgeFillOptions(), GLPreviewFrame::OnExposureChanged(), PreviewFrame::OnFitPano(), GLPreviewFrame::OnFitPano(), PanoPanel::OnFusionOptions(), PanoPanel::OnHDRMergeOptions(), PanoPanel::OnHDRTIFFCompression(), GLPreviewFrame::OnHFOVChanged(), PreviewFrame::OnIncreaseExposure(), GLPreviewFrame::OnIncreaseExposure(), PanoPanel::OnJPEGQualityText(), ImagesPanel::OnMaxEvDiffChanged(), ImagesPanel::OnMinimumOverlapChanged(), PanoPanel::OnNormalTIFFCompression(), PreviewFrame::OnOutputChoice(), PanoPanel::OnOutputFilesChanged(), PreviewFrame::OnProjectionChoice(), GLPreviewFrame::OnProjectionChoice(), GLPreviewFrame::OnProjParameterChanged(), PreviewFrame::OnProjParameterReset(), GLPreviewFrame::OnProjParameterReset(), GLPreviewFrame::OnRangeCompressionChanged(), PreviewFrame::OnRangeCompressionDecrease(), GLPreviewFrame::OnRangeCompressionDecrease(), PreviewFrame::OnRangeCompressionIncrease(), GLPreviewFrame::OnRangeCompressionIncrease(), PanoPanel::OnRemapperOptions(), GLPreviewFrame::OnResetCrop(), GLPreviewFrame::OnROIChanged(), MainFrame::OnSavePTStitcherAs(), GLPreviewFrame::OnSetCropAspect(), GLPreviewFrame::OnStackAutocrop(), PreviewFrame::OnTextCtrlChanged(), GLPreviewFrame::OnTrackChangeFOV(), GLPreviewFrame::OnVFOVChanged(), PreviewFrame::panoramaChanged(), PreviewPanel::panoramaChanged(), ImagesPanel::panoramaChanged(), PanoPanel::panoramaChanged(), ViewState::panoramaChanged(), GLPreviewFrame::panoramaChanged(), ImagesTreeCtrl::panoramaImagesChanged(), BrowsePTOFilesDialog::ParsePTOFile(), PanoCommand::wxAddImagesCmd::processPanorama(), PanoCommand::wxLoadPTProjectCmd::processPanorama(), PanoCommand::wxNewProjectCmd::processPanorama(), PanoCommand::CenterPanoCmd::processPanorama(), PanoCommand::StraightenPanoCmd::processPanorama(), PanoCommand::ResetToMeanExposure::processPanorama(), PanoPanel::ProjectionChanged(), Project::ReadOptions(), ReadPanoramaOptionsFromIni(), PanoPanel::RemapperChanged(), PanoPanel::ROIChanged(), OptimizePhotometricPanel::runOptimizer(), OptimizePanel::runOptimizer(), ImagesTreeCtrl::SelectAllParameters(), GLPreviewFrame::ShowProjectionWarnings(), PanoPanel::StackCheck(), RunStitchPanel::StitchProject(), transferMask(), ImagesTreeCtrl::UpdateImageText(), PreviewPanel::updatePreview(), CPEditorPanel::UpdateTransforms(), PanoPanel::VFOVChanged(), ViewState::ViewState(), PanoPanel::WidthChanged(), work_on_triplets(), and WritePTOFile().

const int HuginBase::Panorama::getPhotometricOptimizerSwitch ( ) const
inlinevirtual
std::set< size_t > HuginBase::Panorama::getRefImages ( )
virtual

returns set of reference image and images linked with reference images

Implements HuginBase::PanoramaData.

Definition at line 1235 of file Panorama.cpp.

References getImage(), getNrOfImages(), getOptions(), and HuginBase::PanoramaOptions::optimizeReferenceImage.

Referenced by main(), and updateOptimizeVector().

SrcPanoImage HuginBase::Panorama::getSrcImage ( unsigned  imgNr) const
virtual
Panorama HuginBase::Panorama::getSubset ( const UIntSet imgs) const
PanoramaData * HuginBase::Panorama::getUnlinkedSubset ( UIntSetVector imageGroups) const
virtual

get a panorama, which does not contain images linked with positions, the cps are moved to the first image of each linked stacked

Parameters
imageGroupscontains a mapping of the initial images to the new images

Implements HuginBase::PanoramaData.

Definition at line 1790 of file Panorama.cpp.

References HuginBase::FindStackNumberForImage(), getCtrlPoints(), getImage(), getNewSubset(), getNrOfImages(), HuginBase::PanoramaData::getOptions(), getOptions(), HuginBase::ControlPoint::image1Nr, HuginBase::ControlPoint::image2Nr, HuginBase::PanoramaOptions::optimizeReferenceImage, HuginBase::PanoramaData::setCtrlPoints(), HuginBase::PanoramaData::setOptions(), and HuginBase::ControlPoint::X_Y.

VariableMapVector HuginBase::Panorama::getVariables ( ) const
virtual
const bool HuginBase::Panorama::hasPendingChanges ( ) const

return if the panorama class has pending changes normally all controls listen to panoramaChanges notification and react only there, but the fast preview window also reacts to changes in the Redraw procedure to handle the tools like drag or crop, use this as workaround (it does not include all changes)

Definition at line 1563 of file Panorama.cpp.

References changedImages.

Referenced by GLViewer::Redraw().

const bool HuginBase::Panorama::hasPossibleStacks ( ) const

return true, if the metadata indicates that the projects is a bracketet project

Definition at line 2137 of file Panorama.cpp.

References fill_set(), HuginBase::getExposureLayers(), getMaxExposureDifference(), HuginBase::PanoramaMemento::images, and state.

Referenced by PossiblePano::GeneratePanorama(), main(), and PanoCommand::wxAddImagesCmd::processPanorama().

void HuginBase::Panorama::imageChanged ( unsigned int  imgNr)
virtual
bool HuginBase::Panorama::isDirty ( ) const
inlinevirtual

true if there are unsaved changes

Reimplemented from AppBase::DocumentData.

Definition at line 636 of file Panorama.h.

References DEBUG_WARN, and AppBase::DocumentData::isDirty().

Referenced by MainFrame::CloseProject(), and PanoPanel::DoSendToBatch().

void HuginBase::Panorama::linkPossibleStacks ( bool  linkPosition)

create automatically stacks as indicated by metadata

Definition at line 2181 of file Panorama.cpp.

References fill_set(), HuginBase::getExposureLayers(), HuginBase::PanoramaMemento::images, set_contains(), and state.

Referenced by PossiblePano::GeneratePanorama(), main(), and PanoCommand::wxAddImagesCmd::processPanorama().

void HuginBase::Panorama::markAsOptimized ( bool  optimized = true)
inlinevirtual
void HuginBase::Panorama::mergePanorama ( const Panorama newPano)

merges the panorama with the given pano

Referenced by main(), and PanoCommand::MergePanoCmd::processPanorama().

void HuginBase::Panorama::moveImage ( size_t  img1,
size_t  img2 
)
virtual
bool HuginBase::Panorama::needsOptimization ( )
inlinevirtual

true if control points or lens variables have been changed after the last optimisation

Implements HuginBase::ManagedPanoramaData.

Definition at line 614 of file Panorama.h.

Referenced by GLPreviewFrame::panoramaChanged().

void HuginBase::Panorama::printPanoramaScript ( std::ostream &  o,
const OptimizeVector optvars,
const PanoramaOptions options,
const UIntSet imgs,
bool  forPTOptimizer,
const std::string &  stripPrefix = "" 
) const
virtual
void HuginBase::Panorama::printStitcherScript ( std::ostream &  o,
const PanoramaOptions target,
const UIntSet imgs 
) const
virtual
bool HuginBase::Panorama::ReadPTOFile ( const std::string &  filename,
const std::string &  prefix = "" 
)

read pto file from the given filename into Panorama object it does some checks on the file and issues warnings to std::cerr

Parameters
filenamethe filename from which is pto file is read
prefixpath prefix to use for filepath mangling
Returns
true, if file could be successful read

Definition at line 2023 of file Panorama.cpp.

References HuginBase::PanoramaMemento::loadPTScript(), setFilePrefix(), and setMemento().

Referenced by CheckProjectFile(), GenerateThumbnail(), PanoDetector::loadProject(), main(), HuginExecutor::OnRun(), BrowsePTOFilesDialog::ParsePTOFile(), PanoCommand::LoadPTProjectCmd::processPanorama(), processPTO(), and PTOCopyMove().

void HuginBase::Panorama::removeCtrlPoint ( unsigned int  pNr)
virtual
void HuginBase::Panorama::removeDuplicateCtrlPoints ( )
virtual
void HuginBase::Panorama::removeImage ( unsigned int  nr)
virtual

creates an image, from filename, and a Lens, if needed

add an Image to the panorama

Returns
image numberremove an Image.

also deletes/updates all associated control points and the Lens, if it was only used by this image.

Implements HuginBase::PanoramaData.

Definition at line 329 of file Panorama.cpp.

References HuginBase::PanoramaOptions::colorReferenceImage, HuginBase::PanoramaMemento::ctrlPoints, DEBUG_DEBUG, DEBUG_TRACE, imageChanged(), HuginBase::PanoramaMemento::images, m_forceImagesUpdate, HuginBase::PanoramaOptions::optimizeReferenceImage, HuginBase::PanoramaMemento::options, HuginBase::PanoramaMemento::optvec, and state.

Referenced by PanoCommand::RemoveImageCmd::processPanorama(), and PanoCommand::RemoveImagesCmd::processPanorama().

bool HuginBase::Panorama::removeObserver ( PanoramaObserver observer)
virtual
void HuginBase::Panorama::reset ( )
void HuginBase::Panorama::setCtrlPoints ( const CPVector points)
virtual
void HuginBase::Panorama::setDirty ( const bool &  dirty = true)
inlineprotectedvirtual

Reimplemented from AppBase::DocumentData.

Definition at line 652 of file Panorama.h.

References AppBase::DocumentData::setDirty().

void HuginBase::Panorama::setFilePrefix ( std::string  prefix)
inline

sets the path prefix of the images reffered with relative paths

Definition at line 664 of file Panorama.h.

Referenced by ReadPTOFile().

void HuginBase::Panorama::setICCProfileDesc ( const std::string &  newDesc)
void HuginBase::Panorama::setImage ( std::size_t  nr,
const SrcPanoImage img 
)
inlinevirtual

set a panorama image, counting starts with 0

Implements HuginBase::PanoramaData.

Definition at line 218 of file Panorama.h.

Referenced by PanoDetector::loadProject().

void HuginBase::Panorama::setImageFilename ( unsigned int  img,
const std::string &  fname 
)
virtual

set a new image filename

It is assumed that it is of the same size as the old image.

Implements HuginBase::PanoramaData.

Definition at line 373 of file Panorama.cpp.

References DEBUG_ASSERT, imageChanged(), HuginBase::PanoramaMemento::images, m_forceImagesUpdate, and state.

Referenced by CreateMissingImages(), main(), PanoCommand::wxLoadPTProjectCmd::processPanorama(), and PTOCopyMove().

void HuginBase::Panorama::setMemento ( const PanoramaMemento memento)
bool HuginBase::Panorama::setMementoToCopyOf ( const PanoramaDataMemento *const  memento)
virtual
void HuginBase::Panorama::setNrOfBands ( const int  nrBands)
void HuginBase::Panorama::setOptimizerSwitch ( const int  newSwitch)
virtual
void HuginBase::Panorama::setOptimizeVector ( const OptimizeVector optvec)
virtual
void HuginBase::Panorama::setOptions ( const PanoramaOptions opt)
virtual
void HuginBase::Panorama::setPhotometricOptimizerSwitch ( const int  newSwitch)
virtual
void HuginBase::Panorama::setSrcImage ( unsigned int  nr,
const SrcPanoImage img 
)
virtual
void HuginBase::Panorama::swapImages ( unsigned int  img1,
unsigned int  img2 
)
virtual
void HuginBase::Panorama::transferMask ( MaskPolygon  mask,
unsigned int  imgNr,
const UIntSet targetImgs 
)
virtual
void HuginBase::Panorama::UpdateCropFactor ( UIntSet  imgs,
double  newCropFactor 
)
virtual

updates the crop factor, try to keep focal length constant

Definition at line 254 of file Panorama.cpp.

References getNrOfImages(), imageChanged(), HuginBase::PanoramaMemento::images, and state.

Referenced by PanoCommand::UpdateCropFactorCmd::processPanorama().

void HuginBase::Panorama::updateCropMode ( unsigned int  imgNr)
private

update the crop mode in dependence of crop rect and lens projection

Definition at line 1147 of file Panorama.cpp.

References HuginBase::BaseSrcPanoImage::CROP_CIRCLE, HuginBase::BaseSrcPanoImage::CROP_RECTANGLE, HuginBase::PanoramaMemento::images, HuginBase::BaseSrcPanoImage::NO_CROP, and state.

Referenced by changeFinished().

void HuginBase::Panorama::updateCtrlPointErrors ( const CPVector controlPoints)
virtual

update control points distances.

updates control distances and position in final panorama usually used to set the changes from the optimization. The control points must be the same as in

Implements HuginBase::PanoramaData.

Definition at line 160 of file Panorama.cpp.

References HuginBase::PanoramaMemento::ctrlPoints, imageChanged(), and state.

Referenced by PanoCommand::UpdateVariablesCPCmd::processPanorama(), and PanoCommand::UpdateVariablesCPSetCmd::processPanorama().

void HuginBase::Panorama::updateCtrlPointErrors ( const UIntSet imgs,
const CPVector cps 
)
virtual

update control points for a subset of images.

Usually, the control point subset is created using subset() The number and ordering and control points must not be changed between the call to subset() and this function.

Implements HuginBase::PanoramaData.

Definition at line 135 of file Panorama.cpp.

References HuginBase::PanoramaMemento::ctrlPoints, imageChanged(), set_contains(), and state.

void HuginBase::Panorama::UpdateFocalLength ( UIntSet  imgs,
double  newFocalLength 
)
virtual

updates the focal length by changing hfov

Definition at line 227 of file Panorama.cpp.

References getNrOfImages(), imageChanged(), HuginBase::PanoramaMemento::images, and state.

Referenced by PanoCommand::UpdateFocalLengthCmd::processPanorama().

void HuginBase::Panorama::updateLineCtrlPoints ( )
virtual

assign new mode line numbers, if required

Implements HuginBase::PanoramaData.

Definition at line 471 of file Panorama.cpp.

References HuginBase::PanoramaMemento::ctrlPoints, imageChanged(), and state.

Referenced by changeControlPoint(), removeCtrlPoint(), removeDuplicateCtrlPoints(), and setCtrlPoints().

void HuginBase::Panorama::updateMasks ( bool  convertPosMaskToNeg = false)
virtual
void HuginBase::Panorama::updateMasksForImage ( unsigned int  imgNr,
MaskPolygonVector  newMasks 
)
virtual

set complete mask list for image with number

Implements HuginBase::PanoramaData.

Definition at line 882 of file Panorama.cpp.

References DEBUG_ASSERT, imageChanged(), HuginBase::PanoramaMemento::images, m_forceImagesUpdate, and state.

Referenced by main(), and PanoCommand::UpdateMaskForImgCmd::processPanorama().

void HuginBase::Panorama::updateOptimizeVector ( )
virtual
virtual void HuginBase::Panorama::updateVariable ( unsigned int  imgNr,
const Variable var 
)
virtual

update a single variable

It knows lenses etc and updates other images when the variable is linked

Implements HuginBase::PanoramaData.

Referenced by PanoCommand::SetVariableCmd::processPanorama(), Parser::UpdateSingleVar(), and updateVariables().

void HuginBase::Panorama::updateVariables ( const VariableMapVector vars)
virtual
void HuginBase::Panorama::updateVariables ( const UIntSet imgs,
const VariableMapVector var 
)
virtual

update variables for some specific images

Implements HuginBase::PanoramaData.

Definition at line 181 of file Panorama.cpp.

References HuginBase::PanoramaMemento::images, state, and updateVariables().

void HuginBase::Panorama::updateVariables ( unsigned int  imgNr,
const VariableMap var 
)
virtual

Set variables for a single picture.

Implements HuginBase::PanoramaData.

Definition at line 191 of file Panorama.cpp.

References HuginBase::PanoramaMemento::images, state, and updateVariable().

void HuginBase::Panorama::updateWhiteBalance ( double  redFactor,
double  blueFactor 
)
virtual

update the global white balace of the panorama by multiplying the red and blue factor of each image with given factors

Implements HuginBase::PanoramaData.

Definition at line 2090 of file Panorama.cpp.

References getNrOfImages(), imageChanged(), HuginBase::PanoramaMemento::images, set_contains(), and state.

Referenced by PanoCommand::UpdateWhiteBalance::processPanorama().

bool HuginBase::Panorama::WritePTOFile ( const std::string &  filename,
const std::string &  prefix = "" 
)

Member Data Documentation

UIntSet HuginBase::Panorama::changedImages
private

the images that have been changed since the last changeFinished()

Definition at line 697 of file Panorama.h.

Referenced by changeFinished(), hasPendingChanges(), and imageChanged().

bool HuginBase::Panorama::dirty
private

this indicates that there are unsaved changes

Definition at line 692 of file Panorama.h.

Referenced by changeFinished(), and reset().

std::string HuginBase::Panorama::imgFilePrefix
private

Definition at line 689 of file Panorama.h.

bool HuginBase::Panorama::m_forceImagesUpdate
private

Definition at line 699 of file Panorama.h.

Referenced by changeFinished(), removeImage(), setImageFilename(), and updateMasksForImage().

std::set<std::string> HuginBase::Panorama::m_ptoptimizerVarNames
private

Definition at line 701 of file Panorama.h.

Referenced by Panorama(), and printStitcherScript().

std::list<PanoramaObserver *> HuginBase::Panorama::observers
private

Definition at line 695 of file Panorama.h.

Referenced by addObserver(), changeFinished(), clearObservers(), duplicate(), and removeObserver().

PanoramaMemento HuginBase::Panorama::state
private

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