VISU::WriteToFile( aCutter->GetOutput(), "/data/apo/elno_from_cutter.vtk" );
VISU_ElnoAssembleFilter* anAssembleFilter = VISU_ElnoAssembleFilter::New();
- anAssembleFilter->SetInput( aCutter->GetOutput() );
- VISU::WriteToFile( anAssembleFilter->GetPolyDataOutput(), "/data/apo/elno_from_assemble.vtk" );
+ //anAssembleFilter->SetInput( aCutter->GetOutput() );
+ //VISU::WriteToFile( anAssembleFilter->GetPolyDataOutput(), "/data/apo/elno_from_assemble.vtk" );
+ anAssembleFilter->SetInput( anExtractScalars->GetOutput() );
+ VISU::WriteToFile( anAssembleFilter->GetUnstructuredGridOutput(), "/data/apo/elno_from_assemble.vtk" );
//VISU_ElnoWarpVector* anElnoWarpVector = VISU_ElnoWarpVector::New();
//anElnoWarpVector->SetInput( anUnstructuredGridIDMapper->GetUnstructuredGridOutput() );
vtkFloatingPointType aScalarRange[ 2 ];
aGeometryFilter->GetRange( aScalarRange );
anExtractScalars->GetOutput()->GetScalarRange( aScalarRange );
- aCutter->GetOutput()->GetScalarRange( aScalarRange );
+ //aCutter->GetOutput()->GetScalarRange( aScalarRange );
// To calculate and apply default scale factor
//{
// vtkFloatingPointType aScale = VISU_DeformedShapePL::GetScaleFactor( anElnoWarpVector->GetOutput() );
TPointsDataArray *theOutputPointsArray,
VISU::TGetElnoNodeData< elno_type >& theGetElnoNodeData,
TElnoDataArray* theElnoPointDataArray,
+ TElnoDataArray* theElnoPointVectors,
TPointsDataArray *theElnoPointCoords )
{
typedef typename VISU::TL::TEnum2VTKBasicType< points_type >::TResult TPointsDataType;
typedef typename VISU::TL::TEnum2VTKBasicType< elno_type >::TResult TElnoDataType;
+ // To reserve a temproary value holder
+ vtkIdType aNbComp = std::max( 3, theGetElnoNodeData.getNbComp() );
+ std::vector< TElnoDataType > anElnoDataValues( aNbComp );
+
theConnectivity->InitTraversal();
vtkIdType aNbPts = 0, *aPts = 0;
for ( vtkIdType aCellId = 0; theConnectivity->GetNextCell( aNbPts, aPts ); aCellId++ ) {
TElnoDataType* anElnoData = theGetElnoNodeData( aCellId, aPntId );
theElnoPointDataArray->SetTupleValue( aNewPntId, anElnoData );
+
+ theElnoPointDataArray->GetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
+ theElnoPointVectors->SetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
}
}
}
TPointsDataArray *theOutputPointsArray,
VISU::TGetElnoNodeData< elno_type >& theGetElnoNodeData,
TElnoDataArray* theElnoPointDataArray,
+ TElnoDataArray* theElnoPointVectors,
TPointsDataArray *theElnoPointCoords,
vtkFloatingPointType theShrinkFactor )
{
typedef typename VISU::TL::TEnum2VTKBasicType< points_type >::TResult TPointsDataType;
typedef typename VISU::TL::TEnum2VTKBasicType< elno_type >::TResult TElnoDataType;
+ // To reserve a temproary value holder
+ vtkIdType aNbComp = std::max( 3, theGetElnoNodeData.getNbComp() );
+ std::vector< TElnoDataType > anElnoDataValues( aNbComp );
+
theConnectivity->InitTraversal();
vtkIdType aNbPts = 0, *aPts = 0;
for ( vtkIdType aCellId = 0; theConnectivity->GetNextCell( aNbPts, aPts ); aCellId++ ) {
theOutputPointData->CopyData( theInputPointData, aCurrentPntId, aNewPntId );
TElnoDataType* anElnoData = theGetElnoNodeData( aCellId, aPntId );
- theElnoPointDataArray->SetTupleValue( aNewPntId, anElnoData );
+ theElnoPointDataArray->SetTupleValue( aNewPntId, anElnoData );
+
+ theElnoPointDataArray->GetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
+ theElnoPointVectors->SetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
}
}
}
anElnoPointDataArray->SetNumberOfTuples( aNbPoints );
anElnoPointDataArray->SetName( "ELNO_POINT_DATA" );
+ TElnoDataArray* anElnoPointVectors = TElnoDataArray::New();
+ anElnoPointVectors->SetNumberOfComponents( 3 );
+ anElnoPointVectors->SetNumberOfTuples( aNbPoints );
+ anElnoPointVectors->SetName( "ELNO_POINT_VECTORS" );
+
TPointsDataArray* anElnoPointCoords = TPointsDataArray::New();
anElnoPointCoords->SetNumberOfComponents( 3 );
anElnoPointCoords->SetNumberOfTuples( aNbPoints );
anOutputPointsArray,
aGetElnoNodeData,
anElnoPointDataArray,
+ anElnoPointVectors,
anElnoPointCoords,
theShrinkFactor );
} else {
anOutputPointsArray,
aGetElnoNodeData,
anElnoPointDataArray,
+ anElnoPointVectors,
anElnoPointCoords );
}
anOutputPointData->AddArray( anElnoPointDataArray );
anElnoPointDataArray->Delete();
+ anOutputPointData->AddArray( anElnoPointVectors );
+ anElnoPointVectors->Delete();
+
anOutputPointData->AddArray( anElnoPointCoords );
anElnoPointCoords->Delete();