1 // Copyright (C) 2010-2013 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "vtkMedFieldStep.h"
22 #include "vtkObjectFactory.h"
23 #include "vtkSmartPointer.h"
24 #include "vtkMedUtilities.h"
25 #include "vtkMedFieldOverEntity.h"
26 #include "vtkMedField.h"
27 #include "vtkMedFile.h"
28 #include "vtkMedDriver.h"
30 vtkCxxGetObjectVectorMacro(vtkMedFieldStep, FieldOverEntity, vtkMedFieldOverEntity);
31 vtkCxxSetObjectVectorMacro(vtkMedFieldStep, FieldOverEntity, vtkMedFieldOverEntity);
33 vtkCxxSetObjectMacro(vtkMedFieldStep, ParentField, vtkMedField);
34 vtkCxxSetObjectMacro(vtkMedFieldStep, PreviousStep, vtkMedFieldStep);
36 // vtkCxxRevisionMacro(vtkMedFieldStep, "$Revision$")
37 vtkStandardNewMacro(vtkMedFieldStep)
39 vtkMedFieldStep::vtkMedFieldStep()
41 this->FieldOverEntity = new vtkObjectVector<vtkMedFieldOverEntity>();
42 this->PreviousStep = NULL;
43 this->ParentField = NULL;
44 this->MedIterator = -1;
45 this->EntityInfoLoaded = 0;
48 vtkMedFieldStep::~vtkMedFieldStep()
50 delete this->FieldOverEntity;
51 this->SetPreviousStep(NULL);
52 this->SetParentField(NULL);
55 vtkMedFieldOverEntity* vtkMedFieldStep::GetFieldOverEntity(
56 const vtkMedEntity& entity)
58 for(int id=0; id < this->GetNumberOfFieldOverEntity(); id++)
60 vtkMedFieldOverEntity* fieldOverEntity = this->GetFieldOverEntity(id);
61 if(fieldOverEntity->GetEntity() == entity)
62 return fieldOverEntity;
67 void vtkMedFieldStep::LoadInformation()
69 this->GetParentField()->GetParentFile()->GetMedDriver()->
70 ReadFieldStepInformation(this, true);
73 void vtkMedFieldStep::PrintSelf(ostream& os, vtkIndent indent)
75 this->Superclass::PrintSelf(os, indent);
76 PRINT_OBJECT_VECTOR(os, indent, FieldOverEntity);