1 // Copyright (C) 2010-2012 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 "vtkMedStructElement.h"
22 #include "vtkObjectFactory.h"
23 #include "vtkMedUtilities.h"
24 #include "vtkMedVariableAttribute.h"
25 #include "vtkMedConstantAttribute.h"
26 #include "vtkMedFile.h"
27 #include "vtkMedMesh.h"
34 vtkCxxGetObjectVectorMacro(vtkMedStructElement, VariableAttribute, vtkMedVariableAttribute);
35 vtkCxxSetObjectVectorMacro(vtkMedStructElement, VariableAttribute, vtkMedVariableAttribute);
36 vtkCxxGetObjectVectorMacro(vtkMedStructElement, ConstantAttribute, vtkMedConstantAttribute);
37 vtkCxxSetObjectVectorMacro(vtkMedStructElement, ConstantAttribute, vtkMedConstantAttribute);
39 vtkCxxSetObjectMacro(vtkMedStructElement, ParentFile, vtkMedFile);
40 vtkCxxSetObjectMacro(vtkMedStructElement, SupportMesh, vtkMedMesh);
42 vtkCxxRevisionMacro(vtkMedStructElement, "$Revision$")
43 vtkStandardNewMacro(vtkMedStructElement)
45 vtkMedStructElement::vtkMedStructElement()
47 this->MedIterator = -1;
49 this->GeometryType = MED_UNDEF_GEOTYPE;
50 this->ModelDimension = 0;
51 this->SupportMeshName = NULL;
52 this->SupportMesh = NULL;
53 this->SupportEntityType = MED_UNDEF_ENTITY_TYPE;
54 this->SupportNumberOfNode = 0;
55 this->SupportNumberOfCell = 0;
56 this->SupportGeometryType = MED_UNDEF_GEOTYPE;
57 this->AnyProfile = MED_FALSE;
58 this->VariableAttribute = new vtkObjectVector<vtkMedVariableAttribute>();
59 this->ConstantAttribute = new vtkObjectVector<vtkMedConstantAttribute>();
60 this->ParentFile = NULL;
63 vtkMedStructElement::~vtkMedStructElement()
66 this->SetSupportMeshName(NULL);
67 this->SetParentFile(NULL);
68 this->SetSupportMesh(NULL);
69 delete this->VariableAttribute;
70 delete this->ConstantAttribute;
73 void vtkMedStructElement::LoadVariableAttributes(vtkMedEntityArray* array)
75 for(int varattit = 0; varattit < this->GetNumberOfVariableAttribute(); varattit++)
77 vtkMedVariableAttribute* varatt = this->GetVariableAttribute(varattit);
82 int vtkMedStructElement::GetConnectivitySize()
84 if(strcmp(this->Name, MED_PARTICLE_NAME) == 0
85 || this->SupportEntityType != MED_CELL)
86 return this->SupportNumberOfNode;
88 return this->SupportNumberOfCell *
89 vtkMedUtilities::GetNumberOfPoint(this->SupportGeometryType);
92 void vtkMedStructElement::PrintSelf(ostream& os, vtkIndent indent)
94 this->Superclass::PrintSelf(os, indent);