Skip to content

Commit 1e594b7

Browse files
authored
Merge pull request #40 from thewtex/cell-data-type
ENH: Support distinct CellData pixel type
2 parents 8e04b0a + 3d3b20c commit 1e594b7

File tree

3 files changed

+211
-199
lines changed

3 files changed

+211
-199
lines changed

include/itkPolyData.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace itk
3131
*
3232
* \ingroup MeshToPolyData
3333
*/
34-
template< typename TPixel >
34+
template< typename TPixel, typename TCellPixel = TPixel >
3535
class ITK_TEMPLATE_EXPORT PolyData: public DataObject
3636
{
3737
public:
@@ -53,7 +53,8 @@ class ITK_TEMPLATE_EXPORT PolyData: public DataObject
5353

5454
/** Type of PointData or CellData */
5555
using PixelType = TPixel;
56-
using MeshTraits = DefaultStaticMeshTraits< PixelType, PointDimension, PointDimension >;
56+
using CellPixelType = TCellPixel;
57+
using MeshTraits = DefaultStaticMeshTraits< PixelType, PointDimension, PointDimension, float, float, CellPixelType >;
5758

5859
/** Convenient type alias obtained from TMeshTraits template parameter. */
5960
using CoordRepType = typename MeshTraits::CoordRepType;
@@ -121,8 +122,8 @@ class ITK_TEMPLATE_EXPORT PolyData: public DataObject
121122

122123
/** Access routines to fill the CellData container, and get information
123124
* from it. */
124-
void SetCellData(CellIdentifier, PixelType);
125-
bool GetCellData(CellIdentifier, PixelType *) const;
125+
void SetCellData(CellIdentifier, CellPixelType);
126+
bool GetCellData(CellIdentifier, CellPixelType *) const;
126127

127128
protected:
128129
PolyData();

0 commit comments

Comments
 (0)