IPAL22870: Incorrect numbering of volume elements

This commit is contained in:
ouv 2012-03-14 08:59:47 +00:00
parent b4fbb4655f
commit 3f1a249dc8
5 changed files with 18 additions and 18 deletions

View File

@ -38,7 +38,7 @@
#include <vtkPointData.h>
#include <vtkProperty2D.h>
#include <vtkRenderer.h>
#include <vtkPolyData.h>
#include <vtkUnstructuredGrid.h>
#include <vtkCellData.h>
vtkStandardNewMacro(SMESH_CellLabelActor);
@ -49,7 +49,7 @@ vtkStandardNewMacro(SMESH_CellLabelActor);
SMESH_CellLabelActor::SMESH_CellLabelActor() {
//Definition of cells numbering pipeline
//---------------------------------------
myCellsNumDataSet = vtkPolyData::New();
myCellsNumDataSet = vtkUnstructuredGrid::New();
myCellCenters = VTKViewer_CellCenters::New();
myCellCenters->SetInput(myCellsNumDataSet);
@ -125,19 +125,19 @@ SMESH_CellLabelActor::~SMESH_CellLabelActor() {
void SMESH_CellLabelActor::SetCellsLabeled(bool theIsCellsLabeled) {
myTransformFilter->Update();
vtkPolyData* aGrid = vtkPolyData::SafeDownCast(myTransformFilter->GetOutput());
vtkUnstructuredGrid* aGrid = vtkUnstructuredGrid::SafeDownCast(myTransformFilter->GetOutput());
if(!aGrid)
return;
myIsCellsLabeled = theIsCellsLabeled && aGrid->GetNumberOfPoints();
if(myIsCellsLabeled){
myCellsNumDataSet->ShallowCopy(aGrid);
vtkDataSet *aDataSet = myCellsNumDataSet;
vtkUnstructuredGrid *aDataSet = myCellsNumDataSet;
int aNbElem = aDataSet->GetNumberOfCells();
vtkIntArray *anArray = vtkIntArray::New();
anArray->SetNumberOfValues(aNbElem);
for(int anId = 0; anId < aNbElem; anId++){
int aSMDSId = GetElemObjId(anId);
int aSMDSId = myVisualObj->GetElemObjId(anId);
anArray->SetValue(anId,aSMDSId);
}
aDataSet->GetCellData()->SetScalars(anArray);

View File

@ -32,7 +32,7 @@ class vtkSelectVisiblePoints;
class vtkLabeledDataMapper;
class vtkActor2D;
class vtkMaskPoints;
class vtkPolyData;
class vtkUnstructuredGrid;
class VTKViewer_CellCenters;
@ -65,7 +65,7 @@ protected:
~SMESH_CellLabelActor();
bool myIsCellsLabeled;
vtkPolyData* myCellsNumDataSet;
vtkUnstructuredGrid* myCellsNumDataSet;
vtkActor2D *myCellsLabels;
vtkMaskPoints* myClsMaskPoints;
VTKViewer_CellCenters* myCellCenters;

View File

@ -240,17 +240,17 @@ SMESH_DeviceActor
myPassFilter[ anId + 1]->SetInput( myPassFilter[ anId ]->GetOutput() );
anId++; // 1
myGeomFilter->SetInput( myPassFilter[ anId ]->GetOutput() );
myTransformFilter->SetInput( myPassFilter[ anId ]->GetOutput() );
anId++; // 2
myPassFilter[ anId ]->SetInput( myGeomFilter->GetOutput() );
myPassFilter[ anId ]->SetInput( myTransformFilter->GetOutput() );
myPassFilter[ anId + 1 ]->SetInput( myPassFilter[ anId ]->GetOutput() );
anId++; // 3
myTransformFilter->SetInput( myPassFilter[ anId ]->GetPolyDataOutput() );
myGeomFilter->SetInput( myPassFilter[ anId ]->GetOutput() );
anId++; // 4
myPassFilter[ anId ]->SetInput( myTransformFilter->GetOutput() );
myPassFilter[ anId ]->SetInput( myGeomFilter->GetOutput() );
myPassFilter[ anId + 1 ]->SetInput( myPassFilter[ anId ]->GetOutput() );
anId++; // 5

View File

@ -37,7 +37,7 @@
#include <vtkPointData.h>
#include <vtkProperty2D.h>
#include <vtkRenderer.h>
#include <vtkPolyData.h>
#include <vtkUnstructuredGrid.h>
vtkStandardNewMacro(SMESH_NodeLabelActor);
@ -47,7 +47,7 @@ vtkStandardNewMacro(SMESH_NodeLabelActor);
SMESH_NodeLabelActor::SMESH_NodeLabelActor() {
//Definition of points numbering pipeline
//---------------------------------------
myPointsNumDataSet = vtkPolyData::New();
myPointsNumDataSet = vtkUnstructuredGrid::New();
myPtsMaskPoints = vtkMaskPoints::New();
myPtsMaskPoints->SetInput(myPointsNumDataSet);
@ -114,7 +114,7 @@ SMESH_NodeLabelActor::~SMESH_NodeLabelActor() {
void SMESH_NodeLabelActor::SetPointsLabeled(bool theIsPointsLabeled) {
myTransformFilter->Update();
vtkDataSet* aGrid = vtkPolyData::SafeDownCast(myTransformFilter->GetOutput());
vtkDataSet* aGrid = vtkUnstructuredGrid::SafeDownCast(myTransformFilter->GetOutput());
if(!aGrid)
return;
@ -124,7 +124,7 @@ void SMESH_NodeLabelActor::SetPointsLabeled(bool theIsPointsLabeled) {
if ( myIsPointsLabeled )
{
myPointsNumDataSet->ShallowCopy(aGrid);
vtkDataSet *aDataSet = myPointsNumDataSet;
vtkUnstructuredGrid *aDataSet = myPointsNumDataSet;
int aNbElem = aDataSet->GetNumberOfPoints();
@ -133,7 +133,7 @@ void SMESH_NodeLabelActor::SetPointsLabeled(bool theIsPointsLabeled) {
for ( vtkIdType anId = 0; anId < aNbElem; anId++ )
{
int aSMDSId = GetNodeObjId( anId );
int aSMDSId = myVisualObj->GetNodeObjId( anId );
anArray->SetValue( anId, aSMDSId );
}

View File

@ -32,7 +32,7 @@ class vtkSelectVisiblePoints;
class vtkLabeledDataMapper;
class vtkActor2D;
class vtkMaskPoints;
class vtkPolyData;
class vtkUnstructuredGrid;
class SMESHOBJECT_EXPORT SMESH_NodeLabelActor : public SMESH_DeviceActor {
@ -63,7 +63,7 @@ protected:
~SMESH_NodeLabelActor();
bool myIsPointsLabeled;
vtkPolyData* myPointsNumDataSet;
vtkUnstructuredGrid* myPointsNumDataSet;
vtkActor2D *myPointLabels;
vtkMaskPoints* myPtsMaskPoints;
vtkLabeledDataMapper* myPtsLabeledDataMapper;