Salome HOME
Merge from V6_main (04/10/2012)
[modules/paravis.git] / src / Plugins / MedReader / IO / vtkMedFamilyOnEntity.h
1 // Copyright (C) 2010-2012  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef __vtkMedFamilyOnEntity_h_
21 #define __vtkMedFamilyOnEntity_h_
22
23 // Description :
24 // This class represents the intersection between a family and an entity.
25
26 #include "vtkObject.h"
27 #include "vtkMed.h"
28 #include "vtkMedUtilities.h"
29
30 class vtkMedEntityArray;
31 class vtkMedFamily;
32 class vtkMedGrid;
33 class vtkMedFamilyOnEntityOnProfile;
34 class vtkMedIntArray;
35
36 class VTK_EXPORT vtkMedFamilyOnEntity : public vtkObject
37 {
38 public :
39   static vtkMedFamilyOnEntity* New();
40   vtkTypeRevisionMacro(vtkMedFamilyOnEntity, vtkObject)
41   void PrintSelf(ostream& os, vtkIndent indent);
42
43   // Description:
44   // This is the family of this family on entity.
45   virtual void  SetFamily(vtkMedFamily*);
46   vtkGetObjectMacro(Family, vtkMedFamily);
47
48   // Description:
49   // This is the entity array this family on entity is on.
50   virtual void  SetEntityArray(vtkMedEntityArray*);
51   vtkGetObjectMacro(EntityArray, vtkMedEntityArray);
52
53   // Description:
54   // This is the grid this family on entity is reffering to
55   virtual void  SetParentGrid(vtkMedGrid*);
56   vtkGetObjectMacro(ParentGrid, vtkMedGrid);
57
58   // Description :
59   //  Returns vtkMedUtilities::OnPoint (0) or vtkMedUtilities::OnCell (1)
60   virtual int  GetPointOrCell();
61
62   // Description :
63   // Returns true if the family is on points or if the entity is MED_POINT1
64   // of if it is MED_BALL or MED_PARTICLE elements
65   virtual int  GetVertexOnly();
66
67   // Description:
68   // returns the entity descriptor associated with this family on entity
69   virtual vtkMedEntity GetEntity();
70
71   // Description:
72   // Fields can use profile to be stored on a subset of entities.
73   // a priori, profiles and families are independent notions.
74   // In case there are profiles, we create the intersection of the profile and
75   // the FamilyOnEntity to be able to map the field on the geometry.
76   // BEFORE calling those function, you have to have assigned a profile
77   // to the vtkMedFamilyOnEntityOnProfile
78   void  AddFamilyOnEntityOnProfile(vtkMedFamilyOnEntityOnProfile*);
79   int GetNumberOfFamilyOnEntityOnProfile();
80   vtkMedFamilyOnEntityOnProfile* GetFamilyOnEntityOnProfile(vtkMedProfile*);
81   vtkMedFamilyOnEntityOnProfile* GetFamilyOnEntityOnProfile(int index);
82
83 protected:
84   vtkMedFamilyOnEntity();
85   virtual ~vtkMedFamilyOnEntity();
86
87   vtkMedFamily* Family;
88   vtkMedEntityArray* EntityArray;
89   vtkMedGrid* ParentGrid;
90
91   std::map<vtkMedProfile*, vtkSmartPointer<vtkMedFamilyOnEntityOnProfile> >
92       FamilyOnEntityOnProfile;
93
94 private:
95   vtkMedFamilyOnEntity(const vtkMedFamilyOnEntity&); // Not implemented.
96   void operator=(const vtkMedFamilyOnEntity&); // Not implemented.
97
98 };
99
100 #endif //__vtkMedFamilyOnEntity_h_