 |
Computer Assited Medical Intervention Tool Kit
version 4.1
|
Go to the documentation of this file.
42 class ActionExtension;
213 Action(ActionExtension*);
219 #define CAMITK_WINDOWS_SYSTEM_ERROR_SAFEGUARD ERROR
231 #ifdef CAMITK_WINDOWS_SYSTEM_ERROR_SAFEGUARD
232 #define ERROR CAMITK_WINDOWS_SYSTEM_ERROR_SAFEGUARD
288 void setInputComponent(
Component* input);
308 QAction* getQAction();
311 QString getName()
const {
316 QString getDescription()
const {
321 QString getComponent()
const {
326 QString getFamily()
const {
331 QString getExtensionName()
const;
334 QStringList getTag()
const {
339 bool getEmbedded()
const {
368 virtual QWidget* getWidget();
371 virtual QPixmap getIcon();
380 bool getAutoUpdateProperties()
const;
383 void setAutoUpdateProperties(
bool);
391 Q_INVOKABLE
virtual Property* getProperty(QString name);
401 virtual bool addParameter(
Property*);
427 void setName(QString name);
435 void setComponent(QString component);
438 void setFamily(QString family);
441 void addTag(QString tag);
444 void setEmbedded(
bool isEmbedded);
447 void setIcon(QPixmap);
450 QWidget* actionWidget;
486 QMap<QString, Property*> parameterMap;
500 bool autoUpdateProperties;
556 void preProcessInPipeline();
562 void postProcessInPipeline();
void setFamily(QString family)
the name of the family in which this action is associated
Definition: Action.cpp:129
bool isEmbedded
is the widget embedded or not
Definition: Action.h:497
virtual QPixmap getIcon()
the icon to personalize the action (no icon by default)
Definition: Action.cpp:154
const vtkSmartPointer< vtkTransform > getTransform() const override
Get the transformation with respect to the parent frame.
Definition: sdk/libraries/core/component/Component.cpp:666
HistoryItem * item
Definition: Action.h:535
#define CAMITK_WARNING(MSG)
Log for warning verbosity (the most common one) Will appear by default.
Definition: Log.h:263
QString description
the descriptionof the action
Definition: Action.h:485
void preProcess()
Save the number of top level components loaded in memory before applying the action.
Definition: Action.cpp:328
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:638
QAction * qAction
the corresponding QAction
Definition: Action.h:506
@ WARNING
some (partial) error occured during the application of the algorithm
Definition: Action.h:249
@ SUCCESS
everything went according to plan
Definition: Action.h:247
virtual bool isSelected() const
Check if this data component is selected.
Definition: sdk/libraries/core/component/Component.h:833
Component * getOutputComponent()
Returns the output Components in case of only one Component.
Definition: Action.cpp:318
@ ABORTED
the action was aborted before completion
Definition: Action.h:250
static const ComponentList & getAllComponents()
get the current application wide list of all Components.
Definition: Application.cpp:889
ApplyStatus
Definition: Action.h:246
void setName(QString name)
Definition: Action.cpp:113
QAction * getQAction()
Get the corresponding QAction.
Definition: Action.cpp:183
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:404
ComponentList outputComponents
List returned by getOutputComponents()
Definition: Action.h:571
void setComponent(QString component)
the name of the component class that can be used by this action
Definition: Action.cpp:124
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:248
QStringList tags
the name of the tag called this action
Definition: Action.h:494
QWidget * actionWidget
the action widget
Definition: Action.h:473
ComponentList targetComponents
The list of valid (regarding the component property) components for which this action is called.
Definition: Action.h:520
const ComponentList getTargets() const
the currently selected and valid (regarding the component property) components, for which this action...
Definition: Action.cpp:159
QString getName() const
get the name of the action
Definition: Action.h:334
~Action() override
Destructor.
Definition: Action.cpp:73
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:928
void postProcess()
Register the action in the history.
Definition: Action.cpp:361
void postProcessInPipeline()
Set the right output component list so that the method getOutputComponents() can be called.
Definition: Action.cpp:388
static const ComponentList & getSelectedComponents()
get the currently selected Components.
Definition: Application.cpp:894
void setEmbedded(bool isEmbedded)
set the embedded property (an action is embedded by default, unless specified otherwise by explicitly...
Definition: Action.cpp:139
Action(ActionExtension *)
Default Constructor: the ActionExtension is needed.
Definition: Action.cpp:62
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:149
ApplyStatus applyInPipeline()
This method encapsulates the apply() method.
Definition: Action.cpp:267
void setInputComponents(ComponentList inputs)
Specify the input Component(s) Only applyInPipeline() should be called with this method (maybe apply)...
Definition: Action.cpp:289
This class describes a property that can be used in components and actions or any class that needs to...
Definition: Property.h:314
const QString & getName() const
get the name of the property
Definition: Property.cpp:73
void addTag(QString tag)
add a tag to the tags list of this action
Definition: Action.cpp:134
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:491
ApplyStatus applyAndRegister()
This method is called whenever the action has to be applied on the target list (like the apply()) met...
Definition: Action.cpp:245
Action class is an abstract class that enables you to build a action (generally on a component)....
Definition: Action.h:230
@ TRIGGERED
the action was triggered only, but not applied
Definition: Action.h:251
QString getDescription() const
the description of the action
Definition: Action.h:339
virtual ApplyStatus apply()=0
This method is called when the action has to be applied on the target list (get the target lists usin...
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:500
bool isInstanceOf(QString className) const override
Assert that a Component instance really inherits from a given className.
Definition: sdk/libraries/core/component/Component.cpp:164
ComponentList aliveBeforeComponents
In case of a pipeline application of the Action (i.e.
Definition: Action.h:566
const char * description
Definition: applications/cepgenerator/main.cpp:37
static ActionViewer * getInstance()
returns the unique instance of ActionViewer
Definition: ActionViewer.cpp:75
void setDescription(QString description)
the description of the action
Definition: Action.cpp:119
void embedActionWidget(Action *)
embed an action widget in the stacked widget
Definition: ActionViewer.cpp:340
QSizePolicy policy(QSizePolicy::Expanding, QSizePolicy::Expanding)
ApplyStatus trigger(QWidget *parent=nullptr)
This method triggers the action.
Definition: Action.cpp:197
void applyTargetPosition(Component *input, Component *target)
Change the target frame according to the default frame policy regarding the input's one.
Definition: Action.cpp:427
@ SUBFRAME
New component's parent frame is its parent component.
Definition: Application.h:72
@ SAME_TRANSFORMATION
New component has no parent frame (parent frame is set to nullptr), and its frame is copied from its ...
Definition: Application.h:70
static PropertyObject * getPropertyObject()
Get the property object of the application.
Definition: Application.cpp:1325
QList< Component * > ComponentList
A list of Component.
Definition: CamiTKAPI.h:89
void setIcon(QPixmap)
set the Pixmap
Definition: Action.cpp:144
QPixmap icon
the Action pixmap icon
Definition: Action.h:503
const QVariant & getInitialValue() const
return the initial (default) value
Definition: Property.cpp:78
virtual bool addParameter(Property *)
Add a new parameter to the action, using the CamiTK property class.
Definition: Action.cpp:417
QString name
the name of the action
Definition: Action.h:482
This class describes what is a generic Action extension. To add a ActionExtension to CamiTK core,...
Definition: ActionExtension.h:82
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:253
ComponentList getOutputComponents()
Returns the output Component(s)
Definition: Action.cpp:313
setObjectName("RendererWidget")
virtual Q_INVOKABLE Property * getProperty(QString name)
Get a Property given its name.
Definition: Action.cpp:412
TargetPositionningPolicy
Definition: Application.h:69
bool autoUpdateProperties
Should the properties/parameters of this action be automatically updated when the user change somethi...
Definition: Action.h:523
static const ComponentList & getTopLevelComponents()
get the current application wide list of instantiated top-level Components.
Definition: Application.cpp:884
virtual QWidget * getWidget()
This method has to be redefined in your Action only if:
Definition: Action.cpp:164
virtual void setTransform(vtkSmartPointer< vtkTransform > transform)=0
Set the current input frame position (according to its parent Frame)
bool getAutoUpdateProperties() const
Definition: Action.cpp:399
void preProcessInPipeline()
Selects the right component(s) (the one that has been set by setInputComponents() ),...
Definition: Action.cpp:353
ComponentList topLevelSelectedComponents
The list of top level selected components before running the action This list is used to deduce the n...
Definition: Action.h:540
QMap< QString, Property * > parameterMap
list of CamiTK property decorating the dynamic properties (action parameters)
Definition: Action.h:509
void setInputComponent(Component *input)
Specify the input Components in case of only one Component.
Definition: Action.cpp:301
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:344
QString component
the name of the component class that can be used by this action
Definition: Action.h:488
A Component represents something that could be included in the explorer view, the interactive 3D view...
Definition: sdk/libraries/core/component/Component.h:298
virtual bool getModified() const
set the modified flag
Definition: sdk/libraries/core/component/Component.h:887
@ NO_TRANSFORMATION
New component has no parent frame (parent frame is therefore set to nullptr) and transform is Id.
Definition: Application.h:71
#define CAMITK_API
Definition: CamiTKAPI.h:49
Definition: Action.cpp:36