vtkPointData *myOutputPointData;
TPointsDataArray *myInputPointsArray;
TPointsDataArray *myOutputPointsArray;
- TElnoDataArray* myElnoPointDataArray;
- TElnoDataArray* myElnoPointVectors;
+ TElnoDataArray* myElnoFullDataArray;
+ TElnoDataArray* myElnoPartialDataArray;
TPointsDataArray *myElnoPointCoords;
vtkIntArray* myInputPointsMapper;
vtkIntArray* myOutputPointsMapper;
myOutputPointData->Allocate( aNbPoints );
vtkCellData *anInputCellData = theInput->GetCellData();
- vtkDataArray* aVectors = anInputCellData->GetVectors();
- myElnoPointDataArray = TElnoDataArray::New();
- myElnoPointDataArray->SetName( "VISU_FIELD" );
- myElnoPointDataArray->SetNumberOfComponents( myGetElnoNodeData.getNbComp() );
- myElnoPointDataArray->SetNumberOfTuples( aNbPoints );
-
- myElnoPointVectors = TElnoDataArray::New();
- myElnoPointVectors->SetName( aVectors->GetName() );
- myElnoPointVectors->SetNumberOfComponents( 3 );
- myElnoPointVectors->SetNumberOfTuples( aNbPoints );
+ // To create a new copy of initial data for output
+ myElnoFullDataArray = TElnoDataArray::New();
+ myElnoFullDataArray->SetName( "VISU_FIELD" );
+ myElnoFullDataArray->SetNumberOfComponents( myGetElnoNodeData.getNbComp() );
+ myElnoFullDataArray->SetNumberOfTuples( aNbPoints );
+
+ // To create a new copy of partial initial data for output
+ myElnoPartialDataArray = TElnoDataArray::New();
+ // This partial data can be represented as in terms of vectors as scalars
+ if ( anInputCellData->GetVectors() != NULL )
+ myElnoPartialDataArray->SetNumberOfComponents( 3 );
+ else
+ myElnoPartialDataArray->SetNumberOfComponents( 1 );
+ myElnoPartialDataArray->SetNumberOfTuples( aNbPoints );
myElnoPointCoords = TPointsDataArray::New();
myElnoPointCoords->SetName( "ELNO_POINT_COORDS" );
//anOutputPointData->PassData( anInputPointData );
- myOutputPointData->AddArray( myElnoPointDataArray );
- myElnoPointDataArray->Delete();
+ myOutputPointData->AddArray( myElnoFullDataArray );
+ myElnoFullDataArray->Delete();
- myOutputPointData->SetVectors( myElnoPointVectors );
- myElnoPointVectors->Delete();
+ if ( anInputCellData->GetVectors() != NULL )
+ myOutputPointData->SetVectors( myElnoPartialDataArray );
+ else
+ myOutputPointData->SetScalars( myElnoPartialDataArray );
+ myElnoPartialDataArray->Delete();
myOutputPointData->AddArray( myElnoPointCoords );
myElnoPointCoords->Delete();
myOutputPointData->CopyData( myInputPointData, aCurrentPntId, aNewPntId );
TElnoDataType* anElnoData = myGetElnoNodeData( aCellId, aPntId );
- myElnoPointDataArray->SetTupleValue( aNewPntId, anElnoData );
+ myElnoFullDataArray->SetTupleValue( aNewPntId, anElnoData );
- myElnoPointDataArray->GetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
- myElnoPointVectors->SetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
+ myElnoFullDataArray->GetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
+ myElnoPartialDataArray->SetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
myInputPointsMapper->GetTupleValue( aCurrentPntId, &anPointsMapperValues[ 0 ] );
myOutputPointsMapper->SetTupleValue( aNewPntId, &anPointsMapperValues[ 0 ] );
myOutputPointData->CopyData( myInputPointData, aCurrentPntId, aNewPntId );
TElnoDataType* anElnoData = myGetElnoNodeData( aCellId, aPntId );
- myElnoPointDataArray->SetTupleValue( aNewPntId, anElnoData );
+ myElnoFullDataArray->SetTupleValue( aNewPntId, anElnoData );
- myElnoPointDataArray->GetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
- myElnoPointVectors->SetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
+ myElnoFullDataArray->GetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
+ myElnoPartialDataArray->SetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
myInputPointsMapper->GetTupleValue( aCurrentPntId, &anPointsMapperValues[ 0 ] );
myOutputPointsMapper->SetTupleValue( aNewPntId, &anPointsMapperValues[ 0 ] );