[vtkusers] Error with visibility vtkResliceCursorActor

Jose Barreto jose.de.paula at live.com
Sat Mar 5 12:20:52 EST 2016


Hello, 
I am using vtkResliceImageViewer with vtkResliceCursor Line Representation. 
At one point I had to turn off the visibility of the lines representing the
views Sagittal, Coronal and Axial. 
I used the following code. 

for (int i = 0; i < 3; ++i) 
        { 
                vtkSmartPointer<vtkResliceCursorLineRepresentation> rep =
vtkResliceCursorLineRepresentation::SafeDownCast(obj_VTKCriarPanoramica->GetReslicerImageViewer(i)->GetResliceCursorWidget()->GetRepresentation()); 
               
rep->GetResliceCursorActor()->GetCenterlineProperty(0)->SetEdgeVisibility(0); 
               
rep->GetResliceCursorActor()->GetCenterlineProperty(1)->SetEdgeVisibility(0); 
               
rep->GetResliceCursorActor()->GetCenterlineProperty(2)->SetEdgeVisibility(0); 
        } 

I did not succeed, the lines did not accept SetEdgeVisibility. 
I looked at vtkResliceCursorActor of code and saw that the 
void vtkResliceCursorActor :: UpdateViewProps (vtkViewport * v) 
It was ignored property visibildiade. 
The code always passes visibility to true. 

void vtkResliceCursorActor::UpdateViewProps(vtkViewport *v) 
{ 
... 
 
this->CursorThickSlabActor[axis1]->GetProperty()->SetEdgeVisibility(thickMode); 
 
this->CursorThickSlabActor[axis2]->GetProperty()->SetEdgeVisibility(thickMode); 
 
this->CursorThickSlabActor[axisNormal]->GetProperty()->SetEdgeVisibility(0); 
  this->CursorCenterlineActor[axis1]->GetProperty()->SetEdgeVisibility(1); 
  this->CursorCenterlineActor[axis2]->GetProperty()->SetEdgeVisibility(1); 
 
this->CursorCenterlineActor[axisNormal]->GetProperty()->SetEdgeVisibility(0); 
} 



*Is there any reason for this?*

I changed the code to use the active exposure for the User. 

void vtkResliceCursorActor::UpdateViewProps(vtkViewport *v) 
{ 
... 
  const bool visibleAxis1 =
this->CursorCenterlineActor[axis1]->GetProperty()->GetEdgeVisibility() ?
true : false; 
  const bool visibleAxis2 =
this->CursorCenterlineActor[axis2]->GetProperty()->GetEdgeVisibility() ?
true : false; 
  const bool visibleAxisNormal =
this->CursorCenterlineActor[axisNormal]->GetProperty()->GetEdgeVisibility()
? true : false; 

 
this->CursorThickSlabActor[axis1]->GetProperty()->SetEdgeVisibility(thickMode); 
 
this->CursorThickSlabActor[axis2]->GetProperty()->SetEdgeVisibility(thickMode); 
 
this->CursorThickSlabActor[axisNormal]->GetProperty()->SetEdgeVisibility(thickMode); 

 
this->CursorCenterlineActor[axis1]->GetProperty()->SetEdgeVisibility(visibleAxis1); 
 
this->CursorCenterlineActor[axis2]->GetProperty()->SetEdgeVisibility(visibleAxis2); 
 
this->CursorCenterlineActor[axisNormal]->GetProperty()->SetEdgeVisibility(visibleAxisNormal); 
}



--
View this message in context: http://vtk.1045678.n5.nabble.com/Error-with-visibility-vtkResliceCursorActor-tp5737044.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list