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 "vtkMedFieldOnProfile.h"
22 #include "vtkObjectFactory.h"
23 #include "vtkDataArray.h"
25 #include "vtkMedFieldOverEntity.h"
26 #include "vtkMedFieldStep.h"
27 #include "vtkMedField.h"
28 #include "vtkMedFile.h"
29 #include "vtkMedDriver.h"
30 #include "vtkMedProfile.h"
32 vtkCxxSetObjectMacro(vtkMedFieldOnProfile, Data, vtkDataArray);
33 vtkCxxSetObjectMacro(vtkMedFieldOnProfile, Profile, vtkMedProfile);
34 vtkCxxSetObjectMacro(vtkMedFieldOnProfile, ParentFieldOverEntity, vtkMedFieldOverEntity);
36 // vtkCxxRevisionMacro(vtkMedFieldOnProfile, "$Revision$")
37 vtkStandardNewMacro(vtkMedFieldOnProfile)
39 vtkMedFieldOnProfile::vtkMedFieldOnProfile()
41 this->MedIterator = -1;
42 this->ParentFieldOverEntity = NULL;
43 this->ProfileName = NULL;
44 this->ProfileSize = 0;
45 this->LocalizationName = NULL;
46 this->NumberOfIntegrationPoint = 0;
47 this->NumberOfValues = 0;
50 this->SetProfileName(MED_NO_PROFILE);
51 this->SetLocalizationName(MED_NO_LOCALIZATION);
54 vtkMedFieldOnProfile::~vtkMedFieldOnProfile()
56 this->SetProfileName(NULL);
57 this->SetLocalizationName(NULL);
58 this->SetParentFieldOverEntity(NULL);
62 int vtkMedFieldOnProfile::GetHasProfile()
64 cout << "Profile Name = " << this->ProfileName << endl;
65 return strcmp(this->ProfileName, MED_NO_PROFILE) != 0;
68 int vtkMedFieldOnProfile::IsLoaded()
70 return this->Data!=NULL
71 && this->Data->GetNumberOfTuples() == this->NumberOfValues;
74 void vtkMedFieldOnProfile::Load(med_storage_mode mode)
76 this->ParentFieldOverEntity->GetParentStep()->GetParentField()
77 ->GetParentFile()->GetMedDriver()->LoadField(this, mode);
80 void vtkMedFieldOnProfile::PrintSelf(ostream& os, vtkIndent indent)
82 this->Superclass::PrintSelf(os, indent);
84 PRINT_IVAR(os, indent, MedIterator);
85 PRINT_IVAR(os, indent, ProfileSize);
86 PRINT_IVAR(os, indent, NumberOfIntegrationPoint);
87 PRINT_IVAR(os, indent, NumberOfValues);