Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
VTK
VTK
Commits
2bccf55e
Commit
2bccf55e
authored
Nov 12, 2002
by
Brad King
Browse files
ENH: vtkDataArray::MakeObject() method is now deprecated.
parent
71382535
Changes
47
Hide whitespace changes
Inline
Side-by-side
Common/Testing/Cxx/otherArrays.cxx
View file @
2bccf55e
...
...
@@ -78,23 +78,6 @@ int doArrayTest (ostream& strm, T *ptr, A *array, V value, int size)
ptr
->
SetVoidArray
(
array
,
size
,
1
);
strm
<<
"OK"
<<
endl
;
strm
<<
"
\t
MakeObject..."
;
if
(
ptr2
=
ptr
->
SafeDownCast
(
ptr
->
MakeObject
()))
{
if
(
ptr2
->
GetNumberOfComponents
()
==
10
)
strm
<<
"OK"
<<
endl
;
else
{
errors
++
;
strm
<<
"FAILED"
<<
endl
;
}
ptr2
->
Delete
();
}
else
{
errors
++
;
strm
<<
"FAILED"
<<
endl
;
}
strm
<<
"CreateDefaultLookupTable"
<<
endl
;
ptr
->
CreateDefaultLookupTable
();
strm
<<
*
ptr
;
...
...
Common/vtkBitArray.cxx
View file @
2bccf55e
...
...
@@ -18,16 +18,9 @@
#include
"vtkBitArray.h"
#include
"vtkObjectFactory.h"
vtkCxxRevisionMacro
(
vtkBitArray
,
"1.5
3
"
);
vtkCxxRevisionMacro
(
vtkBitArray
,
"1.5
4
"
);
vtkStandardNewMacro
(
vtkBitArray
);
vtkDataArray
*
vtkBitArray
::
MakeObject
()
{
vtkDataArray
*
a
=
vtkBitArray
::
New
();
a
->
SetNumberOfComponents
(
this
->
NumberOfComponents
);
return
a
;
}
// Instantiate object.
vtkBitArray
::
vtkBitArray
(
vtkIdType
numComp
)
{
...
...
Common/vtkBitArray.h
View file @
2bccf55e
...
...
@@ -44,7 +44,6 @@ public:
void
Initialize
();
// satisfy vtkDataArray API
vtkDataArray
*
MakeObject
();
int
GetDataType
()
{
return
VTK_BIT
;};
int
GetDataTypeSize
()
{
return
0
;
}
...
...
Common/vtkCharArray.cxx
View file @
2bccf55e
...
...
@@ -18,16 +18,9 @@
#include
"vtkCharArray.h"
#include
"vtkObjectFactory.h"
vtkCxxRevisionMacro
(
vtkCharArray
,
"1.3
5
"
);
vtkCxxRevisionMacro
(
vtkCharArray
,
"1.3
6
"
);
vtkStandardNewMacro
(
vtkCharArray
);
vtkDataArray
*
vtkCharArray
::
MakeObject
()
{
vtkDataArray
*
a
=
vtkCharArray
::
New
();
a
->
SetNumberOfComponents
(
this
->
NumberOfComponents
);
return
a
;
}
// Instantiate object.
vtkCharArray
::
vtkCharArray
(
vtkIdType
numComp
)
{
...
...
Common/vtkCharArray.h
View file @
2bccf55e
...
...
@@ -42,10 +42,6 @@ public:
// Description:
// Release storage and reset array to initial state.
void
Initialize
();
// Description:
// Create the same type object as this (virtual constructor).
vtkDataArray
*
MakeObject
();
// Description:
// Get the data type.
...
...
Common/vtkDataArray.cxx
View file @
2bccf55e
...
...
@@ -33,7 +33,7 @@
#include
"vtkIdList.h"
#include
"vtkMath.h"
vtkCxxRevisionMacro
(
vtkDataArray
,
"1.5
2
"
);
vtkCxxRevisionMacro
(
vtkDataArray
,
"1.5
3
"
);
// Construct object with default tuple dimension (number of components) of 1.
vtkDataArray
::
vtkDataArray
(
vtkIdType
numComp
)
...
...
@@ -991,3 +991,14 @@ void vtkDataArray::PrintSelf(ostream& os, vtkIndent indent)
os
<<
indent
<<
"LookupTable: (none)
\n
"
;
}
}
//----------------------------------------------------------------------------
#ifndef VTK_REMOVE_LEGACY_CODE
vtkDataArray
*
vtkDataArray
::
MakeObject
()
{
VTK_LEGACY_METHOD
(
MakeObject
,
"4.2"
);
vtkDataArray
*
a
=
this
->
NewInstance
();
a
->
SetNumberOfComponents
(
this
->
NumberOfComponents
);
return
a
;
}
#endif
Common/vtkDataArray.h
View file @
2bccf55e
...
...
@@ -64,11 +64,11 @@ public:
virtual
int
Allocate
(
const
vtkIdType
sz
,
const
vtkIdType
ext
=
1000
)
=
0
;
virtual
void
Initialize
()
=
0
;
#ifndef VTK_REMOVE_LEGACY_CODE
// Description:
// Virtual constructor creates an object of the same type as this one.
// The created object also has the same number of components. You are
// responsible for freeing the object.
virtual
vtkDataArray
*
MakeObject
()
=
0
;
// For legacy compatibility. Do not use.
virtual
vtkDataArray
*
MakeObject
();
#endif
// Description:
// Return the underlying data type. An integer indicating data type is
...
...
Common/vtkDataSetAttributes.cxx
View file @
2bccf55e
...
...
@@ -33,7 +33,7 @@
#include
"vtkIdTypeArray.h"
#include
"vtkObjectFactory.h"
vtkCxxRevisionMacro
(
vtkDataSetAttributes
,
"1.6
7
"
);
vtkCxxRevisionMacro
(
vtkDataSetAttributes
,
"1.6
8
"
);
vtkStandardNewMacro
(
vtkDataSetAttributes
);
//--------------------------------------------------------------------------
...
...
@@ -106,7 +106,7 @@ void vtkDataSetAttributes::DeepCopy(vtkFieldData *fd)
for
(
int
i
=
0
;
i
<
numArrays
;
i
++
)
{
data
=
fd
->
GetArray
(
i
);
newData
=
data
->
MakeObject
();
//instantiate same type of object
newData
=
data
->
NewInstance
();
//instantiate same type of object
newData
->
DeepCopy
(
data
);
newData
->
SetName
(
data
->
GetName
());
if
((
attributeType
=
dsa
->
IsArrayAnAttribute
(
i
))
!=
-
1
)
...
...
@@ -473,7 +473,8 @@ void vtkDataSetAttributes::CopyAllocate(vtkDataSetAttributes* pd,
{
// Create all required arrays
da
=
pd
->
GetArray
(
i
);
newDA
=
da
->
MakeObject
();
newDA
=
da
->
NewInstance
();
newDA
->
SetNumberOfComponents
(
da
->
GetNumberOfComponents
());
newDA
->
SetName
(
da
->
GetName
());
if
(
sze
>
0
)
{
...
...
Common/vtkDoubleArray.cxx
View file @
2bccf55e
...
...
@@ -18,16 +18,9 @@
#include
"vtkDoubleArray.h"
#include
"vtkObjectFactory.h"
vtkCxxRevisionMacro
(
vtkDoubleArray
,
"1.4
5
"
);
vtkCxxRevisionMacro
(
vtkDoubleArray
,
"1.4
6
"
);
vtkStandardNewMacro
(
vtkDoubleArray
);
vtkDataArray
*
vtkDoubleArray
::
MakeObject
()
{
vtkDataArray
*
a
=
vtkDoubleArray
::
New
();
a
->
SetNumberOfComponents
(
this
->
NumberOfComponents
);
return
a
;
}
// Instantiate object.
vtkDoubleArray
::
vtkDoubleArray
(
vtkIdType
numComp
)
{
...
...
Common/vtkDoubleArray.h
View file @
2bccf55e
...
...
@@ -43,10 +43,6 @@ public:
// Release storage and reset array to initial state.
void
Initialize
();
// Description:
// Create the same type object as this (virtual constructor).
vtkDataArray
*
MakeObject
();
// Description:
// Get the data type.
int
GetDataType
()
{
return
VTK_DOUBLE
;};
...
...
Common/vtkFieldData.cxx
View file @
2bccf55e
...
...
@@ -18,7 +18,7 @@
#include
"vtkFieldData.h"
#include
"vtkObjectFactory.h"
vtkCxxRevisionMacro
(
vtkFieldData
,
"1.4
5
"
);
vtkCxxRevisionMacro
(
vtkFieldData
,
"1.4
6
"
);
vtkStandardNewMacro
(
vtkFieldData
);
vtkFieldData
::
BasicIterator
::
BasicIterator
(
const
int
*
list
,
...
...
@@ -244,7 +244,8 @@ vtkFieldData *vtkFieldData::MakeObject()
for
(
i
=
0
;
i
<
this
->
GetNumberOfArrays
();
i
++
)
{
data
=
this
->
Data
[
i
]
->
MakeObject
();
data
=
this
->
Data
[
i
]
->
NewInstance
();
data
->
SetNumberOfComponents
(
this
->
Data
[
i
]
->
GetNumberOfComponents
());
data
->
SetName
(
this
->
Data
[
i
]
->
GetName
());
f
->
SetArray
(
i
,
data
);
data
->
Delete
();
...
...
@@ -383,7 +384,7 @@ void vtkFieldData::DeepCopy(vtkFieldData *f)
for
(
int
i
=
0
;
i
<
f
->
GetNumberOfArrays
();
i
++
)
{
data
=
f
->
GetArray
(
i
);
newData
=
data
->
MakeObject
();
//instantiate same type of object
newData
=
data
->
NewInstance
();
//instantiate same type of object
newData
->
DeepCopy
(
data
);
newData
->
SetName
(
data
->
GetName
());
this
->
AddArray
(
newData
);
...
...
Common/vtkFloatArray.cxx
View file @
2bccf55e
...
...
@@ -18,16 +18,9 @@
#include
"vtkFloatArray.h"
#include
"vtkObjectFactory.h"
vtkCxxRevisionMacro
(
vtkFloatArray
,
"1.5
5
"
);
vtkCxxRevisionMacro
(
vtkFloatArray
,
"1.5
6
"
);
vtkStandardNewMacro
(
vtkFloatArray
);
vtkDataArray
*
vtkFloatArray
::
MakeObject
()
{
vtkDataArray
*
a
=
vtkFloatArray
::
New
();
a
->
SetNumberOfComponents
(
this
->
NumberOfComponents
);
return
a
;
}
// Instantiate object with 1 components.
vtkFloatArray
::
vtkFloatArray
(
vtkIdType
numComp
)
{
...
...
Common/vtkFloatArray.h
View file @
2bccf55e
...
...
@@ -42,10 +42,6 @@ public:
// Release storage and reset array to initial state.
void
Initialize
();
// Description:
// Create the same type object as this (virtual constructor).
vtkDataArray
*
MakeObject
();
// Description:
// Get the data type.
int
GetDataType
()
...
...
Common/vtkIdTypeArray.cxx
View file @
2bccf55e
...
...
@@ -18,16 +18,9 @@
#include
"vtkIdTypeArray.h"
#include
"vtkObjectFactory.h"
vtkCxxRevisionMacro
(
vtkIdTypeArray
,
"1.
5
"
);
vtkCxxRevisionMacro
(
vtkIdTypeArray
,
"1.
6
"
);
vtkStandardNewMacro
(
vtkIdTypeArray
);
vtkDataArray
*
vtkIdTypeArray
::
MakeObject
()
{
vtkDataArray
*
a
=
vtkIdTypeArray
::
New
();
a
->
SetNumberOfComponents
(
this
->
NumberOfComponents
);
return
a
;
}
// Instantiate object.
vtkIdTypeArray
::
vtkIdTypeArray
(
vtkIdType
numComp
)
{
...
...
Common/vtkIdTypeArray.h
View file @
2bccf55e
...
...
@@ -43,10 +43,6 @@ public:
// Release storage and reset array to initial state.
void
Initialize
();
// Description:
// Create the same type object as this (virtual constructor).
vtkDataArray
*
MakeObject
();
// Description:
// Get the data type.
int
GetDataType
()
...
...
Common/vtkIntArray.cxx
View file @
2bccf55e
...
...
@@ -18,16 +18,9 @@
#include
"vtkIntArray.h"
#include
"vtkObjectFactory.h"
vtkCxxRevisionMacro
(
vtkIntArray
,
"1.6
4
"
);
vtkCxxRevisionMacro
(
vtkIntArray
,
"1.6
5
"
);
vtkStandardNewMacro
(
vtkIntArray
);
vtkDataArray
*
vtkIntArray
::
MakeObject
()
{
vtkDataArray
*
a
=
vtkIntArray
::
New
();
a
->
SetNumberOfComponents
(
this
->
NumberOfComponents
);
return
a
;
}
// Instantiate object.
vtkIntArray
::
vtkIntArray
(
vtkIdType
numComp
)
{
...
...
Common/vtkIntArray.h
View file @
2bccf55e
...
...
@@ -43,10 +43,6 @@ public:
// Release storage and reset array to initial state.
void
Initialize
();
// Description:
// Create the same type object as this (virtual constructor).
vtkDataArray
*
MakeObject
();
// Description:
// Get the data type.
int
GetDataType
()
...
...
Common/vtkLongArray.cxx
View file @
2bccf55e
...
...
@@ -18,16 +18,9 @@
#include
"vtkLongArray.h"
#include
"vtkObjectFactory.h"
vtkCxxRevisionMacro
(
vtkLongArray
,
"1.3
3
"
);
vtkCxxRevisionMacro
(
vtkLongArray
,
"1.3
4
"
);
vtkStandardNewMacro
(
vtkLongArray
);
vtkDataArray
*
vtkLongArray
::
MakeObject
()
{
vtkDataArray
*
a
=
vtkLongArray
::
New
();
a
->
SetNumberOfComponents
(
this
->
NumberOfComponents
);
return
a
;
}
// Instantiate object.
vtkLongArray
::
vtkLongArray
(
vtkIdType
numComp
)
{
...
...
Common/vtkLongArray.h
View file @
2bccf55e
...
...
@@ -51,10 +51,6 @@ public:
// Resize the array while conserving the data.
virtual
void
Resize
(
vtkIdType
numTuples
);
// Description:
// Create the same type object as this (virtual constructor).
vtkDataArray
*
MakeObject
();
// Description:
// Get the data type.
int
GetDataType
()
{
return
VTK_LONG
;};
...
...
Common/vtkPolyLine.cxx
View file @
2bccf55e
...
...
@@ -21,7 +21,7 @@
#include
"vtkObjectFactory.h"
#include
"vtkFloatArray.h"
vtkCxxRevisionMacro
(
vtkPolyLine
,
"1.7
1
"
);
vtkCxxRevisionMacro
(
vtkPolyLine
,
"1.7
2
"
);
vtkStandardNewMacro
(
vtkPolyLine
);
vtkPolyLine
::
vtkPolyLine
()
...
...
@@ -354,7 +354,8 @@ void vtkPolyLine::Contour(float value, vtkDataArray *cellScalars,
vtkCellData
*
outCd
)
{
int
i
,
numLines
=
this
->
Points
->
GetNumberOfPoints
()
-
1
;
vtkDataArray
*
lineScalars
=
cellScalars
->
MakeObject
();
vtkDataArray
*
lineScalars
=
cellScalars
->
NewInstance
();
lineScalars
->
SetNumberOfComponents
(
cellScalars
->
GetNumberOfComponents
());
lineScalars
->
SetNumberOfTuples
(
2
);
for
(
i
=
0
;
i
<
numLines
;
i
++
)
...
...
Prev
1
2
3
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment