]> SALOME platform Git repositories - modules/visu.git/blob - src/CONVERTOR/VISU_Structures_impl.hxx
Salome HOME
Compatibility CMake
[modules/visu.git] / src / CONVERTOR / VISU_Structures_impl.hxx
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 #ifndef VISU_Structures_impl_HeaderFile
27 #define VISU_Structures_impl_HeaderFile
28
29 /*! 
30   \file VISU_Structures_impl.hxx
31   \brief The file contains definitions for basic classes of the implementation of VISU CONVERTER package
32 */
33
34 #include "VISUConvertor.hxx"
35 #include "VISU_Structures.hxx"
36 #include "VISU_ConvertorDef_impl.hxx"
37
38 class vtkPointSet;
39
40
41 namespace VISU
42 {
43   //---------------------------------------------------------------
44   //! Define an utility base class which allow to keep calculated number of cells and their size
45   struct VISU_CONVERTOR_EXPORT TSizeCounter: virtual TIsVTKDone
46   {
47     TSizeCounter();
48     vtkIdType myNbCells; //!< Number of cells contained into corresponding sublclass
49     vtkIdType myCellsSize; //!< Size of cells contained into corresponding sublclass
50   };
51
52
53   //---------------------------------------------------------------
54   //! Define a container for VTK representation
55   class TPolyDataHolder: public virtual TSizeCounter
56   {
57   protected:
58     mutable PPolyData mySource;
59   public:
60     TPolyDataHolder();
61
62     //! This method allow to create corresponding VTK data set by demand (not at once)
63     const PPolyData& 
64     GetSource() const;
65
66     virtual
67     vtkPolyData* 
68     GetPolyDataOutput();
69
70     //! Gets memory size used by the instance (bytes).
71     virtual
72     unsigned long int
73     GetMemorySize();
74   };
75
76
77   //---------------------------------------------------------------
78   //! Define a container for VTK representation
79   class VISU_CONVERTOR_EXPORT TUnstructuredGridHolder: public virtual TSizeCounter
80   {
81   public:
82     TUnstructuredGridHolder();
83
84     //! This method allow to create corresponding VTK data set by demand (not at once)
85     const PUnstructuredGrid& 
86     GetSource() const;
87
88     virtual
89     vtkUnstructuredGrid* 
90     GetUnstructuredGridOutput();
91
92     //! Gets memory size used by the instance (bytes).
93     virtual
94     unsigned long int
95     GetMemorySize();
96
97   protected:
98     mutable PUnstructuredGrid mySource;
99   };
100
101
102   //---------------------------------------------------------------
103   //! Define an intermediate class which unifies memory size calculation
104   struct VISU_CONVERTOR_EXPORT TMemoryCheckIDMapper: public virtual TIsVTKDone,
105                                public virtual TIDMapper
106   {
107     //! Gets memory size used by the instance (bytes).
108     virtual
109     unsigned long int
110     GetMemorySize();
111   };
112
113
114   //---------------------------------------------------------------
115   //! Define a container for VTK representation
116   /*!
117     This container allow to combine other VTK representation into single one.
118   */
119   class VISU_CONVERTOR_EXPORT TAppendFilterHolder: public virtual TMemoryCheckIDMapper
120   {
121   protected:
122     mutable PAppendFilter myFilter;
123   public:
124     TAppendFilterHolder();
125
126     //! This method allow to create corresponding VTK filter by demand (not at once)
127     const PAppendFilter& 
128     GetFilter() const;
129
130     //! Reimplement the TNamedIDMapper::GetUnstructuredGridOutput
131     virtual
132     vtkUnstructuredGrid* 
133     GetUnstructuredGridOutput();
134   };
135
136   /*!
137     This container allow to combine other VTK representation into single one.
138   */
139   //---------------------------------------------------------------
140   //! Define a container for VTK representation
141   /*!
142     This container allow to combine other VTK representation into single one.
143   */
144   class TAppendPolyDataHolder: public virtual TMemoryCheckIDMapper
145   {
146   protected:
147     mutable PAppendPolyData myFilter;
148   public:
149     TAppendPolyDataHolder();
150
151     //! This method allow to create corresponding VTK filter by demand (not at once)
152     const PAppendPolyData& 
153     GetFilter() const;
154
155     //! Reimplement the TGaussPtsIDMapper::GetPolyDataOutput
156     virtual
157     vtkPolyData* 
158     GetPolyDataOutput();
159   };
160
161
162   //---------------------------------------------------------------
163   //! Define a container for VTK representation
164   /*!
165     This container allow to assign data to mesh and represent them into single VTK representation
166   */
167   class TMergeFilterHolder: public virtual TMemoryCheckIDMapper
168   {
169   protected:
170     mutable PMergeFilter myFilter;
171   public:
172     TMergeFilterHolder();
173
174     //! This method allow to create corresponding VTK filter by demand (not at once)
175     const PMergeFilter& 
176     GetFilter() const;
177
178     //! Gets output of the filter as vtkDataSet
179     virtual
180     vtkDataSet*
181     GetOutput();
182   };
183
184
185   //---------------------------------------------------------------
186   //! Specialize TMesh to provide VTK mapping for nodes
187   struct VISU_CONVERTOR_EXPORT TMeshImpl: virtual TMesh, 
188                     virtual TIsVTKDone
189   {
190     PNamedPointCoords myNamedPointCoords; //!< Keeps intermediate representation of the nodes
191     vtkIdType myNbPoints; //!< Keeps number of the nodes
192
193     TMeshImpl();
194
195     vtkIdType
196     GetNbPoints() const;
197
198     vtkIdType
199     GetDim() const;
200
201     vtkPointSet*
202     GetPointSet(); //!< Gets initialized corresponding VTK structure
203   };
204
205
206   //---------------------------------------------------------------
207   typedef TVector<vtkIdType> TSubMeshID;
208   typedef enum {eRemoveAll, eAddAll, eAddPart, eNone} ESubMeshStatus; 
209
210   //! Specialize TSubProfile to provide VTK mapping
211   struct VISU_CONVERTOR_EXPORT TSubProfileImpl: virtual TSubProfile, 
212                           virtual TUnstructuredGridHolder
213   {
214     TSubProfileImpl();
215
216     EGeometry myGeom; //!< Defines to what geometrical type the MED PROFILE belong to
217     std::string myName; //!< Keeps its name
218
219     //! Get object number of mesh cell by its VTK one
220     virtual 
221     vtkIdType 
222     GetElemObjID(vtkIdType theVtkI) const;
223
224     //! Get cell VTK ID for corresponding object ID
225     virtual
226     vtkIdType 
227     GetElemVTKID(vtkIdType theID) const;
228
229     //! Gets memory size used by the instance (bytes).
230     virtual
231     unsigned long int
232     GetMemorySize();
233
234     //! Keeps status of the structure
235     /*!
236       In some cases MED file does not use MED PROFILES, but at VISU creates corresponding data strucutre
237       in order to construct mesh for MED TIEMSTAMPS in uniform way.
238     */
239     ESubMeshStatus myStatus; 
240     TSubMeshID mySubMeshID; //!< Keeps numbers of mesh cell which contain the MED PROFILE
241   };
242
243
244   //---------------------------------------------------------------
245   typedef std::map<vtkIdType,vtkIdType> TID2ID;
246   typedef TVector<PSubProfileImpl> TSubProfileArr;
247   typedef std::map<EGeometry,PSubProfileImpl> TGeom2SubProfile;
248
249   //! Specialize TProfile to provide VTK mapping for MED TIMESTAMP mesh
250   struct VISU_CONVERTOR_EXPORT TProfileImpl: virtual TProfile, 
251                        virtual TAppendFilterHolder
252   {
253     TProfileImpl();
254     bool myIsAll; //!< Say, whether the MED TIMESTAMP defined on all MED ENTITY or not
255    
256     //! Reimplement the TIDMapper::GetNodeObjID
257     virtual 
258     vtkIdType 
259     GetNodeObjID(vtkIdType theID) const;
260
261     //! Reimplement the TIDMapper::GetNodeVTKID
262     virtual 
263     vtkIdType 
264     GetNodeVTKID(vtkIdType theID) const;
265
266     //! Reimplement the TIDMapper::GetNodeCoord
267     virtual 
268     vtkFloatingPointType*  
269     GetNodeCoord(vtkIdType theObjID);
270
271     //! Reimplement the TIDMapper::GetElemObjID
272     virtual 
273     vtkIdType 
274     GetElemObjID(vtkIdType theID) const;
275
276     //! Reimplement the TIDMapper::GetElemVTKID
277     virtual 
278     vtkIdType 
279     GetElemVTKID(vtkIdType theID) const;
280
281     //! Reimplement the TIDMapper::GetElemCell
282     virtual
283     vtkCell* 
284     GetElemCell(vtkIdType theObjID);
285     
286     //! Reimplement the TNamedIDMapper::GetUnstructuredGridOutput
287     virtual
288     vtkUnstructuredGrid* 
289     GetUnstructuredGridOutput();
290
291     //! Gets memory size used by the instance (bytes).
292     virtual
293     unsigned long int
294     GetMemorySize();
295
296     //! Reimplement the TNamedIDMapper::GetNodeName
297     virtual
298     std::string 
299     GetNodeName(vtkIdType theObjID) const;
300
301     //! Reimplement the TNamedIDMapper::GetElemName
302     virtual
303     std::string 
304     GetElemName(vtkIdType theObjID) const;
305
306     TID2ID myElemObj2VTKID; //!< Keeps object to VTK numeration mapping
307     TSubProfileArr mySubProfileArr; //!< Keeps sequence of TSubProfiles as they were added into TAppendFilterHolder
308     PNamedPointCoords myNamedPointCoords; //!< Keeps reference on the same TNamedPointCoords as TMesh
309     TMeshOnEntityImpl* myMeshOnEntity; //<! Keeps backward reference to corresponding MED ENTITY mesh
310
311     TGeom2SubProfile myGeom2SubProfile; //!< Keeps TSubProfiles according to their geometrical type
312   };
313
314
315   //---------------------------------------------------------------
316   //! Specialize TIDMapper to provide VTK mapping for MED TIMESTAMP mesh
317   struct TUnstructuredGridIDMapperImpl: virtual TMergeFilterHolder,
318                                         virtual TUnstructuredGridIDMapper
319   {
320     PAppendFilterHolder myIDMapper; //!< Responsible for numbering
321     PCommonCellsFilter myCommonCellsFilter;
322
323     TUnstructuredGridIDMapperImpl();
324     
325     //! Reimplement the TIDMapper::GetNodeObjID
326     virtual 
327     vtkIdType 
328     GetNodeObjID(vtkIdType theID) const;
329
330     //! Reimplement the TIDMapper::GetNodeVTKID
331     virtual 
332     vtkIdType 
333     GetNodeVTKID(vtkIdType theID) const;
334
335     //! Reimplement the TIDMapper::GetNodeCoord
336     virtual 
337     vtkFloatingPointType*  
338     GetNodeCoord(vtkIdType theObjID);
339
340     //! Reimplement the TIDMapper::GetElemObjID
341     virtual 
342     vtkIdType 
343     GetElemObjID(vtkIdType theID) const;
344
345     //! Reimplement the TIDMapper::GetElemVTKID
346     virtual 
347     vtkIdType 
348     GetElemVTKID(vtkIdType theID) const;
349
350     //! Reimplement the TIDMapper::GetElemCell
351     virtual
352     vtkCell* 
353     GetElemCell(vtkIdType theObjID);
354     
355     //! Reimplement the TUnstructuredGridIDMapper::GetUnstructuredGridOutput
356     virtual
357     vtkUnstructuredGrid* 
358     GetUnstructuredGridOutput();
359
360     //! Reimplement the TIDMapper::GetOutput
361     virtual
362     vtkDataSet* 
363     GetOutput();
364
365     //! Gets memory size used by the instance (bytes).
366     virtual
367     unsigned long int
368     GetMemorySize();
369     
370     void 
371     SetReferencedMesh( const PNamedIDMapper& theNamedIDMapper );
372
373     PUnstructuredGrid 
374     GetSource();
375
376   protected:
377     void Build();
378
379     TUnstructuredGridHolder mySource; //!< Keeps assigned data
380   };
381
382   //---------------------------------------------------------------
383   //! Specialize TIDMapper to provide VTK mapping for MED TIMESTAMP mesh
384   struct TPolyDataIDMapperImpl: virtual TMergeFilterHolder,
385                                 virtual TPolyDataIDMapper
386   {
387     PAppendPolyDataHolder myIDMapper; //!< Responsible for numbering
388
389     //! Reimplement the TIDMapper::GetNodeObjID
390     virtual 
391     vtkIdType 
392     GetNodeObjID(vtkIdType theID) const;
393
394     //! Reimplement the TIDMapper::GetNodeVTKID
395     virtual 
396     vtkIdType 
397     GetNodeVTKID(vtkIdType theID) const;
398
399     //! Reimplement the TIDMapper::GetNodeCoord
400     virtual 
401     vtkFloatingPointType*  
402     GetNodeCoord(vtkIdType theObjID);
403
404     //! Reimplement the TIDMapper::GetElemObjID
405     virtual 
406     vtkIdType 
407     GetElemObjID(vtkIdType theID) const;
408
409     //! Reimplement the TIDMapper::GetElemVTKID
410     virtual 
411     vtkIdType 
412     GetElemVTKID(vtkIdType theID) const;
413
414     //! Reimplement the TIDMapper::GetElemCell
415     virtual
416     vtkCell* 
417     GetElemCell(vtkIdType theObjID);
418     
419     //! Reimplement the TPolyDataIDMapper::GetPolyDataOutput
420     virtual
421     vtkPolyData* 
422     GetPolyDataOutput();
423
424     //! Reimplement the TIDMapper::GetOutput
425     virtual
426     vtkDataSet* 
427     GetOutput();
428
429     //! Gets memory size used by the instance (bytes).
430     virtual
431     unsigned long int
432     GetMemorySize();
433
434     PPolyData 
435     GetSource();
436
437   protected:
438     void Build();
439
440     TPolyDataHolder mySource; //!< Keeps assigned data
441   };
442
443
444   //---------------------------------------------------------------
445   //! Specialize TGauss to provide more detail information of the MED GAUSS entity for VTK mapping
446   struct VISU_CONVERTOR_EXPORT TGaussImpl: virtual TGauss
447   {
448     EGeometry myGeom; //!< Define, to which geometrical type the MED GAUSS entity belongs
449     std::string myName; //!< Keeps name of the MED GAUSS entity
450     vtkIdType myNbPoints; //<! Keeps number of points for the MED GAUSS entity
451
452     TGaussImpl();
453
454     //! To define a way to implement more detail comparision of the TGaussSubMesh instances
455     virtual
456     void
457     LessThan(const PGaussImpl& theGauss,
458              bool& theResult) const;
459   };
460
461
462   //---------------------------------------------------------------
463   //! Specialize TGaussSubMesh to provide VTK mapping for the entity
464   struct VISU_CONVERTOR_EXPORT TGaussSubMeshImpl: virtual TGaussSubMesh, 
465                             virtual TPolyDataHolder
466   {
467     TGaussSubMeshImpl();
468
469     //! To implement the TGaussPtsIDMapper::GetObjID
470     virtual
471     TGaussPointID
472     GetObjID(vtkIdType theID) const;
473
474     //! To implement the TGaussPtsIDMapper::GetVTKID
475     virtual
476     vtkIdType
477     GetVTKID(const TGaussPointID& theID) const;
478     
479     virtual 
480     vtkIdType 
481     GetElemObjID(vtkIdType theID) const;
482
483     virtual 
484     vtkIdType 
485     GetElemVTKID(vtkIdType theID) const;
486     
487     virtual
488     vtkIdType
489     GetGlobalID(vtkIdType theID) const;
490     
491     //! Gets memory size used by the instance (bytes).
492     virtual
493     unsigned long int
494     GetMemorySize();
495
496     PGaussImpl myGauss; //<! Keep reference to corresponding TGauss structure
497
498     //! Keeps status of the structure
499     /*!
500       In some cases MED file does not use MED GAUSS, but at VISU creates corresponding data strucutre
501       in order to construct mesh for MED TIEMSTAMPS in uniform way.
502     */
503     ESubMeshStatus myStatus;
504
505     vtkIdType myStartID;
506     PPointCoords myPointCoords; //!< Keeps coordinates of Gauss Points
507   };
508
509
510   //---------------------------------------------------------------
511   typedef TVector<PGaussSubMeshImpl> TGaussSubMeshArr;
512   typedef std::map<EGeometry, PGaussSubMeshImpl> TGeom2GaussSubMesh;
513
514   //! Specialize TGaussMesh to provide VTK mapping for the entity
515   struct VISU_CONVERTOR_EXPORT TGaussMeshImpl: virtual TGaussMesh, 
516                          virtual TAppendPolyDataHolder
517   {
518     TGaussMeshImpl();
519
520     //! Reimplement the TGaussPtsIDMapper::GetObjID
521     virtual
522     TGaussPointID
523     GetObjID(vtkIdType theID) const;
524
525     //! Reimplements the TGaussPtsIDMapper::GetVTKID
526     virtual
527     vtkIdType 
528     GetVTKID(const TGaussPointID& theID) const;
529
530     //! Reimplement the TGaussPtsIDMapper::GetPolyDataOutput
531     virtual
532     vtkPolyData* 
533     GetPolyDataOutput();
534
535     //! Gets memory size used by the instance (bytes).
536     virtual
537     unsigned long int
538     GetMemorySize();
539
540     //! Reimplement the TGaussPtsIDMapper::GetParent
541     virtual 
542     TNamedIDMapper*
543     GetParent() const;
544
545     TNamedIDMapper* myParent; //!< Refer to parent mesh
546     TGaussSubMeshArr myGaussSubMeshArr; //!< Keeps sequence of TGaussSubMesh as they were added into TAppendFilterHolder
547     TGeom2GaussSubMesh myGeom2GaussSubMesh; //!< Keeps TGaussSubMesh according to their geometrical type
548   };
549
550
551   //---------------------------------------------------------------
552   //! Specialize TGaussPtsIDMapper to provide VTK mapping for MED TIMESTAMP mesh
553   struct VISU_CONVERTOR_EXPORT TGaussPtsIDFilter: virtual TPolyDataIDMapperImpl,
554                             virtual TGaussPtsIDMapper
555   { 
556     PGaussPtsIDMapper myGaussPtsIDMapper;
557
558     //! Reimplement the TGaussPtsIDMapper::GetObjID
559     virtual 
560     TGaussPointID 
561     GetObjID(vtkIdType theID) const;
562
563     //! Reimplements the TGaussPtsIDMapper::GetVTKID
564     virtual 
565     vtkIdType 
566     GetVTKID(const TGaussPointID& theID) const;
567
568     //! Reimplements the TGaussPtsIDMapper::GetParent
569     //! Reimplement the TGaussPtsIDMapper::GetParent
570     virtual 
571     TNamedIDMapper*
572     GetParent() const;
573
574     //! Reimplement the TNamedIDMapper::GetUnstructuredGridOutput
575     virtual
576     vtkPolyData* 
577     GetPolyDataOutput();
578
579     //! Reimplement the TIDMapper::GetOutput
580     virtual
581     vtkDataSet*
582     GetOutput();
583   };
584
585
586   //---------------------------------------------------------------
587   typedef TVector<vtkIdType> TConnect;
588   typedef TVector<TConnect> TCell2Connect;
589
590   //! The class is responsible for mapping of cells of defined geometrical type  
591   struct VISU_CONVERTOR_EXPORT TSubMeshImpl: virtual TUnstructuredGridHolder
592   {
593     TSubMeshImpl();
594
595     //! Reimplements the TStructured::CopyStructure
596     virtual
597     void
598     CopyStructure( PStructured theStructured );
599
600     //! To implement the TIDMapper::GetElemObjID
601     virtual 
602     vtkIdType 
603     GetElemObjID(vtkIdType theID) const;
604
605     //! To implement the TNamedIDMapper::GetElemName
606     virtual
607     std::string 
608     GetElemName(vtkIdType theObjID) const;
609
610     //! Gets memory size used by the instance (bytes).
611     virtual
612     unsigned long int
613     GetMemorySize();
614
615     vtkIdType myStartID;
616     TCell2Connect myCell2Connect; //!< Contains connectivity for the cells
617   };
618
619
620   //---------------------------------------------------------------
621   typedef std::map<EGeometry,PSubMeshImpl> TGeom2SubMesh;
622   typedef TVector<PSubMeshImpl> TSubMeshArr;
623
624   //! Specialize TMeshOnEntity to provide VTK mapping for the entity
625   struct VISU_CONVERTOR_EXPORT TMeshOnEntityImpl: virtual TMeshOnEntity, 
626                             virtual TAppendFilterHolder, 
627                             virtual TSizeCounter
628   {
629     TMeshOnEntityImpl();
630
631     //! Reimplements the TStructured::CopyStructure
632     virtual
633     void
634     CopyStructure( PStructured theStructured );
635
636     //! Reimplement the TIDMapper::GetNodeVTKID
637     virtual 
638     vtkIdType 
639     GetNodeVTKID(vtkIdType theID) const;
640
641     //! Reimplement the TIDMapper::GetNodeObjID
642     virtual 
643     vtkIdType 
644     GetNodeObjID(vtkIdType theID) const;
645
646     //! Reimplement the TIDMapper::GetElemVTKID
647     virtual 
648     vtkIdType 
649     GetElemVTKID(vtkIdType theID) const;
650
651     //! Reimplement the TIDMapper::GetElemObjID
652     virtual 
653     vtkIdType 
654     GetElemObjID(vtkIdType theID) const;
655
656     //! Reimplement the TNamedIDMapper::GetNodeName
657     virtual
658     std::string 
659     GetNodeName(vtkIdType theObjID) const;
660
661     //! Reimplement the TNamedIDMapper::GetElemName
662     virtual
663     std::string 
664     GetElemName(vtkIdType theObjID) const;
665
666     //! Reimplement the TNamedIDMapper::GetUnstructuredGridOutput
667     virtual
668     vtkUnstructuredGrid* 
669     GetUnstructuredGridOutput();
670
671     //! Gets memory size used by the instance (bytes).
672     virtual
673     unsigned long int
674     GetMemorySize();
675
676     TID2ID myElemObj2VTKID; //!< To support object to VTK number mapping 
677     TSubMeshArr mySubMeshArr; //!< Keeps sequence of TSubMeshImpl as they were added into TAppendFilterHolder
678     PNamedPointCoords myNamedPointCoords; //!< Share the same instance with TMesh to implement nodal mapping
679
680     TGeom2SubMesh myGeom2SubMesh; //!< Keeps TSubMeshImpl according to their geometrical type
681   };
682
683
684   //---------------------------------------------------------------
685   typedef std::map<EGeometry,TSubMeshID> TGeom2SubMeshID;
686
687   //! Specialize TFamily to provide VTK mapping for the entity
688   struct VISU_CONVERTOR_EXPORT TFamilyImpl: virtual TFamily, 
689                       virtual TUnstructuredGridHolder
690   {
691     //! Reimplements the TStructured::CopyStructure
692     virtual
693     void
694     CopyStructure( PStructured theStructured );
695
696     //! Reimplement the TIDMapper::GetNodeObjID
697     vtkIdType 
698     GetNodeObjID(vtkIdType theID) const ;
699
700     //! Reimplement the TIDMapper::GetNodeVTKID
701     virtual 
702     vtkIdType 
703     GetNodeVTKID(vtkIdType theID) const ;
704
705     //! Reimplement the TIDMapper::GetElemVTKID
706     virtual 
707     vtkIdType 
708     GetElemVTKID(vtkIdType theID) const;
709
710     //! Reimplement the TIDMapper::GetElemObjID
711     virtual 
712     vtkIdType 
713     GetElemObjID(vtkIdType theID) const;
714
715     //! Reimplement the TUnstructuredGridIDMapper::GetUnstructuredGridOutput
716     virtual
717     vtkUnstructuredGrid* 
718     GetUnstructuredGridOutput();
719
720     //! Gets memory size used by the instance (bytes).
721     virtual
722     unsigned long int
723     GetMemorySize();
724
725     PNamedPointCoords myNamedPointCoords;  //!< Share the same instance with TMesh to implement nodal mapping
726     TID2ID myElemObj2VTKID; //!< To support object to VTK number mapping
727     TSubMeshID myMeshID; //!< Keeps numbers of mesh elements that belongs to the MED FAMILY
728
729     TGeom2SubMeshID myGeom2SubMeshID; //!< Keeps TSubMeshID according to their geometrical type
730   };
731
732
733   //---------------------------------------------------------------
734   typedef std::pair<vtkIdType,vtkIdType> TNbASizeCells;
735   typedef TVector<PFamilyImpl> TFamilyArr;
736
737   //! Specialize TGroup to provide VTK mapping for the entity
738   struct VISU_CONVERTOR_EXPORT TGroupImpl: virtual TGroup, 
739                      virtual TAppendFilterHolder
740   {
741     //! Reimplements the TStructured::CopyStructure
742     virtual
743     void
744     CopyStructure( PStructured theStructured );
745
746     //! Calculate pair of values - number of cells and its size
747     TNbASizeCells 
748     GetNbASizeCells() const;
749
750     //! Reimplement the TIDMapper::GetElemVTKID
751     virtual 
752     vtkIdType 
753     GetElemVTKID(vtkIdType theID) const;
754
755     //! Reimplement the TIDMapper::GetElemObjID
756     virtual 
757     vtkIdType 
758     GetElemObjID(vtkIdType theID) const;
759
760     //! Reimplement the TIDMapper::GetNodeObjID
761     virtual 
762     vtkIdType 
763     GetNodeObjID(vtkIdType theID) const;
764
765     //! Reimplement the TIDMapper::GetNodeVTKID
766     virtual 
767     vtkIdType 
768     GetNodeVTKID(vtkIdType theID) const;
769
770     //! Reimplement the TUnstructuredGridIDMapper::GetUnstructuredGridOutput
771     virtual
772     vtkUnstructuredGrid* 
773     GetUnstructuredGridOutput();
774
775     //! Gets memory size used by the instance (bytes).
776     virtual
777     unsigned long int
778     GetMemorySize();
779
780     TID2ID myElemObj2VTKID; //!< To support object to VTK number mapping
781     TFamilyArr myFamilyArr; //!< Keeps sequence of TFamily as they were added into TAppendFilterHolder
782     PNamedPointCoords myNamedPointCoords; //!< Share the same instance with TMesh to implement nodal mapping
783   };
784
785
786   //---------------------------------------------------------------
787   typedef TVector<TMinMax> TMinMaxArr;
788
789   //! Specialize TField to provide VTK mapping for the entity
790   struct VISU_CONVERTOR_EXPORT TFieldImpl: virtual TField
791   {
792     TFieldImpl();
793
794     //! To initialize the data structure    
795     void 
796     Init(vtkIdType theNbComp,
797          vtkIdType theDataType);
798
799     //! Gets type idetificator of the mesh data.
800     vtkIdType
801     GetDataType() const;
802
803     //! Implement the TField::GetMinMax
804     virtual
805     TMinMax 
806     GetMinMax(vtkIdType theCompID);
807
808     //! Implement the TField::GetAverageMinMax
809     virtual
810     TMinMax 
811     GetAverageMinMax(vtkIdType theCompID);
812
813     vtkIdType myDataSize; //!< Keeps size of the assigned data
814     vtkIdType myDataType; //!< Keeps type idetificator of the mesh data
815     TMinMaxArr myMinMaxArr; //!< Keeps min/max values for each component of the MED FIELD
816     TMinMaxArr myAverageMinMaxArr; //!< Keeps average by Gauss Points min/max values for each component of the MED FIELD
817                                    //!< If Nb of Gauss Points <=1 myAverageMinMaxArr equal myMinMaxArr
818   };
819
820
821   //---------------------------------------------------------------
822   typedef std::map<EGeometry, PMeshValue> TGeom2MeshValue;
823
824   class TGeom2Value: public virtual TBaseStructure
825   {
826     TGeom2MeshValue myGeom2MeshValue;
827   public:
828
829     //! Gets mesh data for defined geometrical type (constant version)
830     const PMeshValue& 
831     GetMeshValue(EGeometry theGeom) const;
832
833     //! Gets mesh data for defined geometrical type
834     PMeshValue& 
835     GetMeshValue(EGeometry theGeom);
836
837     //! Gets container of the whole mesh data
838     TGeom2MeshValue& 
839     GetGeom2MeshValue();
840     
841     //! Gets container of the whole mesh data (constant version)
842     const TGeom2MeshValue& 
843     GetGeom2MeshValue() const;
844
845     //! Gets mesh data for the first geometry
846     PMeshValue
847     GetFirstMeshValue() const;
848   };
849
850
851   //---------------------------------------------------------------
852   typedef std::map<EGeometry,vtkIdType> TGeom2NbGauss;
853
854   //! Specialize TValForTime to provide VTK mapping for the entity
855   struct VISU_CONVERTOR_EXPORT TValForTimeImpl: virtual TValForTime
856   {
857     PGaussPtsIDFilter myGaussPtsIDFilter; //!< Keep VTK representation for mesh and data on Gauss Points
858     PUnstructuredGridIDMapperImpl myUnstructuredGridIDMapper; //!< Keep VTK representation for ordinary mesh and data
859     TGeom2Value myGeom2Value; //!< Keep value that is assigned to the mesh
860     TGeom2NbGauss myGeom2NbGauss; //!< Keep number of Gauss Points
861    
862     TValForTimeImpl();
863
864     TGeom2MeshValue& 
865     GetGeom2MeshValue();
866     
867     const TGeom2MeshValue& 
868     GetGeom2MeshValue() const;
869     
870     //! Get mesh data for defined geometrical type (constant version)
871     const PMeshValue& 
872     GetMeshValue(EGeometry theGeom) const;
873
874     //! Get mesh data for defined geometrical type
875     PMeshValue& 
876     GetMeshValue(EGeometry theGeom);
877
878     //! Gets mesh data for the first geometry
879     PMeshValue
880     GetFirstMeshValue() const;
881
882     //! Get number of Gauss Points for defined geometrical type
883     virtual
884     int
885     GetNbGauss(EGeometry theGeom) const;
886
887     //! Gets memory size used by the instance (bytes).
888     virtual
889     unsigned long int
890     GetMemorySize();
891   };
892
893
894   //---------------------------------------------------------------
895 }
896
897
898 #endif