Fix slice sync slice number corner text bug.

This commit is contained in:
Krad
2022-07-27 15:00:51 +08:00
parent fbb6b957ca
commit 75160118cc
2 changed files with 5 additions and 5 deletions

View File

@@ -257,8 +257,6 @@ void infinitiViewer::InstallPipeline() {
&infinitiViewer::ChangeSlice); &infinitiViewer::ChangeSlice);
this->InteractorStyle->AddObserver(ActorDraggableInteractorStyle::DraggableStyleEvents::SlicedEvent, this, this->InteractorStyle->AddObserver(ActorDraggableInteractorStyle::DraggableStyleEvents::SlicedEvent, this,
&infinitiViewer::LoadMeasures); &infinitiViewer::LoadMeasures);
InteractorStyle->AddObserver(ActorDraggableInteractorStyle::SlicedEvent, this,
&infinitiViewer::UpdateTopLeftCornerInfo);
//for convert vtkEvent to Qt signal //for convert vtkEvent to Qt signal
this->InteractorStyle->AddObserver(ActorDraggableInteractorStyle::DraggableStyleEvents::SlicedEvent, this, this->InteractorStyle->AddObserver(ActorDraggableInteractorStyle::DraggableStyleEvents::SlicedEvent, this,
@@ -461,8 +459,8 @@ void infinitiViewer::SetSlice(int slice) {
if (Fusion && FusionMapper) { if (Fusion && FusionMapper) {
FusionMapper->SetClippingPlanes(ImageMapper->GetClippingPlanes()); FusionMapper->SetClippingPlanes(ImageMapper->GetClippingPlanes());
} }
this->Render(); this->Render();
UpdateTopLeftCornerInfo();
if (InteractorStyle){ if (InteractorStyle){
double direction = (double)(slice - lastSliceNumber); double direction = (double)(slice - lastSliceNumber);
double focusPoint[5] = {.0, .0, .0 }; double focusPoint[5] = {.0, .0, .0 };
@@ -503,6 +501,8 @@ void infinitiViewer::applySliceOffset(double offset, double direction){
// 假设原数据为slice--则需要唯一 // 假设原数据为slice--则需要唯一
if (direction < 0) offset = offset * -1.0; if (direction < 0) offset = offset * -1.0;
Renderer->GetActiveCamera()->SetDistance(Renderer->GetActiveCamera()->GetDistance() + offset); Renderer->GetActiveCamera()->SetDistance(Renderer->GetActiveCamera()->GetDistance() + offset);
this->Render();
UpdateTopLeftCornerInfo();
} }
vtkSmartPointer<vtkPoints> infinitiViewer::GetSliceBoundPoints() { vtkSmartPointer<vtkPoints> infinitiViewer::GetSliceBoundPoints() {
@@ -549,6 +549,8 @@ void infinitiViewer::SyncSlicePoint(double *point) {
ImageMapper->GetBounds(bounds); ImageMapper->GetBounds(bounds);
f[SliceOrientation] = focusPoint[SliceOrientation]; f[SliceOrientation] = focusPoint[SliceOrientation];
Renderer->GetActiveCamera()->SetFocalPoint(f); Renderer->GetActiveCamera()->SetFocalPoint(f);
this->Render();
UpdateTopLeftCornerInfo();
} }
// zoom------------------------------------------------------------------------ // zoom------------------------------------------------------------------------

View File

@@ -162,12 +162,10 @@ public:
void syncSlicePoint(double *point) { void syncSlicePoint(double *point) {
mImageViewer->SyncSlicePoint(point); mImageViewer->SyncSlicePoint(point);
mImageViewer->Render();
} }
void applySliceOffset(double offset, double direction){ void applySliceOffset(double offset, double direction){
mImageViewer->applySliceOffset(offset, direction); mImageViewer->applySliceOffset(offset, direction);
mImageViewer->Render();
} }
void loadSeries(SeriesImageSet *series); void loadSeries(SeriesImageSet *series);