void
VISU_AppendFilter
-::SetPoints(vtkPoints* thePoints)
+::SetSharedPointsDataSet(vtkPointSet* thePointsDataSet)
{
- if(GetPoints() == thePoints)
+ if(GetSharedPointsDataSet() == thePointsDataSet)
return;
- myPoints = thePoints;
+ mySharedPointsDataSet = thePointsDataSet;
Modified();
}
-vtkPoints*
+vtkPointSet*
VISU_AppendFilter
-::GetPoints()
+::GetSharedPointsDataSet()
{
- return myPoints.GetPointer();
+ return mySharedPointsDataSet.GetPointer();
}
void
VISU_AppendFilter
::Execute()
{
- if(myPoints.GetPointer()){
- if(myPoints->GetNumberOfPoints() < 1)
+ if(GetSharedPointsDataSet()){
+ vtkPoints* aPoints = GetSharedPointsDataSet()->GetPoints();
+ if(aPoints->GetNumberOfPoints() < 1)
return;
vtkUnstructuredGrid *anOutput = this->GetOutput();
// Append each input dataset together
// 1.points
- anOutput->SetPoints(myPoints.GetPointer());
+ anOutput->SetPoints(GetSharedPointsDataSet()->GetPoints());
+ anOutput->GetPointData()->PassData(GetSharedPointsDataSet()->GetPointData());
// 2.cells
vtkIdList *anIdList = vtkIdList::New();
// Append each input dataset together
// 1.points
- anOutput->SetPoints(myPoints.GetPointer());
+ anOutput->SetPoints(GetSharedPointsDataSet()->GetPoints());
+ anOutput->GetPointData()->PassData(GetSharedPointsDataSet()->GetPointData());
// 2.cells
vtkIdList *anIdList = vtkIdList::New();
//---------------------------------------------------------------
TMeshImpl::TMeshImpl():
- myPoints(vtkPoints::New()),
+ myPointsSource(vtkUnstructuredGrid::New()),
myNbPoints(0)
{
- myPoints->Delete();
+ vtkPoints* aPoints = vtkPoints::New();
+ myPointsSource->SetPoints(aPoints);
+ aPoints->Delete();
+
+ myPointsSource->Delete();
}
//---------------------------------------------------------------
- vtkPoints*
- GetPoints(const PMeshImpl& theMesh)
+ vtkUnstructuredGrid*
+ GetPointsSource(const PMeshImpl& theMesh)
{
- TVTKPoints& aPoints = theMesh->myPoints;
- const TNamedPointCoords& aCoords = theMesh->myNamedPointCoords;
-
+ TVTKSource& aPointSource = theMesh->myPointsSource;
if(!theMesh->myIsVTKDone){
+ const TNamedPointCoords& aCoords = theMesh->myNamedPointCoords;
TCoordHelperPtr aCoordHelperPtr;
{
int aMeshDimension = theMesh->myDim;
}
}
+ vtkPoints* aPoints = aPointSource->GetPoints();
vtkIdType aNbPoints = aCoords.GetNbPoints();
aPoints->SetNumberOfPoints(aNbPoints);
- INITMSG(MYDEBUG,"GetPoints - aNbPoints = "<<aNbPoints<<
+ INITMSG(MYDEBUG,"GetPointsSource - aNbPoints = "<<aNbPoints<<
"; aDim = "<<theMesh->myDim<<
endl);
aCoordHelperPtr->GetCoord(aCoordSlice,eY),
aCoordHelperPtr->GetCoord(aCoordSlice,eZ));
}
-
+
+ vtkIdType aNbTuples = aNbPoints;
+ vtkIntArray *aDataArray = vtkIntArray::New();
+ aDataArray->SetName("VISU_POINTS_MAPPER");
+ aDataArray->SetNumberOfComponents(1);
+ aDataArray->SetNumberOfTuples(aNbTuples);
+ for(vtkIdType aTupleId = 0; aTupleId < aNbTuples; aTupleId++){
+ vtkIdType anObjID = aCoords.GetObjID(aTupleId);
+ aDataArray->SetValue(aTupleId, anObjID);
+ }
+ aPointSource->GetPointData()->AddArray(aDataArray);
+ aDataArray->Delete();
+
theMesh->myIsVTKDone = true;
if(MYVTKDEBUG) aPoints->DebugOn();
}
- return aPoints.GetPointer();
+ return aPointSource.GetPointer();
}
if(theSubProfile->myIsVTKDone)
return;
- aSource->SetPoints(GetPoints(theMesh));
+ aSource->ShallowCopy(GetPointsSource(theMesh));
INITMSGA(MYDEBUG,0,"GetNumberOfPoints - "<<aSource->GetNumberOfPoints()<<endl);
GetCells(aSource,theSubProfile,theProfile,theMeshOnEntity);
BEGMSG(MYDEBUG,"GetNumberOfCells - "<<aSource->GetNumberOfCells()<<endl);
return true;
const TVTKAppendFilter& anAppendFilter = theProfile->GetFilter();
- anAppendFilter->SetPoints(GetPoints(theMesh));
+ anAppendFilter->SetSharedPointsDataSet(GetPointsSource(theMesh));
if(theProfile->myIsAll){
TVTKOutput* aDataSet = theMeshOnEntity->GetVTKOutput();
if(MYVTKDEBUG) anAppendFilter->DebugOn();
LoadMeshOnEntity(aMesh,aMeshOnEntity);
- anAppendFilter->SetPoints(GetPoints(aMesh));
+ anAppendFilter->SetSharedPointsDataSet(GetPointsSource(aMesh));
const TGeom2SubMesh& aGeom2SubMesh = aMeshOnEntity->myGeom2SubMesh;
TGeom2SubMesh::const_iterator anIter = aGeom2SubMesh.begin();
//ENK: 23.11.2006
const TVTKSource& aSource = aSubMesh->GetSource();
- aSource->SetPoints(GetPoints(aMesh));
+ aSource->ShallowCopy(GetPointsSource(aMesh));
aSubMesh->myStartID = aCellID;
GetCellsOnSubMesh(aSource, aMeshOnEntity, aSubMesh, aVGeom);
GetMeshOnEntity(theMeshName,theEntity);
LoadFamilyOnEntity(aMesh,aMeshOnEntity,aFamily);
- aSource->SetPoints(GetPoints(aMesh));
+ aSource->ShallowCopy(GetPointsSource(aMesh));
GetCellsOnFamily(aSource,aMeshOnEntity,aFamily);
aFamily->myNamedPointCoords = aMesh->myNamedPointCoords;
const VISU::TFamilySet& aFamilySet = aGroup->myFamilySet;
LoadMeshOnGroup(aMesh,aFamilySet);
- anAppendFilter->SetPoints(GetPoints(aMesh));
+ anAppendFilter->SetSharedPointsDataSet(GetPointsSource(aMesh));
TFamilySet::const_iterator anIter = aFamilySet.begin();