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

Base class for all panorama commands. More...

#include <Command.h>

Inheritance diagram for PanoCommand::PanoCommand:
Inheritance graph

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::Panoramam_pano
 internal variables More...
 
HuginBase::PanoramaDataMementom_memento
 
HuginBase::PanoramaDataMementom_redoMemento
 
bool m_clearDirty
 

Private Attributes

bool m_successful
 
std::string m_name
 

Detailed Description

Base class for all panorama commands.

see command pattern.

Definition at line 38 of file Command.h.

Constructor & Destructor Documentation

PanoCommand::PanoCommand::PanoCommand ( HuginBase::Panorama pano)
inlineexplicit

constructor

Definition at line 42 of file Command.h.

PanoCommand::PanoCommand::PanoCommand ( HuginBase::Panorama pano,
const std::string &  commandName 
)
inline

Definition at line 45 of file Command.h.

PanoCommand::PanoCommand::~PanoCommand ( )
virtual

destructor

Definition at line 29 of file Command.cpp.

References m_memento, and m_redoMemento.

Member Function Documentation

void PanoCommand::PanoCommand::execute ( )
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().

std::string PanoCommand::PanoCommand::getName ( ) const
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.

bool PanoCommand::PanoCommand::processPanorama ( HuginBase::Panorama pano)
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().

void PanoCommand::PanoCommand::redo ( )
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().

void PanoCommand::PanoCommand::saveMemento ( )
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().

void PanoCommand::PanoCommand::saveRedoMemento ( )
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().

void PanoCommand::PanoCommand::setName ( const std::string &  newName)
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().

void PanoCommand::PanoCommand::setSuccessful ( bool  success = true)
protectedvirtual

Definition at line 98 of file Command.cpp.

References m_successful.

Referenced by execute().

void PanoCommand::PanoCommand::undo ( )
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().

bool PanoCommand::PanoCommand::wasSuccessful ( ) const
virtual

Definition at line 93 of file Command.cpp.

References m_successful.

Referenced by MainFrame::LoadProjectFile().

Member Data Documentation

bool PanoCommand::PanoCommand::m_clearDirty
protected

Definition at line 100 of file Command.h.

Referenced by execute(), and PanoCommand::LoadPTProjectCmd::LoadPTProjectCmd().

HuginBase::PanoramaDataMemento* PanoCommand::PanoCommand::m_memento
protected

Definition at line 96 of file Command.h.

Referenced by execute(), saveMemento(), undo(), and ~PanoCommand().

std::string PanoCommand::PanoCommand::m_name
private

Definition at line 103 of file Command.h.

Referenced by getName(), and setName().

HuginBase::Panorama& PanoCommand::PanoCommand::m_pano
protected

internal variables

Definition at line 95 of file Command.h.

Referenced by execute(), redo(), saveMemento(), saveRedoMemento(), and undo().

HuginBase::PanoramaDataMemento* PanoCommand::PanoCommand::m_redoMemento
protected

Definition at line 97 of file Command.h.

Referenced by redo(), saveRedoMemento(), and ~PanoCommand().

bool PanoCommand::PanoCommand::m_successful
private

Definition at line 102 of file Command.h.

Referenced by setSuccessful(), and wasSuccessful().


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