Salome HOME
Merge from BR_V5_DEV 16Feb09
[modules/visu.git] / src / CONVERTOR / VISU_Structures_impl.cxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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.
10 //
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.
15 //
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
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  File:    
23 //  Author:  Alexey PETROV
24 //  Module : VISU
25 //
26 #include "VISU_Structures_impl.hxx"
27 #include "VISU_PointCoords.hxx"
28 #include "VISU_MeshValue.hxx"
29
30 #include "VISU_AppendFilter.hxx"
31 #include "VISU_AppendPolyData.hxx"
32 #include "VISU_MergeFilter.hxx"
33
34 #include "VISU_ConvertorUtils.hxx"
35 #include "VISU_CommonCellsFilter.hxx"
36
37 #include <vtkUnstructuredGrid.h>
38 #include <vtkPolyData.h>
39 #include <vtkCellType.h>
40 #include <vtkCell.h>
41
42 namespace VISU
43 {
44   /*  vtkIdType
45   VISUGeom2NbNodes(EGeometry theGeom)
46   { 
47     switch(theGeom){
48 #ifndef VISU_ENABLE_QUADRATIC
49     case VISU::eSEG3: 
50       return 2;
51     case VISU::eTRIA6: 
52       return 3;
53     case VISU::eQUAD8: 
54       return 4;
55     case VISU::eTETRA10: 
56       return 4;
57     case VISU::eHEXA20: 
58       return 8;
59     case VISU::ePENTA15: 
60       return 6;
61     case VISU::ePYRA13: 
62       return 5;
63 #endif
64     case VISU::ePOLYGONE: 
65     case VISU::ePOLYEDRE: 
66       return -1;
67     default:
68       return theGeom % 100;
69     }
70   }
71
72   vtkIdType
73   VISUGeom2VTK(EGeometry theGeom)
74   { 
75     switch(theGeom){
76     case VISU::ePOINT1: 
77       return VTK_VERTEX;
78     case VISU::eSEG2: 
79       return VTK_LINE;
80     case VISU::eTRIA3: 
81       return VTK_TRIANGLE;
82     case VISU::eQUAD4: 
83       return VTK_QUAD;
84     case VISU::eTETRA4: 
85       return VTK_TETRA;
86     case VISU::eHEXA8: 
87       return VTK_HEXAHEDRON;
88     case VISU::ePENTA6: 
89       return VTK_WEDGE;
90     case VISU::ePYRA5: 
91       return VTK_PYRAMID;
92
93     case VISU::ePOLYGONE: 
94       return VTK_POLYGON;
95     case VISU::ePOLYEDRE: 
96       return VTK_CONVEX_POINT_SET;
97
98 #ifndef VISU_ENABLE_QUADRATIC
99     case VISU::eSEG3: 
100       return VTK_LINE;
101     case VISU::eTRIA6: 
102       return VTK_TRIANGLE;
103     case VISU::eQUAD8: 
104       return VTK_QUAD;
105     case VISU::eTETRA10: 
106       return VTK_TETRA;
107     case VISU::eHEXA20: 
108       return VTK_HEXAHEDRON;
109     case VISU::ePENTA15: 
110       return VTK_WEDGE;
111     case VISU::ePYRA13: 
112       return VTK_PYRAMID;
113
114 #else
115
116     case VISU::eSEG3: 
117 #if defined(VTK_QUADRATIC_EDGE) && defined(VISU_USE_VTK_QUADRATIC)
118       return VTK_QUADRATIC_EDGE;
119 #else
120       return VTK_POLY_LINE;
121 #endif
122
123     case VISU::eTRIA6: 
124 #if defined(VTK_QUADRATIC_TRIANGLE) && defined(VISU_USE_VTK_QUADRATIC)
125       return VTK_QUADRATIC_TRIANGLE;
126 #else
127       return VTK_POLYGON;
128 #endif
129
130     case VISU::eQUAD8: 
131 #if defined(VTK_QUADRATIC_QUAD) && defined(VISU_USE_VTK_QUADRATIC)
132       return VTK_QUADRATIC_QUAD;
133 #else
134       return VTK_POLYGON;
135 #endif
136
137     case VISU::eTETRA10: 
138 #if defined(VTK_QUADRATIC_TETRA) && defined(VISU_USE_VTK_QUADRATIC)
139       return VTK_QUADRATIC_TETRA;
140 #else
141       return VTK_CONVEX_POINT_SET;
142 #endif
143
144     case VISU::eHEXA20: 
145 #if defined(VTK_QUADRATIC_HEXAHEDRON) && defined(VISU_USE_VTK_QUADRATIC)
146       return VTK_QUADRATIC_HEXAHEDRON;
147 #else
148       return VTK_CONVEX_POINT_SET;
149 #endif
150
151     case VISU::ePENTA15: 
152 #if defined(VTK_QUADRATIC_WEDGE) && defined(VISU_USE_VTK_QUADRATIC)
153       return VTK_QUADRATIC_WEDGE;
154 #else
155       return VTK_CONVEX_POINT_SET;
156 #endif
157
158     case VISU::ePYRA13: 
159 #if defined(VTK_QUADRATIC_PYRAMID) && defined(VISU_USE_VTK_QUADRATIC)
160       return VTK_QUADRATIC_PYRAMID;
161 #else
162       return VTK_CONVEX_POINT_SET;
163 #endif
164
165 #endif //VISU_ENABLE_QUADRATIC
166
167     default:
168       return -1;
169     }
170     }*/
171
172
173   EGeometry
174   VTKGeom2VISU(vtkIdType theGeom)
175   { 
176     switch(theGeom){
177     case VTK_VERTEX: 
178       return VISU::ePOINT1;
179     case VTK_LINE: 
180       return VISU::eSEG2;
181     case VTK_TRIANGLE: 
182       return VISU::eTRIA3;
183     case VTK_QUAD: 
184       return VISU::eQUAD4;
185     case VTK_TETRA: 
186       return VISU::eTETRA4;
187     case VTK_HEXAHEDRON: 
188       return VISU::eHEXA8;
189     case VTK_WEDGE: 
190       return VISU::ePENTA6;
191     case VTK_PYRAMID: 
192       return VISU::ePYRA5;
193
194     case VTK_POLYGON: 
195       return VISU::ePOLYGONE;
196     case VTK_CONVEX_POINT_SET: 
197       return VISU::ePOLYEDRE;
198
199 #if defined(VISU_ENABLE_QUADRATIC) && defined(VISU_USE_VTK_QUADRATIC)
200   #if defined(VTK_QUADRATIC_EDGE)
201     case VTK_QUADRATIC_EDGE: 
202       return VISU::eSEG3;
203   #endif
204
205   #if defined(VTK_QUADRATIC_TRIANGLE)
206     case VTK_QUADRATIC_TRIANGLE: 
207       return VISU::eTRIA6;
208   #endif
209
210   #if defined(VTK_QUADRATIC_QUAD)
211     case VTK_QUADRATIC_QUAD: 
212       return VISU::eQUAD8;
213   #endif
214
215   #if defined(VTK_QUADRATIC_TETRA)
216     case VTK_QUADRATIC_TETRA: 
217       return VISU::eTETRA10;
218   #endif
219
220   #if defined(VTK_QUADRATIC_HEXAHEDRON)
221     case VTK_QUADRATIC_HEXAHEDRON: 
222       return VISU::eHEXA20;
223   #endif
224
225   #if defined(VTK_QUADRATIC_WEDGE)
226     case VTK_QUADRATIC_WEDGE: 
227       return VISU::ePENTA15;
228   #endif
229
230   #if defined(VTK_QUADRATIC_PYRAMID)
231     case VTK_QUADRATIC_PYRAMID: 
232       return VISU::ePYRA13;
233   #endif
234
235 #endif //VISU_ENABLE_QUADRATIC
236
237     default:
238       return EGeometry(-1);
239     }
240   }
241
242   //---------------------------------------------------------------
243   /*! Computes number of points by the given number of cells
244    *  in assumption of regular hexahedral mesh structure
245    */
246   size_t
247   GetNumberOfPoints(size_t theNbCells)
248   {
249     return size_t(pow(pow(theNbCells, 1.0/3.0) + 1.0, 3.0));
250   }
251
252   //---------------------------------------------------------------
253   /*! Computes size dataset the given number of mesh macro metrics
254    *  in assumption of regular hexahedral mesh structure
255    */
256   size_t
257   GetDataSetSize(size_t theNbOfPoints,
258                  size_t theNbOfCells,
259                  size_t theCellsSize,
260                  bool theComputeLinks)
261   {
262     size_t aPointsSize = 3*theNbOfPoints*sizeof(VISU::TCoord);
263     size_t aConnectivityAndTypesSize = theCellsSize*sizeof(vtkIdType);
264     size_t aLocationsSize = theNbOfCells*sizeof(int);
265     vtkFloatingPointType aNbCellsPerPoint = theCellsSize / theNbOfCells - 1;
266     size_t aLinksSize = theNbOfPoints * (vtkIdType(sizeof(vtkIdType)*aNbCellsPerPoint) + sizeof(short));
267     if(!theComputeLinks)
268       aLinksSize = 0;
269     size_t aResult = aPointsSize + aConnectivityAndTypesSize + aLocationsSize + aLinksSize;
270     return aResult;
271   }
272
273   //---------------------------------------------------------------
274   TSizeCounter
275   ::TSizeCounter():
276     myNbCells(0),
277     myCellsSize(0)
278   {}
279
280
281   //---------------------------------------------------------------
282   TPolyDataHolder
283   ::TPolyDataHolder()
284   {}
285
286   const PPolyData& 
287   TPolyDataHolder
288   ::GetSource() const
289   {
290     if(!mySource.GetPointer()){
291       mySource = vtkPolyData::New();
292       mySource->Delete();
293     }
294     return mySource;
295   }
296
297   vtkPolyData* 
298   TPolyDataHolder
299   ::GetPolyDataOutput()
300   {
301     return GetSource().GetPointer();
302   }
303
304   unsigned long int
305   TPolyDataHolder
306   ::GetMemorySize()
307   {
308     if(vtkDataSet* anOutput = GetPolyDataOutput()){
309       anOutput->Update();
310       return anOutput->GetActualMemorySize() * 1024;
311     }
312     if(myIsDone){
313       size_t aNbPoints = GetNumberOfPoints(myNbCells);
314       return GetDataSetSize(aNbPoints, myNbCells, myCellsSize, false);
315     }
316     throw std::runtime_error("TUnstructuredGridHolder::GetMemorySize - myIsDone == false !!!");
317     return 0;
318   }
319
320   //---------------------------------------------------------------
321   TUnstructuredGridHolder
322   ::TUnstructuredGridHolder()
323   {}
324
325   const PUnstructuredGrid& 
326   TUnstructuredGridHolder
327   ::GetSource() const
328   {
329     if(!mySource.GetPointer()){
330       mySource = vtkUnstructuredGrid::New();
331       mySource->Delete();
332     }
333     return mySource;
334   }
335
336   vtkUnstructuredGrid* 
337   TUnstructuredGridHolder
338   ::GetUnstructuredGridOutput()
339   {
340     return GetSource().GetPointer();
341   }
342
343   unsigned long int
344   TUnstructuredGridHolder
345   ::GetMemorySize()
346   {
347     if(vtkDataSet* anOutput = GetUnstructuredGridOutput()){
348       anOutput->Update();
349       return anOutput->GetActualMemorySize() * 1024;
350     }
351     if(myIsDone){
352       size_t aNbPoints = GetNumberOfPoints(myNbCells);
353       return GetDataSetSize(aNbPoints, myNbCells, myCellsSize, false);
354     }
355     throw std::runtime_error("TUnstructuredGridHolder::GetMemorySize - myIsDone == false !!!");
356     return 0;
357   }
358
359   //---------------------------------------------------------------
360   unsigned long int
361   TMemoryCheckIDMapper
362   ::GetMemorySize()
363   {
364     if(myIsVTKDone){
365       if(vtkDataSet* anOutput = GetOutput()){
366         anOutput->Update();
367         return anOutput->GetActualMemorySize() * 1024;
368       }
369     }
370     throw std::runtime_error("TMemoryCheckIDMapper::GetMemorySize - myIsVTKDone == false !!!");
371     return 0;
372   }
373
374
375   //---------------------------------------------------------------
376   TAppendFilterHolder
377   ::TAppendFilterHolder()
378   {}
379
380   const PAppendFilter& 
381   TAppendFilterHolder
382   ::GetFilter() const
383   {
384     if(!myFilter.GetPointer()){
385       myFilter = VISU_AppendFilter::New();
386       myFilter->Delete();
387       myFilter->SetMappingInputs(true);
388     }
389     return myFilter;
390   }
391
392   vtkUnstructuredGrid* 
393   TAppendFilterHolder
394   ::GetUnstructuredGridOutput()
395   {
396     GetFilter()->Update();
397     return GetFilter()->GetOutput();
398   }
399
400   //---------------------------------------------------------------
401   TAppendPolyDataHolder
402   ::TAppendPolyDataHolder()
403   {}
404
405   const PAppendPolyData& 
406   TAppendPolyDataHolder
407   ::GetFilter() const
408   {
409     if(!myFilter.GetPointer()){
410       myFilter = VISU_AppendPolyData::New();
411       myFilter->SetMappingInputs(true);
412       myFilter->Delete();
413     }
414     return myFilter;
415   }
416
417   vtkPolyData* 
418   TAppendPolyDataHolder
419   ::GetPolyDataOutput()
420   {
421     GetFilter()->Update();
422     return GetFilter()->GetOutput();
423   }
424
425
426   //---------------------------------------------------------------
427   TMergeFilterHolder
428   ::TMergeFilterHolder()
429   {}
430
431   const PMergeFilter& 
432   TMergeFilterHolder
433   ::GetFilter() const
434   {
435     if(!myFilter.GetPointer()){
436       myFilter = VISU_MergeFilter::New();
437       myFilter->Delete();
438     }
439     return myFilter;
440   }
441
442   vtkDataSet* 
443   TMergeFilterHolder
444   ::GetOutput()
445   {
446     GetFilter()->Update();
447     return GetFilter()->GetOutput();
448   }
449
450
451   //---------------------------------------------------------------
452   TMeshImpl
453   ::TMeshImpl(): 
454     myNbPoints(0)
455   {}
456
457   vtkIdType
458   TMeshImpl::
459   GetNbPoints() const
460   {
461     return myNbPoints;
462   }
463   
464   vtkIdType
465   TMeshImpl::
466   GetDim() const
467   {
468     return myDim;
469   }
470   
471   vtkPointSet*
472   TMeshImpl::
473   GetPointSet()
474   {
475     return myNamedPointCoords->GetPointSet();
476   }
477
478
479   //---------------------------------------------------------------
480   TSubProfileImpl::TSubProfileImpl():
481     myStatus(eNone),
482     myGeom(eNONE)
483   {}
484
485
486   vtkIdType
487   TSubProfileImpl
488   ::GetElemObjID(vtkIdType theID) const
489   {
490     if ( !mySubMeshID.empty() )
491       return mySubMeshID[theID];
492     
493     return theID;
494   }
495
496
497   vtkIdType
498   TSubProfileImpl
499   ::GetElemVTKID(vtkIdType theID) const
500   {
501     if ( !mySubMeshID.empty() )
502       for ( size_t anId = 0; anId < mySubMeshID.size(); anId++ ) 
503         if ( mySubMeshID[ anId ] == theID ) 
504           return anId;
505
506     return theID;
507   }
508
509   unsigned long int
510   TSubProfileImpl
511   ::GetMemorySize()
512   {
513     size_t aSize = TUnstructuredGridHolder::GetMemorySize();
514     aSize += sizeof(vtkIdType) * mySubMeshID.size();
515     return aSize;
516   }
517
518
519   //---------------------------------------------------------------
520   bool
521   operator<(const PSubProfile& theLeft, const PSubProfile& theRight)
522   {
523     PSubProfileImpl aLeft(theLeft), aRight(theRight);
524
525     if(aLeft->myGeom != aRight->myGeom)
526       return aLeft->myGeom < aRight->myGeom;
527
528     if(aLeft->myStatus != aRight->myStatus)
529       return aLeft->myStatus < aRight->myStatus;
530
531     return aLeft->myName < aRight->myName;
532   }
533
534
535   //---------------------------------------------------------------
536   TProfileImpl
537   ::TProfileImpl():
538     myIsAll(true),
539     myMeshOnEntity(NULL)
540   {}
541
542   vtkIdType
543   TProfileImpl
544   ::GetNodeObjID(vtkIdType theID) const
545   {
546     return myNamedPointCoords->GetObjID(theID);
547   }
548   
549   vtkIdType
550   TProfileImpl
551   ::GetNodeVTKID(vtkIdType theID) const
552   {
553     return myNamedPointCoords->GetVTKID(theID);
554   }
555
556   vtkFloatingPointType*  
557   TProfileImpl
558   ::GetNodeCoord(vtkIdType theObjID)
559   {
560     if(myIsAll)
561       return myMeshOnEntity->GetNodeCoord(theObjID);
562
563     vtkIdType aVtkID = GetNodeVTKID(theObjID);
564     return GetFilter()->GetOutput()->GetPoint(aVtkID);
565   }
566
567   vtkIdType
568   TProfileImpl
569   ::GetElemObjID(vtkIdType theID) const
570   {
571     return VISU::GetElemObjID(GetFilter()->GetOutput(), theID);
572   }
573
574   vtkIdType
575   TProfileImpl
576   ::GetElemVTKID(vtkIdType theID) const
577   {
578     return VISU::GetElemVTKID(GetFilter()->GetOutput(), theID);
579   }
580
581   vtkCell* 
582   TProfileImpl
583   ::GetElemCell(vtkIdType theObjID)
584   {
585     if(myIsAll)
586       return myMeshOnEntity->GetElemCell(theObjID);
587
588     vtkIdType aVtkID = GetElemVTKID(theObjID);
589     return GetFilter()->GetOutput()->GetCell(aVtkID);
590   }
591   
592   vtkUnstructuredGrid* 
593   TProfileImpl
594   ::GetUnstructuredGridOutput()
595   {
596     const PAppendFilter& anAppendFilter = GetFilter();
597     return anAppendFilter->GetOutput();
598   }
599
600   unsigned long int
601   TProfileImpl
602   ::GetMemorySize()
603   {
604     size_t aSize = TAppendFilterHolder::GetMemorySize();
605     aSize += myNamedPointCoords->GetMemorySize();
606     aSize += myElemObj2VTKID.size() * 2 * sizeof(vtkIdType);
607     TGeom2SubProfile::const_iterator anIter = myGeom2SubProfile.begin();
608     TGeom2SubProfile::const_iterator anIterEnd = myGeom2SubProfile.end();
609     for(; anIter != anIterEnd; anIter++){
610       const PSubProfileImpl& aSubProfile = anIter->second;
611       aSize += aSubProfile->GetMemorySize();
612       aSize += sizeof(EGeometry);
613     }
614     return aSize;
615   }
616
617   std::string 
618   TProfileImpl
619   ::GetNodeName(vtkIdType theObjID) const
620   {
621     return myNamedPointCoords->GetNodeName(theObjID);
622   }
623
624   std::string 
625   TProfileImpl
626   ::GetElemName(vtkIdType theObjID) const
627   {
628     return myMeshOnEntity->GetElemName(theObjID);
629   }
630
631
632   //---------------------------------------------------------------
633   TUnstructuredGridIDMapperImpl
634   ::TUnstructuredGridIDMapperImpl()
635   {
636     if ( !myCommonCellsFilter.GetPointer() ) {
637       myCommonCellsFilter = VISU_CommonCellsFilter::New();
638       myCommonCellsFilter->Delete();
639     }
640   }
641
642   vtkIdType
643   TUnstructuredGridIDMapperImpl
644   ::GetNodeObjID(vtkIdType theID) const
645   {
646     return myIDMapper->GetNodeObjID(theID);
647   }
648   
649   vtkIdType
650   TUnstructuredGridIDMapperImpl
651   ::GetNodeVTKID(vtkIdType theID) const
652   {
653     return myIDMapper->GetNodeVTKID(theID);
654   }
655
656   vtkFloatingPointType*  
657   TUnstructuredGridIDMapperImpl
658   ::GetNodeCoord(vtkIdType theObjID)
659   {
660     return myIDMapper->GetNodeCoord(theObjID);
661   }
662
663   vtkIdType
664   TUnstructuredGridIDMapperImpl
665   ::GetElemObjID(vtkIdType theID) const
666   {
667     return myIDMapper->GetElemObjID(theID);
668   }
669
670   vtkIdType
671   TUnstructuredGridIDMapperImpl
672   ::GetElemVTKID(vtkIdType theID) const
673   {
674     return myIDMapper->GetElemVTKID(theID);
675   }
676
677   vtkCell* 
678   TUnstructuredGridIDMapperImpl
679   ::GetElemCell(vtkIdType theObjID)
680   {
681     return myIDMapper->GetElemCell(theObjID);
682   }
683   
684   void 
685   TUnstructuredGridIDMapperImpl
686   ::SetReferencedMesh( const PNamedIDMapper& theNamedIDMapper )
687   {
688     myCommonCellsFilter->SetCellsUG( theNamedIDMapper->GetUnstructuredGridOutput() );
689   }
690
691   void 
692   TUnstructuredGridIDMapperImpl
693   ::Build()
694   {
695     if ( !myFilter.GetPointer() ) {
696       const PAppendFilter& anAppendFilter = myIDMapper->GetFilter();
697
698       vtkUnstructuredGrid* aGeometry = anAppendFilter->GetOutput();
699       const PUnstructuredGrid& aSource = mySource.GetSource();
700       vtkUnstructuredGrid* aDataSet = aSource.GetPointer();
701       aDataSet->ShallowCopy( aGeometry );
702
703       const PMergeFilter& aFilter = GetFilter();
704       aFilter->SetGeometry( aGeometry );
705       aFilter->SetScalars( aDataSet );
706       aFilter->SetVectors( aDataSet );
707       aFilter->AddField( "VISU_FIELD", aDataSet );
708       aFilter->AddField( "VISU_CELLS_MAPPER", aDataSet );
709       aFilter->AddField( "ELNO_FIELD", aDataSet );
710       aFilter->AddField( "ELNO_COMPONENT_MAPPER", aDataSet );
711       aFilter->AddField( "VISU_POINTS_MAPPER", aDataSet );
712                                                       
713       myCommonCellsFilter->SetProfileUG( aFilter->GetUnstructuredGridOutput() );
714     } 
715   }
716
717   vtkUnstructuredGrid* 
718   TUnstructuredGridIDMapperImpl
719   ::GetUnstructuredGridOutput()
720   {
721     Build();
722     return myCommonCellsFilter->GetOutput();
723   }
724
725   vtkDataSet* 
726   TUnstructuredGridIDMapperImpl
727   ::GetOutput()
728   {
729     return GetUnstructuredGridOutput();
730   }
731
732   PUnstructuredGrid 
733   TUnstructuredGridIDMapperImpl
734   ::GetSource()
735   {
736     Build();
737     return mySource.GetSource();
738   }
739
740   unsigned long int
741   TUnstructuredGridIDMapperImpl
742   ::GetMemorySize()
743   {
744     size_t aSize = myIDMapper->GetMemorySize();
745
746     aSize += mySource.GetMemorySize();
747
748     if ( vtkUnstructuredGrid* anOutput = myCommonCellsFilter->GetOutput() )
749       aSize += anOutput->GetActualMemorySize() * 1024;
750
751     return aSize;
752   }
753
754   //---------------------------------------------------------------
755   vtkIdType
756   TPolyDataIDMapperImpl
757   ::GetNodeObjID(vtkIdType theID) const
758   {
759     return myIDMapper->GetNodeObjID(theID);
760   }
761   
762   vtkIdType
763   TPolyDataIDMapperImpl
764   ::GetNodeVTKID(vtkIdType theID) const
765   {
766     return myIDMapper->GetNodeVTKID(theID);
767   }
768
769   vtkFloatingPointType*  
770   TPolyDataIDMapperImpl
771   ::GetNodeCoord(vtkIdType theObjID)
772   {
773     return myIDMapper->GetNodeCoord(theObjID);
774   }
775
776   vtkIdType
777   TPolyDataIDMapperImpl
778   ::GetElemObjID(vtkIdType theID) const
779   {
780     return myIDMapper->GetElemObjID(theID);
781   }
782
783   vtkIdType
784   TPolyDataIDMapperImpl
785   ::GetElemVTKID(vtkIdType theID) const
786   {
787     return myIDMapper->GetElemVTKID(theID);
788   }
789
790   vtkCell* 
791   TPolyDataIDMapperImpl
792   ::GetElemCell(vtkIdType theObjID)
793   {
794     return myIDMapper->GetElemCell(theObjID);
795   }
796   
797   void 
798   TPolyDataIDMapperImpl
799   ::Build()
800   {
801     if ( !myFilter.GetPointer() ) {
802       const PAppendPolyData& anAppendFilter = myIDMapper->GetFilter();
803       vtkPolyData* aGeometry = anAppendFilter->GetOutput();
804       
805       const PPolyData& aSource = mySource.GetSource();
806       vtkPolyData* aDataSet = aSource.GetPointer();
807       aDataSet->ShallowCopy( aGeometry );
808       
809       const PMergeFilter& aFilter = GetFilter();
810       aFilter->SetGeometry( aGeometry );
811       aFilter->SetScalars( aDataSet );
812       aFilter->SetVectors( aDataSet );
813       aFilter->AddField( "VISU_FIELD", aDataSet );
814       aFilter->AddField( "VISU_CELLS_MAPPER", aDataSet );
815       aFilter->AddField( "VISU_POINTS_MAPPER", aDataSet );
816     }
817   }
818
819   vtkPolyData* 
820   TPolyDataIDMapperImpl
821   ::GetPolyDataOutput()
822   {
823     Build();
824     return myFilter->GetPolyDataOutput();
825   }
826
827   vtkDataSet* 
828   TPolyDataIDMapperImpl
829   ::GetOutput()
830   {
831     return GetPolyDataOutput();
832   }
833
834   PPolyData 
835   TPolyDataIDMapperImpl
836   ::GetSource()
837   {
838     Build();
839     return mySource.GetSource();
840   }
841
842   unsigned long int
843   TPolyDataIDMapperImpl
844   ::GetMemorySize()
845   {
846     size_t aSize = myIDMapper->GetMemorySize();
847     aSize += mySource.GetMemorySize();
848     return aSize;
849   }
850
851
852   //---------------------------------------------------------------
853   TGaussImpl
854   ::TGaussImpl():
855     myGeom(EGeometry(-1)),
856     myNbPoints(0)
857   {}
858   
859   void
860   TGaussImpl
861   ::LessThan(const PGaussImpl& theGauss,
862              bool& theResult) const
863   {
864     theResult = false;
865   }
866
867
868   //---------------------------------------------------------------
869   TGaussSubMeshImpl
870   ::TGaussSubMeshImpl():
871     myPointCoords(new TPointCoords()),
872     myStatus(eNone),
873     myStartID(0)
874   {}
875   
876   TGaussPointID
877   TGaussSubMeshImpl
878   ::GetObjID(vtkIdType theID) const
879   {
880     TCellID aCellID = myStartID + theID / myGauss->myNbPoints;
881     TLocalPntID aLocalPntID = theID % myGauss->myNbPoints;
882     
883     return TGaussPointID(aCellID, aLocalPntID);
884   }
885
886   vtkIdType
887   TGaussSubMeshImpl
888   ::GetVTKID(const TGaussPointID& theID) const
889   {
890     vtkIdType aResult = -1;
891
892     TCellID aCellID = theID.first;
893     TLocalPntID aLocalPntID = theID.second;
894     
895     vtkIdType aNbPoints = myGauss->myNbPoints;
896     if ( aLocalPntID >= aNbPoints )
897       return aResult;
898
899     return ( aCellID - myStartID ) * aNbPoints + aLocalPntID;
900   }
901
902   vtkIdType
903   VISU::TGaussSubMeshImpl
904   ::GetElemObjID(vtkIdType theID) const
905   {
906     return mySubProfile->GetElemObjID( theID );
907   }
908   
909   
910   vtkIdType
911   VISU::TGaussSubMeshImpl
912   ::GetElemVTKID(vtkIdType theID) const
913   {
914     return mySubProfile->GetElemVTKID( theID );
915   }
916
917   vtkIdType 
918   TGaussSubMeshImpl
919   ::GetGlobalID(vtkIdType theID) const
920   {
921     return myStartID + theID;
922   }
923
924   unsigned long int
925   TGaussSubMeshImpl
926   ::GetMemorySize()
927   {
928     size_t aSize = TPolyDataHolder::GetMemorySize();
929     aSize += myPointCoords->GetMemorySize();
930     return aSize;
931   }
932
933   //---------------------------------------------------------------
934   bool
935   operator<(const PGaussSubMesh& theLeft, const PGaussSubMesh& theRight)
936   {
937     PGaussSubMeshImpl aLeft(theLeft), aRight(theRight);
938     const PGaussImpl& aGaussLeft = aLeft->myGauss;
939     const PGaussImpl& aGaussRight = aRight->myGauss;
940     
941     if(aGaussLeft->myGeom != aGaussRight->myGeom)
942       return aGaussLeft->myGeom < aGaussRight->myGeom;
943
944     if(aLeft->mySubProfile != aRight->mySubProfile)
945       return aLeft->mySubProfile < aRight->mySubProfile;
946
947     bool aResult;
948     aGaussLeft->LessThan(aGaussRight,aResult);
949
950     return aResult;
951   }
952
953
954   //---------------------------------------------------------------
955   TGaussMeshImpl
956   ::TGaussMeshImpl():
957     myParent(NULL)
958   {}
959
960   TGaussPointID 
961   TGaussMeshImpl
962   ::GetObjID(vtkIdType theID) const
963   {
964     const PAppendPolyData& aFilter = GetFilter();
965     return VISU::GetObjID(aFilter->GetOutput(), theID);
966   }
967
968   vtkIdType 
969   TGaussMeshImpl
970   ::GetVTKID(const TGaussPointID& theID) const
971   {
972     vtkIdType aResult = -1;
973
974     TCellID aCellID = theID.first;
975
976     vtkIdType aVTKCellId = GetParent()->GetElemVTKID( aCellID );
977     if ( aVTKCellId < 0 ) 
978       return aResult;
979       
980     vtkCell* aCell = GetParent()->GetElemCell( aCellID );
981     if ( !aCell )
982       return aResult;
983
984     EGeometry aVGeom = VISU::VTKGeom2VISU( aCell->GetCellType() );
985     if ( aVGeom < EGeometry(0) ) 
986       return aResult;
987     
988     TGeom2GaussSubMesh::const_iterator anIter = myGeom2GaussSubMesh.find( aVGeom );
989     if ( anIter == myGeom2GaussSubMesh.end() )
990       return aResult;
991       
992     size_t aSubMeshEnd = myGaussSubMeshArr.size();
993     const PGaussSubMeshImpl& aGaussSubMesh = anIter->second;
994     for ( size_t aSubMeshId = 0; aSubMeshId < aSubMeshEnd; aSubMeshId++ ) {
995       const PGaussSubMeshImpl& aSubMesh = myGaussSubMeshArr[aSubMeshId];
996       if ( aGaussSubMesh.get() == aSubMesh.get() ) {
997         return aGaussSubMesh->GetVTKID(theID);
998       }
999     }
1000
1001     return aResult;
1002   }
1003
1004   vtkPolyData* 
1005   TGaussMeshImpl
1006   ::GetPolyDataOutput()
1007   {
1008     return TAppendPolyDataHolder::GetPolyDataOutput();
1009   }
1010
1011   unsigned long int
1012   TGaussMeshImpl
1013   ::GetMemorySize()
1014   {
1015     size_t aSize = TAppendPolyDataHolder::GetMemorySize();
1016     TGeom2GaussSubMesh::const_iterator anIter = myGeom2GaussSubMesh.begin();
1017     TGeom2GaussSubMesh::const_iterator anIterEnd = myGeom2GaussSubMesh.end();
1018     for(; anIter != anIterEnd; anIter++){
1019       const PGaussSubMeshImpl& aGaussSubMesh = anIter->second;
1020       aSize += aGaussSubMesh->GetMemorySize();
1021       aSize += sizeof(EGeometry);
1022     }
1023     return aSize;
1024   }
1025
1026   TNamedIDMapper* 
1027   TGaussMeshImpl
1028   ::GetParent() const
1029   {
1030     return myParent;
1031   }
1032
1033
1034   //---------------------------------------------------------------
1035   TGaussPointID 
1036   TGaussPtsIDFilter
1037   ::GetObjID(vtkIdType theID) const
1038   {
1039     return myGaussPtsIDMapper->GetObjID(theID);
1040   }
1041
1042   vtkIdType 
1043   TGaussPtsIDFilter
1044   ::GetVTKID(const TGaussPointID& theID) const
1045   {
1046     return myGaussPtsIDMapper->GetVTKID(theID);
1047   }
1048   
1049   TNamedIDMapper* 
1050   TGaussPtsIDFilter
1051   ::GetParent() const
1052   {
1053     return myGaussPtsIDMapper->GetParent();
1054   }
1055
1056   vtkPolyData* 
1057   TGaussPtsIDFilter
1058   ::GetPolyDataOutput()
1059   {
1060     return TPolyDataIDMapperImpl::GetPolyDataOutput();
1061   }
1062
1063   vtkDataSet* 
1064   TGaussPtsIDFilter
1065   ::GetOutput()
1066   {
1067     return GetPolyDataOutput();
1068   }
1069
1070
1071   //---------------------------------------------------------------
1072   TSubMeshImpl
1073   ::TSubMeshImpl():
1074     myStartID(0)
1075   {}
1076
1077   void
1078   TSubMeshImpl
1079   ::CopyStructure( PStructured theStructured )
1080   {
1081     TStructured::CopyStructure( theStructured );
1082
1083     if ( PMeshImpl aMesh = theStructured ) 
1084       GetSource()->ShallowCopy( aMesh->GetPointSet() );    
1085   }
1086
1087   vtkIdType
1088   TSubMeshImpl
1089   ::GetElemObjID(vtkIdType theID) const
1090   {
1091     return myStartID + theID;
1092   }
1093
1094   std::string 
1095   TSubMeshImpl
1096   ::GetElemName(vtkIdType theObjID) const
1097   {
1098     return "";
1099   }
1100
1101   unsigned long int
1102   TSubMeshImpl
1103   ::GetMemorySize()
1104   {
1105     size_t aSize = TUnstructuredGridHolder::GetMemorySize();
1106     for(size_t anId = 0; anId < myCell2Connect.size(); anId++){
1107       const TConnect& aConnect = myCell2Connect[anId];
1108       aSize += aConnect.size() * sizeof(vtkIdType);
1109     }
1110     return aSize;
1111   }
1112
1113   //---------------------------------------------------------------
1114   TMeshOnEntityImpl
1115   ::TMeshOnEntityImpl()
1116   {
1117     const PAppendFilter& anAppendFilter = GetFilter();
1118     anAppendFilter->SetMappingInputs(true);
1119   }
1120
1121   void
1122   TMeshOnEntityImpl
1123   ::CopyStructure( PStructured theStructured )
1124   {
1125     TStructured::CopyStructure( theStructured );
1126
1127     if ( PMeshImpl aMesh = theStructured ) 
1128       myNamedPointCoords = aMesh->myNamedPointCoords;    
1129   }
1130
1131   vtkIdType
1132   TMeshOnEntityImpl
1133   ::GetNodeVTKID(vtkIdType theID) const
1134   {
1135     return myNamedPointCoords->GetVTKID(theID);
1136   }
1137
1138   vtkIdType
1139   TMeshOnEntityImpl
1140   ::GetNodeObjID(vtkIdType theID) const
1141   {
1142     return myNamedPointCoords->GetObjID(theID);
1143   }
1144
1145   vtkIdType
1146   TMeshOnEntityImpl
1147   ::GetElemVTKID(vtkIdType theID) const
1148   {
1149     return VISU::GetElemVTKID(GetFilter()->GetOutput(), theID);
1150   }
1151
1152   vtkIdType
1153   TMeshOnEntityImpl
1154   ::GetElemObjID(vtkIdType theID) const
1155   {
1156     return VISU::GetElemObjID(GetFilter()->GetOutput(), theID);
1157   }
1158
1159   std::string 
1160   TMeshOnEntityImpl
1161   ::GetNodeName(vtkIdType theObjID) const
1162   {
1163     return myNamedPointCoords->GetNodeName(theObjID);
1164   }
1165
1166   std::string 
1167   TMeshOnEntityImpl
1168   ::GetElemName(vtkIdType theObjID) const
1169   {
1170     TInputCellID anInputCellID = VISU::GetInputCellID(GetFilter()->GetOutput(), theObjID);
1171     const PSubMeshImpl& aSubMesh = mySubMeshArr[anInputCellID.first];
1172     return aSubMesh->GetElemName(anInputCellID.second);
1173   }
1174
1175   vtkUnstructuredGrid* 
1176   TMeshOnEntityImpl
1177   ::GetUnstructuredGridOutput()
1178   {
1179     return TAppendFilterHolder::GetUnstructuredGridOutput();
1180   }
1181
1182   unsigned long int
1183   TMeshOnEntityImpl
1184   ::GetMemorySize()
1185   {
1186     size_t aSize = TAppendFilterHolder::GetMemorySize();
1187     aSize += myNamedPointCoords->GetMemorySize();
1188     aSize += myElemObj2VTKID.size() * 2 * sizeof(vtkIdType);
1189     TGeom2SubMesh::const_iterator anIter = myGeom2SubMesh.begin();
1190     TGeom2SubMesh::const_iterator anIterEnd = myGeom2SubMesh.end();
1191     for(; anIter != anIterEnd; anIter++){
1192       const PSubMeshImpl& aSubMesh = anIter->second;
1193       aSize += aSubMesh->GetMemorySize();
1194       aSize += sizeof(EGeometry);
1195     }
1196     return aSize;
1197   }
1198
1199   //---------------------------------------------------------------
1200   void
1201   TFamilyImpl
1202   ::CopyStructure( PStructured theStructured )
1203   {
1204     TStructured::CopyStructure( theStructured );
1205
1206     if ( PMeshImpl aMesh = theStructured ) {
1207       myNamedPointCoords = aMesh->myNamedPointCoords;
1208       GetSource()->ShallowCopy( aMesh->GetPointSet() );
1209     }
1210   }
1211
1212   vtkIdType
1213   TFamilyImpl
1214   ::GetElemVTKID(vtkIdType theID) const
1215   {
1216     if(myElemObj2VTKID.empty())
1217       return theID;
1218     else{
1219       TID2ID::const_iterator anIter = myElemObj2VTKID.find(theID);
1220       if(anIter != myElemObj2VTKID.end())
1221         return anIter->second;
1222     }
1223     return -1;
1224   }
1225
1226   vtkIdType
1227   TFamilyImpl
1228   ::GetElemObjID(vtkIdType theID) const
1229   {
1230     return myMeshID[theID];
1231   }
1232
1233   vtkIdType 
1234   TFamilyImpl
1235   ::GetNodeObjID(vtkIdType theID) const 
1236   {
1237     return myNamedPointCoords->GetObjID(theID);
1238   }
1239
1240   vtkIdType
1241   TFamilyImpl
1242   ::GetNodeVTKID(vtkIdType theID) const 
1243   {
1244     return myNamedPointCoords->GetVTKID(theID);
1245   }
1246
1247   vtkUnstructuredGrid* 
1248   TFamilyImpl
1249   ::GetUnstructuredGridOutput()
1250   {
1251     return TUnstructuredGridHolder::GetUnstructuredGridOutput();
1252   }
1253
1254   unsigned long int
1255   TFamilyImpl
1256   ::GetMemorySize()
1257   {
1258     size_t aSize = TUnstructuredGridHolder::GetMemorySize();
1259     aSize += myNamedPointCoords->GetMemorySize();
1260     aSize += myElemObj2VTKID.size() * 2 * sizeof(vtkIdType);
1261     aSize += myMeshID.size() * sizeof(vtkIdType);
1262     TGeom2SubMeshID::const_iterator anIter = myGeom2SubMeshID.begin();
1263     TGeom2SubMeshID::const_iterator anIterEnd = myGeom2SubMeshID.end();
1264     for(; anIter != anIterEnd; anIter++){
1265       const TSubMeshID& aSubMeshID = anIter->second;
1266       aSize += aSubMeshID.size() * sizeof(vtkIdType);
1267       aSize += sizeof(EGeometry);
1268     }
1269     return aSize;
1270   }
1271
1272
1273   //---------------------------------------------------------------
1274   void
1275   TGroupImpl
1276   ::CopyStructure( PStructured theStructured )
1277   {
1278     TStructured::CopyStructure( theStructured );
1279
1280     if ( PMeshImpl aMesh = theStructured ) 
1281       myNamedPointCoords = aMesh->myNamedPointCoords;
1282   }
1283
1284   TNbASizeCells 
1285   TGroupImpl
1286   ::GetNbASizeCells() const
1287   {
1288     vtkIdType aNbCells = 0, aCellsSize = 0;
1289     TFamilySet::const_iterator anIter = myFamilySet.begin();
1290     for(; anIter != myFamilySet.end(); anIter++){
1291       PFamilyImpl aFamily = *anIter; 
1292       aNbCells += aFamily->myNbCells;
1293       aCellsSize += aFamily->myCellsSize;
1294     }
1295     return std::make_pair(aNbCells,aCellsSize);
1296   }
1297
1298   vtkIdType
1299   TGroupImpl
1300   ::GetElemVTKID(vtkIdType theID) const
1301   {
1302     if(myElemObj2VTKID.empty())
1303       return theID;
1304     else{
1305       TID2ID::const_iterator anIter = myElemObj2VTKID.find(theID);
1306       if(anIter != myElemObj2VTKID.end())
1307         return anIter->second;
1308     }
1309     return -1;
1310   }
1311
1312   vtkIdType
1313   TGroupImpl
1314   ::GetElemObjID(vtkIdType theID) const
1315   {
1316     return VISU::GetElemObjID(GetFilter()->GetOutput(), theID);
1317   }
1318
1319   vtkIdType 
1320   TGroupImpl
1321   ::GetNodeObjID(vtkIdType theID) const 
1322   {
1323     return myNamedPointCoords->GetObjID(theID);
1324   }
1325
1326   vtkIdType
1327   TGroupImpl
1328   ::GetNodeVTKID(vtkIdType theID) const 
1329   {
1330     return myNamedPointCoords->GetVTKID(theID);
1331   }
1332
1333   vtkUnstructuredGrid* 
1334   TGroupImpl
1335   ::GetUnstructuredGridOutput()
1336   {
1337     return TAppendFilterHolder::GetUnstructuredGridOutput();
1338   }
1339
1340   unsigned long int
1341   TGroupImpl
1342   ::GetMemorySize()
1343   {
1344     size_t aSize = TAppendFilterHolder::GetMemorySize();
1345     aSize += myNamedPointCoords->GetMemorySize();
1346     aSize += myElemObj2VTKID.size() * 2 * sizeof(vtkIdType);
1347     for(size_t anId = 0; anId < myFamilyArr.size(); anId++){
1348       const PFamilyImpl& aFamily = myFamilyArr[anId];
1349       aSize += aFamily->GetMemorySize();
1350     }
1351     return aSize;
1352   }
1353
1354
1355   
1356   //---------------------------------------------------------------
1357   TFieldImpl
1358   ::TFieldImpl()
1359     : myDataSize( 0 )
1360     , myDataType( 0 )
1361   {}
1362
1363   void 
1364   TFieldImpl
1365   ::Init(vtkIdType theNbComp,
1366          vtkIdType theDataType)
1367   {
1368     myNbComp = theNbComp;
1369     myDataType = theDataType;
1370     myCompNames.resize(theNbComp);
1371     myUnitNames.resize(theNbComp);
1372     myMinMaxArr.resize(theNbComp + 1);
1373     myAverageMinMaxArr.resize(theNbComp + 1);
1374     for(vtkIdType iComp = 0; iComp <= theNbComp; iComp++){
1375       TMinMax& aMinMax = myMinMaxArr[iComp];
1376       aMinMax.first = VTK_LARGE_FLOAT;
1377       aMinMax.second = -VTK_LARGE_FLOAT;
1378       TMinMax& anAverageMinMax = myAverageMinMaxArr[iComp];
1379       anAverageMinMax.first = VTK_LARGE_FLOAT;
1380       anAverageMinMax.second = -VTK_LARGE_FLOAT;
1381     }
1382   }
1383
1384   vtkIdType 
1385   TFieldImpl
1386   ::GetDataType() const
1387   {
1388     return myDataType;
1389   }
1390
1391   TMinMax 
1392   TFieldImpl
1393   ::GetMinMax(vtkIdType theCompID)
1394   {
1395     return myMinMaxArr[theCompID];
1396   }
1397
1398
1399   TMinMax 
1400   TFieldImpl
1401   ::GetAverageMinMax(vtkIdType theCompID)
1402   {
1403     return myAverageMinMaxArr[theCompID];
1404   }
1405   
1406   //----------------------------------------------------------------------------
1407   const PMeshValue& 
1408   TGeom2Value
1409   ::GetMeshValue(EGeometry theGeom) const
1410   {
1411     TGeom2MeshValue::const_iterator anIter = myGeom2MeshValue.find(theGeom);
1412     if(anIter == myGeom2MeshValue.end())
1413       EXCEPTION(std::runtime_error,"TGeom2Value::GetMeshValue - myGeom2MeshValue.find(theGeom) fails");
1414     return anIter->second;
1415   }
1416   
1417   PMeshValue& 
1418   TGeom2Value
1419   ::GetMeshValue(EGeometry theGeom)
1420   {
1421     return myGeom2MeshValue[theGeom];
1422   }
1423
1424
1425   //----------------------------------------------------------------------------
1426   TGeom2MeshValue& 
1427   TGeom2Value
1428   ::GetGeom2MeshValue()
1429   {
1430     return myGeom2MeshValue;
1431   }
1432     
1433   const TGeom2MeshValue& 
1434   TGeom2Value
1435   ::GetGeom2MeshValue() const
1436   {
1437     return myGeom2MeshValue;
1438   }
1439
1440   PMeshValue 
1441   TGeom2Value
1442   ::GetFirstMeshValue() const
1443   {
1444     if(myGeom2MeshValue.size() == 1)
1445       return myGeom2MeshValue.begin()->second;
1446     return PMeshValue();
1447   }
1448
1449
1450   //---------------------------------------------------------------
1451   TValForTimeImpl
1452   ::TValForTimeImpl():
1453     myGaussPtsIDFilter(new TGaussPtsIDFilter()),
1454     myUnstructuredGridIDMapper(new TUnstructuredGridIDMapperImpl())
1455   {}
1456
1457   const PMeshValue& 
1458   TValForTimeImpl
1459   ::GetMeshValue(EGeometry theGeom) const
1460   {
1461     return myGeom2Value.GetMeshValue(theGeom);
1462   }
1463   
1464   PMeshValue& 
1465   TValForTimeImpl
1466   ::GetMeshValue(EGeometry theGeom)
1467   {
1468     return myGeom2Value.GetMeshValue(theGeom);
1469   }
1470
1471   TGeom2MeshValue& 
1472   TValForTimeImpl
1473   ::GetGeom2MeshValue()
1474   {
1475     return myGeom2Value.GetGeom2MeshValue();
1476   }
1477
1478   const TGeom2MeshValue& 
1479   TValForTimeImpl
1480   ::GetGeom2MeshValue() const
1481   {
1482     return myGeom2Value.GetGeom2MeshValue();
1483   }
1484
1485   PMeshValue 
1486   TValForTimeImpl
1487   ::GetFirstMeshValue() const
1488   {
1489     return myGeom2Value.GetFirstMeshValue();
1490   }
1491
1492   int
1493   TValForTimeImpl
1494   ::GetNbGauss(EGeometry theGeom) const
1495   {
1496     TGeom2NbGauss::const_iterator anIter = myGeom2NbGauss.find(theGeom);
1497     if(anIter == myGeom2NbGauss.end()){
1498       return 1;
1499     }
1500     return anIter->second;
1501   }
1502   
1503   unsigned long int
1504   TValForTimeImpl
1505   ::GetMemorySize()
1506   {
1507     size_t aSize = sizeof(TValForTimeImpl);
1508     const TGeom2MeshValue& aGeom2MeshValue = GetGeom2MeshValue();
1509     TGeom2MeshValue::const_iterator anIter = aGeom2MeshValue.begin();
1510     TGeom2MeshValue::const_iterator anIterEnd = aGeom2MeshValue.end();
1511     for(; anIter != anIterEnd; anIter++){
1512       const PMeshValue& aMeshValue = anIter->second;
1513       aSize += aMeshValue->GetMemorySize();
1514       aSize += sizeof(EGeometry);
1515     }
1516     return aSize;
1517   }
1518
1519
1520   //---------------------------------------------------------------
1521 }