Back to index

salome-paravis  6.5.0
vtkMedFieldOnProfile.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 "vtkMedFieldOnProfile.h"
00021 
00022 #include "vtkObjectFactory.h"
00023 #include "vtkDataArray.h"
00024 
00025 #include "vtkMedFieldOverEntity.h"
00026 #include "vtkMedFieldStep.h"
00027 #include "vtkMedField.h"
00028 #include "vtkMedFile.h"
00029 #include "vtkMedDriver.h"
00030 #include "vtkMedProfile.h"
00031 
00032 vtkCxxSetObjectMacro(vtkMedFieldOnProfile, Data, vtkDataArray);
00033 vtkCxxSetObjectMacro(vtkMedFieldOnProfile, Profile, vtkMedProfile);
00034 vtkCxxSetObjectMacro(vtkMedFieldOnProfile, ParentFieldOverEntity, vtkMedFieldOverEntity);
00035 
00036 vtkCxxRevisionMacro(vtkMedFieldOnProfile, "$Revision: 1.1.4.5.2.1 $")
00037 vtkStandardNewMacro(vtkMedFieldOnProfile)
00038 
00039 vtkMedFieldOnProfile::vtkMedFieldOnProfile()
00040 {
00041   this->MedIterator = -1;
00042   this->ParentFieldOverEntity = NULL;
00043   this->ProfileName = NULL;
00044   this->ProfileSize = 0;
00045   this->LocalizationName = NULL;
00046   this->NumberOfIntegrationPoint = 0;
00047   this->NumberOfValues = 0;
00048   this->Data = NULL;
00049   this->Profile = NULL;
00050   this->SetProfileName(MED_NO_PROFILE);
00051   this->SetLocalizationName(MED_NO_LOCALIZATION);
00052 }
00053 
00054 vtkMedFieldOnProfile::~vtkMedFieldOnProfile()
00055 {
00056   this->SetProfileName(NULL);
00057   this->SetLocalizationName(NULL);
00058   this->SetParentFieldOverEntity(NULL);
00059   this->SetData(NULL);
00060 }
00061 
00062 int vtkMedFieldOnProfile::GetHasProfile()
00063 {
00064   cout << "Profile Name = " << this->ProfileName << endl;
00065   return strcmp(this->ProfileName, MED_NO_PROFILE) != 0;
00066 }
00067 
00068 int vtkMedFieldOnProfile::IsLoaded()
00069 {
00070   return this->Data!=NULL
00071       && this->Data->GetNumberOfTuples() == this->NumberOfValues;
00072 }
00073 
00074 void  vtkMedFieldOnProfile::Load(med_storage_mode mode)
00075 {
00076   this->ParentFieldOverEntity->GetParentStep()->GetParentField()
00077       ->GetParentFile()->GetMedDriver()->LoadField(this, mode);
00078 }
00079 
00080 void vtkMedFieldOnProfile::PrintSelf(ostream& os, vtkIndent indent)
00081 {
00082   this->Superclass::PrintSelf(os, indent);
00083 
00084   PRINT_IVAR(os, indent, MedIterator);
00085   PRINT_IVAR(os, indent, ProfileSize);
00086   PRINT_IVAR(os, indent, NumberOfIntegrationPoint);
00087   PRINT_IVAR(os, indent, NumberOfValues);
00088 }