|
Computer Assited Medical Intervention Tool Kit
version 5.0
|
|
Go to the documentation of this file.
32 #include <Component.h>
42 class ActionExtension;
214 Action(ActionExtension*);
220 #define CAMITK_WINDOWS_SYSTEM_ERROR_SAFEGUARD ERROR
232 #ifdef CAMITK_WINDOWS_SYSTEM_ERROR_SAFEGUARD
233 #define ERROR CAMITK_WINDOWS_SYSTEM_ERROR_SAFEGUARD
289 void setInputComponent(
Component* input);
312 virtual QAction* getQAction(
Component* target =
nullptr);
315 QString getName()
const {
320 QString getDescription()
const {
325 QString getComponent()
const {
330 QString getFamily()
const {
335 QString getExtensionName()
const;
338 QStringList getTag()
const {
343 bool getEmbedded()
const {
372 virtual QWidget* getWidget();
375 virtual QPixmap getIcon();
381 void updateTargets();
387 bool getAutoUpdateProperties()
const;
390 void setAutoUpdateProperties(
bool);
408 virtual bool addParameter(
Property*);
434 void setName(QString name);
442 void setComponent(QString component);
445 void setFamily(QString family);
448 void addTag(QString tag);
451 void setEmbedded(
bool isEmbedded);
454 void setIcon(QPixmap);
457 QWidget* actionWidget;
493 QMap<QString, Property*> parameterMap;
507 bool autoUpdateProperties;
563 void preProcessInPipeline();
569 void postProcessInPipeline();
void setFamily(QString family)
the name of the family in which this action is associated
Definition: Action.cpp:136
bool isEmbedded
is the widget embedded or not
Definition: Action.h:504
virtual QPixmap getIcon()
the icon to personalize the action (no icon by default)
Definition: Action.cpp:161
const vtkSmartPointer< vtkTransform > getTransform() const override
Get the transformation with respect to the parent frame.
Definition: sdk/libraries/core/component/Component.cpp:824
HistoryItem * item
Definition: Action.h:542
#define CAMITK_WARNING(MSG)
Log for warning verbosity (the most common one) Will appear by default.
Definition: Log.h:266
QString description
the descriptionof the action
Definition: Action.h:492
void preProcess()
Save the number of top level components loaded in memory before applying the action.
Definition: Action.cpp:347
void setParentFrame(InterfaceFrame *frame, bool keepTransform=true) override
Set the parent frame and update or not its transform during the parent transition.
Definition: sdk/libraries/core/component/Component.cpp:792
QAction * qAction
the corresponding QAction
Definition: Action.h:513
@ WARNING
some (partial) error occured during the application of the algorithm
Definition: Action.h:250
@ SUCCESS
everything went according to plan
Definition: Action.h:248
virtual bool isSelected() const
Check if this data component is selected.
Definition: sdk/libraries/core/component/Component.h:892
Component * getOutputComponent()
Returns the output Components in case of only one Component.
Definition: Action.cpp:337
@ ABORTED
the action was aborted before completion
Definition: Action.h:251
static const ComponentList & getAllComponents()
get the current application wide list of all Components.
Definition: Application.cpp:1083
static void refresh()
refresh the main window (this will call the refresh method of all viewers)
Definition: Application.cpp:333
ApplyStatus
Definition: Action.h:247
void setName(QString name)
Definition: Action.cpp:120
void addProperty(QByteArray name, QVariant value)
Add a property of the corresponding action to the history item.
Definition: HistoryItem.cpp:65
void setAutoUpdateProperties(bool)
are the properties to be udpated every time the user makes a change in the widget (default is false)?
Definition: Action.cpp:426
ComponentList outputComponents
List returned by getOutputComponents()
Definition: Action.h:578
void setComponent(QString component)
the name of the component class that can be used by this action
Definition: Action.cpp:131
virtual bool isInstanceOf(const char *) const =0
pure virtual method, implemented in the child-class
@ ERROR
apply() failed : an error occured (usually it means that the apply() was interrupted)
Definition: Action.h:249
QStringList tags
the name of the tag called this action
Definition: Action.h:501
QWidget * actionWidget
the action widget
Definition: Action.h:480
ComponentList targetComponents
The list of valid (regarding the component property) components for which this action is called.
Definition: Action.h:527
const ComponentList getTargets() const
the currently selected and valid (regarding the component property) components, for which this action...
Definition: Action.cpp:166
QString getName() const
get the name of the action
Definition: Action.h:338
~Action() override
Destructor.
Definition: Action.cpp:72
HistoryComponent class describes the component information (name, type) stored in the history.
Definition: HistoryComponent.h:82
void setInputHistoryComponents(QList< HistoryComponent > inputHistoryComponents)
Set the input components of the history item action.
Definition: HistoryItem.cpp:75
static void addHistoryItem(HistoryItem item)
Add the history item to the application history.
Definition: Application.cpp:1132
void postProcess()
Register the action in the history.
Definition: Action.cpp:381
void postProcessInPipeline()
Set the right output component list so that the method getOutputComponents() can be called.
Definition: Action.cpp:409
static const ComponentList & getSelectedComponents()
get the currently selected Components.
Definition: Application.cpp:1088
void setEmbedded(bool isEmbedded)
set the embedded property (an action is embedded by default, unless specified otherwise by explicitly...
Definition: Action.cpp:146
Action(ActionExtension *)
Default Constructor: the ActionExtension is needed.
Definition: Action.cpp:61
static QString getStatusAsString(ApplyStatus)
Definition: Action.cpp:87
QString getExtensionName() const
the name of the extension in the family in which this action is associated
Definition: Action.cpp:156
ApplyStatus applyInPipeline()
This method encapsulates the apply() method.
Definition: Action.cpp:285
void setInputComponents(ComponentList inputs)
Specify the input Component(s) Only applyInPipeline() should be called with this method (maybe apply)...
Definition: Action.cpp:307
This class describes a property that can be used in components and actions or any class that needs to...
Definition: Property.h:303
void addTag(QString tag)
add a tag to the tags list of this action
Definition: Action.cpp:141
void updateTargets()
update the target list using the currently selected components
Definition: Action.cpp:171
void setOutputHistoryComponents(QList< HistoryComponent > outputHistoryComponents)
Set the output components of the history item action.
Definition: HistoryItem.cpp:85
QString family
the name of the family in which this action is associated
Definition: Action.h:498
camitk::Action::ApplyStatus applyAndRegister()
This method is called whenever the action has to be applied on the target list (like the apply()) met...
Definition: Action.cpp:263
Action class is an abstract class that enables you to build a action (generally on a component)....
Definition: Action.h:231
virtual QAction * getQAction(Component *target=nullptr)
Get the corresponding QAction.
Definition: Action.cpp:204
virtual camitk::Action::ApplyStatus apply()=0
This method is called when the action has to be applied on the target list (get the target lists usin...
@ TRIGGERED
the action was triggered only, but not applied
Definition: Action.h:252
QString getDescription() const
the description of the action
Definition: Action.h:343
HistoryItem class describes the entry of an action used in a pipeline, in the history.
Definition: HistoryItem.h:84
ActionExtension * extension
the extension in which this action is declared and registered
Definition: Action.h:507
bool isInstanceOf(QString className) const override
Assert that a Component instance really inherits from a given className.
Definition: sdk/libraries/core/component/Component.cpp:496
ComponentList aliveBeforeComponents
In case of a pipeline application of the Action (i.e.
Definition: Action.h:573
const char * description
Definition: applications/cepgenerator/main.cpp:38
void setDescription(QString description)
the description of the action
Definition: Action.cpp:126
QSizePolicy policy(QSizePolicy::Expanding, QSizePolicy::Expanding)
static void setTriggeredAction(Action *action)
set the currently triggered action This is used by Action::trigger(..) to refresh all the viewer (the...
Definition: Application.cpp:1115
camitk::Action::ApplyStatus trigger(QWidget *parent=nullptr)
This method triggers the action.
Definition: Action.cpp:218
void applyTargetPosition(Component *input, Component *target)
Change the target frame according to the default frame policy regarding the input's one.
Definition: Action.cpp:450
@ SUBFRAME
New component's parent frame is its parent component.
Definition: Application.h:91
@ SAME_TRANSFORMATION
New component has no parent frame (parent frame is set to nullptr), and its frame is copied from its ...
Definition: Application.h:89
static PropertyObject * getPropertyObject()
Get the property object of the application.
Definition: Application.cpp:1531
QList< Component * > ComponentList
A list of Component.
Definition: CamiTKAPI.h:127
void setIcon(QPixmap)
set the Pixmap
Definition: Action.cpp:151
QPixmap icon
the Action pixmap icon
Definition: Action.h:510
virtual bool addParameter(Property *)
Add a new parameter to the action, using the CamiTK property class.
Definition: Action.cpp:440
QString name
the name of the action
Definition: Action.h:489
This class describes what is a generic Action extension. To add a ActionExtension to CamiTK core,...
Definition: ActionExtension.h:80
A component is something that composed something and could also be a part of something.
Definition: modeling/libraries/pml/Component.h:48
#define CAMITK_TRACE(MSG)
Log for trace verbosity (the most verbose one, should be used for bug report) The msg will appear onl...
Definition: Log.h:256
ComponentList getOutputComponents()
Returns the output Component(s)
Definition: Action.cpp:332
setObjectName("RendererWidget")
virtual Q_INVOKABLE camitk::Property * getProperty(QString name)
Get a Property given its name.
Definition: Action.cpp:435
TargetPositionningPolicy
Definition: Application.h:88
bool autoUpdateProperties
Should the properties/parameters of this action be automatically updated when the user change somethi...
Definition: Action.h:530
static const ComponentList & getTopLevelComponents()
get the current application wide list of instantiated top-level Components.
Definition: Application.cpp:1078
virtual QWidget * getWidget()
This method has to be redefined in your Action only if:
Definition: Action.cpp:185
virtual void setTransform(vtkSmartPointer< vtkTransform > transform)=0
Set the current input frame position (according to its parent Frame)
bool getAutoUpdateProperties() const
Definition: Action.cpp:421
void preProcessInPipeline()
Selects the right component(s) (the one that has been set by setInputComponents() ),...
Definition: Action.cpp:373
ComponentList topLevelSelectedComponents
The list of top level selected components before running the action This list is used to deduce the n...
Definition: Action.h:547
QMap< QString, Property * > parameterMap
list of CamiTK property decorating the dynamic properties (action parameters)
Definition: Action.h:516
void setInputComponent(Component *input)
Specify the input Components in case of only one Component.
Definition: Action.cpp:320
virtual QString getName()=0
returns the action extension name (to be overriden in your ActionExtension)
QString getComponent() const
the name of the component class that can be used by this action
Definition: Action.h:348
QString component
the name of the component class that can be used by this action
Definition: Action.h:495
A Component represents something that could be included in the explorer view, the interactive 3D view...
Definition: sdk/libraries/core/component/Component.h:302
virtual bool getModified() const
set the modified flag
Definition: sdk/libraries/core/component/Component.h:948
virtual QVariant getPropertyValue(unsigned int index)
get the value of the property at the given index, a non valid QVariant if the index is out of bounds ...
Definition: PropertyObject.cpp:111
@ NO_TRANSFORMATION
New component has no parent frame (parent frame is therefore set to nullptr) and transform is Id.
Definition: Application.h:90
#define CAMITK_API
Definition: CamiTKAPI.h:49
Definition: Action.cpp:35