Back to index

salome-paravis  6.5.0
vtkMedFieldStep.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2010-2012  CEA/DEN, EDF R&D
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 #include "vtkMedFieldStep.h"
00021 
00022 #include "vtkObjectFactory.h"
00023 #include "vtkSmartPointer.h"
00024 #include "vtkMedUtilities.h"
00025 #include "vtkMedFieldOverEntity.h"
00026 #include "vtkMedField.h"
00027 #include "vtkMedFile.h"
00028 #include "vtkMedDriver.h"
00029 
00030 vtkCxxGetObjectVectorMacro(vtkMedFieldStep, FieldOverEntity, vtkMedFieldOverEntity);
00031 vtkCxxSetObjectVectorMacro(vtkMedFieldStep, FieldOverEntity, vtkMedFieldOverEntity);
00032 
00033 vtkCxxSetObjectMacro(vtkMedFieldStep, ParentField, vtkMedField);
00034 vtkCxxSetObjectMacro(vtkMedFieldStep, PreviousStep, vtkMedFieldStep);
00035 
00036 vtkCxxRevisionMacro(vtkMedFieldStep, "$Revision: 1.1.4.9.2.1 $")
00037 vtkStandardNewMacro(vtkMedFieldStep)
00038 
00039 vtkMedFieldStep::vtkMedFieldStep()
00040 {
00041   this->FieldOverEntity = new vtkObjectVector<vtkMedFieldOverEntity>();
00042   this->PreviousStep = NULL;
00043   this->ParentField = NULL;
00044   this->MedIterator = -1;
00045   this->EntityInfoLoaded = 0;
00046 }
00047 
00048 vtkMedFieldStep::~vtkMedFieldStep()
00049 {
00050   delete this->FieldOverEntity;
00051   this->SetPreviousStep(NULL);
00052   this->SetParentField(NULL);
00053 }
00054 
00055 vtkMedFieldOverEntity* vtkMedFieldStep::GetFieldOverEntity(
00056     const vtkMedEntity& entity)
00057 {
00058   for(int id=0; id < this->GetNumberOfFieldOverEntity(); id++)
00059     {
00060     vtkMedFieldOverEntity* fieldOverEntity = this->GetFieldOverEntity(id);
00061     if(fieldOverEntity->GetEntity() == entity)
00062       return fieldOverEntity;
00063     }
00064   return NULL;
00065 }
00066 
00067 void  vtkMedFieldStep::LoadInformation()
00068 {
00069   this->GetParentField()->GetParentFile()->GetMedDriver()->
00070       ReadFieldStepInformation(this, true);
00071 }
00072 
00073 void vtkMedFieldStep::PrintSelf(ostream& os, vtkIndent indent)
00074 {
00075   this->Superclass::PrintSelf(os, indent);
00076   PRINT_OBJECT_VECTOR(os, indent, FieldOverEntity);
00077 }