Salome HOME
projects
/
modules
/
smesh.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'V8_2_BR' into pre/V8_2_BR
[modules/smesh.git]
/
src
/
OBJECT
/
SMESH_NodeLabelActor.cxx
diff --git
a/src/OBJECT/SMESH_NodeLabelActor.cxx
b/src/OBJECT/SMESH_NodeLabelActor.cxx
index b3a8d3d0f8d4a72012ae854136a5b3d260b3d45a..a1ed15ad7db9e5388c1111ae2486bd0838710bde 100644
(file)
--- a/
src/OBJECT/SMESH_NodeLabelActor.cxx
+++ b/
src/OBJECT/SMESH_NodeLabelActor.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-201
2
CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-201
6
CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@
-6,7
+6,7
@@
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License
, or (at your option) any later version
.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-44,25
+44,26
@@
vtkStandardNewMacro(SMESH_NodeLabelActor);
/*!
Constructor.
*/
/*!
Constructor.
*/
-SMESH_NodeLabelActor::SMESH_NodeLabelActor() {
+SMESH_NodeLabelActor::SMESH_NodeLabelActor()
+{
//Definition of points numbering pipeline
//---------------------------------------
myPointsNumDataSet = vtkUnstructuredGrid::New();
myPtsMaskPoints = vtkMaskPoints::New();
//Definition of points numbering pipeline
//---------------------------------------
myPointsNumDataSet = vtkUnstructuredGrid::New();
myPtsMaskPoints = vtkMaskPoints::New();
- myPtsMaskPoints->SetInput(myPointsNumDataSet);
+ myPtsMaskPoints->SetInput
Data
(myPointsNumDataSet);
myPtsMaskPoints->SetOnRatio(1);
myPtsSelectVisiblePoints = vtkSelectVisiblePoints::New();
myPtsMaskPoints->SetOnRatio(1);
myPtsSelectVisiblePoints = vtkSelectVisiblePoints::New();
- myPtsSelectVisiblePoints->SetInput
(myPtsMaskPoints->GetOutpu
t());
+ myPtsSelectVisiblePoints->SetInput
Connection(myPtsMaskPoints->GetOutputPor
t());
myPtsSelectVisiblePoints->SelectInvisibleOff();
myPtsSelectVisiblePoints->SetTolerance(0.1);
myPtsSelectVisiblePoints->SelectInvisibleOff();
myPtsSelectVisiblePoints->SetTolerance(0.1);
-
+
myPtsLabeledDataMapper = vtkLabeledDataMapper::New();
myPtsLabeledDataMapper = vtkLabeledDataMapper::New();
- myPtsLabeledDataMapper->SetInput
(myPtsSelectVisiblePoints->GetOutpu
t());
+ myPtsLabeledDataMapper->SetInput
Connection(myPtsSelectVisiblePoints->GetOutputPor
t());
myPtsLabeledDataMapper->SetLabelFormat("%d");
myPtsLabeledDataMapper->SetLabelModeToLabelScalars();
myPtsLabeledDataMapper->SetLabelFormat("%d");
myPtsLabeledDataMapper->SetLabelModeToLabelScalars();
-
+
myPtsTextProp = vtkTextProperty::New();
myPtsTextProp->SetFontFamilyToTimes();
myPtsTextProp->SetFontSize(10);
myPtsTextProp = vtkTextProperty::New();
myPtsTextProp->SetFontFamilyToTimes();
myPtsTextProp->SetFontSize(10);
@@
-90,19
+91,20
@@
SMESH_NodeLabelActor::SMESH_NodeLabelActor() {
/*!
Destructor
*/
/*!
Destructor
*/
-SMESH_NodeLabelActor::~SMESH_NodeLabelActor() {
+SMESH_NodeLabelActor::~SMESH_NodeLabelActor()
+{
//Deleting of points numbering pipeline
//---------------------------------------
myPointsNumDataSet->Delete();
//Deleting of points numbering pipeline
//---------------------------------------
myPointsNumDataSet->Delete();
-
+
// commented: porting to vtk 5.0
// myPtsLabeledDataMapper->RemoveAllInputs();
myPtsLabeledDataMapper->Delete();
// commented: porting to vtk 5.0
// myPtsLabeledDataMapper->RemoveAllInputs();
myPtsLabeledDataMapper->Delete();
-
+
// commented: porting to vtk 5.0
// myPtsSelectVisiblePoints->UnRegisterAllOutputs();
myPtsSelectVisiblePoints->Delete();
// commented: porting to vtk 5.0
// myPtsSelectVisiblePoints->UnRegisterAllOutputs();
myPtsSelectVisiblePoints->Delete();
-
+
// commented: porting to vtk 5.0
// myPtsMaskPoints->UnRegisterAllOutputs();
myPtsMaskPoints->Delete();
// commented: porting to vtk 5.0
// myPtsMaskPoints->UnRegisterAllOutputs();
myPtsMaskPoints->Delete();
@@
-112,7
+114,7
@@
SMESH_NodeLabelActor::~SMESH_NodeLabelActor() {
void SMESH_NodeLabelActor::SetFontProperties( SMESH::LabelFont family, int size,
bool bold, bool italic, bool shadow,
void SMESH_NodeLabelActor::SetFontProperties( SMESH::LabelFont family, int size,
bool bold, bool italic, bool shadow,
-
vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointTyp
e b )
+
double r, double g, doubl
e b )
{
switch ( family ) {
case SMESH::FntArial:
{
switch ( family ) {
case SMESH::FntArial:
@@
-130,16
+132,16
@@
void SMESH_NodeLabelActor::SetFontProperties( SMESH::LabelFont family, int size,
myPtsTextProp->SetColor( r, g, b );
}
myPtsTextProp->SetColor( r, g, b );
}
-void SMESH_NodeLabelActor::SetPointsLabeled(bool theIsPointsLabeled) {
+void SMESH_NodeLabelActor::SetPointsLabeled(bool theIsPointsLabeled)
+{
+ myIsPointsLabeled = theIsPointsLabeled;
+
+ myPointLabels->SetVisibility( false );
+
myTransformFilter->Update();
vtkDataSet* aGrid = vtkUnstructuredGrid::SafeDownCast(myTransformFilter->GetOutput());
myTransformFilter->Update();
vtkDataSet* aGrid = vtkUnstructuredGrid::SafeDownCast(myTransformFilter->GetOutput());
- if(!aGrid)
- return;
-
- myIsPointsLabeled = theIsPointsLabeled && aGrid->GetNumberOfPoints();
-
- if ( myIsPointsLabeled )
+ if ( myIsPointsLabeled && aGrid )
{
myPointsNumDataSet->ShallowCopy(aGrid);
vtkUnstructuredGrid *aDataSet = myPointsNumDataSet;
{
myPointsNumDataSet->ShallowCopy(aGrid);
vtkUnstructuredGrid *aDataSet = myPointsNumDataSet;
@@
-156,14
+158,10
@@
void SMESH_NodeLabelActor::SetPointsLabeled(bool theIsPointsLabeled) {
}
aDataSet->GetPointData()->SetScalars( anArray );
}
aDataSet->GetPointData()->SetScalars( anArray );
- myPtsMaskPoints->SetInput( aDataSet );
+ myPtsMaskPoints->SetInput
Data
( aDataSet );
myPointLabels->SetVisibility( GetVisibility() );
anArray->Delete();
}
myPointLabels->SetVisibility( GetVisibility() );
anArray->Delete();
}
- else
- {
- myPointLabels->SetVisibility( false );
- }
}
}
@@
-189,7
+187,8
@@
void SMESH_NodeLabelActor::RemoveFromRender(vtkRenderer* theRenderer)
SMESH_DeviceActor::RemoveFromRender(theRenderer);
}
SMESH_DeviceActor::RemoveFromRender(theRenderer);
}
-void SMESH_NodeLabelActor::UpdateLabels() {
+void SMESH_NodeLabelActor::UpdateLabels()
+{
if(myIsPointsLabeled)
SetPointsLabeled(myIsPointsLabeled);
}
if(myIsPointsLabeled)
SetPointsLabeled(myIsPointsLabeled);
}
@@
-198,8
+197,9
@@
void SMESH_NodeLabelActor::UpdateLabels() {
void SMESH_NodeLabelActor::ProcessEvents(vtkObject* vtkNotUsed(theObject),
unsigned long theEvent,
void* theClientData,
void SMESH_NodeLabelActor::ProcessEvents(vtkObject* vtkNotUsed(theObject),
unsigned long theEvent,
void* theClientData,
- void* vtkNotUsed(theCallData)) {
- SMESH_NodeLabelActor* self = reinterpret_cast<SMESH_NodeLabelActor*>(theClientData);
+ void* vtkNotUsed(theCallData))
+{
+ SMESH_NodeLabelActor* self = reinterpret_cast<SMESH_NodeLabelActor*>(theClientData);
if(self)
self->UpdateLabels();
}
if(self)
self->UpdateLabels();
}