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