X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FOBJECT%2FSMESH_CellLabelActor.cxx;h=7b5e7aec6d6f37a866cf54ef7c93e4d1714530b7;hb=30ce546b0c5099ad1112929e2db94810e683e54b;hp=afd31449ec82617b6ba99c647c4033c9e3aa0fc8;hpb=1c1bbf6798782cb24bcab45d519817cff125ae5c;p=modules%2Fsmesh.git diff --git a/src/OBJECT/SMESH_CellLabelActor.cxx b/src/OBJECT/SMESH_CellLabelActor.cxx index afd31449e..7b5e7aec6 100644 --- a/src/OBJECT/SMESH_CellLabelActor.cxx +++ b/src/OBJECT/SMESH_CellLabelActor.cxx @@ -140,18 +140,19 @@ void SMESH_CellLabelActor::SetFontProperties( SMESH::LabelFont family, int size, myClsTextProp->SetBold( bold ); myClsTextProp->SetItalic( italic ); myClsTextProp->SetShadow( shadow ); - myClsTextProp->SetColor( r, g, b ); + myClsTextProp->SetColor( r, g, b ); } void SMESH_CellLabelActor::SetCellsLabeled(bool theIsCellsLabeled) { + myIsCellsLabeled = theIsCellsLabeled; + + myCellsLabels->SetVisibility(false); + myTransformFilter->Update(); vtkUnstructuredGrid* aGrid = vtkUnstructuredGrid::SafeDownCast(myTransformFilter->GetOutput()); - if ( !aGrid ) - return; - myIsCellsLabeled = theIsCellsLabeled && aGrid->GetNumberOfPoints(); - if ( myIsCellsLabeled ) + if ( myIsCellsLabeled && aGrid ) { myCellsNumDataSet->ShallowCopy(aGrid); vtkUnstructuredGrid *aDataSet = myCellsNumDataSet; @@ -172,8 +173,6 @@ void SMESH_CellLabelActor::SetCellsLabeled(bool theIsCellsLabeled) aDataSet->GetCellData()->SetScalars(anArray); myCellCenters->SetInputData(aDataSet); myCellsLabels->SetVisibility(GetVisibility()); - }else{ - myCellsLabels->SetVisibility(false); } } @@ -198,7 +197,8 @@ void SMESH_CellLabelActor::RemoveFromRender(vtkRenderer* theRenderer) SMESH_DeviceActor::RemoveFromRender(theRenderer); } -void SMESH_CellLabelActor::UpdateLabels() { +void SMESH_CellLabelActor::UpdateLabels() +{ if(myIsCellsLabeled) SetCellsLabeled(myIsCellsLabeled); } @@ -207,7 +207,8 @@ void SMESH_CellLabelActor::UpdateLabels() { void SMESH_CellLabelActor::ProcessEvents(vtkObject* vtkNotUsed(theObject), unsigned long theEvent, void* theClientData, - void* vtkNotUsed(theCallData)) { + void* vtkNotUsed(theCallData)) +{ SMESH_CellLabelActor* self = reinterpret_cast(theClientData); if(self) self->UpdateLabels();