Commit 790bcfa9 authored by Emmanuel Promayon's avatar Emmanuel Promayon
Browse files

UPDATED action menu reflects the current state of visibility in 3D

parent 59798efc
......@@ -53,7 +53,12 @@ ShowImageIn3D::~ShowImageIn3D() {
// --------------- getWidget --------------
QWidget* ShowImageIn3D::getWidget() {
return NULL;
ImageComponent* img = dynamic_cast<ImageComponent*> (getTargets().last());
if (img!=nullptr) {
bool isDisplayedIn3D = img->property("Display Image in 3D Viewer").toBool();
getQAction()->setChecked(isDisplayedIn3D);
}
return nullptr;
}
// --------------- apply -------------------
......@@ -63,7 +68,11 @@ Action::ApplyStatus ShowImageIn3D::apply() {
foreach (Component * comp, getTargets()) {
ImageComponent* img = dynamic_cast<ImageComponent*> (comp);
if (img) {
img->setViewIn3D(! img->getViewIn3D());
bool isDisplayedIn3D = img->property("Display Image in 3D Viewer").toBool();
// togle
isDisplayedIn3D = !isDisplayedIn3D;
img->setProperty("Display Image in 3D Viewer",isDisplayedIn3D);
getQAction()->setChecked(isDisplayedIn3D);
Application::refresh();
}
}
......
......@@ -60,11 +60,15 @@ class MeshComponent;
* An image volume data has no concrete 3D representation,
* but handles several sub-components for axial, sagittal and coronal slices.
*
* Vtk Pipeline:
* \verbatim
* \endverbatim
*
* Vtk Pipeline: @see Slice
*
* @note
* You can use the following properties to change the visualization of an ImageComponent and children components:
* - "Image Name" type QString
* - "Display Image in 3D Viewer" type boolean, controls what is displayed in the default 3D viewer
*
* Everytime a property is changed using setProperty(QString propertyName, QVariant value), the ImageComponent
* will automatically update, thanks to the updateProperty(..) method.
*/
class CAMITK_API ImageComponent : public camitk::Component {
Q_OBJECT
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment