|
virtual ActionInfoHandle | get_action_info () const =0 |
|
std::string | get_definition () const |
| Get the definition of the action (in XML format)
|
|
std::string | get_type () const |
| Get the type of the action.
|
|
std::string | get_usage () const |
| Get a usage description.
|
|
std::string | get_key (size_t index) const |
| Get the name of the key with a certain index.
|
|
std::string | get_default_key_value (size_t index) const |
| Get the name of the key with a certain index.
|
|
int | get_key_index (const std::string &name) const |
| Get the index of a certain key.
|
|
bool | is_undoable () const |
| Check whether the action is undoable.
|
|
virtual bool | changes_project_data () |
|
virtual bool | translate (ActionContextHandle &context) |
|
virtual bool | validate (ActionContextHandle &context)=0 |
|
virtual bool | run (ActionContextHandle &context, ActionResultHandle &result)=0 |
|
virtual void | clear_cache () |
|
std::string | export_to_string () const |
|
bool | import_from_string (const std::string &action, std::string &error) |
|
bool | import_from_string (const std::string &action) |
| Same as function above, but without the error report.
|
|
CLASS ACTION: Main class that defines an action in the program An action is not copyable as that would invalidate the ActionParameter pointers used internally.
bool Core::Action::changes_project_data |
( |
| ) |
|
|
virtual |
Query whether the action changes the data NOTE: This function is overloadable from the default subclass definition. As certain functions like Set, Add, etc, have this property depend on the actual object they operate on. For example setting a layer state variable should change this, whereas a interface variable should not. For these functions the default implementation that picks up this property from the macro can thence be overwritten.
Reimplemented in Core::ActionRotateView.
virtual bool Core::Action::run |
( |
ActionContextHandle & |
context, |
|
|
ActionResultHandle & |
result |
|
) |
| |
|
pure virtual |
Each action needs to have this piece implemented. It spells out how the action is run. It returns whether the action was successful or not. NOTE: In case of an asynchronous action, the return value is ignored and the program relies on report_done() from the context to be triggered when the asynchronous part has finished. In any other case the ActionDispatcher will issue the report_done() when run returns.
Implemented in Seg3D::ActionDilateErodeFilter, Seg3D::ActionIterativeDilateErodeFilter, Seg3D::ActionSmoothDilateErodeFilter, Seg3D::ActionErodeFilter, Seg3D::ActionIterativeErodeFilter, Seg3D::ActionSmoothErodeFilter, Seg3D::ActionIterativeDilateFilter, Seg3D::ActionSmoothDilateFilter, Seg3D::ActionDilateFilter, Seg3D::ActionThresholdSegmentationLSFilter, Seg3D::ActionImportLayer, Seg3D::ActionImportSeries, Seg3D::ActionGradientAnisotropicDiffusionFilter, Seg3D::ActionIntensityCorrectionFilter, Seg3D::ActionExportPoints, Seg3D::ActionCurvatureAnisotropicDiffusionFilter, Seg3D::ActionPolyline, Seg3D::ActionConnectedComponentFilter, Seg3D::ActionHistogramEqualizationFilter, Seg3D::ActionMeanFilter, Seg3D::ActionMedianFilter, Seg3D::ActionResample, Seg3D::ActionExportSegmentation, Seg3D::ActionConfidenceConnectedFilter, Seg3D::ActionMaskDataFilter, Seg3D::ActionGradientMagnitudeFilter, Seg3D::ActionExportIsosurface, Seg3D::ActionExportLayer, Seg3D::ActionImportLargeVolumeLayer, Seg3D::ActionCannyEdgeDetectionFilter, Seg3D::ActionDistanceFilter, Seg3D::ActionFillHolesFilter, Seg3D::ActionOrFilter, Seg3D::ActionPointSetRegisterFilter, Seg3D::ActionRemoveFilter, Seg3D::ActionDiscreteGaussianFilter, Seg3D::ActionXorFilter, Seg3D::ActionNeighborhoodConnectedFilter, Seg3D::ActionOtsuThresholdFilter, Seg3D::ActionDeleteLayers, Seg3D::ActionAndFilter, Seg3D::ActionMigrateSandboxLayer, Seg3D::ActionCopy, Seg3D::ActionExtractDataLayer, Seg3D::ActionArithmeticFilter, Seg3D::ActionConnectedComponentSizeFilter, Seg3D::ActionInvert, Seg3D::ActionGetLayerGroup, Seg3D::ActionMoveLayer, Seg3D::ActionPadFilter, Seg3D::ActionComputeIsosurface, Seg3D::ActionMoveGroup, Seg3D::ActionCrop, Seg3D::ActionTransform, Seg3D::ActionPermute, Seg3D::ActionNewMaskLayer, Seg3D::ActionPointSetTransformFilter, Seg3D::ActionThreshold, Seg3D::ActionSynchronize, Seg3D::ActionAutoSave, Seg3D::ActionSingleThreshold, Seg3D::ActionSaveSession, Seg3D::ActionDeleteIsosurface, Seg3D::ActionDuplicateLayer, Seg3D::ActionRecreateLayer, Seg3D::ActionReportScriptStatus, Seg3D::ActionExportProject, Core::ActionRotateView, Seg3D::ActionCalculateMaskVolume, Seg3D::ActionDeleteSandbox, Seg3D::ActionLoadSession, Seg3D::ActionSaveProjectAs, Seg3D::ActionActivateLayer, Seg3D::ActionBeginScriptStatusReport, Seg3D::ActionNewProject, Seg3D::ActionResetChangesMade, Seg3D::ActionEndScriptStatusReport, Seg3D::ActionShiftActiveLayer, Seg3D::ActionSavePreferences, Seg3D::ActionLoadProject, Seg3D::ActionOpenTool, Seg3D::ActionAddNote, Seg3D::ActionSaveToolPreferences, Seg3D::ActionActivateTool, Seg3D::ActionCloseTool, Seg3D::ActionDeleteSession, Seg3D::ActionCreateSandbox, Seg3D::ActionRedo, Seg3D::ActionUndo, and Core::ActionGet.
virtual bool Core::Action::validate |
( |
ActionContextHandle & |
context | ) |
|
|
pure virtual |
Each action needs to be validated just before it is posted. This way we enforce that every action that hits the main post_action signal will be a valid action to execute. NOTE: This function is not const and may alter the values of the parameters and correct faulty input. Run on the other hand is not allowed to change anything in the action, as it is posted to any observers after the action is validated.
Implemented in Seg3D::ActionDilateErodeFilter, Seg3D::ActionIterativeDilateErodeFilter, Seg3D::ActionSmoothDilateErodeFilter, Seg3D::ActionErodeFilter, Seg3D::ActionIterativeErodeFilter, Seg3D::ActionSmoothErodeFilter, Seg3D::ActionIterativeDilateFilter, Seg3D::ActionSmoothDilateFilter, Seg3D::ActionDilateFilter, Seg3D::ActionThresholdSegmentationLSFilter, Seg3D::ActionGradientAnisotropicDiffusionFilter, Seg3D::ActionIntensityCorrectionFilter, Seg3D::ActionCurvatureAnisotropicDiffusionFilter, Seg3D::ActionImportLayer, Seg3D::ActionImportSeries, Seg3D::ActionConnectedComponentFilter, Seg3D::ActionHistogramEqualizationFilter, Seg3D::ActionMeanFilter, Seg3D::ActionMedianFilter, Seg3D::ActionResample, Seg3D::ActionConfidenceConnectedFilter, Seg3D::ActionMaskDataFilter, Seg3D::ActionGradientMagnitudeFilter, Seg3D::ActionExportPoints, Seg3D::ActionCannyEdgeDetectionFilter, Seg3D::ActionDistanceFilter, Seg3D::ActionPolyline, Seg3D::ActionFillHolesFilter, Seg3D::ActionOrFilter, Seg3D::ActionPointSetRegisterFilter, Seg3D::ActionRemoveFilter, Seg3D::ActionExportSegmentation, Seg3D::ActionDiscreteGaussianFilter, Seg3D::ActionXorFilter, Seg3D::ActionNeighborhoodConnectedFilter, Seg3D::ActionOtsuThresholdFilter, Seg3D::ActionExportIsosurface, Seg3D::ActionExportLayer, Seg3D::ActionImportLargeVolumeLayer, Seg3D::ActionAndFilter, Seg3D::ActionExtractDataLayer, Seg3D::ActionArithmeticFilter, Seg3D::ActionConnectedComponentSizeFilter, Seg3D::ActionInvert, Seg3D::ActionPadFilter, Seg3D::ActionComputeIsosurface, Seg3D::ActionCrop, Seg3D::ActionTransform, Seg3D::ActionDeleteLayers, Seg3D::ActionPermute, Seg3D::ActionMigrateSandboxLayer, Seg3D::ActionNewMaskLayer, Seg3D::ActionCopy, Seg3D::ActionPointSetTransformFilter, Seg3D::ActionGetLayerGroup, Seg3D::ActionMoveLayer, Seg3D::ActionThreshold, Seg3D::ActionMoveGroup, Seg3D::ActionSynchronize, Seg3D::ActionAutoSave, Seg3D::ActionSingleThreshold, Seg3D::ActionSaveSession, Seg3D::ActionDeleteIsosurface, Seg3D::ActionDuplicateLayer, Seg3D::ActionRecreateLayer, Seg3D::ActionReportScriptStatus, Seg3D::ActionExportProject, Core::ActionRotateView, Seg3D::ActionCalculateMaskVolume, Seg3D::ActionDeleteSandbox, Seg3D::ActionLoadSession, Seg3D::ActionSaveProjectAs, Seg3D::ActionActivateLayer, Seg3D::ActionBeginScriptStatusReport, Seg3D::ActionNewProject, Seg3D::ActionResetChangesMade, Seg3D::ActionEndScriptStatusReport, Seg3D::ActionShiftActiveLayer, Seg3D::ActionSavePreferences, Seg3D::ActionLoadProject, Seg3D::ActionOpenTool, Seg3D::ActionAddNote, Seg3D::ActionSaveToolPreferences, Seg3D::ActionActivateTool, Seg3D::ActionCloseTool, Seg3D::ActionDeleteSession, Seg3D::ActionCreateSandbox, Seg3D::ActionRedo, Seg3D::ActionUndo, and Core::ActionGet.