TPointCoords
::GetPoints() const
{
+ if(!myIsVTKDone){
+ vtkIdType aNbPoints = GetNbPoints();
+ vtkIdType aDim = GetDim();
+
+ INITMSG(MYDEBUG,"TPointCoords::GetPoints - aNbPoints = "<<aNbPoints<<
+ "; aDim = "<<aDim<<
+ endl);
+
+ if(GetDim() == 3){
+ SetVoidArray();
+ }else{
+ for(vtkIdType aPointId = 0; aPointId < aNbPoints; aPointId++){
+ TCCoordSlice aSlice = GetCoordSlice(aPointId);
+
+ vtkFloatingPointType aCoords[3] = {0.0, 0.0, 0.0};
+ for(vtkIdType aDimId = 0; aDimId < aDim; aDimId++)
+ aCoords[aDimId] = aSlice[aDimId];
+
+ myPoints->SetPoint(aPointId, aCoords);
+ }
+ }
+
+ myIsVTKDone = true;
+ }
+
return myPoints.GetPointer();
}
{
const TPointCoords& aCoords = theGaussSubMesh->myPointCoords;
vtkIdType aNbPoints = aCoords.GetNbPoints();
- vtkIdType aDim = aCoords.GetDim();
vtkIdType aNbCells = theGaussSubMesh->myNbCells;
vtkIdType aCellsSize = theGaussSubMesh->myCellsSize;
aCellTypesArray->SetNumberOfComponents(1);
aCellTypesArray->SetNumberOfTuples(aNbCells);
- vtkPoints* aPoints = aCoords.GetPoints();
vtkIdList *anIdList = vtkIdList::New();
anIdList->SetNumberOfIds(1);
for(vtkIdType aPointId = 0; aPointId < aNbPoints; aPointId++){
- TCCoordSlice aSlice = aCoords.GetCoordSlice(aPointId);
-
- vtkFloatingPointType aCoords[3] = {0.0, 0.0, 0.0};
- for(vtkIdType aDimId = 0; aDimId < aDim; aDimId++)
- aCoords[aDimId] = aSlice[aDimId];
-
- aPoints->SetPoint(aPointId, aCoords);
-
- anIdList->SetId(0,aPointId);
+ anIdList->SetId(0, aPointId);
aConnectivity->InsertNextCell(anIdList);
aCellTypesArray->SetValue(aPointId, (unsigned char)VTK_VERTEX);
}
const TVTKSource& aSource = theGaussSubMesh->GetSource();
aSource->SetCells(aCellTypesArray, aCellLocationsArray, aConnectivity);
- aSource->SetPoints(aPoints);
+ aSource->SetPoints(aCoords.GetPoints());
aCellLocationsArray->Delete();
aCellTypesArray->Delete();
//---------------------------------------------------------------
//! This class is responsible for representation of mesh nodes
- class TPointCoords: public virtual TBaseStructure
+ class TPointCoords: public virtual TIsVTKDone
{
protected:
//! An container for coordinates of the nodes
In additition to its base functionlity it support mapping of VTK to object numeration and
keeps names for each of nodes.
*/
- class TNamedPointCoords: public virtual TPointCoords,
- public virtual TIsVTKDone
+ class TNamedPointCoords: public virtual TPointCoords
{
protected:
typedef TVector<std::string> TPointsDim;