Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/paravis.git] / src / Plugins / MedReader / IO / vtkMedLink.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 __vtkMedLink_h_
21 #define __vtkMedLink_h_
22
23 #include "vtkObject.h"
24 #include "vtkMed.h"
25
26 #include <string>
27 #include <map>
28
29 class vtkMedString;
30
31 class VTK_EXPORT vtkMedLink: public vtkObject
32 {
33 public:
34   static vtkMedLink* New();
35   vtkTypeRevisionMacro(vtkMedLink, vtkObject);
36   void PrintSelf(ostream& os, vtkIndent indent);
37
38   // Description:
39   // the index of this field in the med file.
40   vtkSetMacro(MedIterator, med_int);
41   vtkGetMacro(MedIterator, med_int);
42
43   // Description:
44   // Set the name of the mesh linked to.
45   vtkSetStringMacro(MeshName);
46   vtkGetStringMacro(MeshName);
47
48   // Description:
49   // Set the name of the file this link points to.
50   vtkSetStringMacro(Link);
51   vtkGetStringMacro(Link);
52
53   // Description:
54   // returns the full path to the linked file.
55   // If the Link is already a full path, it is returned.
56   // If the directory is a relative path, the returned path is the
57   // concatenation of the directory where the
58   // original file is in and the Link.
59   const char* GetFullLink(const char* originalFileName);
60
61   // Description:
62   // this stores the iterator that should be used when unmounting this link
63   void  SetMountedIterator(med_class, med_int);
64   med_int GetMountedIterator(med_class);
65
66 protected:
67   vtkMedLink();
68   virtual ~vtkMedLink();
69
70   med_int MedIterator;
71   char* MeshName;
72   char * Link;
73
74   std::string FullLinkPath;
75
76   // BTX
77   std::map<med_class, int> Status;
78   std::map<med_class, med_int> MountedIterator;
79   //ETX
80
81 private:
82   vtkMedLink(const vtkMedLink&); // Not implemented.
83   void operator=(const vtkMedLink&); // Not implemented.
84
85 };
86
87 #endif //__vtkMedLink_h_