3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 // Author: Alexey PETROV
27 #include "VISU_Structures_impl.hxx"
28 #include "VISU_PointCoords.hxx"
29 #include "VISU_MeshValue.hxx"
31 #include "VISU_AppendFilter.hxx"
32 #include "VISU_AppendPolyData.hxx"
33 #include "VISU_MergeFilter.hxx"
35 #include "VISU_ConvertorUtils.hxx"
36 #include "VISU_CommonCellsFilter.hxx"
38 #include <vtkUnstructuredGrid.h>
39 #include <vtkPolyData.h>
40 #include <vtkCellType.h>
46 VISUGeom2NbNodes(EGeometry theGeom)
49 #ifndef VISU_ENABLE_QUADRATIC
74 VISUGeom2VTK(EGeometry theGeom)
88 return VTK_HEXAHEDRON;
97 return VTK_CONVEX_POINT_SET;
99 #ifndef VISU_ENABLE_QUADRATIC
109 return VTK_HEXAHEDRON;
118 #if defined(VTK_QUADRATIC_EDGE) && defined(VISU_USE_VTK_QUADRATIC)
119 return VTK_QUADRATIC_EDGE;
121 return VTK_POLY_LINE;
125 #if defined(VTK_QUADRATIC_TRIANGLE) && defined(VISU_USE_VTK_QUADRATIC)
126 return VTK_QUADRATIC_TRIANGLE;
132 #if defined(VTK_QUADRATIC_QUAD) && defined(VISU_USE_VTK_QUADRATIC)
133 return VTK_QUADRATIC_QUAD;
139 #if defined(VTK_QUADRATIC_TETRA) && defined(VISU_USE_VTK_QUADRATIC)
140 return VTK_QUADRATIC_TETRA;
142 return VTK_CONVEX_POINT_SET;
146 #if defined(VTK_QUADRATIC_HEXAHEDRON) && defined(VISU_USE_VTK_QUADRATIC)
147 return VTK_QUADRATIC_HEXAHEDRON;
149 return VTK_CONVEX_POINT_SET;
153 #if defined(VTK_QUADRATIC_WEDGE) && defined(VISU_USE_VTK_QUADRATIC)
154 return VTK_QUADRATIC_WEDGE;
156 return VTK_CONVEX_POINT_SET;
160 #if defined(VTK_QUADRATIC_PYRAMID) && defined(VISU_USE_VTK_QUADRATIC)
161 return VTK_QUADRATIC_PYRAMID;
163 return VTK_CONVEX_POINT_SET;
166 #endif //VISU_ENABLE_QUADRATIC
175 VTKGeom2VISU(vtkIdType theGeom)
179 return VISU::ePOINT1;
187 return VISU::eTETRA4;
191 return VISU::ePENTA6;
196 return VISU::ePOLYGONE;
197 case VTK_CONVEX_POINT_SET:
198 return VISU::ePOLYEDRE;
200 #if defined(VISU_ENABLE_QUADRATIC) && defined(VISU_USE_VTK_QUADRATIC)
201 #if defined(VTK_QUADRATIC_EDGE)
202 case VTK_QUADRATIC_EDGE:
206 #if defined(VTK_QUADRATIC_TRIANGLE)
207 case VTK_QUADRATIC_TRIANGLE:
211 #if defined(VTK_QUADRATIC_QUAD)
212 case VTK_QUADRATIC_QUAD:
216 #if defined(VTK_QUADRATIC_TETRA)
217 case VTK_QUADRATIC_TETRA:
218 return VISU::eTETRA10;
221 #if defined(VTK_QUADRATIC_HEXAHEDRON)
222 case VTK_QUADRATIC_HEXAHEDRON:
223 return VISU::eHEXA20;
226 #if defined(VTK_QUADRATIC_WEDGE)
227 case VTK_QUADRATIC_WEDGE:
228 return VISU::ePENTA15;
231 #if defined(VTK_QUADRATIC_PYRAMID)
232 case VTK_QUADRATIC_PYRAMID:
233 return VISU::ePYRA13;
236 #endif //VISU_ENABLE_QUADRATIC
239 return EGeometry(-1);
243 //---------------------------------------------------------------
244 /*! Computes number of points by the given number of cells
245 * in assumption of regular hexahedral mesh structure
248 GetNumberOfPoints(size_t theNbCells)
250 return size_t(pow(pow(theNbCells, 1.0/3.0) + 1.0, 3.0));
253 //---------------------------------------------------------------
254 /*! Computes size dataset the given number of mesh macro metrics
255 * in assumption of regular hexahedral mesh structure
258 GetDataSetSize(size_t theNbOfPoints,
261 bool theComputeLinks)
263 size_t aPointsSize = 3*theNbOfPoints*sizeof(VISU::TCoord);
264 size_t aConnectivityAndTypesSize = theCellsSize*sizeof(vtkIdType);
265 size_t aLocationsSize = theNbOfCells*sizeof(int);
266 vtkFloatingPointType aNbCellsPerPoint = theCellsSize / theNbOfCells - 1;
267 size_t aLinksSize = theNbOfPoints * (vtkIdType(sizeof(vtkIdType)*aNbCellsPerPoint) + sizeof(short));
270 size_t aResult = aPointsSize + aConnectivityAndTypesSize + aLocationsSize + aLinksSize;
274 //---------------------------------------------------------------
282 //---------------------------------------------------------------
291 if(!mySource.GetPointer()){
292 mySource = vtkPolyData::New();
300 ::GetPolyDataOutput()
302 return GetSource().GetPointer();
309 if(vtkDataSet* anOutput = GetPolyDataOutput()){
311 return anOutput->GetActualMemorySize() * 1024;
314 size_t aNbPoints = GetNumberOfPoints(myNbCells);
315 return GetDataSetSize(aNbPoints, myNbCells, myCellsSize, false);
317 throw std::runtime_error("TUnstructuredGridHolder::GetMemorySize - myIsDone == false !!!");
321 //---------------------------------------------------------------
322 TUnstructuredGridHolder
323 ::TUnstructuredGridHolder()
326 const PUnstructuredGrid&
327 TUnstructuredGridHolder
330 if(!mySource.GetPointer()){
331 mySource = vtkUnstructuredGrid::New();
338 TUnstructuredGridHolder
339 ::GetUnstructuredGridOutput()
341 return GetSource().GetPointer();
345 TUnstructuredGridHolder
348 if(vtkDataSet* anOutput = GetUnstructuredGridOutput()){
350 return anOutput->GetActualMemorySize() * 1024;
353 size_t aNbPoints = GetNumberOfPoints(myNbCells);
354 return GetDataSetSize(aNbPoints, myNbCells, myCellsSize, false);
356 throw std::runtime_error("TUnstructuredGridHolder::GetMemorySize - myIsDone == false !!!");
360 //---------------------------------------------------------------
366 if(vtkDataSet* anOutput = GetOutput()){
368 return anOutput->GetActualMemorySize() * 1024;
371 throw std::runtime_error("TMemoryCheckIDMapper::GetMemorySize - myIsVTKDone == false !!!");
376 //---------------------------------------------------------------
378 ::TAppendFilterHolder()
385 if(!myFilter.GetPointer()){
386 myFilter = VISU_AppendFilter::New();
388 myFilter->SetMappingInputs(true);
395 ::GetUnstructuredGridOutput()
397 GetFilter()->Update();
398 return GetFilter()->GetOutput();
401 //---------------------------------------------------------------
402 TAppendPolyDataHolder
403 ::TAppendPolyDataHolder()
406 const PAppendPolyData&
407 TAppendPolyDataHolder
410 if(!myFilter.GetPointer()){
411 myFilter = VISU_AppendPolyData::New();
412 myFilter->SetMappingInputs(true);
419 TAppendPolyDataHolder
420 ::GetPolyDataOutput()
422 GetFilter()->Update();
423 return GetFilter()->GetOutput();
427 //---------------------------------------------------------------
429 ::TMergeFilterHolder()
436 if(!myFilter.GetPointer()){
437 myFilter = VISU_MergeFilter::New();
447 GetFilter()->Update();
448 return GetFilter()->GetOutput();
452 //---------------------------------------------------------------
476 return myNamedPointCoords->GetPointSet();
480 //---------------------------------------------------------------
481 TSubProfileImpl::TSubProfileImpl():
489 ::GetElemObjID(vtkIdType theID) const
491 if ( !mySubMeshID.empty() )
492 return mySubMeshID[theID];
500 ::GetElemVTKID(vtkIdType theID) const
502 if ( !mySubMeshID.empty() )
503 for ( size_t anId = 0; anId < mySubMeshID.size(); anId++ )
504 if ( mySubMeshID[ anId ] == theID )
514 size_t aSize = TUnstructuredGridHolder::GetMemorySize();
515 aSize += sizeof(vtkIdType) * mySubMeshID.size();
520 //---------------------------------------------------------------
522 operator<(const PSubProfile& theLeft, const PSubProfile& theRight)
524 PSubProfileImpl aLeft(theLeft), aRight(theRight);
526 if(aLeft->myGeom != aRight->myGeom)
527 return aLeft->myGeom < aRight->myGeom;
529 if(aLeft->myStatus != aRight->myStatus)
530 return aLeft->myStatus < aRight->myStatus;
532 return aLeft->myName < aRight->myName;
536 //---------------------------------------------------------------
545 ::GetNodeObjID(vtkIdType theID) const
547 return myNamedPointCoords->GetObjID(theID);
552 ::GetNodeVTKID(vtkIdType theID) const
554 return myNamedPointCoords->GetVTKID(theID);
557 vtkFloatingPointType*
559 ::GetNodeCoord(vtkIdType theObjID)
562 return myMeshOnEntity->GetNodeCoord(theObjID);
564 vtkIdType aVtkID = GetNodeVTKID(theObjID);
565 return GetFilter()->GetOutput()->GetPoint(aVtkID);
570 ::GetElemObjID(vtkIdType theID) const
572 return VISU::GetElemObjID(GetFilter()->GetOutput(), theID);
577 ::GetElemVTKID(vtkIdType theID) const
579 return VISU::GetElemVTKID(GetFilter()->GetOutput(), theID);
584 ::GetElemCell(vtkIdType theObjID)
587 return myMeshOnEntity->GetElemCell(theObjID);
589 vtkIdType aVtkID = GetElemVTKID(theObjID);
590 return GetFilter()->GetOutput()->GetCell(aVtkID);
595 ::GetUnstructuredGridOutput()
597 const PAppendFilter& anAppendFilter = GetFilter();
598 return anAppendFilter->GetOutput();
605 size_t aSize = TAppendFilterHolder::GetMemorySize();
606 aSize += myNamedPointCoords->GetMemorySize();
607 aSize += myElemObj2VTKID.size() * 2 * sizeof(vtkIdType);
608 TGeom2SubProfile::const_iterator anIter = myGeom2SubProfile.begin();
609 TGeom2SubProfile::const_iterator anIterEnd = myGeom2SubProfile.end();
610 for(; anIter != anIterEnd; anIter++){
611 const PSubProfileImpl& aSubProfile = anIter->second;
612 aSize += aSubProfile->GetMemorySize();
613 aSize += sizeof(EGeometry);
620 ::GetNodeName(vtkIdType theObjID) const
622 return myNamedPointCoords->GetNodeName(theObjID);
627 ::GetElemName(vtkIdType theObjID) const
629 return myMeshOnEntity->GetElemName(theObjID);
633 //---------------------------------------------------------------
636 TUnstructuredGridIDMapperImpl
637 ::TUnstructuredGridIDMapperImpl():
638 myIsSpecialKey(false)
640 if(!myCommonCellsFilter.GetPointer()){
641 myCommonCellsFilter = VISU_CommonCellsFilter::New();
642 myCommonCellsFilter->Delete();
647 TUnstructuredGridIDMapperImpl
648 ::GetNodeObjID(vtkIdType theID) const
650 return myIDMapper->GetNodeObjID(theID);
654 TUnstructuredGridIDMapperImpl
655 ::GetNodeVTKID(vtkIdType theID) const
657 return myIDMapper->GetNodeVTKID(theID);
660 vtkFloatingPointType*
661 TUnstructuredGridIDMapperImpl
662 ::GetNodeCoord(vtkIdType theObjID)
664 return myIDMapper->GetNodeCoord(theObjID);
668 TUnstructuredGridIDMapperImpl
669 ::GetElemObjID(vtkIdType theID) const
671 return myIDMapper->GetElemObjID(theID);
675 TUnstructuredGridIDMapperImpl
676 ::GetElemVTKID(vtkIdType theID) const
678 return myIDMapper->GetElemVTKID(theID);
682 TUnstructuredGridIDMapperImpl
683 ::GetElemCell(vtkIdType theObjID)
685 return myIDMapper->GetElemCell(theObjID);
689 TUnstructuredGridIDMapperImpl
690 ::GetUnstructuredGridOutput()
692 if(!myFilter.GetPointer()){
694 const PAppendFilter& anAppendFilter = myIDMapper->GetFilter();
695 vtkUnstructuredGrid* aGeometry;
697 const PUnstructuredGrid& aSource = mySource.GetSource();
698 vtkUnstructuredGrid* aDataSet;
701 PNamedIDMapperMap::iterator aIter;
702 aIter = myMappers.find(VISU::CELL_ENTITY);
703 if(aIter!=myMappers.end()) myCommonCellsFilter->SetCellsUG((aIter->second)->GetUnstructuredGridOutput());
705 aIter = myMappers.find(VISU::FACE_ENTITY);
706 if(aIter!=myMappers.end()) myCommonCellsFilter->SetCellsUG((aIter->second)->GetUnstructuredGridOutput());
708 aIter = myMappers.find(VISU::EDGE_ENTITY);
709 if(aIter!=myMappers.end()) myCommonCellsFilter->SetCellsUG((aIter->second)->GetUnstructuredGridOutput());
714 aGeometry = anAppendFilter->GetOutput();
715 aDataSet = aSource.GetPointer();
716 aDataSet->ShallowCopy(aGeometry);
718 const PMergeFilter& aFilter = GetFilter();
719 aFilter->SetGeometry(aGeometry);
720 aFilter->SetScalars(aDataSet);
721 aFilter->SetVectors(aDataSet);
722 aFilter->AddField("VISU_FIELD",aDataSet);
723 aFilter->AddField("VISU_CELLS_MAPPER",aDataSet);
724 aFilter->AddField("VISU_POINTS_MAPPER",aDataSet);
726 myCommonCellsFilter->SetProfileUG(aFilter->GetUnstructuredGridOutput());
728 return myCommonCellsFilter->GetOutput();
732 TUnstructuredGridIDMapperImpl
735 return GetUnstructuredGridOutput();
739 TUnstructuredGridIDMapperImpl
742 size_t aSize = myIDMapper->GetMemorySize();
743 aSize += mySource.GetMemorySize();
744 if(vtkUnstructuredGrid* anOutput = myCommonCellsFilter->GetOutput())
745 aSize += anOutput->GetActualMemorySize() * 1024;
746 PNamedIDMapperMap::const_iterator aIter = myMappers.begin();
747 for(;aIter!=myMappers.end();aIter++)
748 aSize += (aIter->second)->GetMemorySize();
752 //---------------------------------------------------------------
754 TPolyDataIDMapperImpl
755 ::GetNodeObjID(vtkIdType theID) const
757 return myIDMapper->GetNodeObjID(theID);
761 TPolyDataIDMapperImpl
762 ::GetNodeVTKID(vtkIdType theID) const
764 return myIDMapper->GetNodeVTKID(theID);
767 vtkFloatingPointType*
768 TPolyDataIDMapperImpl
769 ::GetNodeCoord(vtkIdType theObjID)
771 return myIDMapper->GetNodeCoord(theObjID);
775 TPolyDataIDMapperImpl
776 ::GetElemObjID(vtkIdType theID) const
778 return myIDMapper->GetElemObjID(theID);
782 TPolyDataIDMapperImpl
783 ::GetElemVTKID(vtkIdType theID) const
785 return myIDMapper->GetElemVTKID(theID);
789 TPolyDataIDMapperImpl
790 ::GetElemCell(vtkIdType theObjID)
792 return myIDMapper->GetElemCell(theObjID);
796 TPolyDataIDMapperImpl
797 ::GetPolyDataOutput()
799 if(!myFilter.GetPointer()){
800 const PAppendPolyData& anAppendFilter = myIDMapper->GetFilter();
801 vtkPolyData* aGeometry = anAppendFilter->GetOutput();
803 const PPolyData& aSource = mySource.GetSource();
804 vtkPolyData* aDataSet = aSource.GetPointer();
805 aDataSet->ShallowCopy(aGeometry);
807 const PMergeFilter& aFilter = GetFilter();
808 aFilter->SetGeometry(aGeometry);
809 aFilter->SetScalars(aDataSet);
810 aFilter->SetVectors(aDataSet);
811 aFilter->AddField("VISU_FIELD",aDataSet);
812 aFilter->AddField("VISU_CELLS_MAPPER",aDataSet);
813 aFilter->AddField("VISU_POINTS_MAPPER",aDataSet);
815 return myFilter->GetPolyDataOutput();
819 TPolyDataIDMapperImpl
822 return GetPolyDataOutput();
826 TPolyDataIDMapperImpl
829 size_t aSize = myIDMapper->GetMemorySize();
830 aSize += mySource.GetMemorySize();
835 //---------------------------------------------------------------
838 myGeom(EGeometry(-1)),
844 ::LessThan(const PGaussImpl& theGauss,
845 bool& theResult) const
851 //---------------------------------------------------------------
853 ::TGaussSubMeshImpl():
854 myPointCoords(new TPointCoords()),
861 ::GetObjID(vtkIdType theID) const
863 TCellID aCellID = myStartID + theID / myGauss->myNbPoints;
864 TLocalPntID aLocalPntID = theID % myGauss->myNbPoints;
866 return TGaussPointID(aCellID, aLocalPntID);
871 ::GetVTKID(const TGaussPointID& theID) const
873 vtkIdType aResult = -1;
875 TCellID aCellID = theID.first;
876 TLocalPntID aLocalPntID = theID.second;
878 vtkIdType aNbPoints = myGauss->myNbPoints;
879 if ( aLocalPntID >= aNbPoints )
882 return ( aCellID - myStartID ) * aNbPoints + aLocalPntID;
886 VISU::TGaussSubMeshImpl
887 ::GetElemObjID(vtkIdType theID) const
889 return mySubProfile->GetElemObjID( theID );
894 VISU::TGaussSubMeshImpl
895 ::GetElemVTKID(vtkIdType theID) const
897 return mySubProfile->GetElemVTKID( theID );
902 ::GetGlobalID(vtkIdType theID) const
904 return myStartID + theID;
911 size_t aSize = TPolyDataHolder::GetMemorySize();
912 aSize += myPointCoords->GetMemorySize();
916 //---------------------------------------------------------------
918 operator<(const PGaussSubMesh& theLeft, const PGaussSubMesh& theRight)
920 PGaussSubMeshImpl aLeft(theLeft), aRight(theRight);
921 const PGaussImpl& aGaussLeft = aLeft->myGauss;
922 const PGaussImpl& aGaussRight = aRight->myGauss;
924 if(aGaussLeft->myGeom != aGaussRight->myGeom)
925 return aGaussLeft->myGeom < aGaussRight->myGeom;
927 if(aLeft->mySubProfile != aRight->mySubProfile)
928 return aLeft->mySubProfile < aRight->mySubProfile;
931 aGaussLeft->LessThan(aGaussRight,aResult);
937 //---------------------------------------------------------------
945 ::GetObjID(vtkIdType theID) const
947 const PAppendPolyData& aFilter = GetFilter();
948 return VISU::GetObjID(aFilter->GetOutput(), theID);
953 ::GetVTKID(const TGaussPointID& theID) const
955 vtkIdType aResult = -1;
957 TCellID aCellID = theID.first;
959 vtkIdType aVTKCellId = GetParent()->GetElemVTKID( aCellID );
960 if ( aVTKCellId < 0 )
963 vtkCell* aCell = GetParent()->GetElemCell( aCellID );
967 EGeometry aVGeom = VISU::VTKGeom2VISU( aCell->GetCellType() );
968 if ( aVGeom < EGeometry(0) )
971 TGeom2GaussSubMesh::const_iterator anIter = myGeom2GaussSubMesh.find( aVGeom );
972 if ( anIter == myGeom2GaussSubMesh.end() )
975 size_t aSubMeshEnd = myGaussSubMeshArr.size();
976 const PAppendFilter& anAppendFilter = GetFilter();
977 const PGaussSubMeshImpl& aGaussSubMesh = anIter->second;
978 for ( size_t aSubMeshId = 0; aSubMeshId < aSubMeshEnd; aSubMeshId++ ) {
979 const PGaussSubMeshImpl& aSubMesh = myGaussSubMeshArr[aSubMeshId];
980 if ( aGaussSubMesh.get() == aSubMesh.get() ) {
981 return aGaussSubMesh->GetVTKID(theID);
990 ::GetPolyDataOutput()
992 return TAppendPolyDataHolder::GetPolyDataOutput();
999 size_t aSize = TAppendPolyDataHolder::GetMemorySize();
1000 TGeom2GaussSubMesh::const_iterator anIter = myGeom2GaussSubMesh.begin();
1001 TGeom2GaussSubMesh::const_iterator anIterEnd = myGeom2GaussSubMesh.end();
1002 for(; anIter != anIterEnd; anIter++){
1003 const PGaussSubMeshImpl& aGaussSubMesh = anIter->second;
1004 aSize += aGaussSubMesh->GetMemorySize();
1005 aSize += sizeof(EGeometry);
1018 //---------------------------------------------------------------
1021 ::GetObjID(vtkIdType theID) const
1023 return myGaussPtsIDMapper->GetObjID(theID);
1028 ::GetVTKID(const TGaussPointID& theID) const
1030 return myGaussPtsIDMapper->GetVTKID(theID);
1037 return myGaussPtsIDMapper->GetParent();
1042 ::GetPolyDataOutput()
1044 return TPolyDataIDMapperImpl::GetPolyDataOutput();
1051 return GetPolyDataOutput();
1055 //---------------------------------------------------------------
1063 ::GetElemObjID(vtkIdType theID) const
1065 return myStartID + theID;
1070 ::GetElemName(vtkIdType theObjID) const
1079 size_t aSize = TUnstructuredGridHolder::GetMemorySize();
1080 for(size_t anId = 0; anId < myCell2Connect.size(); anId++){
1081 const TConnect& aConnect = myCell2Connect[anId];
1082 aSize += aConnect.size() * sizeof(vtkIdType);
1087 //---------------------------------------------------------------
1089 ::TMeshOnEntityImpl()
1091 const PAppendFilter& anAppendFilter = GetFilter();
1092 anAppendFilter->SetMappingInputs(true);
1097 ::GetNodeVTKID(vtkIdType theID) const
1099 return myNamedPointCoords->GetVTKID(theID);
1104 ::GetNodeObjID(vtkIdType theID) const
1106 return myNamedPointCoords->GetObjID(theID);
1111 ::GetElemVTKID(vtkIdType theID) const
1113 return VISU::GetElemVTKID(GetFilter()->GetOutput(), theID);
1118 ::GetElemObjID(vtkIdType theID) const
1120 return VISU::GetElemObjID(GetFilter()->GetOutput(), theID);
1125 ::GetNodeName(vtkIdType theObjID) const
1127 return myNamedPointCoords->GetNodeName(theObjID);
1132 ::GetElemName(vtkIdType theObjID) const
1134 TInputCellID anInputCellID = VISU::GetInputCellID(GetFilter()->GetOutput(), theObjID);
1135 const PSubMeshImpl& aSubMesh = mySubMeshArr[anInputCellID.first];
1136 return aSubMesh->GetElemName(anInputCellID.second);
1139 vtkUnstructuredGrid*
1141 ::GetUnstructuredGridOutput()
1143 return TAppendFilterHolder::GetUnstructuredGridOutput();
1150 size_t aSize = TAppendFilterHolder::GetMemorySize();
1151 aSize += myNamedPointCoords->GetMemorySize();
1152 aSize += myElemObj2VTKID.size() * 2 * sizeof(vtkIdType);
1153 TGeom2SubMesh::const_iterator anIter = myGeom2SubMesh.begin();
1154 TGeom2SubMesh::const_iterator anIterEnd = myGeom2SubMesh.end();
1155 for(; anIter != anIterEnd; anIter++){
1156 const PSubMeshImpl& aSubMesh = anIter->second;
1157 aSize += aSubMesh->GetMemorySize();
1158 aSize += sizeof(EGeometry);
1163 //---------------------------------------------------------------
1166 ::GetElemVTKID(vtkIdType theID) const
1168 if(myElemObj2VTKID.empty())
1171 TID2ID::const_iterator anIter = myElemObj2VTKID.find(theID);
1172 if(anIter != myElemObj2VTKID.end())
1173 return anIter->second;
1180 ::GetElemObjID(vtkIdType theID) const
1182 return myMeshID[theID];
1187 ::GetNodeObjID(vtkIdType theID) const
1189 return myNamedPointCoords->GetObjID(theID);
1194 ::GetNodeVTKID(vtkIdType theID) const
1196 return myNamedPointCoords->GetVTKID(theID);
1199 vtkUnstructuredGrid*
1201 ::GetUnstructuredGridOutput()
1203 return TUnstructuredGridHolder::GetUnstructuredGridOutput();
1210 size_t aSize = TUnstructuredGridHolder::GetMemorySize();
1211 aSize += myNamedPointCoords->GetMemorySize();
1212 aSize += myElemObj2VTKID.size() * 2 * sizeof(vtkIdType);
1213 aSize += myMeshID.size() * sizeof(vtkIdType);
1214 TGeom2SubMeshID::const_iterator anIter = myGeom2SubMeshID.begin();
1215 TGeom2SubMeshID::const_iterator anIterEnd = myGeom2SubMeshID.end();
1216 for(; anIter != anIterEnd; anIter++){
1217 const TSubMeshID& aSubMeshID = anIter->second;
1218 aSize += aSubMeshID.size() * sizeof(vtkIdType);
1219 aSize += sizeof(EGeometry);
1225 //---------------------------------------------------------------
1228 ::GetNbASizeCells() const
1230 vtkIdType aNbCells = 0, aCellsSize = 0;
1231 TFamilySet::const_iterator anIter = myFamilySet.begin();
1232 for(; anIter != myFamilySet.end(); anIter++){
1233 PFamilyImpl aFamily = *anIter;
1234 aNbCells += aFamily->myNbCells;
1235 aCellsSize += aFamily->myCellsSize;
1237 return std::make_pair(aNbCells,aCellsSize);
1242 ::GetElemVTKID(vtkIdType theID) const
1244 if(myElemObj2VTKID.empty())
1247 TID2ID::const_iterator anIter = myElemObj2VTKID.find(theID);
1248 if(anIter != myElemObj2VTKID.end())
1249 return anIter->second;
1256 ::GetElemObjID(vtkIdType theID) const
1258 return VISU::GetElemObjID(GetFilter()->GetOutput(), theID);
1263 ::GetNodeObjID(vtkIdType theID) const
1265 return myNamedPointCoords->GetObjID(theID);
1270 ::GetNodeVTKID(vtkIdType theID) const
1272 return myNamedPointCoords->GetVTKID(theID);
1275 vtkUnstructuredGrid*
1277 ::GetUnstructuredGridOutput()
1279 return TAppendFilterHolder::GetUnstructuredGridOutput();
1286 size_t aSize = TAppendFilterHolder::GetMemorySize();
1287 aSize += myNamedPointCoords->GetMemorySize();
1288 aSize += myElemObj2VTKID.size() * 2 * sizeof(vtkIdType);
1289 for(size_t anId = 0; anId < myFamilyArr.size(); anId++){
1290 const PFamilyImpl& aFamily = myFamilyArr[anId];
1291 aSize += aFamily->GetMemorySize();
1298 //---------------------------------------------------------------
1307 ::Init(vtkIdType theNbComp,
1308 vtkIdType theDataType)
1310 myNbComp = theNbComp;
1311 myDataType = theDataType;
1312 myCompNames.resize(theNbComp);
1313 myUnitNames.resize(theNbComp);
1314 myMinMaxArr.resize(theNbComp + 1);
1315 for(vtkIdType iComp = 0; iComp <= theNbComp; iComp++){
1316 TMinMax& aMinMax = myMinMaxArr[iComp];
1317 aMinMax.first = VTK_LARGE_FLOAT;
1318 aMinMax.second = -VTK_LARGE_FLOAT;
1324 ::GetDataType() const
1331 ::GetMinMax(vtkIdType theCompID)
1333 return myMinMaxArr[theCompID];
1337 //----------------------------------------------------------------------------
1340 ::GetMeshValue(EGeometry theGeom) const
1342 TGeom2MeshValue::const_iterator anIter = myGeom2MeshValue.find(theGeom);
1343 if(anIter == myGeom2MeshValue.end())
1344 EXCEPTION(std::runtime_error,"TGeom2Value::GetMeshValue - myGeom2MeshValue.find(theGeom) fails");
1345 return anIter->second;
1350 ::GetMeshValue(EGeometry theGeom)
1352 return myGeom2MeshValue[theGeom];
1356 //----------------------------------------------------------------------------
1359 ::GetGeom2MeshValue()
1361 return myGeom2MeshValue;
1364 const TGeom2MeshValue&
1366 ::GetGeom2MeshValue() const
1368 return myGeom2MeshValue;
1373 ::GetFirstMeshValue() const
1375 if(myGeom2MeshValue.size() == 1)
1376 return myGeom2MeshValue.begin()->second;
1377 return PMeshValue();
1381 //---------------------------------------------------------------
1383 ::TValForTimeImpl():
1384 myGaussPtsIDFilter(new TGaussPtsIDFilter()),
1385 myUnstructuredGridIDMapper(new TUnstructuredGridIDMapperImpl())
1390 ::GetMeshValue(EGeometry theGeom) const
1392 return myGeom2Value.GetMeshValue(theGeom);
1397 ::GetMeshValue(EGeometry theGeom)
1399 return myGeom2Value.GetMeshValue(theGeom);
1404 ::GetGeom2MeshValue()
1406 return myGeom2Value.GetGeom2MeshValue();
1409 const TGeom2MeshValue&
1411 ::GetGeom2MeshValue() const
1413 return myGeom2Value.GetGeom2MeshValue();
1418 ::GetFirstMeshValue() const
1420 return myGeom2Value.GetFirstMeshValue();
1425 ::GetNbGauss(EGeometry theGeom) const
1427 TGeom2NbGauss::const_iterator anIter = myGeom2NbGauss.find(theGeom);
1428 if(anIter == myGeom2NbGauss.end()){
1431 return anIter->second;
1438 size_t aSize = sizeof(TValForTimeImpl);
1439 const TGeom2MeshValue& aGeom2MeshValue = GetGeom2MeshValue();
1440 TGeom2MeshValue::const_iterator anIter = aGeom2MeshValue.begin();
1441 TGeom2MeshValue::const_iterator anIterEnd = aGeom2MeshValue.end();
1442 for(; anIter != anIterEnd; anIter++){
1443 const PMeshValue& aMeshValue = anIter->second;
1444 aSize += aMeshValue->GetMemorySize();
1445 aSize += sizeof(EGeometry);
1451 //---------------------------------------------------------------