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