Hugintrunk
0.1
|
Base class for all panorama commands. More...
#include <Command.h>
Public Member Functions | |
PanoCommand (HuginBase::Panorama &pano) | |
constructor More... | |
PanoCommand (HuginBase::Panorama &pano, const std::string &commandName) | |
virtual | ~PanoCommand () |
destructor More... | |
virtual void | execute () |
execute the command. More... | |
virtual void | undo () |
undo execute() [virtual] More... | |
virtual void | redo () |
redo execute() [virtual] More... | |
virtual std::string | getName () const |
returns the name of the command More... | |
virtual void | setName (const std::string &newName) |
sets the name for the command More... | |
virtual bool | wasSuccessful () const |
virtual bool | processPanorama (HuginBase::Panorama &pano) |
Called by execute(). More... | |
Protected Member Functions | |
virtual void | setSuccessful (bool success=true) |
virtual void | saveMemento () |
saves the state for undo More... | |
virtual void | saveRedoMemento () |
saves the state for redo More... | |
Protected Attributes | |
HuginBase::Panorama & | m_pano |
internal variables More... | |
HuginBase::PanoramaDataMemento * | m_memento |
HuginBase::PanoramaDataMemento * | m_redoMemento |
bool | m_clearDirty |
Private Attributes | |
bool | m_successful |
std::string | m_name |
|
inlineexplicit |
|
inline |
|
virtual |
|
virtual |
execute the command.
[virtual] Processes the panorama and saves the stateThe default implementation calls processPanorama() and saveMemento(). Only override this method when you want to customize the undo behaviour.
Definition at line 41 of file Command.cpp.
References HuginBase::Panorama::changeFinished(), HuginBase::Panorama::clearDirty(), m_clearDirty, m_memento, m_pano, processPanorama(), saveMemento(), HuginBase::Panorama::setMementoToCopyOf(), and setSuccessful().
Referenced by redo().
|
virtual |
returns the name of the command
Reimplemented in PanoCommand::DistributeImagesCmd, PanoCommand::ResetToMeanExposure, PanoCommand::UpdateWhiteBalance, PanoCommand::UpdateMaskForImgCmd, PanoCommand::NewPartCmd, PanoCommand::LinkLensVarsCmd, PanoCommand::ChangePartImagesLinkingCmd, PanoCommand::ChangePartNumberCmd, PanoCommand::UpdateCropFactorCmd, PanoCommand::UpdateFocalLengthCmd, PanoCommand::TranslatePanoCmd, PanoCommand::RotatePanoCmd, PanoCommand::LoadPTProjectCmd, PanoCommand::SetPanoOptionsCmd, PanoCommand::UpdateSrcImagesCmd, PanoCommand::UpdateSrcImageCmd, PanoCommand::MergePanoCmd, PanoCommand::MoveImageCmd, PanoCommand::SwapImagesCmd, PanoCommand::SetActiveImagesCmd, PanoCommand::ChangeCtrlPointCmd, PanoCommand::RemoveCtrlPointsCmd, PanoCommand::RemoveCtrlPointCmd, PanoCommand::AddCtrlPointsCmd, PanoCommand::AddCtrlPointCmd, PanoCommand::StraightenPanoCmd, PanoCommand::CenterPanoCmd, PanoCommand::SetVariableCmd, PanoCommand::UpdatePhotometricOptimizerSwitchCmd, PanoCommand::UpdateOptimizerSwitchCmd, PanoCommand::UpdateOptimizeVectorCmd, PanoCommand::UpdateVariablesByParseExpression, PanoCommand::UpdateImagesVariablesCmd, PanoCommand::UpdateImageVariablesCmd, PanoCommand::UpdateVariablesCPSetCmd, PanoCommand::UpdateVariablesCPCmd, PanoCommand::UpdateCPsCmd, PanoCommand::wxAddCtrlPointGridCmd, PanoCommand::UpdateVariablesCmd, PanoCommand::wxApplyTemplateCmd, PanoCommand::RemoveImagesCmd, PanoCommand::wxNewProjectCmd, PanoCommand::RemoveImageCmd, PanoCommand::wxLoadPTProjectCmd, PanoCommand::AddImagesCmd, PanoCommand::NewPanoCmd, and PanoCommand::wxAddImagesCmd.
Definition at line 83 of file Command.cpp.
References m_name.
|
virtual |
Called by execute().
The default implementation does nothing and returns true. Should return false when the processing was unsuccessful.
Reimplemented in PanoCommand::DistributeImagesCmd, PanoCommand::ResetToMeanExposure, PanoCommand::UpdateWhiteBalance, PanoCommand::UpdateMaskForImgCmd, PanoCommand::NewPartCmd, PanoCommand::LinkLensVarsCmd, PanoCommand::ChangePartImagesLinkingCmd, PanoCommand::ChangePartNumberCmd, PanoCommand::UpdateCropFactorCmd, PanoCommand::UpdateFocalLengthCmd, PanoCommand::TranslatePanoCmd, PanoCommand::RotatePanoCmd, PanoCommand::LoadPTProjectCmd, PanoCommand::SetPanoOptionsCmd, PanoCommand::UpdateSrcImagesCmd, PanoCommand::UpdateSrcImageCmd, PanoCommand::MergePanoCmd, PanoCommand::MoveImageCmd, PanoCommand::SwapImagesCmd, PanoCommand::SetActiveImagesCmd, PanoCommand::ChangeCtrlPointCmd, PanoCommand::RemoveCtrlPointsCmd, PanoCommand::RemoveCtrlPointCmd, PanoCommand::AddCtrlPointsCmd, PanoCommand::AddCtrlPointCmd, PanoCommand::StraightenPanoCmd, PanoCommand::CenterPanoCmd, PanoCommand::SetVariableCmd, PanoCommand::UpdatePhotometricOptimizerSwitchCmd, PanoCommand::UpdateOptimizerSwitchCmd, PanoCommand::UpdateOptimizeVectorCmd, PanoCommand::UpdateVariablesByParseExpression, PanoCommand::UpdateImagesVariablesCmd, PanoCommand::UpdateImageVariablesCmd, PanoCommand::UpdateVariablesCPSetCmd, PanoCommand::UpdateVariablesCPCmd, PanoCommand::UpdateCPsCmd, PanoCommand::wxAddCtrlPointGridCmd, PanoCommand::UpdateVariablesCmd, PanoCommand::wxApplyTemplateCmd, PanoCommand::RemoveImagesCmd, PanoCommand::wxNewProjectCmd, PanoCommand::RemoveImageCmd, PanoCommand::wxLoadPTProjectCmd, PanoCommand::AddImagesCmd, PanoCommand::NewPanoCmd, PanoCommand::wxAddImagesCmd, and PanoCommand::CombinedPanoCommand.
Definition at line 121 of file Command.cpp.
Referenced by execute().
|
virtual |
redo execute() [virtual]
the derived class must call PanoComand::execute() or saveRedoMemento() in its execute() method to save the state.
Definition at line 70 of file Command.cpp.
References HuginBase::Panorama::changeFinished(), execute(), m_pano, m_redoMemento, and HuginBase::Panorama::setMementoToCopyOf().
|
protectedvirtual |
saves the state for undo
Definition at line 103 of file Command.cpp.
References HuginBase::Panorama::getNewMemento(), m_memento, and m_pano.
Referenced by execute().
|
protectedvirtual |
saves the state for redo
Definition at line 112 of file Command.cpp.
References HuginBase::Panorama::getNewMemento(), m_pano, and m_redoMemento.
Referenced by undo().
|
virtual |
sets the name for the command
Definition at line 88 of file Command.cpp.
References m_name.
Referenced by GLPreviewFrame::LoadImages(), and RawImportDialog::OnOk().
|
protectedvirtual |
|
virtual |
undo execute() [virtual]
the derived class must call PanoComand::execute() or saveMemento() in its execute() method to save the state.
Definition at line 62 of file Command.cpp.
References HuginBase::Panorama::changeFinished(), DEBUG_ASSERT, m_memento, m_pano, saveRedoMemento(), and HuginBase::Panorama::setMementoToCopyOf().
|
virtual |
Definition at line 93 of file Command.cpp.
References m_successful.
Referenced by MainFrame::LoadProjectFile().
|
protected |
Definition at line 100 of file Command.h.
Referenced by execute(), and PanoCommand::LoadPTProjectCmd::LoadPTProjectCmd().
|
protected |
Definition at line 96 of file Command.h.
Referenced by execute(), saveMemento(), undo(), and ~PanoCommand().
|
private |
|
protected |
internal variables
Definition at line 95 of file Command.h.
Referenced by execute(), redo(), saveMemento(), saveRedoMemento(), and undo().
|
protected |
Definition at line 97 of file Command.h.
Referenced by redo(), saveRedoMemento(), and ~PanoCommand().
|
private |
Definition at line 102 of file Command.h.
Referenced by setSuccessful(), and wasSuccessful().