Salome HOME
Merge from V6_main (04/10/2012)
[modules/paravis.git] / src / Plugins / MedReader / IO / vtkMedFamily.cxx
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 #include "vtkMedFamily.h"
21
22 #include "vtkObjectFactory.h"
23 #include "vtkSmartPointer.h"
24
25 #include "vtkMedGroup.h"
26 #include "vtkMedUtilities.h"
27
28 vtkCxxGetObjectVectorMacro(vtkMedFamily, Group, vtkMedGroup);
29 vtkCxxSetObjectVectorMacro(vtkMedFamily, Group, vtkMedGroup);
30
31 vtkCxxRevisionMacro(vtkMedFamily, "$Revision$")
32 vtkStandardNewMacro(vtkMedFamily)
33
34 vtkMedFamily::vtkMedFamily()
35 {
36   this->Id = 0;
37   this->Name = NULL;
38   this->Group = new vtkObjectVector<vtkMedGroup>();
39   this->MedIterator = -1;
40   this->PointOrCell = vtkMedUtilities::OnPoint;
41
42   // by default, the family is part of the "NoGroup" fake group
43   this->AllocateNumberOfGroup(1);
44   vtkMedGroup* nogroup = this->GetGroup(0);
45   nogroup->SetName(vtkMedUtilities::NoGroupName);
46
47   this->SetName("UNDEFINED_FAMILY");
48 }
49
50 vtkMedFamily::~vtkMedFamily()
51 {
52   this->SetName(NULL);
53   delete this->Group;
54 }
55
56 void vtkMedFamily::PrintSelf(ostream& os, vtkIndent indent)
57 {
58   this->Superclass::PrintSelf(os, indent);
59   PRINT_IVAR(os, indent, Id);
60   PRINT_IVAR(os, indent, MedIterator);
61   PRINT_IVAR(os, indent, PointOrCell);
62   PRINT_OBJECT_VECTOR(os, indent, Group);
63 }