SwitchViewDirection will remove volume measure.
This commit is contained in:
@@ -329,12 +329,12 @@ void VolumeInteractorStyle::MeasurePlace() {
|
||||
}
|
||||
|
||||
void VolumeInteractorStyle::ClearMeasure() {
|
||||
|
||||
ActiveMeasure(nullptr);
|
||||
EndMeasure();
|
||||
std::for_each(measureStore.begin(), measureStore.end(),[=](Measure* m){
|
||||
picker->DeletePickList(m->GetProp());
|
||||
m->ForceDelete();
|
||||
});
|
||||
|
||||
measureStore.clear();
|
||||
}
|
||||
|
||||
|
||||
@@ -300,7 +300,7 @@ void VolumeRenderingViewer::Render() {
|
||||
firstRender = false;
|
||||
RenderWindow->SetDesiredUpdateRate(Interactor->GetDesiredUpdateRate());
|
||||
Interactor->InvokeEvent(vtkCommand::StartInteractionEvent, nullptr);
|
||||
SetViewDirection(0);
|
||||
SwitchViewDirection(0);
|
||||
this->OrientationMarker->RemoveAllObservers();
|
||||
this->OrientationMarker->SetInteractor(this->Interactor);
|
||||
this->OrientationMarker->EnabledOn();
|
||||
@@ -483,7 +483,7 @@ void VolumeRenderingViewer::SetCoordsTransformMatrix(ExtendMedicalImagePropertie
|
||||
OrientationMatrix->Invert();
|
||||
}
|
||||
|
||||
void VolumeRenderingViewer::SetViewDirection(int direction) {
|
||||
void VolumeRenderingViewer::SwitchViewDirection(int direction) {
|
||||
double position[4] = {.0, .0, .0, 1.};
|
||||
double ViewUp[4] = {.0, .0, .0, 1.};
|
||||
switch (direction){
|
||||
@@ -525,6 +525,10 @@ void VolumeRenderingViewer::SetViewDirection(int direction) {
|
||||
camera->SetPosition(position);
|
||||
camera->SetViewUp(ViewUp);
|
||||
Renderer->ResetCamera();
|
||||
auto style = VolumeInteractorStyle::SafeDownCast(InteractorStyle);
|
||||
if (style){
|
||||
style->ClearMeasure();
|
||||
}
|
||||
}
|
||||
|
||||
void VolumeRenderingViewer::ResetZoomFitWindow() {
|
||||
@@ -572,7 +576,10 @@ void VolumeRenderingViewer::ResetZoomFitWindow() {
|
||||
//use 0.99 to avoid border out of screen
|
||||
camera->Dolly(0.99/halfDisY);
|
||||
}
|
||||
|
||||
auto style = VolumeInteractorStyle::SafeDownCast(InteractorStyle);
|
||||
if (style){
|
||||
style->ClearMeasure();
|
||||
}
|
||||
Renderer->ResetCameraClippingRange();
|
||||
}
|
||||
|
||||
@@ -601,7 +608,7 @@ void VolumeRenderingViewer::pressedOrientationMarker(vtkObject* sender, unsigned
|
||||
auto cube = vtkAnnotatedCubeActor::SafeDownCast(OrientationMarker->GetOrientationMarker());
|
||||
if (cube){
|
||||
int v = GetViewDirection(cube,var->ToInt());
|
||||
SetViewDirection(v);
|
||||
SwitchViewDirection(v);
|
||||
Render();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,10 +78,10 @@ public:
|
||||
|
||||
void SetInteractorStyleMode(int mode);
|
||||
|
||||
void SetViewDirection(int direction);
|
||||
void SwitchViewDirection(int direction);
|
||||
|
||||
void ResetViewDirection(){
|
||||
SetViewDirection(0);
|
||||
SwitchViewDirection(0);
|
||||
}
|
||||
|
||||
void ResetView(){
|
||||
|
||||
@@ -54,7 +54,7 @@ VolumeRenderingWindow::VolumeRenderingWindow(QWidget *parent , Qt::WindowFlags f
|
||||
});
|
||||
|
||||
connect(toolBar, &VolumeRenderingToolBar::viewDirectionChanged, [=](int direction){
|
||||
mViewer->SetViewDirection(direction);
|
||||
mViewer->SwitchViewDirection(direction);
|
||||
mViewer->Render();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user