VMTK
Loading...
Searching...
No Matches
vtkvmtkPolyDataFlowExtensionsFilter Class Reference

Extend open boundaries of a surface with straight (or centerline-following) tubes, tapering the cross-section to a target shape. More...

#include <vtkvmtkPolyDataFlowExtensionsFilter.h>

Inheritance diagram for vtkvmtkPolyDataFlowExtensionsFilter:
[legend]
Collaboration diagram for vtkvmtkPolyDataFlowExtensionsFilter:
[legend]

Public Types

enum  { USE_NORMAL_TO_BOUNDARY = 0 , USE_CENTERLINE_DIRECTION }
enum  { USE_LINEAR_INTERPOLATION = 0 , USE_THIN_PLATE_SPLINE_INTERPOLATION , USE_RAMP_INTERPOLATION }
typedef vtkPolyDataAlgorithm Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkvmtkPolyDataFlowExtensionsFilter * NewInstance () const
void PrintSelf (std::ostream &os, vtkIndent indent) override
virtual void SetCenterlines (vtkPolyData *)
virtual vtkPolyData * GetCenterlines ()
virtual void SetExtensionRatio (double)
virtual double GetExtensionRatio ()
virtual void SetExtensionLength (double)
virtual double GetExtensionLength ()
virtual void SetExtensionLengthScaleFactors (vtkDoubleArray *)
virtual vtkDoubleArray * GetExtensionLengthScaleFactors ()
virtual void SetBoundaryLabelsArrayName (const char *)
virtual char * GetBoundaryLabelsArrayName ()
virtual void SetBoundaryPointOrderArrayName (const char *)
virtual char * GetBoundaryPointOrderArrayName ()
virtual void SetExtensionRadius (double)
virtual double GetExtensionRadius ()
virtual void SetTransitionRatio (double)
virtual double GetTransitionRatio ()
virtual void SetSigma (double)
virtual double GetSigma ()
virtual void SetCenterlineNormalEstimationDistanceRatio (double)
virtual double GetCenterlineNormalEstimationDistanceRatio ()
virtual void SetAdaptiveExtensionLength (int)
virtual int GetAdaptiveExtensionLength ()
virtual void AdaptiveExtensionLengthOn ()
virtual void AdaptiveExtensionLengthOff ()
virtual void SetAdaptiveExtensionRadius (int)
virtual int GetAdaptiveExtensionRadius ()
virtual void AdaptiveExtensionRadiusOn ()
virtual void AdaptiveExtensionRadiusOff ()
virtual void SetPreserveCrossSectionShape (int)
virtual int GetPreserveCrossSectionShape ()
virtual void PreserveCrossSectionShapeOn ()
virtual void PreserveCrossSectionShapeOff ()
virtual void SetNumberOfBoundaryPoints (int)
virtual int GetNumberOfBoundaryPoints ()
virtual void SetAdaptiveNumberOfBoundaryPoints (int)
virtual int GetAdaptiveNumberOfBoundaryPoints ()
virtual void AdaptiveNumberOfBoundaryPointsOn ()
virtual void AdaptiveNumberOfBoundaryPointsOff ()
virtual void SetBoundaryIds (vtkIdList *)
virtual vtkIdList * GetBoundaryIds ()
virtual void SetExtensionMode (int)
virtual int GetExtensionMode ()
void SetExtensionModeToUseNormalToBoundary ()
void SetExtensionModeToUseCenterlineDirection ()
virtual void SetInterpolationMode (int)
virtual int GetInterpolationMode ()
void SetInterpolationModeToLinear ()
void SetInterpolationModeToThinPlateSpline ()
void SetInterpolationModeToRamp ()

Static Public Member Functions

static int IsTypeOf (const char *type)
static vtkvmtkPolyDataFlowExtensionsFilter * SafeDownCast (vtkObjectBase *o)
static vtkvmtkPolyDataFlowExtensionsFilter * New ()

Protected Member Functions

virtual vtkObjectBase * NewInstanceInternal () const
 vtkvmtkPolyDataFlowExtensionsFilter ()
 ~vtkvmtkPolyDataFlowExtensionsFilter ()
virtual int RequestData (vtkInformation *, vtkInformationVector **, vtkInformationVector *) override

Protected Attributes

vtkPolyData * Centerlines
double ExtensionRatio
double ExtensionLength
double ExtensionRadius
vtkDoubleArray * ExtensionLengthScaleFactors
char * BoundaryLabelsArrayName
char * BoundaryPointOrderArrayName
double TransitionRatio
double Sigma
double CenterlineNormalEstimationDistanceRatio
int AdaptiveExtensionLength
int AdaptiveExtensionRadius
int PreserveCrossSectionShape
int NumberOfBoundaryPoints
int AdaptiveNumberOfBoundaryPoints
int ExtensionMode
int InterpolationMode
vtkIdList * BoundaryIds

Detailed Description

Extend open boundaries of a surface with straight (or centerline-following) tubes, tapering the cross-section to a target shape.

For each selected open boundary of the input surface, this filter appends a tubular extension that grows outward from the boundary along a direction either estimated from the local centerline tangent (ExtensionMode = USE_CENTERLINE_DIRECTION) or from the boundary's own normal (ExtensionMode = USE_NORMAL_TO_BOUNDARY). The extension is swept from a target cross-section, which is a circle by default, or the boundary's own outline when PreserveCrossSectionShape is on. The boundary's original (possibly irregular and non-planar) shape is morphed into the target cross-section over the initial TransitionRatio fraction of the extension, either by a thin-plate-spline warp or by fading out a ramp (InterpolationMode). This is the filter behind the vmtkflowextensions pype script, which is typically used to add inlet/outlet flow extensions to a vascular surface before CFD meshing, so that boundary conditions can be applied away from geometrically complex regions and inlet/outlet flow profiles have room to develop/relax.

The extension is left open: its last ring of points is the new inlet/outlet boundary, to be closed downstream (e.g. by vtkvmtkSimpleCapPolyData or vtkvmtkCapPolyData) if a closed surface is needed.

See also
vtkvmtkPolyDataBoundaryExtractor, vtkvmtkBoundaryReferenceSystems, vtkvmtkPolyBallLine

Definition at line 50 of file vtkvmtkPolyDataFlowExtensionsFilter.h.

Member Typedef Documentation

◆ Superclass

Definition at line 53 of file vtkvmtkPolyDataFlowExtensionsFilter.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
USE_NORMAL_TO_BOUNDARY 
USE_CENTERLINE_DIRECTION 

Definition at line 297 of file vtkvmtkPolyDataFlowExtensionsFilter.h.

◆ anonymous enum

anonymous enum

Constructor & Destructor Documentation

◆ vtkvmtkPolyDataFlowExtensionsFilter()

vtkvmtkPolyDataFlowExtensionsFilter::vtkvmtkPolyDataFlowExtensionsFilter ( )
protected

Definition at line 202 of file vtkvmtkPolyDataFlowExtensionsFilter.cxx.

203{
204 this->Centerlines = NULL;
205 this->ExtensionRatio = 1.0;
206 this->TransitionRatio = 0.5;
207 this->ExtensionLength = 0.0;
208 this->ExtensionRadius = 1.0;
209 this->ExtensionLengthScaleFactors = NULL;
210 this->BoundaryLabelsArrayName = NULL;
211 this->BoundaryPointOrderArrayName = NULL;
213 this->AdaptiveExtensionLength = 1;
214 this->AdaptiveExtensionRadius = 1;
216 this->NumberOfBoundaryPoints = 50;
218 this->BoundaryIds = NULL;
219 this->Sigma = 1.0;
222}

◆ ~vtkvmtkPolyDataFlowExtensionsFilter()

vtkvmtkPolyDataFlowExtensionsFilter::~vtkvmtkPolyDataFlowExtensionsFilter ( )
protected

Definition at line 224 of file vtkvmtkPolyDataFlowExtensionsFilter.cxx.

225{
226 if (this->Centerlines)
227 {
228 this->Centerlines->Delete();
229 this->Centerlines = NULL;
230 }
231
232 if (this->BoundaryIds)
233 {
234 this->BoundaryIds->Delete();
235 this->BoundaryIds = NULL;
236 }
237
239 {
240 this->ExtensionLengthScaleFactors->Delete();
241 this->ExtensionLengthScaleFactors = NULL;
242 }
243
244 this->SetBoundaryLabelsArrayName(NULL);
246}
virtual void SetBoundaryPointOrderArrayName(const char *)
virtual void SetBoundaryLabelsArrayName(const char *)

Member Function Documentation

◆ IsTypeOf()

int vtkvmtkPolyDataFlowExtensionsFilter::IsTypeOf ( const char * type)
static

◆ IsA()

virtual int vtkvmtkPolyDataFlowExtensionsFilter::IsA ( const char * type)
virtual

◆ SafeDownCast()

vtkvmtkPolyDataFlowExtensionsFilter * vtkvmtkPolyDataFlowExtensionsFilter::SafeDownCast ( vtkObjectBase * o)
static

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkvmtkPolyDataFlowExtensionsFilter::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkvmtkPolyDataFlowExtensionsFilter * vtkvmtkPolyDataFlowExtensionsFilter::NewInstance ( ) const

◆ PrintSelf()

void vtkvmtkPolyDataFlowExtensionsFilter::PrintSelf ( std::ostream & os,
vtkIndent indent )
override

Definition at line 1004 of file vtkvmtkPolyDataFlowExtensionsFilter.cxx.

1005{
1006 this->Superclass::PrintSelf(os,indent);
1007}

◆ New()

vtkvmtkPolyDataFlowExtensionsFilter * vtkvmtkPolyDataFlowExtensionsFilter::New ( )
static

◆ SetCenterlines()

virtual void vtkvmtkPolyDataFlowExtensionsFilter::SetCenterlines ( vtkPolyData * )
virtual

Set/Get the centerlines used to estimate the extension direction when ExtensionMode is USE_CENTERLINE_DIRECTION. Required in that mode; ignored when ExtensionMode is USE_NORMAL_TO_BOUNDARY.

◆ GetCenterlines()

virtual vtkPolyData * vtkvmtkPolyDataFlowExtensionsFilter::GetCenterlines ( )
virtual

Set/Get the centerlines used to estimate the extension direction when ExtensionMode is USE_CENTERLINE_DIRECTION. Required in that mode; ignored when ExtensionMode is USE_NORMAL_TO_BOUNDARY.

◆ SetExtensionRatio()

virtual void vtkvmtkPolyDataFlowExtensionsFilter::SetExtensionRatio ( double )
virtual

Set/Get the length of the extension, expressed as a multiple of the boundary's mean radius, used when AdaptiveExtensionLength is on. Default: 1.0.

◆ GetExtensionRatio()

virtual double vtkvmtkPolyDataFlowExtensionsFilter::GetExtensionRatio ( )
virtual

Set/Get the length of the extension, expressed as a multiple of the boundary's mean radius, used when AdaptiveExtensionLength is on. Default: 1.0.

◆ SetExtensionLength()

virtual void vtkvmtkPolyDataFlowExtensionsFilter::SetExtensionLength ( double )
virtual

Set/Get the absolute length of the extension, used when AdaptiveExtensionLength is off. Default: 0.0.

◆ GetExtensionLength()

virtual double vtkvmtkPolyDataFlowExtensionsFilter::GetExtensionLength ( )
virtual

Set/Get the absolute length of the extension, used when AdaptiveExtensionLength is off. Default: 0.0.

◆ SetExtensionLengthScaleFactors()

virtual void vtkvmtkPolyDataFlowExtensionsFilter::SetExtensionLengthScaleFactors ( vtkDoubleArray * )
virtual

Set/Get an optional per-boundary scale factor applied to the extension length. Entry i of the array multiplies the length of the extension grown from the boundary whose id is i (the same ids used in BoundaryIds), whether that length comes from ExtensionRatio times the boundary's mean radius or from ExtensionLength. A boundary whose id is beyond the end of the array, or all boundaries when the array is not set (default, NULL), get a factor of 1.0.

◆ GetExtensionLengthScaleFactors()

virtual vtkDoubleArray * vtkvmtkPolyDataFlowExtensionsFilter::GetExtensionLengthScaleFactors ( )
virtual

Set/Get an optional per-boundary scale factor applied to the extension length. Entry i of the array multiplies the length of the extension grown from the boundary whose id is i (the same ids used in BoundaryIds), whether that length comes from ExtensionRatio times the boundary's mean radius or from ExtensionLength. A boundary whose id is beyond the end of the array, or all boundaries when the array is not set (default, NULL), get a factor of 1.0.

◆ SetBoundaryLabelsArrayName()

virtual void vtkvmtkPolyDataFlowExtensionsFilter::SetBoundaryLabelsArrayName ( const char * )
virtual

Set/Get the names of the point data arrays that carry the boundary labels of the input, as written by vtkvmtkPolyDataBoundaryLabeler. When both are set and the input carries arrays that still describe it, the boundaries are read from them instead of being extracted, and the same arrays are written on the output, with the label of each extended boundary carried over to the new boundary at the tip of its extension. That is what lets a caller name a vessel end once and still be talking about the same end after the extension has replaced the boundary it grew from.

Setting them also settles what a boundary id means everywhere else in this filter: with the labels in use a boundary's id is its label, and without them it is the boundary's position in the order the extractor returns, which is what it has always been. So BoundaryIds and ExtensionLengthScaleFactors are read the same way either way, and a caller that labels its surface gets ids that survive the filters in between without having to say so twice.

◆ GetBoundaryLabelsArrayName()

virtual char * vtkvmtkPolyDataFlowExtensionsFilter::GetBoundaryLabelsArrayName ( )
virtual

Set/Get the names of the point data arrays that carry the boundary labels of the input, as written by vtkvmtkPolyDataBoundaryLabeler. When both are set and the input carries arrays that still describe it, the boundaries are read from them instead of being extracted, and the same arrays are written on the output, with the label of each extended boundary carried over to the new boundary at the tip of its extension. That is what lets a caller name a vessel end once and still be talking about the same end after the extension has replaced the boundary it grew from.

Setting them also settles what a boundary id means everywhere else in this filter: with the labels in use a boundary's id is its label, and without them it is the boundary's position in the order the extractor returns, which is what it has always been. So BoundaryIds and ExtensionLengthScaleFactors are read the same way either way, and a caller that labels its surface gets ids that survive the filters in between without having to say so twice.

◆ SetBoundaryPointOrderArrayName()

virtual void vtkvmtkPolyDataFlowExtensionsFilter::SetBoundaryPointOrderArrayName ( const char * )
virtual

Set/Get the names of the point data arrays that carry the boundary labels of the input, as written by vtkvmtkPolyDataBoundaryLabeler. When both are set and the input carries arrays that still describe it, the boundaries are read from them instead of being extracted, and the same arrays are written on the output, with the label of each extended boundary carried over to the new boundary at the tip of its extension. That is what lets a caller name a vessel end once and still be talking about the same end after the extension has replaced the boundary it grew from.

Setting them also settles what a boundary id means everywhere else in this filter: with the labels in use a boundary's id is its label, and without them it is the boundary's position in the order the extractor returns, which is what it has always been. So BoundaryIds and ExtensionLengthScaleFactors are read the same way either way, and a caller that labels its surface gets ids that survive the filters in between without having to say so twice.

◆ GetBoundaryPointOrderArrayName()

virtual char * vtkvmtkPolyDataFlowExtensionsFilter::GetBoundaryPointOrderArrayName ( )
virtual

Set/Get the names of the point data arrays that carry the boundary labels of the input, as written by vtkvmtkPolyDataBoundaryLabeler. When both are set and the input carries arrays that still describe it, the boundaries are read from them instead of being extracted, and the same arrays are written on the output, with the label of each extended boundary carried over to the new boundary at the tip of its extension. That is what lets a caller name a vessel end once and still be talking about the same end after the extension has replaced the boundary it grew from.

Setting them also settles what a boundary id means everywhere else in this filter: with the labels in use a boundary's id is its label, and without them it is the boundary's position in the order the extractor returns, which is what it has always been. So BoundaryIds and ExtensionLengthScaleFactors are read the same way either way, and a caller that labels its surface gets ids that survive the filters in between without having to say so twice.

◆ SetExtensionRadius()

virtual void vtkvmtkPolyDataFlowExtensionsFilter::SetExtensionRadius ( double )
virtual

Set/Get the absolute radius of the extension, used when AdaptiveExtensionRadius is off. Default: 1.0. When PreserveCrossSectionShape is on, the boundary outline is uniformly scaled so that its mean radius equals this value, rather than being replaced by a circle of this radius.

◆ GetExtensionRadius()

virtual double vtkvmtkPolyDataFlowExtensionsFilter::GetExtensionRadius ( )
virtual

Set/Get the absolute radius of the extension, used when AdaptiveExtensionRadius is off. Default: 1.0. When PreserveCrossSectionShape is on, the boundary outline is uniformly scaled so that its mean radius equals this value, rather than being replaced by a circle of this radius.

◆ SetTransitionRatio()

virtual void vtkvmtkPolyDataFlowExtensionsFilter::SetTransitionRatio ( double )
virtual

Set/Get the fraction of the extension length, starting from the original boundary, over which the cross-section is morphed from its original shape into the target cross-section. Beyond this fraction, the extension is a straight, uniform tube. When PreserveCrossSectionShape is on, the target cross-section is the boundary's own outline, so the transition only reconciles the extension with the real, possibly oblique and non-planar rim. Default: 0.5.

◆ GetTransitionRatio()

virtual double vtkvmtkPolyDataFlowExtensionsFilter::GetTransitionRatio ( )
virtual

Set/Get the fraction of the extension length, starting from the original boundary, over which the cross-section is morphed from its original shape into the target cross-section. Beyond this fraction, the extension is a straight, uniform tube. When PreserveCrossSectionShape is on, the target cross-section is the boundary's own outline, so the transition only reconciles the extension with the real, possibly oblique and non-planar rim. Default: 0.5.

◆ SetSigma()

virtual void vtkvmtkPolyDataFlowExtensionsFilter::SetSigma ( double )
virtual

Set/Get the stiffness parameter of the thin-plate-spline transform used to morph the boundary's cross-section into the target cross-section when InterpolationMode is USE_THIN_PLATE_SPLINE_INTERPOLATION. Larger values produce a stiffer, less locally-deforming transform. Ignored by the ramp interpolation modes. Default: 1.0.

◆ GetSigma()

virtual double vtkvmtkPolyDataFlowExtensionsFilter::GetSigma ( )
virtual

Set/Get the stiffness parameter of the thin-plate-spline transform used to morph the boundary's cross-section into the target cross-section when InterpolationMode is USE_THIN_PLATE_SPLINE_INTERPOLATION. Larger values produce a stiffer, less locally-deforming transform. Ignored by the ramp interpolation modes. Default: 1.0.

◆ SetCenterlineNormalEstimationDistanceRatio()

virtual void vtkvmtkPolyDataFlowExtensionsFilter::SetCenterlineNormalEstimationDistanceRatio ( double )
virtual

Set/Get the distance, expressed as a multiple of the boundary's mean radius, walked along the centerline on either side of the boundary's projection when estimating the local centerline tangent used as the extension direction (ExtensionMode = USE_CENTERLINE_DIRECTION). Default: 1.0.

◆ GetCenterlineNormalEstimationDistanceRatio()

virtual double vtkvmtkPolyDataFlowExtensionsFilter::GetCenterlineNormalEstimationDistanceRatio ( )
virtual

Set/Get the distance, expressed as a multiple of the boundary's mean radius, walked along the centerline on either side of the boundary's projection when estimating the local centerline tangent used as the extension direction (ExtensionMode = USE_CENTERLINE_DIRECTION). Default: 1.0.

◆ SetAdaptiveExtensionLength()

virtual void vtkvmtkPolyDataFlowExtensionsFilter::SetAdaptiveExtensionLength ( int )
virtual

Toggle whether the extension length is computed automatically as ExtensionRatio times the boundary's mean radius (on), or taken directly from ExtensionLength (off). Default: on.

◆ GetAdaptiveExtensionLength()

virtual int vtkvmtkPolyDataFlowExtensionsFilter::GetAdaptiveExtensionLength ( )
virtual

Toggle whether the extension length is computed automatically as ExtensionRatio times the boundary's mean radius (on), or taken directly from ExtensionLength (off). Default: on.

◆ AdaptiveExtensionLengthOn()

virtual void vtkvmtkPolyDataFlowExtensionsFilter::AdaptiveExtensionLengthOn ( )
virtual

Toggle whether the extension length is computed automatically as ExtensionRatio times the boundary's mean radius (on), or taken directly from ExtensionLength (off). Default: on.

◆ AdaptiveExtensionLengthOff()

virtual void vtkvmtkPolyDataFlowExtensionsFilter::AdaptiveExtensionLengthOff ( )
virtual

Toggle whether the extension length is computed automatically as ExtensionRatio times the boundary's mean radius (on), or taken directly from ExtensionLength (off). Default: on.

◆ SetAdaptiveExtensionRadius()

virtual void vtkvmtkPolyDataFlowExtensionsFilter::SetAdaptiveExtensionRadius ( int )
virtual

Toggle whether the extension radius is computed automatically from the boundary's own geometry (on), or taken directly from ExtensionRadius (off). Default: on.

◆ GetAdaptiveExtensionRadius()

virtual int vtkvmtkPolyDataFlowExtensionsFilter::GetAdaptiveExtensionRadius ( )
virtual

Toggle whether the extension radius is computed automatically from the boundary's own geometry (on), or taken directly from ExtensionRadius (off). Default: on.

◆ AdaptiveExtensionRadiusOn()

virtual void vtkvmtkPolyDataFlowExtensionsFilter::AdaptiveExtensionRadiusOn ( )
virtual

Toggle whether the extension radius is computed automatically from the boundary's own geometry (on), or taken directly from ExtensionRadius (off). Default: on.

◆ AdaptiveExtensionRadiusOff()

virtual void vtkvmtkPolyDataFlowExtensionsFilter::AdaptiveExtensionRadiusOff ( )
virtual

Toggle whether the extension radius is computed automatically from the boundary's own geometry (on), or taken directly from ExtensionRadius (off). Default: on.

◆ SetPreserveCrossSectionShape()

virtual void vtkvmtkPolyDataFlowExtensionsFilter::SetPreserveCrossSectionShape ( int )
virtual

Toggle whether the extension keeps the cross-sectional shape of the boundary it grows from (on), or morphs it into a circle (off, default). When on, the target cross-section is the boundary outline projected onto the plane orthogonal to the extension direction, uniformly resampled by arc length, so that the area distribution of a non-circular inlet/outlet is not altered. Note that a strongly concave (non star-shaped) preserved outline may be difficult to cap downstream with barycenter-fan cappers, just like the original boundary it reproduces. Default: off.

◆ GetPreserveCrossSectionShape()

virtual int vtkvmtkPolyDataFlowExtensionsFilter::GetPreserveCrossSectionShape ( )
virtual

Toggle whether the extension keeps the cross-sectional shape of the boundary it grows from (on), or morphs it into a circle (off, default). When on, the target cross-section is the boundary outline projected onto the plane orthogonal to the extension direction, uniformly resampled by arc length, so that the area distribution of a non-circular inlet/outlet is not altered. Note that a strongly concave (non star-shaped) preserved outline may be difficult to cap downstream with barycenter-fan cappers, just like the original boundary it reproduces. Default: off.

◆ PreserveCrossSectionShapeOn()

virtual void vtkvmtkPolyDataFlowExtensionsFilter::PreserveCrossSectionShapeOn ( )
virtual

Toggle whether the extension keeps the cross-sectional shape of the boundary it grows from (on), or morphs it into a circle (off, default). When on, the target cross-section is the boundary outline projected onto the plane orthogonal to the extension direction, uniformly resampled by arc length, so that the area distribution of a non-circular inlet/outlet is not altered. Note that a strongly concave (non star-shaped) preserved outline may be difficult to cap downstream with barycenter-fan cappers, just like the original boundary it reproduces. Default: off.

◆ PreserveCrossSectionShapeOff()

virtual void vtkvmtkPolyDataFlowExtensionsFilter::PreserveCrossSectionShapeOff ( )
virtual

Toggle whether the extension keeps the cross-sectional shape of the boundary it grows from (on), or morphs it into a circle (off, default). When on, the target cross-section is the boundary outline projected onto the plane orthogonal to the extension direction, uniformly resampled by arc length, so that the area distribution of a non-circular inlet/outlet is not altered. Note that a strongly concave (non star-shaped) preserved outline may be difficult to cap downstream with barycenter-fan cappers, just like the original boundary it reproduces. Default: off.

◆ SetNumberOfBoundaryPoints()

virtual void vtkvmtkPolyDataFlowExtensionsFilter::SetNumberOfBoundaryPoints ( int )
virtual

Set/Get the number of points used to discretize the target cross-section of the extension, used when AdaptiveNumberOfBoundaryPoints is off. Default: 50.

This count also sets how finely the transition is resolved, because the extension is built one layer of points at a time and the layers are spaced by the distance between two neighbouring points of the target cross-section: 2 * sin(pi/NumberOfBoundaryPoints) * radius for a circular target cross-section, perimeter/NumberOfBoundaryPoints for a preserved one. The number of layers the transition is made of therefore grows in proportion to NumberOfBoundaryPoints, and the first layer, which is one layer thickness away from the boundary, gets that much closer to it. Raising this is what makes the junction between the surface and the extension smooth on a strongly non-circular boundary, where the default 50 leaves the transition a handful of coarse layers. The cost is quadratic: NumberOfBoundaryPoints points per layer, over a number of layers proportional to NumberOfBoundaryPoints.

◆ GetNumberOfBoundaryPoints()

virtual int vtkvmtkPolyDataFlowExtensionsFilter::GetNumberOfBoundaryPoints ( )
virtual

Set/Get the number of points used to discretize the target cross-section of the extension, used when AdaptiveNumberOfBoundaryPoints is off. Default: 50.

This count also sets how finely the transition is resolved, because the extension is built one layer of points at a time and the layers are spaced by the distance between two neighbouring points of the target cross-section: 2 * sin(pi/NumberOfBoundaryPoints) * radius for a circular target cross-section, perimeter/NumberOfBoundaryPoints for a preserved one. The number of layers the transition is made of therefore grows in proportion to NumberOfBoundaryPoints, and the first layer, which is one layer thickness away from the boundary, gets that much closer to it. Raising this is what makes the junction between the surface and the extension smooth on a strongly non-circular boundary, where the default 50 leaves the transition a handful of coarse layers. The cost is quadratic: NumberOfBoundaryPoints points per layer, over a number of layers proportional to NumberOfBoundaryPoints.

◆ SetAdaptiveNumberOfBoundaryPoints()

virtual void vtkvmtkPolyDataFlowExtensionsFilter::SetAdaptiveNumberOfBoundaryPoints ( int )
virtual

Toggle whether the number of points used to discretize the extension's target cross-section is taken equal to the number of points on the original boundary (on), or from NumberOfBoundaryPoints (off). Turning this on keeps the extension at the mesh density of the surface it grows from, which on a finely meshed surface also gives the transition the thin layers it needs to be smooth, without having to pick a count; see NumberOfBoundaryPoints for why the count matters. Default: off.

◆ GetAdaptiveNumberOfBoundaryPoints()

virtual int vtkvmtkPolyDataFlowExtensionsFilter::GetAdaptiveNumberOfBoundaryPoints ( )
virtual

Toggle whether the number of points used to discretize the extension's target cross-section is taken equal to the number of points on the original boundary (on), or from NumberOfBoundaryPoints (off). Turning this on keeps the extension at the mesh density of the surface it grows from, which on a finely meshed surface also gives the transition the thin layers it needs to be smooth, without having to pick a count; see NumberOfBoundaryPoints for why the count matters. Default: off.

◆ AdaptiveNumberOfBoundaryPointsOn()

virtual void vtkvmtkPolyDataFlowExtensionsFilter::AdaptiveNumberOfBoundaryPointsOn ( )
virtual

Toggle whether the number of points used to discretize the extension's target cross-section is taken equal to the number of points on the original boundary (on), or from NumberOfBoundaryPoints (off). Turning this on keeps the extension at the mesh density of the surface it grows from, which on a finely meshed surface also gives the transition the thin layers it needs to be smooth, without having to pick a count; see NumberOfBoundaryPoints for why the count matters. Default: off.

◆ AdaptiveNumberOfBoundaryPointsOff()

virtual void vtkvmtkPolyDataFlowExtensionsFilter::AdaptiveNumberOfBoundaryPointsOff ( )
virtual

Toggle whether the number of points used to discretize the extension's target cross-section is taken equal to the number of points on the original boundary (on), or from NumberOfBoundaryPoints (off). Turning this on keeps the extension at the mesh density of the surface it grows from, which on a finely meshed surface also gives the transition the thin layers it needs to be smooth, without having to pick a count; see NumberOfBoundaryPoints for why the count matters. Default: off.

◆ SetBoundaryIds()

virtual void vtkvmtkPolyDataFlowExtensionsFilter::SetBoundaryIds ( vtkIdList * )
virtual

Set/Get the ids of the boundaries to extend. If not set (default, NULL), every open boundary of the input surface is extended. A boundary's id is its label when BoundaryLabelsArrayName and BoundaryPointOrderArrayName are set and the input carries those arrays, and otherwise its position in the list of open boundaries extracted from the input, in the order returned by vtkvmtkPolyDataBoundaryExtractor.

◆ GetBoundaryIds()

virtual vtkIdList * vtkvmtkPolyDataFlowExtensionsFilter::GetBoundaryIds ( )
virtual

Set/Get the ids of the boundaries to extend. If not set (default, NULL), every open boundary of the input surface is extended. A boundary's id is its label when BoundaryLabelsArrayName and BoundaryPointOrderArrayName are set and the input carries those arrays, and otherwise its position in the list of open boundaries extracted from the input, in the order returned by vtkvmtkPolyDataBoundaryExtractor.

◆ SetExtensionMode()

virtual void vtkvmtkPolyDataFlowExtensionsFilter::SetExtensionMode ( int )
virtual

Set/Get the method used to compute the direction along which each boundary is extended: either USE_NORMAL_TO_BOUNDARY (the boundary's own outward normal) or USE_CENTERLINE_DIRECTION (the local tangent of Centerlines, default). Use the SetExtensionModeToUseNormalToBoundary() / SetExtensionModeToUseCenterlineDirection() convenience methods instead of setting the integer value directly.

◆ GetExtensionMode()

virtual int vtkvmtkPolyDataFlowExtensionsFilter::GetExtensionMode ( )
virtual

Set/Get the method used to compute the direction along which each boundary is extended: either USE_NORMAL_TO_BOUNDARY (the boundary's own outward normal) or USE_CENTERLINE_DIRECTION (the local tangent of Centerlines, default). Use the SetExtensionModeToUseNormalToBoundary() / SetExtensionModeToUseCenterlineDirection() convenience methods instead of setting the integer value directly.

◆ SetExtensionModeToUseNormalToBoundary()

void vtkvmtkPolyDataFlowExtensionsFilter::SetExtensionModeToUseNormalToBoundary ( )
inline

Set/Get the method used to compute the direction along which each boundary is extended: either USE_NORMAL_TO_BOUNDARY (the boundary's own outward normal) or USE_CENTERLINE_DIRECTION (the local tangent of Centerlines, default). Use the SetExtensionModeToUseNormalToBoundary() / SetExtensionModeToUseCenterlineDirection() convenience methods instead of setting the integer value directly.

Definition at line 252 of file vtkvmtkPolyDataFlowExtensionsFilter.h.

◆ SetExtensionModeToUseCenterlineDirection()

void vtkvmtkPolyDataFlowExtensionsFilter::SetExtensionModeToUseCenterlineDirection ( )
inline

Set/Get the method used to compute the direction along which each boundary is extended: either USE_NORMAL_TO_BOUNDARY (the boundary's own outward normal) or USE_CENTERLINE_DIRECTION (the local tangent of Centerlines, default). Use the SetExtensionModeToUseNormalToBoundary() / SetExtensionModeToUseCenterlineDirection() convenience methods instead of setting the integer value directly.

Definition at line 254 of file vtkvmtkPolyDataFlowExtensionsFilter.h.

◆ SetInterpolationMode()

virtual void vtkvmtkPolyDataFlowExtensionsFilter::SetInterpolationMode ( int )
virtual

Set/Get the method used to morph the extension's cross-section from the original boundary shape into the target cross-section over the TransitionRatio portion of the extension.

USE_THIN_PLATE_SPLINE_INTERPOLATION warps the transition portion of the extension with a thin-plate spline pinned to the original boundary at one end and to the undeformed extension at the other. It is the default, and is kept as such for backward compatibility. A thin-plate spline reproduces the boundary exactly only where it is pinned, and loses the finer features of the cross-section faster than the coarse ones as it moves away, so on a strongly non-circular (say, flat) boundary most of the transition happens within the first layers of the extension and lengthening TransitionRatio does not spread it out.

USE_LINEAR_INTERPOLATION and USE_RAMP_INTERPOLATION instead pair each point of the target cross-section with the point of the boundary it grows from, and fade the displacement between the two out over the transition: linearly for the former, and with a smoothstep, flat at both ends, for the latter. Both make the extension start on the real cross-section and reach the target one exactly at the end of the transition, however non-circular the boundary is, so the transition is both smoother and as long as TransitionRatio asks for. USE_RAMP_INTERPOLATION is the one to prefer: being flat at both ends, it leaves no crease where the extension meets the boundary or where it becomes a uniform tube. How closely the extension actually starts on the boundary is still limited by the thickness of its first layer, so a strongly non-circular boundary also wants a NumberOfBoundaryPoints high enough to resolve the transition into thin layers.

Use the SetInterpolationModeToLinear() / SetInterpolationModeToThinPlateSpline() / SetInterpolationModeToRamp() convenience methods instead of setting the integer value directly.

◆ GetInterpolationMode()

virtual int vtkvmtkPolyDataFlowExtensionsFilter::GetInterpolationMode ( )
virtual

Set/Get the method used to morph the extension's cross-section from the original boundary shape into the target cross-section over the TransitionRatio portion of the extension.

USE_THIN_PLATE_SPLINE_INTERPOLATION warps the transition portion of the extension with a thin-plate spline pinned to the original boundary at one end and to the undeformed extension at the other. It is the default, and is kept as such for backward compatibility. A thin-plate spline reproduces the boundary exactly only where it is pinned, and loses the finer features of the cross-section faster than the coarse ones as it moves away, so on a strongly non-circular (say, flat) boundary most of the transition happens within the first layers of the extension and lengthening TransitionRatio does not spread it out.

USE_LINEAR_INTERPOLATION and USE_RAMP_INTERPOLATION instead pair each point of the target cross-section with the point of the boundary it grows from, and fade the displacement between the two out over the transition: linearly for the former, and with a smoothstep, flat at both ends, for the latter. Both make the extension start on the real cross-section and reach the target one exactly at the end of the transition, however non-circular the boundary is, so the transition is both smoother and as long as TransitionRatio asks for. USE_RAMP_INTERPOLATION is the one to prefer: being flat at both ends, it leaves no crease where the extension meets the boundary or where it becomes a uniform tube. How closely the extension actually starts on the boundary is still limited by the thickness of its first layer, so a strongly non-circular boundary also wants a NumberOfBoundaryPoints high enough to resolve the transition into thin layers.

Use the SetInterpolationModeToLinear() / SetInterpolationModeToThinPlateSpline() / SetInterpolationModeToRamp() convenience methods instead of setting the integer value directly.

◆ SetInterpolationModeToLinear()

void vtkvmtkPolyDataFlowExtensionsFilter::SetInterpolationModeToLinear ( )
inline

Set/Get the method used to morph the extension's cross-section from the original boundary shape into the target cross-section over the TransitionRatio portion of the extension.

USE_THIN_PLATE_SPLINE_INTERPOLATION warps the transition portion of the extension with a thin-plate spline pinned to the original boundary at one end and to the undeformed extension at the other. It is the default, and is kept as such for backward compatibility. A thin-plate spline reproduces the boundary exactly only where it is pinned, and loses the finer features of the cross-section faster than the coarse ones as it moves away, so on a strongly non-circular (say, flat) boundary most of the transition happens within the first layers of the extension and lengthening TransitionRatio does not spread it out.

USE_LINEAR_INTERPOLATION and USE_RAMP_INTERPOLATION instead pair each point of the target cross-section with the point of the boundary it grows from, and fade the displacement between the two out over the transition: linearly for the former, and with a smoothstep, flat at both ends, for the latter. Both make the extension start on the real cross-section and reach the target one exactly at the end of the transition, however non-circular the boundary is, so the transition is both smoother and as long as TransitionRatio asks for. USE_RAMP_INTERPOLATION is the one to prefer: being flat at both ends, it leaves no crease where the extension meets the boundary or where it becomes a uniform tube. How closely the extension actually starts on the boundary is still limited by the thickness of its first layer, so a strongly non-circular boundary also wants a NumberOfBoundaryPoints high enough to resolve the transition into thin layers.

Use the SetInterpolationModeToLinear() / SetInterpolationModeToThinPlateSpline() / SetInterpolationModeToRamp() convenience methods instead of setting the integer value directly.

Definition at line 288 of file vtkvmtkPolyDataFlowExtensionsFilter.h.

◆ SetInterpolationModeToThinPlateSpline()

void vtkvmtkPolyDataFlowExtensionsFilter::SetInterpolationModeToThinPlateSpline ( )
inline

Set/Get the method used to morph the extension's cross-section from the original boundary shape into the target cross-section over the TransitionRatio portion of the extension.

USE_THIN_PLATE_SPLINE_INTERPOLATION warps the transition portion of the extension with a thin-plate spline pinned to the original boundary at one end and to the undeformed extension at the other. It is the default, and is kept as such for backward compatibility. A thin-plate spline reproduces the boundary exactly only where it is pinned, and loses the finer features of the cross-section faster than the coarse ones as it moves away, so on a strongly non-circular (say, flat) boundary most of the transition happens within the first layers of the extension and lengthening TransitionRatio does not spread it out.

USE_LINEAR_INTERPOLATION and USE_RAMP_INTERPOLATION instead pair each point of the target cross-section with the point of the boundary it grows from, and fade the displacement between the two out over the transition: linearly for the former, and with a smoothstep, flat at both ends, for the latter. Both make the extension start on the real cross-section and reach the target one exactly at the end of the transition, however non-circular the boundary is, so the transition is both smoother and as long as TransitionRatio asks for. USE_RAMP_INTERPOLATION is the one to prefer: being flat at both ends, it leaves no crease where the extension meets the boundary or where it becomes a uniform tube. How closely the extension actually starts on the boundary is still limited by the thickness of its first layer, so a strongly non-circular boundary also wants a NumberOfBoundaryPoints high enough to resolve the transition into thin layers.

Use the SetInterpolationModeToLinear() / SetInterpolationModeToThinPlateSpline() / SetInterpolationModeToRamp() convenience methods instead of setting the integer value directly.

Definition at line 290 of file vtkvmtkPolyDataFlowExtensionsFilter.h.

◆ SetInterpolationModeToRamp()

void vtkvmtkPolyDataFlowExtensionsFilter::SetInterpolationModeToRamp ( )
inline

Set/Get the method used to morph the extension's cross-section from the original boundary shape into the target cross-section over the TransitionRatio portion of the extension.

USE_THIN_PLATE_SPLINE_INTERPOLATION warps the transition portion of the extension with a thin-plate spline pinned to the original boundary at one end and to the undeformed extension at the other. It is the default, and is kept as such for backward compatibility. A thin-plate spline reproduces the boundary exactly only where it is pinned, and loses the finer features of the cross-section faster than the coarse ones as it moves away, so on a strongly non-circular (say, flat) boundary most of the transition happens within the first layers of the extension and lengthening TransitionRatio does not spread it out.

USE_LINEAR_INTERPOLATION and USE_RAMP_INTERPOLATION instead pair each point of the target cross-section with the point of the boundary it grows from, and fade the displacement between the two out over the transition: linearly for the former, and with a smoothstep, flat at both ends, for the latter. Both make the extension start on the real cross-section and reach the target one exactly at the end of the transition, however non-circular the boundary is, so the transition is both smoother and as long as TransitionRatio asks for. USE_RAMP_INTERPOLATION is the one to prefer: being flat at both ends, it leaves no crease where the extension meets the boundary or where it becomes a uniform tube. How closely the extension actually starts on the boundary is still limited by the thickness of its first layer, so a strongly non-circular boundary also wants a NumberOfBoundaryPoints high enough to resolve the transition into thin layers.

Use the SetInterpolationModeToLinear() / SetInterpolationModeToThinPlateSpline() / SetInterpolationModeToRamp() convenience methods instead of setting the integer value directly.

Definition at line 292 of file vtkvmtkPolyDataFlowExtensionsFilter.h.

◆ RequestData()

int vtkvmtkPolyDataFlowExtensionsFilter::RequestData ( vtkInformation * ,
vtkInformationVector ** ,
vtkInformationVector *  )
overrideprotectedvirtual

Definition at line 248 of file vtkvmtkPolyDataFlowExtensionsFilter.cxx.

252{
253 vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
254 vtkInformation *outInfo = outputVector->GetInformationObject(0);
255
256 vtkPolyData *input = vtkPolyData::SafeDownCast(
257 inInfo->Get(vtkDataObject::DATA_OBJECT()));
258 vtkPolyData *output = vtkPolyData::SafeDownCast(
259 outInfo->Get(vtkDataObject::DATA_OBJECT()));
260
262 {
263 if (!this->Centerlines)
264 {
265 vtkErrorMacro(<< "Centerlines not set.");
266 return 1;
267 }
268 }
269
270 vtkNew<vtkPoints> outputPoints;
271 vtkNew<vtkCellArray> outputPolys;
272
273 outputPoints->DeepCopy(input->GetPoints());
274 outputPolys->DeepCopy(input->GetPolys());
275
276 // The boundaries either come from the labels the input already carries, in which case they
277 // cost a bucket sort rather than an extraction and, more to the point, are the very same
278 // boundaries every other filter reading those labels sees, or they are extracted here as they
279 // always were.
280 bool useBoundaryLabels = false;
281
282 // Outlives the block below: the label of each boundary is needed wherever a boundary id is
283 // read, which with the labels in use is the label rather than the position.
284 vtkNew<vtkIdList> boundaryLabels;
285 vtkSmartPointer<vtkPolyData> boundaries;
288 {
289 vtkNew<vtkPolyData> labeledBoundaries;
290 useBoundaryLabels = vtkvmtkBoundaryLabels::GetBoundaries(
292 labeledBoundaries, boundaryLabels);
293 if (useBoundaryLabels)
294 {
295 boundaries = labeledBoundaries;
296 }
297 else
298 {
299 vtkWarningMacro(<<"The boundary label arrays are missing from the input surface or no longer describe it; "
300 <<"extracting its boundaries instead, and leaving the output unlabeled.");
301 }
302 }
303 if (!boundaries)
304 {
305 vtkNew<vtkvmtkPolyDataBoundaryExtractor> boundaryExtractor;
306 boundaryExtractor->SetInputData(input);
307 boundaryExtractor->Update();
308 boundaries = boundaryExtractor->GetOutput();
309 }
310
311 vtkNew<vtkPolyData> centerlines;
312 vtkNew<vtkvmtkPolyBallLine> tube;
313 vtkNew<vtkDoubleArray> zeroRadiusArray;
314
316 {
317 centerlines->DeepCopy(this->Centerlines);
318
319 const char zeroRadiusArrayName[] = "ZeroRadiusArray";
320
321 zeroRadiusArray->SetName(zeroRadiusArrayName);
322 zeroRadiusArray->SetNumberOfTuples(centerlines->GetNumberOfPoints());
323 zeroRadiusArray->FillComponent(0,0.0);
324
325 centerlines->GetPointData()->AddArray(zeroRadiusArray);
326
327 tube->SetInput(centerlines);
328 tube->SetPolyBallRadiusArrayName(zeroRadiusArrayName);
329 }
330
331 input->BuildCells();
332 input->BuildLinks();
333
334 // Per boundary, the ring it started from and the ring it ended as, so that its label can be
335 // moved from the one to the other once the mesh is built. Empty for a boundary that was not
336 // extended, whose own ring is still a boundary of the output and keeps its label where it is.
337 std::vector<std::vector<vtkIdType> > originalRingByBoundary(boundaries->GetNumberOfCells());
338 std::vector<std::vector<vtkIdType> > tipRingByBoundary(boundaries->GetNumberOfCells());
339
340 int i, k;
341 for (i=0; i<boundaries->GetNumberOfCells(); i++)
342 {
343 if (this->BoundaryIds)
344 {
345 // A boundary is named by its label when the labels are in use, and by its position in the
346 // extraction order otherwise, here as everywhere else in this filter.
347 if (this->BoundaryIds->IsId(useBoundaryLabels ? boundaryLabels->GetId(i) : i) == -1)
348 {
349 continue;
350 }
351 }
352
353 vtkPolyLine* boundary = vtkPolyLine::SafeDownCast(boundaries->GetCell(i));
354
355 if (!boundary)
356 {
357 vtkErrorMacro(<<"Boundary not a vtkPolyLine");
358 continue;
359 }
360
361 int numberOfBoundaryPoints = boundary->GetNumberOfPoints();
362
363 vtkNew<vtkIdList> boundaryIds;
364 int j;
365 for (j=0; j<numberOfBoundaryPoints; j++)
366 {
367 boundaryIds->InsertNextId(static_cast<vtkIdType>(vtkMath::Round(boundaries->GetPointData()->GetScalars()->GetComponent(boundary->GetPointId(j),0))));
368 }
369
370 double barycenter[3];
371 double normal[3], outwardNormal[3];
372 double meanRadius;
373
374 vtkvmtkBoundaryReferenceSystems::ComputeBoundaryBarycenter(boundary->GetPoints(),barycenter);
375 meanRadius = vtkvmtkBoundaryReferenceSystems::ComputeBoundaryMeanRadius(boundary->GetPoints(),barycenter);
376 vtkvmtkBoundaryReferenceSystems::ComputeBoundaryNormal(boundary->GetPoints(),barycenter,normal);
377 vtkvmtkBoundaryReferenceSystems::OrientBoundaryNormalOutwards(input,boundaries,i,normal,outwardNormal);
378
379 double flowExtensionNormal[3];
380 flowExtensionNormal[0] = flowExtensionNormal[1] = flowExtensionNormal[2] = 0.0;
381
383 {
384 tube->EvaluateFunction(barycenter);
385
386 double centerlinePoint[3];
387 vtkIdType cellId, subId;
388 double pcoord;
389 tube->GetLastPolyBallCenter(centerlinePoint);
390 cellId = tube->GetLastPolyBallCellId();
391 subId = tube->GetLastPolyBallCellSubId();
392 pcoord = tube->GetLastPolyBallCellPCoord();
393
394 vtkCell* centerline = centerlines->GetCell(cellId);
395
396 vtkIdType pointId0, pointId1;
397 double abscissa;
398
399 double point0[3], point1[3];
400
401 pointId0 = 0;
402 abscissa = sqrt(vtkMath::Distance2BetweenPoints(centerlinePoint,centerline->GetPoints()->GetPoint(subId)));
403 for (j=subId-1; j>=0; j--)
404 {
405 centerline->GetPoints()->GetPoint(j,point0);
406 centerline->GetPoints()->GetPoint(j+1,point1);
407 abscissa += sqrt(vtkMath::Distance2BetweenPoints(point0,point1));
408 if (abscissa > meanRadius * this->CenterlineNormalEstimationDistanceRatio)
409 {
410 pointId0 = j;
411 break;
412 }
413 }
414
415 pointId1 = centerline->GetNumberOfPoints()-1;
416 abscissa = sqrt(vtkMath::Distance2BetweenPoints(centerlinePoint,centerline->GetPoints()->GetPoint(subId+1)));
417 for (j=subId+1; j<centerline->GetNumberOfPoints()-2; j++)
418 {
419 centerline->GetPoints()->GetPoint(j,point0);
420 centerline->GetPoints()->GetPoint(j+1,point1);
421 abscissa += sqrt(vtkMath::Distance2BetweenPoints(point0,point1));
422 if (abscissa > meanRadius * this->CenterlineNormalEstimationDistanceRatio)
423 {
424 pointId1 = j+1;
425 break;
426 }
427 }
428
429 // use an approximating spline or smooth centerline points to better catch the trend in computing centerlineNormal?
430
431 double centerlineNormal[3];
432
433 centerline->GetPoints()->GetPoint(pointId0,point0);
434 centerline->GetPoints()->GetPoint(pointId1,point1);
435
436 double toleranceFactor = 1E-4;
437
438 for (k=0; k<3; k++)
439 {
440 centerlineNormal[k] = 0.0;
441 }
442 if (sqrt(vtkMath::Distance2BetweenPoints(point1,centerlinePoint)) > toleranceFactor*meanRadius)
443 {
444 for (k=0; k<3; k++)
445 {
446 centerlineNormal[k] += point1[k] - centerlinePoint[k];
447 }
448 }
449 if (sqrt(vtkMath::Distance2BetweenPoints(centerlinePoint,point0)) > toleranceFactor*meanRadius)
450 {
451 for (k=0; k<3; k++)
452 {
453 centerlineNormal[k] += centerlinePoint[k] - point0[k];
454 }
455 }
456
457 vtkMath::Normalize(centerlineNormal);
458
459 for (k=0; k<3; k++)
460 {
461 flowExtensionNormal[k] = centerlineNormal[k];
462 }
463
464 if (vtkMath::Dot(outwardNormal,centerlineNormal) < 0.0)
465 {
466 for (k=0; k<3; k++)
467 {
468 flowExtensionNormal[k] *= -1.0;
469 }
470 }
471 }
472 else if (this->ExtensionMode == USE_NORMAL_TO_BOUNDARY)
473 {
474 for (k=0; k<3; k++)
475 {
476 flowExtensionNormal[k] = outwardNormal[k];
477 }
478 }
479 else
480 {
481 vtkErrorMacro(<< "Invalid ExtensionMode.");
482 return 1;
483 }
484
485 double extensionLength;
486
487 if (this->AdaptiveExtensionLength)
488 {
489 extensionLength = meanRadius * this->ExtensionRatio;
490 }
491 else
492 {
493 extensionLength = this->ExtensionLength;
494 }
495
497 {
498 vtkIdType boundaryId = useBoundaryLabels ? boundaryLabels->GetId(i) : i;
499 if (boundaryId < this->ExtensionLengthScaleFactors->GetNumberOfTuples())
500 {
501 extensionLength *= this->ExtensionLengthScaleFactors->GetValue(boundaryId);
502 }
503 }
504
505 double point[3], extensionPoint[3];
506
507 // Project the boundary onto the plane through the barycenter orthogonal to the extension
508 // direction. This is the outline the extension is swept from when PreserveCrossSectionShape
509 // is on, and its mean radius is the extension radius when AdaptiveExtensionRadius is on.
510 vtkNew<vtkPoints> projectedBoundaryPoints;
511 double meanProjectedRadius = 0.0;
512
513 double barycenterToPoint[3];
514 double outOfPlaneDistance;
515 double projectedPoint[3];
516 for (j=0; j<numberOfBoundaryPoints; j++)
517 {
518 boundary->GetPoints()->GetPoint(j,point);
519 for (k=0; k<3; k++)
520 {
521 barycenterToPoint[k] = point[k] - barycenter[k];
522 }
523 outOfPlaneDistance = vtkMath::Dot(barycenterToPoint,flowExtensionNormal);
524 for (k=0; k<3; k++)
525 {
526 barycenterToPoint[k] -= outOfPlaneDistance*flowExtensionNormal[k];
527 projectedPoint[k] = barycenter[k] + barycenterToPoint[k];
528 }
529 projectedBoundaryPoints->InsertNextPoint(projectedPoint);
530 meanProjectedRadius += vtkMath::Norm(barycenterToPoint);
531 }
532 meanProjectedRadius /= numberOfBoundaryPoints;
533
534 double targetRadius = 0.0;
535
536 if (this->AdaptiveExtensionRadius)
537 {
538 targetRadius = meanProjectedRadius;
539 }
540 else
541 {
542 targetRadius = this->ExtensionRadius;
543 }
544
545 if (this->PreserveCrossSectionShape && meanProjectedRadius < 1E-4 * meanRadius)
546 {
547 vtkWarningMacro(<<"Degenerate boundary outline, skipping flow extension for boundary "<<i);
548 continue;
549 }
550
551 vtkNew<vtkIdList> newBoundaryIds;
552 vtkNew<vtkIdList> previousBoundaryIds;
553 vtkIdType pointId;
554
555 previousBoundaryIds->DeepCopy(boundaryIds);
556
557 // TODO: use area, not meanRadius as targetRadius
558
559 int targetNumberOfBoundaryPoints = this->NumberOfBoundaryPoints;
561 {
562 targetNumberOfBoundaryPoints = numberOfBoundaryPoints;
563 }
564
565 double targetDistanceBetweenPoints = 0.0;
566
567 vtkNew<vtkThinPlateSplineTransform> thinPlateSplineTransform;
568 thinPlateSplineTransform->SetSigma(this->Sigma);
569 thinPlateSplineTransform->SetBasisToR2LogR();
570// thinPlateSplineTransform->SetBasisToR();
571
572 vtkNew<vtkPoints> sourceLandmarks;
573 vtkNew<vtkPoints> targetLandmarks;
574
575 vtkNew<vtkPoints> targetBoundaryPoints;
576 vtkNew<vtkPoints> targetStaggeredBoundaryPoints;
577
578 // The ramp interpolation modes need, for each point of the target cross-section, the point of
579 // the real boundary it grows from. The pairing is built along with the target cross-section
580 // itself, so that it is ordered and one-to-one whatever the shape of the boundary.
581 bool useRampInterpolation = (this->InterpolationMode == USE_LINEAR_INTERPOLATION) || (this->InterpolationMode == USE_RAMP_INTERPOLATION);
582 vtkNew<vtkPoints> rimBoundaryPoints;
583 vtkNew<vtkPoints> rimStaggeredBoundaryPoints;
584
585 int startNumberOfBoundaryPoints = numberOfBoundaryPoints;
586
588 {
589 // The target cross-section is the boundary's own outline, projected onto the plane
590 // orthogonal to the extension direction and uniformly resampled along its perimeter. Since
591 // the samples follow the order of the boundary points, their winding matches the boundary's.
592 // Sampling the boundary itself at the same stations pairs each target point with the point
593 // it is the projection of.
594 vtkPoints* rimPoints = useRampInterpolation ? rimBoundaryPoints.GetPointer() : nullptr;
595 vtkPoints* rimStaggeredPoints = useRampInterpolation ? rimStaggeredBoundaryPoints.GetPointer() : nullptr;
596 double perimeter = ResampleClosedPolygon(projectedBoundaryPoints,targetNumberOfBoundaryPoints,0.0,targetBoundaryPoints,boundary->GetPoints(),rimPoints);
597 ResampleClosedPolygon(projectedBoundaryPoints,targetNumberOfBoundaryPoints,0.5,targetStaggeredBoundaryPoints,boundary->GetPoints(),rimStaggeredPoints);
598
599 double targetPoint[3];
600 double scale = 1.0;
601
602 if (!this->AdaptiveExtensionRadius)
603 {
604 // scale the outline about the barycenter so that its mean radius is the requested
605 // extension radius; the outline is left at its natural size when the radius is adaptive
606 double meanResampledRadius = 0.0;
607 for (j=0; j<targetNumberOfBoundaryPoints; j++)
608 {
609 targetBoundaryPoints->GetPoint(j,targetPoint);
610 for (k=0; k<3; k++)
611 {
612 targetPoint[k] -= barycenter[k];
613 }
614 meanResampledRadius += vtkMath::Norm(targetPoint);
615 }
616 meanResampledRadius /= targetNumberOfBoundaryPoints;
617 scale = targetRadius / meanResampledRadius;
618
619 for (j=0; j<targetNumberOfBoundaryPoints; j++)
620 {
621 targetBoundaryPoints->GetPoint(j,targetPoint);
622 for (k=0; k<3; k++)
623 {
624 targetPoint[k] = barycenter[k] + scale * (targetPoint[k] - barycenter[k]);
625 }
626 targetBoundaryPoints->SetPoint(j,targetPoint);
627 targetStaggeredBoundaryPoints->GetPoint(j,targetPoint);
628 for (k=0; k<3; k++)
629 {
630 targetPoint[k] = barycenter[k] + scale * (targetPoint[k] - barycenter[k]);
631 }
632 targetStaggeredBoundaryPoints->SetPoint(j,targetPoint);
633 }
634 }
635
636 targetDistanceBetweenPoints = scale * perimeter / targetNumberOfBoundaryPoints;
637 }
638 else
639 {
640 targetDistanceBetweenPoints = 2.0 * sin (vtkMath::Pi() / targetNumberOfBoundaryPoints) * targetRadius;
641
642 double baseRadialNormal[3];
643 input->GetPoint(previousBoundaryIds->GetId(0),point);
644 for (k=0; k<3; k++)
645 {
646 baseRadialNormal[k] = point[k] - barycenter[k];
647 }
648 double outOfPlaneComponent = vtkMath::Dot(baseRadialNormal,flowExtensionNormal);
649 for (k=0; k<3; k++)
650 {
651 baseRadialNormal[k] -= outOfPlaneComponent * flowExtensionNormal[k];
652 }
653 vtkMath::Normalize(baseRadialNormal);
654 double angle = 360.0 / targetNumberOfBoundaryPoints;
655 vtkNew<vtkTransform> transform;
656 transform->RotateWXYZ(0.5*angle,flowExtensionNormal);
657 double testRadialNormal[3];
658 transform->TransformPoint(baseRadialNormal,testRadialNormal);
659 double cross[3], testCross[3], point1[3];
660 vtkMath::Cross(baseRadialNormal,testRadialNormal,testCross);
661 double dist = 0.0;
662 int testId = 1;
663 int numberOfPreviousBoundaryIds = previousBoundaryIds->GetNumberOfIds();
664 while (dist < 1E-8 && testId < numberOfPreviousBoundaryIds)
665 {
666 input->GetPoint(previousBoundaryIds->GetId(testId),point1);
667 dist = sqrt(vtkMath::Distance2BetweenPoints(point,point1));
668 testId++;
669 }
670 double testRadialVector[3];
671 for (k=0; k<3; k++)
672 {
673 testRadialVector[k] = point1[k] - barycenter[k];
674 }
675 vtkMath::Cross(baseRadialNormal,testRadialVector,cross);
676 if (vtkMath::Dot(cross,testCross) < 0.0)
677 {
678 angle *= -1.0;
679 transform->Identity();
680 transform->RotateWXYZ(0.5*angle,flowExtensionNormal);
681 }
682 double radialVector[3];
683 for (k=0; k<3; k++)
684 {
685 radialVector[k] = targetRadius * baseRadialNormal[k];
686 }
687 double targetPoint[3];
688 for (j=0; j<targetNumberOfBoundaryPoints; j++)
689 {
690 for (k=0; k<3; k++)
691 {
692 targetPoint[k] = barycenter[k] + radialVector[k];
693 }
694 targetBoundaryPoints->InsertNextPoint(targetPoint);
695 transform->TransformPoint(radialVector,radialVector);
696 for (k=0; k<3; k++)
697 {
698 targetPoint[k] = barycenter[k] + radialVector[k];
699 }
700 targetStaggeredBoundaryPoints->InsertNextPoint(targetPoint);
701 transform->TransformPoint(radialVector,radialVector);
702 }
703
704 if (useRampInterpolation)
705 {
706 // Pair each point of the circle with the point of the boundary that lies on the same ray
707 // from the barycenter, so that the transition is a purely radial morph. Matching by
708 // proximity instead would collapse whole arcs of the circle onto the same few boundary
709 // points on a strongly non-circular boundary, and would pair the two facing sides of a
710 // flat one with each other.
711 if (!SampleClosedPolygonByAngle(projectedBoundaryPoints,boundary->GetPoints(),barycenter,flowExtensionNormal,baseRadialNormal,angle,0.0,targetNumberOfBoundaryPoints,rimBoundaryPoints)
712 || !SampleClosedPolygonByAngle(projectedBoundaryPoints,boundary->GetPoints(),barycenter,flowExtensionNormal,baseRadialNormal,angle,0.5,targetNumberOfBoundaryPoints,rimStaggeredBoundaryPoints))
713 {
714 vtkWarningMacro(<<"Boundary "<<i<<" is not star-shaped about its barycenter, pairing it with the extension by arc length instead of by angle");
715 rimBoundaryPoints->Initialize();
716 rimStaggeredBoundaryPoints->Initialize();
717 vtkNew<vtkPoints> discardedPoints;
718 ResampleClosedPolygon(projectedBoundaryPoints,targetNumberOfBoundaryPoints,0.0,discardedPoints,boundary->GetPoints(),rimBoundaryPoints);
719 discardedPoints->Initialize();
720 ResampleClosedPolygon(projectedBoundaryPoints,targetNumberOfBoundaryPoints,0.5,discardedPoints,boundary->GetPoints(),rimStaggeredBoundaryPoints);
721 }
722 }
723 }
724
725 // Displacement taking each point of the target cross-section onto the point of the real
726 // boundary it is paired with. Fading it out over the transition length is what the ramp
727 // interpolation modes do, so the extension starts on the real boundary and reaches the target
728 // cross-section exactly at the end of the transition, whatever the shape of the boundary.
729 std::vector<double> displacement, staggeredDisplacement;
730
731 if (useRampInterpolation)
732 {
733 displacement.resize(3*targetNumberOfBoundaryPoints);
734 staggeredDisplacement.resize(3*targetNumberOfBoundaryPoints);
735 double targetPoint[3], rimPoint[3];
736 for (j=0; j<targetNumberOfBoundaryPoints; j++)
737 {
738 targetBoundaryPoints->GetPoint(j,targetPoint);
739 rimBoundaryPoints->GetPoint(j,rimPoint);
740 for (k=0; k<3; k++)
741 {
742 displacement[3*j+k] = rimPoint[k] - targetPoint[k];
743 }
744 targetStaggeredBoundaryPoints->GetPoint(j,targetPoint);
745 rimStaggeredBoundaryPoints->GetPoint(j,rimPoint);
746 for (k=0; k<3; k++)
747 {
748 staggeredDisplacement[3*j+k] = rimPoint[k] - targetPoint[k];
749 }
750 }
751 }
752
754 {
755 for (j=0; j<targetNumberOfBoundaryPoints; j++)
756 {
757 double firstBoundaryPoint[3], lastBoundaryPoint[3];
758 targetBoundaryPoints->GetPoint(j,firstBoundaryPoint);
759 double distance = 1E20;
760 double currentPoint[3];
761 for (int j2=0; j2<startNumberOfBoundaryPoints; j2++)
762 {
763 input->GetPoint(previousBoundaryIds->GetId(j2),currentPoint);
764 double currentDistance = vtkMath::Distance2BetweenPoints(currentPoint,firstBoundaryPoint);
765 if (currentDistance < distance)
766 {
767 distance = currentDistance;
768 for (k=0; k<3; k++)
769 {
770 point[k] = currentPoint[k];
771 }
772 }
773 }
774 sourceLandmarks->InsertNextPoint(firstBoundaryPoint);
775 targetLandmarks->InsertNextPoint(point);
776 for (k=0; k<3; k++)
777 {
778 lastBoundaryPoint[k] = firstBoundaryPoint[k] + extensionLength * this->TransitionRatio * flowExtensionNormal[k];
779 }
780 sourceLandmarks->InsertNextPoint(lastBoundaryPoint);
781 targetLandmarks->InsertNextPoint(lastBoundaryPoint);
782 }
783 thinPlateSplineTransform->SetSourceLandmarks(sourceLandmarks);
784 thinPlateSplineTransform->SetTargetLandmarks(targetLandmarks);
785 }
786
787 double transitionLength = extensionLength * this->TransitionRatio;
788 int numberOfLayers = extensionLength / targetDistanceBetweenPoints;
789 int numberOfTransitionLayers = transitionLength / targetDistanceBetweenPoints;
790 int l;
791 for (l=0; l<numberOfLayers; l++)
792 {
793 newBoundaryIds->Initialize();
794 for (j=0; j<targetNumberOfBoundaryPoints; j++)
795 {
796 if (l%2 != 0)
797 {
798 targetBoundaryPoints->GetPoint(j,extensionPoint);
799 }
800 else
801 {
802 targetStaggeredBoundaryPoints->GetPoint(j,extensionPoint);
803 }
804 for (k=0; k<3; k++)
805 {
806 extensionPoint[k] += (l+1) * targetDistanceBetweenPoints * flowExtensionNormal[k];
807 }
808 if (l<numberOfTransitionLayers)
809 {
811 {
812 thinPlateSplineTransform->TransformPoint(extensionPoint,extensionPoint);
813 }
814 else
815 {
816 // fade the displacement onto the real boundary from full at the boundary to none at
817 // the end of the transition; since the whole displacement is scaled by the same
818 // weight, the transition spans exactly transitionLength however irregular the
819 // boundary is
820 double parametricHeight = (l+1) * targetDistanceBetweenPoints / transitionLength;
821 parametricHeight = parametricHeight > 1.0 ? 1.0 : parametricHeight;
822 double weight = 0.0;
824 {
825 weight = 1.0 - parametricHeight;
826 }
827 else
828 {
829 // smoothstep, flat at both ends, so that the extension leaves the boundary
830 // tangentially and settles into the uniform tube without a crease
831 weight = 1.0 - parametricHeight * parametricHeight * (3.0 - 2.0 * parametricHeight);
832 }
833 const std::vector<double>& layerDisplacement = (l%2 != 0) ? displacement : staggeredDisplacement;
834 for (k=0; k<3; k++)
835 {
836 extensionPoint[k] += weight * layerDisplacement[3*j+k];
837 }
838 }
839 }
840 pointId = outputPoints->InsertNextPoint(extensionPoint);
841 newBoundaryIds->InsertNextId(pointId);
842 }
843
844 if (l==0)
845 {
846 vtkIdType pts[3];
847 int j2 = 0;
848 for (j=0; j<targetNumberOfBoundaryPoints; j++)
849 {
850 double point0[3], point1[3], point2[3], point3[3];
851 outputPoints->GetPoint(previousBoundaryIds->GetId(j2%startNumberOfBoundaryPoints),point0);
852 outputPoints->GetPoint(previousBoundaryIds->GetId((j2+1)%startNumberOfBoundaryPoints),point1);
853 outputPoints->GetPoint(newBoundaryIds->GetId(j),point2);
854 outputPoints->GetPoint(newBoundaryIds->GetId((j+1)%targetNumberOfBoundaryPoints),point3);
855
856 bool advance = false;
857 if ((j==0) || (j==targetNumberOfBoundaryPoints-1) || (vtkMath::Distance2BetweenPoints(point0,point3) > vtkMath::Distance2BetweenPoints(point1,point2)))
858 {
859 advance = true;
860 }
861 if (j2 == startNumberOfBoundaryPoints)
862 {
863 advance = false;
864 }
865 while(advance)
866 {
867 pts[0] = previousBoundaryIds->GetId(j2%startNumberOfBoundaryPoints);
868 pts[1] = newBoundaryIds->GetId(j);
869 pts[2] = previousBoundaryIds->GetId((j2+1)%startNumberOfBoundaryPoints);
870 outputPolys->InsertNextCell(3,pts);
871 j2 += 1;
872
873 outputPoints->GetPoint(previousBoundaryIds->GetId(j2%startNumberOfBoundaryPoints),point0);
874 outputPoints->GetPoint(previousBoundaryIds->GetId((j2+1)%startNumberOfBoundaryPoints),point1);
875 outputPoints->GetPoint(newBoundaryIds->GetId(j),point2);
876 outputPoints->GetPoint(newBoundaryIds->GetId((j+1)%targetNumberOfBoundaryPoints),point3);
877
878 if (j2 == startNumberOfBoundaryPoints || vtkMath::Distance2BetweenPoints(point0,point3) < vtkMath::Distance2BetweenPoints(point1,point2))
879 {
880 advance = false;
881 if (j2 < startNumberOfBoundaryPoints && j == targetNumberOfBoundaryPoints-1)
882 {
883 advance = true;
884 }
885 }
886 }
887 pts[0] = newBoundaryIds->GetId(j);
888 pts[1] = newBoundaryIds->GetId((j+1)%targetNumberOfBoundaryPoints);
889 pts[2] = previousBoundaryIds->GetId(j2%startNumberOfBoundaryPoints);
890 outputPolys->InsertNextCell(3,pts);
891 }
892 }
893 else
894 {
895 vtkIdType pts[3];
896 for (j=0; j<targetNumberOfBoundaryPoints; j++)
897 {
898 if (l%2 != 0)
899 {
900 pts[0] = newBoundaryIds->GetId(j);
901 pts[1] = newBoundaryIds->GetId((j-1+targetNumberOfBoundaryPoints)%targetNumberOfBoundaryPoints);
902 pts[2] = previousBoundaryIds->GetId((j-1+targetNumberOfBoundaryPoints)%targetNumberOfBoundaryPoints);
903 outputPolys->InsertNextCell(3,pts);
904
905 pts[0] = previousBoundaryIds->GetId(j);
906 pts[1] = newBoundaryIds->GetId(j);
907 pts[2] = previousBoundaryIds->GetId((j-1+targetNumberOfBoundaryPoints)%targetNumberOfBoundaryPoints);
908 outputPolys->InsertNextCell(3,pts);
909 }
910 else
911 {
912 pts[0] = newBoundaryIds->GetId(j);
913 pts[1] = newBoundaryIds->GetId((j-1+targetNumberOfBoundaryPoints)%targetNumberOfBoundaryPoints);
914 pts[2] = previousBoundaryIds->GetId(j);
915 outputPolys->InsertNextCell(3,pts);
916
917 pts[0] = previousBoundaryIds->GetId(j);
918 pts[1] = newBoundaryIds->GetId((j-1+targetNumberOfBoundaryPoints)%targetNumberOfBoundaryPoints);
919 pts[2] = previousBoundaryIds->GetId((j-1+targetNumberOfBoundaryPoints)%targetNumberOfBoundaryPoints);
920 outputPolys->InsertNextCell(3,pts);
921 }
922 }
923 }
924
925 previousBoundaryIds->DeepCopy(newBoundaryIds);
926 }
927
928 // previousBoundaryIds is now the last ring laid down, which is the new open boundary at the
929 // tip of this extension - or, when the extension was too short for a single layer, still the
930 // ring this started from, which is then the right answer too.
931 if (useBoundaryLabels)
932 {
933 for (j=0; j<boundaryIds->GetNumberOfIds(); j++)
934 {
935 originalRingByBoundary[i].push_back(boundaryIds->GetId(j));
936 }
937 for (j=0; j<previousBoundaryIds->GetNumberOfIds(); j++)
938 {
939 tipRingByBoundary[i].push_back(previousBoundaryIds->GetId(j));
940 }
941 }
942
943 }
944
945 output->SetPoints(outputPoints);
946 output->SetPolys(outputPolys);
947
948 if (useBoundaryLabels)
949 {
950 // Carry the labels onto the output. The points of the input keep the ids they had - they are
951 // deep copied first and the extensions only append - so the arrays copy across as they
952 // stand, and only the boundaries that were extended have to be moved: the ring an extension
953 // grew from is inside the surface now and is no longer anything's boundary, while the ring
954 // at the tip is, and is the same vessel end.
955 const vtkIdType invalidLabel = vtkvmtkBoundaryLabels::GetInvalidBoundaryLabel();
956 vtkIdType numberOfInputPoints = input->GetNumberOfPoints();
957 vtkIdType numberOfOutputPoints = outputPoints->GetNumberOfPoints();
958
959 vtkDataArray* inputLabels = input->GetPointData()->GetArray(this->BoundaryLabelsArrayName);
960 vtkDataArray* inputOrder = input->GetPointData()->GetArray(this->BoundaryPointOrderArrayName);
961
962 vtkNew<vtkIntArray> outputLabels;
963 outputLabels->SetName(this->BoundaryLabelsArrayName);
964 outputLabels->SetNumberOfTuples(numberOfOutputPoints);
965 outputLabels->FillComponent(0,static_cast<double>(invalidLabel));
966
967 vtkNew<vtkIntArray> outputOrder;
968 outputOrder->SetName(this->BoundaryPointOrderArrayName);
969 outputOrder->SetNumberOfTuples(numberOfOutputPoints);
970 outputOrder->FillComponent(0,static_cast<double>(invalidLabel));
971
972 for (vtkIdType pointId=0; pointId<numberOfInputPoints; pointId++)
973 {
974 outputLabels->SetValue(pointId,static_cast<int>(vtkMath::Round(inputLabels->GetComponent(pointId,0))));
975 outputOrder->SetValue(pointId,static_cast<int>(vtkMath::Round(inputOrder->GetComponent(pointId,0))));
976 }
977
978 for (size_t boundaryIndex=0; boundaryIndex<tipRingByBoundary.size(); boundaryIndex++)
979 {
980 if (tipRingByBoundary[boundaryIndex].empty())
981 {
982 continue;
983 }
984 vtkIdType boundaryLabel = boundaryLabels->GetId(static_cast<vtkIdType>(boundaryIndex));
985 for (size_t j2=0; j2<originalRingByBoundary[boundaryIndex].size(); j2++)
986 {
987 outputLabels->SetValue(originalRingByBoundary[boundaryIndex][j2],static_cast<int>(invalidLabel));
988 outputOrder->SetValue(originalRingByBoundary[boundaryIndex][j2],static_cast<int>(invalidLabel));
989 }
990 for (size_t j2=0; j2<tipRingByBoundary[boundaryIndex].size(); j2++)
991 {
992 outputLabels->SetValue(tipRingByBoundary[boundaryIndex][j2],static_cast<int>(boundaryLabel));
993 outputOrder->SetValue(tipRingByBoundary[boundaryIndex][j2],static_cast<int>(j2));
994 }
995 }
996
997 output->GetPointData()->AddArray(outputLabels);
998 output->GetPointData()->AddArray(outputOrder);
999 }
1000
1001 return 1;
1002}
static bool GetBoundaries(vtkPolyData *surface, const char *boundaryLabelsArrayName, const char *boundaryPointOrderArrayName, vtkPolyData *boundaries, vtkIdList *boundaryLabels)
static vtkIdType GetInvalidBoundaryLabel()
static void ComputeBoundaryBarycenter(vtkPoints *points, double barycenter[3])
static void OrientBoundaryNormalOutwards(vtkPolyData *surface, vtkPolyData *boundaries, vtkIdType boundaryCellId, double normal[3], double outwardNormal[3])
static void ComputeBoundaryNormal(vtkPoints *points, double barycenter[3], double normal[3])
static double ComputeBoundaryMeanRadius(vtkPoints *points, double barycenter[3])

Member Data Documentation

◆ Centerlines

vtkPolyData* vtkvmtkPolyDataFlowExtensionsFilter::Centerlines
protected

Definition at line 315 of file vtkvmtkPolyDataFlowExtensionsFilter.h.

◆ ExtensionRatio

double vtkvmtkPolyDataFlowExtensionsFilter::ExtensionRatio
protected

Definition at line 317 of file vtkvmtkPolyDataFlowExtensionsFilter.h.

◆ ExtensionLength

double vtkvmtkPolyDataFlowExtensionsFilter::ExtensionLength
protected

Definition at line 318 of file vtkvmtkPolyDataFlowExtensionsFilter.h.

◆ ExtensionRadius

double vtkvmtkPolyDataFlowExtensionsFilter::ExtensionRadius
protected

Definition at line 319 of file vtkvmtkPolyDataFlowExtensionsFilter.h.

◆ ExtensionLengthScaleFactors

vtkDoubleArray* vtkvmtkPolyDataFlowExtensionsFilter::ExtensionLengthScaleFactors
protected

Definition at line 321 of file vtkvmtkPolyDataFlowExtensionsFilter.h.

◆ BoundaryLabelsArrayName

char* vtkvmtkPolyDataFlowExtensionsFilter::BoundaryLabelsArrayName
protected

Definition at line 322 of file vtkvmtkPolyDataFlowExtensionsFilter.h.

◆ BoundaryPointOrderArrayName

char* vtkvmtkPolyDataFlowExtensionsFilter::BoundaryPointOrderArrayName
protected

Definition at line 323 of file vtkvmtkPolyDataFlowExtensionsFilter.h.

◆ TransitionRatio

double vtkvmtkPolyDataFlowExtensionsFilter::TransitionRatio
protected

Definition at line 325 of file vtkvmtkPolyDataFlowExtensionsFilter.h.

◆ Sigma

double vtkvmtkPolyDataFlowExtensionsFilter::Sigma
protected

Definition at line 326 of file vtkvmtkPolyDataFlowExtensionsFilter.h.

◆ CenterlineNormalEstimationDistanceRatio

double vtkvmtkPolyDataFlowExtensionsFilter::CenterlineNormalEstimationDistanceRatio
protected

Definition at line 328 of file vtkvmtkPolyDataFlowExtensionsFilter.h.

◆ AdaptiveExtensionLength

int vtkvmtkPolyDataFlowExtensionsFilter::AdaptiveExtensionLength
protected

Definition at line 330 of file vtkvmtkPolyDataFlowExtensionsFilter.h.

◆ AdaptiveExtensionRadius

int vtkvmtkPolyDataFlowExtensionsFilter::AdaptiveExtensionRadius
protected

Definition at line 331 of file vtkvmtkPolyDataFlowExtensionsFilter.h.

◆ PreserveCrossSectionShape

int vtkvmtkPolyDataFlowExtensionsFilter::PreserveCrossSectionShape
protected

Definition at line 333 of file vtkvmtkPolyDataFlowExtensionsFilter.h.

◆ NumberOfBoundaryPoints

int vtkvmtkPolyDataFlowExtensionsFilter::NumberOfBoundaryPoints
protected

Definition at line 335 of file vtkvmtkPolyDataFlowExtensionsFilter.h.

◆ AdaptiveNumberOfBoundaryPoints

int vtkvmtkPolyDataFlowExtensionsFilter::AdaptiveNumberOfBoundaryPoints
protected

Definition at line 336 of file vtkvmtkPolyDataFlowExtensionsFilter.h.

◆ ExtensionMode

int vtkvmtkPolyDataFlowExtensionsFilter::ExtensionMode
protected

Definition at line 338 of file vtkvmtkPolyDataFlowExtensionsFilter.h.

◆ InterpolationMode

int vtkvmtkPolyDataFlowExtensionsFilter::InterpolationMode
protected

Definition at line 339 of file vtkvmtkPolyDataFlowExtensionsFilter.h.

◆ BoundaryIds

vtkIdList* vtkvmtkPolyDataFlowExtensionsFilter::BoundaryIds
protected

Definition at line 341 of file vtkvmtkPolyDataFlowExtensionsFilter.h.


The documentation for this class was generated from the following files: