vtkInformationVector *theOutputVector)
{
bool anIsExecuted = false;
- if(GetNumberOfInputConnections(0) > 1 || IsMergingInputs() || IsMappingInputs())
+ if( IsMergingInputs() || IsMappingInputs() )
anIsExecuted = VISU::UnstructuredGridRequestData(theInputVector,
- this->GetNumberOfInputConnections(0),
+ GetNumberOfInputConnections( 0 ),
theOutputVector,
GetSharedPointSet(),
IsMergingInputs(),
IsMappingInputs());
- if(!anIsExecuted)
+ if( !anIsExecuted )
anIsExecuted = Superclass::RequestData(theRequest,
theInputVector,
theOutputVector);
bool theIsMergingInputs,
bool theIsMappingInputs)
{
- if(theSharedPointSet){
+ if ( theNumberOfInputConnections == 1 ) {
+ // get the input and ouptut
+ vtkDataSet *anInput = VISU::GetInput( theInputVector, 0 );
+ vtkDataSet* anOutput = VISU::GetOutput( theOutputVector );
+
+ // This has to be here because it initialized all field datas.
+ anOutput->CopyStructure( anInput );
+
+ // Pass all. (data object's field data is passed by the
+ // superclass after this method)
+ anOutput->GetPointData()->PassData( anInput->GetPointData() );
+ anOutput->GetCellData()->PassData( anInput->GetCellData() );
+
+ return 1;
+ }
+
+ if ( theSharedPointSet ) {
vtkPoints* aPoints = theSharedPointSet->GetPoints();
if(aPoints->GetNumberOfPoints() < 1)
return true;
TDataSet* anOutput = TDataSet::SafeDownCast(VISU::GetOutput(theOutputVector));
vtkIdType anNbInputs = theNumberOfInputConnections;
- if(theIsMergingInputs){
+ if ( theIsMergingInputs ) {
TCellIdMerger aFunctor(anNbInputs);
ForEachInput<TCellIdMerger>(theInputVector, anNbInputs, aFunctor);
std::string aFieldName = VISU::GenerateFieldName(theField, theValForTime);
vtkDataSetAttributes* aDataSetAttributes;
- switch(theEntity){
+ switch ( theEntity ) {
case VISU::NODE_ENTITY :
aDataSetAttributes = theSource->GetPointData();
break;
typedef typename TL::TEnum2VTKArrayType<EDataType>::TResult TVTKDataArray;
TVTKDataArray *aSelectedDataArray = TVTKDataArray::New();
vtkIdType aNbComp = theField->myNbComp;
- aSelectedDataArray->SetNumberOfComponents( 3 );
+
+ switch ( aNbComp ) {
+ case 1:
+ aSelectedDataArray->SetNumberOfComponents( 1 );
+ aDataSetAttributes->SetScalars( aSelectedDataArray );
+ break;
+ default:
+ aSelectedDataArray->SetNumberOfComponents( 3 );
+ aDataSetAttributes->SetVectors( aSelectedDataArray );
+ }
aSelectedDataArray->SetNumberOfTuples( aNbTuples );
aSelectedDataArray->SetName( aFieldName.c_str() );
- aDataSetAttributes->SetVectors( aSelectedDataArray );
TVTKDataArray *aFullDataArray = TVTKDataArray::New();
aFullDataArray->SetNumberOfComponents( aNbComp );
true);
INITMSG(MYDEBUG,"InitTimeStampOnProfile - aFullDataArray->SetVoidArray()"<<std::endl);
if ( aNbComp == 1 ) {
- aSelectedDataArray->SetVoidArray(aMeshValue->GetPointer(),
- aMeshValue->size(),
- true);
+ aSelectedDataArray->SetVoidArray( aMeshValue->GetPointer(),
+ aMeshValue->size(),
+ true );
INITMSG(MYDEBUG,"InitTimeStampOnProfile - aSelectedDataArray->SetVoidArray()"<<std::endl);
}else{
PDataArrayHolder aDataArrayHolder(new TTDataArrayHolder(aSelectedDataArray));
GetMapperHolder()->SetLookupTable(GetMapperTable());
GetMapper()->InterpolateScalarsBeforeMappingOn();
- GetMapper()->SetUseLookupTableScalarRange(true);
+ GetMapper()->SetUseLookupTableScalarRange( true );
GetMapper()->SetColorModeToMapScalars();
GetMapper()->ScalarVisibilityOn();
}
vtkInformationVector **theInputVector,
vtkInformationVector *theOutputVector)
{
- vtkDataSet *anInput = VISU::GetInput(theInputVector, 0);
- vtkDataSet *anOutput = VISU::GetOutput(theOutputVector);
+ vtkDataSet *anInput = VISU::GetInput( theInputVector, 0 );
+ vtkDataSet *anOutput = VISU::GetOutput( theOutputVector );
- anOutput->CopyStructure(anInput);
+ anOutput->CopyStructure( anInput );
vtkPointData *anInputPointData = anInput->GetPointData();
vtkPointData *anOutputPointData = anOutput->GetPointData();
- anOutputPointData->PassData(anInputPointData);
- if(VISU::IsDataOnPoints(anInput)){
+ anOutputPointData->PassData( anInputPointData );
+ if ( VISU::IsDataOnPoints( anInput ) ) {
int aNbElems = anInput->GetNumberOfPoints();
- if(anInputPointData->GetAttribute(vtkDataSetAttributes::VECTORS))
- ExecuteScalars(aNbElems, myScalarMode, anInputPointData, anOutputPointData);
+ if ( anInputPointData->GetAttribute( vtkDataSetAttributes::VECTORS ) )
+ ExecuteScalars( aNbElems, myScalarMode, anInputPointData, anOutputPointData );
}
vtkCellData *anInputCellData = anInput->GetCellData();
vtkCellData *anOutputCellData = anOutput->GetCellData();
- anOutputCellData->PassData(anInputCellData);
- if(VISU::IsDataOnCells(anInput)){
+ anOutputCellData->PassData( anInputCellData );
+ if ( VISU::IsDataOnCells( anInput ) ) {
int aNbElems = anInput->GetNumberOfCells();
- if(anInputCellData->GetAttribute(vtkDataSetAttributes::VECTORS))
- ExecuteScalars(aNbElems, myScalarMode, anInputCellData, anOutputCellData);
+ if ( anInputCellData->GetAttribute( vtkDataSetAttributes::VECTORS ) )
+ ExecuteScalars( aNbElems, myScalarMode, anInputCellData, anOutputCellData );
}
return 1;