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 // .NAME vtkMedIntArrayInternal - dynamic, self-adjusting array of med_int
21 // .SECTION Description
22 // vtkMedIntArray is an array of values of type med_int.
23 // It provides methods for insertion and retrieval of values and will
24 // automatically resize itself to hold new data.
26 #ifndef __vtkMedIntArrayInternal_h
27 #define __vtkMedIntArrayInternal_h
31 // Tell the template header how to give our superclass a DLL interface.
32 #if !defined(__vtkMedIntArrayInternal_cxx)
33 # define VTK_DATA_ARRAY_TEMPLATE_TYPE med_int
36 #include "vtkDataArray.h"
37 #include "vtkDataArrayTemplate.h" // Real Superclass
39 // Fake the superclass for the wrappers.
40 #define vtkDataArray vtkDataArrayTemplate<med_int>
41 class VTK_EXPORT vtkMedIntArrayInternal : public vtkDataArray
45 static vtkMedIntArrayInternal* New();
46 vtkTypeRevisionMacro(vtkMedIntArrayInternal,vtkDataArray);
47 void PrintSelf(ostream& os, vtkIndent indent);
53 { if(sizeof(med_int) == sizeof(vtkIdType)) return VTK_ID_TYPE;
54 if(sizeof(med_int) == sizeof(int)) return VTK_INT;
55 if(sizeof(med_int) == sizeof(long)) return VTK_LONG;
60 // Copy the tuple value into a user-provided array.
61 void GetTupleValue(vtkIdType i, med_int* tuple)
62 { this->RealSuperclass::GetTupleValue(i, tuple); }
65 // Set the tuple value at the ith location in the array.
66 void SetTupleValue(vtkIdType i, const med_int* tuple)
67 { this->RealSuperclass::SetTupleValue(i, tuple); }
70 // Insert (memory allocation performed) the tuple into the ith location
72 void InsertTupleValue(vtkIdType i, const med_int* tuple)
73 { this->RealSuperclass::InsertTupleValue(i, tuple); }
76 // Insert (memory allocation performed) the tuple onto the end of the array.
77 vtkIdType InsertNextTupleValue(const med_int* tuple)
78 { return this->RealSuperclass::InsertNextTupleValue(tuple); }
81 // Get the data at a particular index.
82 med_int GetValue(vtkIdType id)
83 { return this->RealSuperclass::GetValue(id); }
86 // Set the data at a particular index. Does not do range checking. Make sure
87 // you use the method SetNumberOfValues() before inserting data.
88 void SetValue(vtkIdType id, med_int value)
89 { this->RealSuperclass::SetValue(id, value); }
92 // Specify the number of values for this object to hold. Does an
93 // allocation as well as setting the MaxId ivar. Used in conjunction with
94 // SetValue() method for fast insertion.
95 void SetNumberOfValues(vtkIdType number)
96 { this->RealSuperclass::SetNumberOfValues(number); }
99 // Insert data at a specified position in the array.
100 void InsertValue(vtkIdType id, med_int f)
101 { this->RealSuperclass::InsertValue(id, f); }
104 // Insert data at the end of the array. Return its location in the array.
105 vtkIdType InsertNextValue(med_int f)
106 { return this->RealSuperclass::InsertNextValue(f); }
109 // Get the address of a particular data index. Make sure data is allocated
110 // for the number of items requested. Set MaxId according to the number of
111 // data values requested.
112 med_int* WritePointer(vtkIdType id, vtkIdType number)
113 { return this->RealSuperclass::WritePointer(id, number); }
116 // Get the address of a particular data index. Performs no checks
117 // to verify that the memory has been allocated etc.
118 med_int* GetPointer(vtkIdType id)
119 { return this->RealSuperclass::GetPointer(id); }
122 // This method lets the user specify data to be held by the array. The
123 // array argument is a pointer to the data. size is the size of
124 // the array supplied by the user. Set save to 1 to keep the class
125 // from deleting the array when it cleans up or reallocates memory.
126 // The class uses the actual array provided; it does not copy the data
127 // from the suppled array.
128 void SetArray(med_int* array, vtkIdType size, int save)
129 { this->RealSuperclass::SetArray(array, size, save); }
130 void SetArray(med_int* array, vtkIdType size, int save, int deleteMethod)
131 { this->RealSuperclass::SetArray(array, size, save, deleteMethod); }
134 vtkMedIntArrayInternal(vtkIdType numComp=1);
135 ~vtkMedIntArrayInternal();
139 typedef vtkDataArrayTemplate<med_int> RealSuperclass;
141 vtkMedIntArrayInternal(const vtkMedIntArrayInternal&); // Not implemented.
142 void operator=(const vtkMedIntArrayInternal&); // Not implemented.