Salome HOME
Minor: removing annoying print message
[modules/paravis.git] / src / Plugins / MedReader / IO / vtkMedGrid.cxx
1 // Copyright (C) 2010-2013  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 #include "vtkMedGrid.h"
21
22 #include "vtkObjectFactory.h"
23
24 #include "vtkMedUtilities.h"
25 #include "vtkMedMesh.h"
26 #include "vtkMedIntArray.h"
27 #include "vtkMedFamilyOnEntity.h"
28 #include "vtkMedFamily.h"
29 #include "vtkMedEntityArray.h"
30 #include "vtkMedFile.h"
31 #include "vtkMedDriver.h"
32
33 #include <set>
34 using std::set;
35
36 vtkCxxGetObjectVectorMacro(vtkMedGrid, EntityArray, vtkMedEntityArray);
37 vtkCxxSetObjectVectorMacro(vtkMedGrid, EntityArray, vtkMedEntityArray);
38
39 vtkCxxSetObjectMacro(vtkMedGrid, PointGlobalIds, vtkMedIntArray);
40 vtkCxxSetObjectMacro(vtkMedGrid, ParentMesh, vtkMedMesh);
41 vtkCxxSetObjectMacro(vtkMedGrid, PreviousGrid, vtkMedGrid);
42
43 // vtkCxxRevisionMacro(vtkMedGrid, "$Revision$")
44
45 vtkMedGrid::vtkMedGrid()
46 {
47   this->ParentMesh = NULL;
48   this->PointGlobalIds = NULL;
49   this->PreviousGrid = NULL;
50
51   this->CoordinateSystem = MED_CARTESIAN;
52   this->EntityArray = new vtkObjectVector<vtkMedEntityArray>();
53   this->UsePreviousCoordinates = false;
54 }
55
56 vtkMedGrid::~vtkMedGrid()
57 {
58   this->SetPointGlobalIds(NULL);
59   this->SetParentMesh(NULL);
60   delete this->EntityArray;
61 }
62
63 int vtkMedGrid::IsPointGlobalIdsLoaded()
64 {
65   return this->PointGlobalIds != NULL
66       && this->PointGlobalIds->GetNumberOfTuples()
67           == this->GetNumberOfPoints();
68 }
69
70 void  vtkMedGrid::ClearMedSupports()
71 {
72   this->SetPointGlobalIds(NULL);
73 }
74
75 vtkMedEntityArray* vtkMedGrid::GetEntityArray(const vtkMedEntity& entity)
76 {
77   for(int id = 0; id < this->EntityArray->size(); id++)
78     {
79     vtkMedEntityArray* array = this->EntityArray->at(id);
80     if(array->GetEntity() == entity)
81       return array;
82     }
83   return NULL;
84 }
85
86 void  vtkMedGrid::GatherMedEntities(std::set<vtkMedEntity>& entities)
87 {
88   for(int id = 0; id < this->EntityArray->size(); id++)
89     {
90     vtkMedEntityArray* array = this->EntityArray->at(id);
91     entities.insert(array->GetEntity());
92     }
93 }
94
95 void vtkMedGrid::PrintSelf(ostream& os, vtkIndent indent)
96 {
97   this->Superclass::PrintSelf(os, indent);
98 }