From: tbaudier Date: Thu, 7 Mar 2019 15:48:24 +0000 (+0100) Subject: Changment of cursor color value to keep the same color than before VTK8 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=7d4e77191e55f668f316ba3ddf0fddb63e59bd25;p=clitk.git Changment of cursor color value to keep the same color than before VTK8 With VTK update, the color of the cursor was white I found that, passing value from int (base 256) to double (base 1.0) change the behavior So I adapted the color to keep the red for the activated image, the green, unactivated slice and light blue for unactivated linked image --- diff --git a/vv/vvSlicer.cxx b/vv/vvSlicer.cxx index 550e8a0..4a4a515 100644 --- a/vv/vvSlicer.cxx +++ b/vv/vvSlicer.cxx @@ -135,7 +135,7 @@ vvSlicer::vvSlicer() pdmA = vtkSmartPointer::New(); pdmA->SetMapper(pdm); - pdmA->GetProperty()->SetColor(255,10,212); + pdmA->GetProperty()->SetColor(1,0,0); pdmA->SetVisibility(0); pdmA->SetPickable(0); @@ -269,7 +269,7 @@ void vvSlicer::ToggleContourSuperposition() //------------------------------------------------------------------------------ -void vvSlicer::SetCursorColor(int r,int g, int b) +void vvSlicer::SetCursorColor(double r, double g, double b) { pdmA->GetProperty()->SetColor(r,g,b); } diff --git a/vv/vvSlicer.h b/vv/vvSlicer.h index 3beab6e..6af3773 100644 --- a/vv/vvSlicer.h +++ b/vv/vvSlicer.h @@ -164,7 +164,7 @@ public: void SetCursorVisibility(bool s); bool GetCursorVisibility(); - void SetCursorColor(int r,int g, int b); + void SetCursorColor(double r,double g, double b); void SetCornerAnnotationVisibility(bool s); bool GetCornerAnnotationVisibility(); diff --git a/vv/vvSlicerManager.cxx b/vv/vvSlicerManager.cxx index 9548dfd..fab1e8d 100644 --- a/vv/vvSlicerManager.cxx +++ b/vv/vvSlicerManager.cxx @@ -719,7 +719,7 @@ mSlicers[slicer]->GetRegisterExtent(extentImageReslice); #endif { mSlicers[slicer]->UpdateCursorPosition(); - mSlicers[slicer]->SetCursorColor(10,212,255); + mSlicers[slicer]->SetCursorColor(1,0,0); mSelectedSlicer = slicer; switch (mSlicers[slicer]->GetSliceOrientation()) { @@ -750,9 +750,9 @@ mSlicers[slicer]->GetRegisterExtent(extentImageReslice); if (current) { //do not display corner annotation if image is the one picked mSlicers[i]->SetCurrentPosition(-VTK_DOUBLE_MAX,-VTK_DOUBLE_MAX, -VTK_DOUBLE_MAX, mSlicers[slicer]->GetMaxCurrentTSlice()); - mSlicers[i]->SetCursorColor(255,10,212); + mSlicers[i]->SetCursorColor(0,0.96,0.17); } else { - mSlicers[i]->SetCursorColor(150,10,282); + mSlicers[i]->SetCursorColor(0.41,0.96,1); } switch (mSlicers[i]->GetSliceOrientation()) { case vtkImageViewer2::SLICE_ORIENTATION_XY: