VMTK
Loading...
Searching...
No Matches
DifferentialGeometry
vtkvmtkDataSetItems.cxx
Go to the documentation of this file.
1
/*=========================================================================
2
3
Program: VMTK
4
Module: $RCSfile: vtkvmtkDataSetItems.cxx,v $
5
Language: C++
6
Date: $Date: 2005/11/15 17:39:25 $
7
Version: $Revision: 1.3 $
8
9
Copyright (c) Luca Antiga, David Steinman. All rights reserved.
10
See LICENSE file for details.
11
12
Portions of this code are covered under the VTK copyright.
13
See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm
14
for details.
15
16
This software is distributed WITHOUT ANY WARRANTY; without even
17
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
18
PURPOSE. See the above copyright notices for more information.
19
20
=========================================================================*/
21
22
#include "
vtkvmtkDataSetItems.h
"
23
24
#include "vtkObjectFactory.h"
25
#include "
vtkvmtkDataSetItem.h
"
26
27
28
29
void
vtkvmtkDataSetItems::Build
()
30
{
31
vtkIdType numPts;
32
vtkIdType pointId;
33
vtkvmtkDataSetItem
*dataSetItem;
34
35
if
(this->
DataSet
==NULL)
36
{
37
vtkErrorMacro(<<
"No DataSet specified."
);
38
return
;
39
}
40
41
numPts = this->
DataSet
->GetNumberOfPoints();
42
43
if
(!this->
Array
|| (this->
Array
&& this->
ReallocateOnBuild
))
44
{
45
this->
Allocate
(numPts);
46
this->
MaxId
= numPts - 1;
47
}
48
49
for
(pointId=0; pointId<numPts; pointId++)
50
{
51
dataSetItem =
vtkvmtkDataSetItem::SafeDownCast
(this->
Array
[pointId]);
52
if
(dataSetItem==NULL)
53
{
54
vtkErrorMacro(<<
"Cannot build non-vtkvmtkDataSetItem item."
);
55
return
;
56
}
57
58
dataSetItem->
SetDataSet
(this->
DataSet
);
59
dataSetItem->
SetDataSetPointId
(pointId);
60
dataSetItem->
Build
();
61
}
62
}
63
vtkvmtkDataSetItem
Create an item instance associated with a data set and a particular point id.
Definition
vtkvmtkDataSetItem.h:43
vtkvmtkDataSetItem::Build
virtual void Build()=0
vtkvmtkDataSetItem::SetDataSetPointId
virtual void SetDataSetPointId(vtkIdType)
vtkvmtkDataSetItem::SafeDownCast
static vtkvmtkDataSetItem * SafeDownCast(vtkObjectBase *o)
vtkvmtkDataSetItem::SetDataSet
void SetDataSet(vtkDataSet *dataSet)
Definition
vtkvmtkDataSetItem.h:56
vtkvmtkDataSetItems::DataSet
vtkDataSet * DataSet
Definition
vtkvmtkDataSetItems.h:82
vtkvmtkDataSetItems::ReallocateOnBuild
int ReallocateOnBuild
Definition
vtkvmtkDataSetItems.h:84
vtkvmtkDataSetItems::Build
void Build()
Definition
vtkvmtkDataSetItems.cxx:29
vtkvmtkItems::Allocate
void Allocate(vtkIdType numItems, vtkIdType ext=1000)
Definition
vtkvmtkItems.cxx:41
vtkvmtkItems::MaxId
vtkIdType MaxId
Definition
vtkvmtkItems.h:121
vtkvmtkItems::Array
vtkvmtkItem ** Array
Definition
vtkvmtkItems.h:119
vtkvmtkDataSetItem.h
vtkvmtkDataSetItems.h
Generated by
1.15.0