Commit a72dc688 authored by Emmanuel Promayon's avatar Emmanuel Promayon

FIXED viewer extension dependencies are now declared

parent b1bbc90a
......@@ -7,6 +7,7 @@ camitk_extension(COMPONENT_EXTENSION
DEFINES COMPILE_PML_COMPONENT_API
ENABLE_AUTO_TEST
TEST_FILES diaphragm.pml truthcube.pml
NEEDS_VIEWER_EXTENSION interactivegeometryviewer
)
# Additional test for SDK actions: this will add auto test for the given actions using the pmlcomponent
......
......@@ -3,5 +3,5 @@ camitk_extension(ACTION_EXTENSION
DESCRIPTION "Manipulating Frames."
ENABLE_AUTO_TEST
TEST_FILES brain.mha structured.vtk
NEEDS_VIEWER_EXTENSION interactivegeometryviewer
)
......@@ -2,6 +2,7 @@
camitk_extension(ACTION_EXTENSION
DEFINES COMPILE_PIXELCOLORCHANGER_ACTION_API
CEP_NAME SDK
NEEDS_VIEWER_EXTENSION interactivesliceviewer
DESCRIPTION "Allows changing the color of the image pixels"
ENABLE_AUTO_TEST
TEST_FILES mixed_3D_beam.msh brain.mha sinus.mhd
......
......@@ -3,6 +3,8 @@ camitk_extension(ACTION_EXTENSION
DEFINES COMPILE_VOLUME_RENDERING_ACTION_API
CEP_NAME SDK
DESCRIPTION "Use ray tracing to produce a 3D reprensation of the image"
NEEDS_VIEWER_EXTENSION interactivegeometryviewer
NEEDS_VIEWER_EXTENSION interactivegeometryviewer
ENABLE_AUTO_TEST
TEST_FILES Mesh.off brain.mha sinus.mhd
)
......
......@@ -3,7 +3,8 @@ camitk_extension(ACTION_EXTENSION
DEFINES COMPILE_MESHPROCESSING_ACTION_API
CEP_NAME SDK
DESCRIPTION "Features some nice algorithms for mesh processing"
INCLUDE_DIRECTORIES ${CAMITK_INCLUDE_DIR}/components/vtkmesh
NEEDS_COMPONENT_EXTENSION vtkmesh
NEEDS_VIEWER_EXTENSION interactivegeometryviewer
INSTALL_ALL_HEADERS
ENABLE_AUTO_TEST
TEST_FILES brain.mha bassin.msh head1.STL liver-smooth.obj Mesh.off robot.wrl scissors.obj simple.vtk sinus_skin.vtk sinus_skull.vtk skull1.stl structured.vtk pointcloud-with-data.vtk polydata-with-data.vtk cube-with-point-and-cell-data.vtk fieldfile.vtk check-with-color-pointdata.vtk plate-with-data.vtk female.vtk brainImageSmooth.vtk structuredgrid-with-data.vtk male.vtk cube-with-tensors.vtk imageBoundingBox.vtk binary-mesh-with-pointdata.vtk unstructured_binary_with_celldata.vtk
......
......@@ -4,6 +4,7 @@ camitk_extension(COMPONENT_EXTENSION
DESCRIPTION "Support for .msh files"
DEFINES COMPILE_MSH_COMPONENT_API
HEADERS_TO_INSTALL MshComponent.h MshExtension.h MshComponentAPI.h
NEEDS_VIEWER_EXTENSION interactivegeometryviewer
ENABLE_AUTO_TEST
)
......
......@@ -2,6 +2,7 @@
camitk_extension(COMPONENT_EXTENSION
CEP_NAME SDK
DESCRIPTION "Support for .off files"
NEEDS_VIEWER_EXTENSION interactivegeometryviewer
ENABLE_AUTO_TEST
)
......
......@@ -3,6 +3,7 @@ camitk_extension(COMPONENT_EXTENSION
CEP_NAME SDK
DESCRIPTION "Support for .vrml files"
ENABLE_AUTO_TEST
NEEDS_VIEWER_EXTENSION interactivegeometryviewer
# vrml save cannot save VRML -> level 1 is the best we can do
AUTO_TEST_LEVEL 1
)
......
......@@ -238,6 +238,7 @@ void MainWindow::showDockViewer(Viewer* theViewer, bool visible) {
// ------------- showViewer -----------------
void MainWindow::showViewer(Viewer* theViewer, bool visible) {
CAMITK_WARNING(tr("ShowViewer(..) method is now deprecated and will be remove from CamiTK API, please use showDockViewer(..) instead"))
showDockViewer(theViewer, visible);
}
......
......@@ -265,7 +265,31 @@ Component* Component::getTopLevelComponent() {
}
// -------------------- setVisibility --------------------
void Component::setVisibility(QString viewerName, bool b) {
// get the viewer pointer
Viewer* v = Application::getViewer(viewerName);
// only insert real non-null viewers
if (v != nullptr) {
QMap<Viewer*, bool>::iterator it = myViewers.find(v);
if (it == myViewers.end()) {
// insert the new viewer with the corresponding boolean
myViewers.insert(v, b);
}
else {
it.value() = b;
}
}
else {
CAMITK_WARNING(tr("Viewer \"%1\" not found: please make sure the required viewer extension is loaded").arg(viewerName))
}
}
void Component::setVisibility(Viewer* v, bool b) {
CAMITK_WARNING(tr("setVisibility(Viewer*,bool) method is now deprecated and will be remove from CamiTK API, please use setVisibility(QString,bool) instead"))
// only insert real non-null viewers
if (v != nullptr) {
QMap<Viewer*, bool>::iterator it = myViewers.find(v);
......@@ -281,8 +305,31 @@ void Component::setVisibility(Viewer* v, bool b) {
}
// -------------------- getVisibility --------------------
bool Component::getVisibility(QString viewerName) const {
// get the viewer pointer
Viewer* v = Application::getViewer(viewerName);
// only insert real non-null viewers
if (v != nullptr) {
auto it = myViewers.constFind(v);
if (it == myViewers.end()) {
return false;
}
else {
return it.value();
}
}
else {
CAMITK_WARNING(tr("Viewer \"%1\" not found: please make sure the required viewer extension is loaded").arg(viewerName))
}
}
bool Component::getVisibility(Viewer* v) const {
QMap<Viewer*, bool>::const_iterator it = myViewers.constFind(v);
CAMITK_WARNING(tr("getVisibility(Viewer*) method is now deprecated and will be remove from CamiTK API, please use getVisibility(QString) instead"))
auto it = myViewers.constFind(v);
if (it == myViewers.end()) {
return false;
......
......@@ -366,12 +366,27 @@ public:
/// set the modified flag
virtual bool getModified() const;
///@cond
/**
* TODO CAMITK_DEPRECATED. This section list all the methods marked as deprecated. They are to be removed in CamiTK 5.0
* @deprecated
*
* DEPRECATED (CamiTK 5.0) -> to be removed
* Use the setVisibility(QString, bool) / getVisibility(QString, bool) methods
*/
/// set the visibility for a viewer
virtual void setVisibility(Viewer*, bool);
/// get the visibility of a viewer
virtual bool getVisibility(Viewer*) const;
///@endcond
/// set the visibility inside the viewer of the given name
virtual void setVisibility(QString, bool);
/// get the visibility inside the viewer of the given name
virtual bool getVisibility(QString) const;
/// refresh all the viewer that are currently displaying this Component
virtual void refresh() const;
......
......@@ -3,6 +3,7 @@ camitk_extension(VIEWER_EXTENSION
DEFAULT
DEFINES COMPILE_BITMAP_VIEWER_API
DESCRIPTION "This extension provides a simple 2D image viewer"
NEEDS_VIEWER_EXTENSION medicalimageviewer
INSTALL_ALL_HEADERS
)
camitk_extension(ACTION_EXTENSION
ENABLE_AUTO_TEST
NEEDS_VIEWER_EXTENSION interactivesliceviewer
TEST_FILES bassin.msh brain.mha sinus.mhd
)
camitk_extension(ACTION_EXTENSION
ENABLE_AUTO_TEST
TEST_FILES bassin.msh brain.mha sinus.mhd head1.STL liver-smooth.obj Mesh.off robot.wrl scissors.obj simple.vtk sinus_skin.vtk sinus_skull.vtk skull1.stl structured.vtk pointcloud-with-data.vtk polydata-with-data.vtk cube-with-point-and-cell-data.vtk fieldfile.vtk check-with-color-pointdata.vtk plate-with-data.vtk female.vtk brainImageSmooth.vtk structuredgrid-with-data.vtk male.vtk cube-with-tensors.vtk imageBoundingBox.vtk binary-mesh-with-pointdata.vtk unstructured_binary_with_celldata.vtk
NEEDS_VIEWER_EXTENSION medicalimageviewer
NEEDS_VIEWER_EXTENSION interactivegeometryviewer interactivesliceviewer
)
camitk_application()
camitk_application(NEEDS_VIEWER_EXTENSION interactivesliceviewer)
camitk_application()
camitk_application(
NEEDS_VIEWER_EXTENSION interactivegeometryviewer explorer actionviewer
)
camitk_application()
camitk_application(NEEDS_VIEWER_EXTENSION medicalimageviewer)
......@@ -2,8 +2,8 @@
camitk_extension(VIEWER_EXTENSION
DEFAULT
DEFINES COMPILE_MIXED_VIEWER_API
NEEDS_COMPONENT_EXTENSION mixed
NEEDS_COMPONENT_EXTENSION mixed
NEEDS_VIEWER_EXTENSION interactivegeometryviewer interactivesliceviewer
DESCRIPTION "An extension to demonstrate a dual viewer (only for ImageComponent and MixedComponent)"
INSTALL_ALL_HEADERS
)
Markdown is supported
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