Commit 5a99e620 authored by Emmanuel Promayon's avatar Emmanuel Promayon

FIXED Bitmap viewer not depends on axial viewer

parent 82008d2c
......@@ -159,5 +159,10 @@ void SingleImageComponent::translate(double x, double y, double z) {
// Do nothing, my parent (the ImageComponent) should do that globally
}
// -------------------- getSliceOrientation --------------------
Slice::SliceOrientation SingleImageComponent::getSliceOrientation() {
return sliceOrientation;
}
}
......@@ -102,6 +102,9 @@ public:
virtual void setTransformRotationVTK(double, double, double) override;
/// @}
/// get the slice orientation
Slice::SliceOrientation getSliceOrientation();
protected:
/** The concrete building of the Service (Slice in this case, for a 2D representation). */
void initRepresentation() override;
......
......@@ -27,6 +27,7 @@
#include <Application.h>
#include <MainWindow.h>
#include <SingleImageComponent.h>
#include <Log.h>
#include <QToolBar>
......@@ -97,12 +98,13 @@ QToolBar* BitmapViewer::getToolBar() {
// -------------------- updateVisibility --------------------
void BitmapViewer::updateVisibility() {
// as the default component does not know anything about my2DBitmapViewer,
// tell all the components that are already visible in the axial slices to be also
// visible in my2DBitmapViewer
// As the default component does not know anything about BitmapViewer
// tell all the SingleImageComponent components of axial orientation to be
// visible in this viewer
for (Component* comp : Application::getAllComponents()) {
if (comp->getVisibility(Application::getViewer("axialViewer"))) {
comp->setVisibility(this, true);
SingleImageComponent* singleImageComp = dynamic_cast<SingleImageComponent*>(comp);
if (singleImageComp != nullptr && singleImageComp->getSliceOrientation()==Slice::AXIAL) {
singleImageComp->setVisibility(this, true);
}
}
}
......
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