|
VMTK
|
Give each open boundary of a surface a label that stays with it. More...
#include <vtkvmtkPolyDataBoundaryLabeler.h>
Public Types | |
| enum | { BOUNDARY_EXTRACTION_ORDER , CLOSEST_TO_PLANE_ORIGIN , ON_PLANE , MATCH_EXISTING_LABELS } |
| typedef vtkPolyDataAlgorithm | Superclass |
Public Member Functions | |
| virtual int | IsA (const char *type) |
| vtkvmtkPolyDataBoundaryLabeler * | NewInstance () const |
| void | PrintSelf (std::ostream &os, vtkIndent indent) override |
| virtual vtkIdType | GetNumberOfBoundaries () |
| virtual vtkIdList * | GetBoundaryLabels () |
| virtual vtkIdList * | GetUnmatchedPlaneLabels () |
| virtual void | SetBoundaryLabelsArrayName (const char *) |
| virtual char * | GetBoundaryLabelsArrayName () |
| virtual void | SetBoundaryPointOrderArrayName (const char *) |
| virtual char * | GetBoundaryPointOrderArrayName () |
| virtual void | SetLabelingMode (int) |
| virtual int | GetLabelingMode () |
| void | SetLabelingModeToBoundaryExtractionOrder () |
| void | SetLabelingModeToClosestToPlaneOrigin () |
| void | SetLabelingModeToOnPlane () |
| void | SetLabelingModeToMatchExistingLabels () |
| virtual void | SetCellEntityIdOffset (vtkIdType) |
| virtual vtkIdType | GetCellEntityIdOffset () |
| virtual void | SetAnnular (bool) |
| virtual bool | GetAnnular () |
| virtual void | AnnularOn () |
| virtual void | AnnularOff () |
| virtual void | SetAnnularOuterBoundaryOffset (vtkIdType) |
| virtual vtkIdType | GetAnnularOuterBoundaryOffset () |
| virtual void | SetPlaneOrigins (vtkPoints *) |
| virtual vtkPoints * | GetPlaneOrigins () |
| virtual void | SetPlaneNormals (vtkDoubleArray *) |
| virtual vtkDoubleArray * | GetPlaneNormals () |
| virtual void | SetPlaneLabels (vtkIdList *) |
| virtual vtkIdList * | GetPlaneLabels () |
| virtual void | SetMaximumDistanceFromPlane (double) |
| virtual double | GetMaximumDistanceFromPlane () |
| virtual void | SetMaximumDistanceFromPlaneOrigin (double) |
| virtual double | GetMaximumDistanceFromPlaneOrigin () |
Static Public Member Functions | |
| static int | IsTypeOf (const char *type) |
| static vtkvmtkPolyDataBoundaryLabeler * | SafeDownCast (vtkObjectBase *o) |
| static vtkvmtkPolyDataBoundaryLabeler * | New () |
Protected Member Functions | |
| virtual vtkObjectBase * | NewInstanceInternal () const |
| vtkvmtkPolyDataBoundaryLabeler () | |
| ~vtkvmtkPolyDataBoundaryLabeler () override | |
| int | RequestData (vtkInformation *, vtkInformationVector **, vtkInformationVector *) override |
| void | LabelAnnularPairs (vtkPolyData *boundaries, std::vector< vtkIdType > &labels) |
Protected Attributes | |
| char * | BoundaryLabelsArrayName |
| char * | BoundaryPointOrderArrayName |
| int | LabelingMode |
| vtkIdType | CellEntityIdOffset |
| bool | Annular |
| vtkIdType | AnnularOuterBoundaryOffset |
| vtkPoints * | PlaneOrigins |
| vtkDoubleArray * | PlaneNormals |
| vtkIdList * | PlaneLabels |
| double | MaximumDistanceFromPlane |
| double | MaximumDistanceFromPlaneOrigin |
| vtkIdType | NumberOfBoundaries |
| vtkIdList * | BoundaryLabels |
| vtkIdList * | UnmatchedPlaneLabels |
Give each open boundary of a surface a label that stays with it.
Extracts the open boundaries of the input surface and records them in two point data arrays, so that later filters can tell the boundaries apart without extracting them again and without relying on the extraction order staying put. See vtkvmtkBoundaryLabels for what the arrays hold and why they are point data.
This is meant to be the one place the boundaries of a surface are worked out. A boundary is identified here, once, from geometry the caller already has – the points it clicked, or the planes it cut with – and from then on the label is carried by the mesh rather than recomputed, so vtkvmtkCapPolyData and vtkvmtkPolyDataFlowExtensionsFilter can be told which vessel end is which without the caller having to translate ids across each of them.
A boundary's label is the cell entity id its cap will carry. That is the whole point of the numbering: a cap is asked for by the same number that names the vessel end it closes, so nothing has to be translated between the point data that says which end a boundary is and the cell data a solver reads its boundary conditions off. Labels therefore start above the wall, at CellEntityIdOffset+1, rather than at zero – see CellEntityIdOffset.
The labeling modes differ only in where the labels come from:
Both take a boundary only when it lies entirely within MaximumDistanceFromPlaneOrigin of the plane's origin, which is what keeps a match local. A plane is infinite and a surface is not: without that, a boundary on a different branch that happens to be coplanar with this cut, or one merely nearest to it across a gap, would be claimed on the strength of a coincidence.
In every mode a boundary that ends up with no label of its own is given a fresh one, above every label already in use and never below CellEntityIdOffset+1, so no two boundaries ever share a label and none of them is mistaken for the wall. Planes that matched no boundary are reported in UnmatchedPlaneLabels rather than passed over in silence.
This is the class to use. It uses vtkvmtkBoundaryLabels internally – the names of the two arrays and the value that means "not on a boundary" come from there, and that class is what reads the arrays back into boundaries again – but vtkvmtkBoundaryLabels only defines and reads the format, and labels nothing itself.
What makes going through this filter better than letting each filter work the boundaries out for itself is that the boundary information ends up stored in the mesh. Downstream filters do not extract the boundaries again: they read them from the arrays. That keeps them consistent, since every filter is then looking at the same boundaries in the same order rather than at whatever three separate extractions happen to agree on, and it saves the work of extracting them over and over, which on a large surface is not free.
Definition at line 99 of file vtkvmtkPolyDataBoundaryLabeler.h.
| typedef vtkPolyDataAlgorithm vtkvmtkPolyDataBoundaryLabeler::Superclass |
Definition at line 102 of file vtkvmtkPolyDataBoundaryLabeler.h.
| anonymous enum |
| Enumerator | |
|---|---|
| BOUNDARY_EXTRACTION_ORDER | |
| CLOSEST_TO_PLANE_ORIGIN | |
| ON_PLANE | |
| MATCH_EXISTING_LABELS | |
Definition at line 108 of file vtkvmtkPolyDataBoundaryLabeler.h.
|
protected |
Definition at line 76 of file vtkvmtkPolyDataBoundaryLabeler.cxx.
|
overrideprotected |
Definition at line 99 of file vtkvmtkPolyDataBoundaryLabeler.cxx.
|
static |
|
virtual |
|
static |
|
protectedvirtual |
| vtkvmtkPolyDataBoundaryLabeler * vtkvmtkPolyDataBoundaryLabeler::NewInstance | ( | ) | const |
|
override |
Definition at line 564 of file vtkvmtkPolyDataBoundaryLabeler.cxx.
|
static |
|
virtual |
Set/Get the name of the point data array where each boundary point's label is written. Defaults to vtkvmtkBoundaryLabels::GetDefaultBoundaryLabelsArrayName().
|
virtual |
Set/Get the name of the point data array where each boundary point's label is written. Defaults to vtkvmtkBoundaryLabels::GetDefaultBoundaryLabelsArrayName().
|
virtual |
Set/Get the name of the point data array where each boundary point's index within its own boundary is written. Defaults to vtkvmtkBoundaryLabels::GetDefaultBoundaryPointOrderArrayName().
|
virtual |
Set/Get the name of the point data array where each boundary point's index within its own boundary is written. Defaults to vtkvmtkBoundaryLabels::GetDefaultBoundaryPointOrderArrayName().
|
virtual |
Set/Get where the labels come from. See the class documentation.
|
virtual |
Set/Get where the labels come from. See the class documentation.
|
inline |
Set/Get where the labels come from. See the class documentation.
Definition at line 142 of file vtkvmtkPolyDataBoundaryLabeler.h.
|
inline |
Set/Get where the labels come from. See the class documentation.
Definition at line 143 of file vtkvmtkPolyDataBoundaryLabeler.h.
|
inline |
Set/Get where the labels come from. See the class documentation.
Definition at line 144 of file vtkvmtkPolyDataBoundaryLabeler.h.
|
inline |
Set/Get where the labels come from. See the class documentation.
Definition at line 145 of file vtkvmtkPolyDataBoundaryLabeler.h.
|
virtual |
Set/Get the cell entity id of the wall, which the labels are numbered above. Default 1, the same value vtkvmtkCapPolyData's own CellEntityIdOffset defaults to.
A label is the cell entity id of the cap that will close its boundary, and the cappers leave CellEntityIdOffset on the cells they copied from their input. So the first id a cap may take is CellEntityIdOffset+1: this is what keeps a label off the wall, and off the 0 the volume elements of a mesh carry. Set it to whatever the capper this surface will go to is set to.
|
virtual |
Set/Get the cell entity id of the wall, which the labels are numbered above. Default 1, the same value vtkvmtkCapPolyData's own CellEntityIdOffset defaults to.
A label is the cell entity id of the cap that will close its boundary, and the cappers leave CellEntityIdOffset on the cells they copied from their input. So the first id a cap may take is CellEntityIdOffset+1: this is what keeps a label off the wall, and off the 0 the volume elements of a mesh carry. Set it to whatever the capper this surface will go to is set to.
|
virtual |
Set/Get whether the input is a walled surface, whose open boundaries come in pairs – an inner boundary and the outer one facing it across the wall thickness.
With this off (default) every boundary is labelled on its own, and the two boundaries of a wall end up with unrelated labels. With it on the boundaries are paired by barycenter distance, the inner boundary of each pair is labelled as it would have been anyway, and its outer partner takes that label plus AnnularOuterBoundaryOffset. Of a pair, the inner is whichever has the smaller mean radius.
The point of the arrangement is that the two labels of a wall are then related by a known constant, and the inner one is always the lower of the two: a filter that caps the annulus between them names its cap after the lower id, and so always names it after the vessel end the caller meant, whichever way round the pair was found. An odd boundary with no partner keeps the label it was given.
|
virtual |
Set/Get whether the input is a walled surface, whose open boundaries come in pairs – an inner boundary and the outer one facing it across the wall thickness.
With this off (default) every boundary is labelled on its own, and the two boundaries of a wall end up with unrelated labels. With it on the boundaries are paired by barycenter distance, the inner boundary of each pair is labelled as it would have been anyway, and its outer partner takes that label plus AnnularOuterBoundaryOffset. Of a pair, the inner is whichever has the smaller mean radius.
The point of the arrangement is that the two labels of a wall are then related by a known constant, and the inner one is always the lower of the two: a filter that caps the annulus between them names its cap after the lower id, and so always names it after the vessel end the caller meant, whichever way round the pair was found. An odd boundary with no partner keeps the label it was given.
|
virtual |
Set/Get whether the input is a walled surface, whose open boundaries come in pairs – an inner boundary and the outer one facing it across the wall thickness.
With this off (default) every boundary is labelled on its own, and the two boundaries of a wall end up with unrelated labels. With it on the boundaries are paired by barycenter distance, the inner boundary of each pair is labelled as it would have been anyway, and its outer partner takes that label plus AnnularOuterBoundaryOffset. Of a pair, the inner is whichever has the smaller mean radius.
The point of the arrangement is that the two labels of a wall are then related by a known constant, and the inner one is always the lower of the two: a filter that caps the annulus between them names its cap after the lower id, and so always names it after the vessel end the caller meant, whichever way round the pair was found. An odd boundary with no partner keeps the label it was given.
|
virtual |
Set/Get whether the input is a walled surface, whose open boundaries come in pairs – an inner boundary and the outer one facing it across the wall thickness.
With this off (default) every boundary is labelled on its own, and the two boundaries of a wall end up with unrelated labels. With it on the boundaries are paired by barycenter distance, the inner boundary of each pair is labelled as it would have been anyway, and its outer partner takes that label plus AnnularOuterBoundaryOffset. Of a pair, the inner is whichever has the smaller mean radius.
The point of the arrangement is that the two labels of a wall are then related by a known constant, and the inner one is always the lower of the two: a filter that caps the annulus between them names its cap after the lower id, and so always names it after the vessel end the caller meant, whichever way round the pair was found. An odd boundary with no partner keeps the label it was given.
|
virtual |
Set/Get what is added to an inner boundary's label to give its outer partner's, when Annular is on. Default 1000.
It has to be larger than the highest label the surface will ever carry, or an outer boundary's label collides with some other boundary's inner one.
|
virtual |
Set/Get what is added to an inner boundary's label to give its outer partner's, when Annular is on. Default 1000.
It has to be larger than the highest label the surface will ever carry, or an outer boundary's label collides with some other boundary's inner one.
|
virtual |
Set/Get the origins of the planes, one per plane. A point is a plane whose normal is never asked for, so this is also where a caller with only positions to offer puts them.
|
virtual |
Set/Get the origins of the planes, one per plane. A point is a plane whose normal is never asked for, so this is also where a caller with only positions to offer puts them.
|
virtual |
Set/Get the normals of the planes, one 3-component tuple per plane. They need not be unit length. Required by the OnPlane mode and ignored by the others.
|
virtual |
Set/Get the normals of the planes, one 3-component tuple per plane. They need not be unit length. Required by the OnPlane mode and ignored by the others.
|
virtual |
Set/Get the label to give the boundary each plane matches. Entry i belongs to plane i. When not set, plane i is taken to carry the label i+1+CellEntityIdOffset.
A label set here is taken as it stands, so a caller choosing its own is the one responsible for keeping them above the wall: a label of CellEntityIdOffset or below names a cap that cannot be told from the wall it is set into.
|
virtual |
Set/Get the label to give the boundary each plane matches. Entry i belongs to plane i. When not set, plane i is taken to carry the label i+1+CellEntityIdOffset.
A label set here is taken as it stands, so a caller choosing its own is the one responsible for keeping them above the wall: a label of CellEntityIdOffset or below names a cap that cannot be told from the wall it is set into.
|
virtual |
Set/Get how far any point of a boundary may be from a plane for that boundary to count as lying in it. Used by the OnPlane mode, which requires a positive value: a plane is infinite, so with no limit every boundary lies in every plane.
|
virtual |
Set/Get how far any point of a boundary may be from a plane for that boundary to count as lying in it. Used by the OnPlane mode, which requires a positive value: a plane is infinite, so with no limit every boundary lies in every plane.
|
virtual |
Set/Get how far any point of a boundary may be from a plane's origin for that boundary to be a candidate for that plane's label. A boundary is considered only when it lies entirely within this distance – one point of it beyond and it is passed over, however well the rest of it fits – which is what confines a match to the neighbourhood of the origin. Zero or less puts no limit on it. Used by both the ClosestToPlaneOrigin and the OnPlane modes.
|
virtual |
Set/Get how far any point of a boundary may be from a plane's origin for that boundary to be a candidate for that plane's label. A boundary is considered only when it lies entirely within this distance – one point of it beyond and it is passed over, however well the rest of it fits – which is what confines a match to the neighbourhood of the origin. Zero or less puts no limit on it. Used by both the ClosestToPlaneOrigin and the OnPlane modes.
|
virtual |
Number of open boundaries found in the input, valid after Update().
|
virtual |
The label given to each boundary, in the order the boundaries were extracted, valid after Update(). Use it to relate a label back to a positional boundary id, for a filter that has not been told the array names.
|
virtual |
The labels of the planes that claimed no boundary, valid after Update(). A plane lands here when nothing was near enough, when the boundary it would have claimed had already been taken by an earlier plane, or when its boundary is not there at all – a cut that removed another cut's boundary, say.
|
overrideprotected |
Definition at line 114 of file vtkvmtkPolyDataBoundaryLabeler.cxx.
|
protected |
Pair the boundaries by barycenter distance and give each outer boundary its inner partner's label plus AnnularOuterBoundaryOffset. See Annular.
Definition at line 488 of file vtkvmtkPolyDataBoundaryLabeler.cxx.
|
protected |
Definition at line 279 of file vtkvmtkPolyDataBoundaryLabeler.h.
|
protected |
Definition at line 280 of file vtkvmtkPolyDataBoundaryLabeler.h.
|
protected |
Definition at line 282 of file vtkvmtkPolyDataBoundaryLabeler.h.
|
protected |
Definition at line 283 of file vtkvmtkPolyDataBoundaryLabeler.h.
|
protected |
Definition at line 284 of file vtkvmtkPolyDataBoundaryLabeler.h.
|
protected |
Definition at line 285 of file vtkvmtkPolyDataBoundaryLabeler.h.
|
protected |
Definition at line 287 of file vtkvmtkPolyDataBoundaryLabeler.h.
|
protected |
Definition at line 288 of file vtkvmtkPolyDataBoundaryLabeler.h.
|
protected |
Definition at line 289 of file vtkvmtkPolyDataBoundaryLabeler.h.
|
protected |
Definition at line 290 of file vtkvmtkPolyDataBoundaryLabeler.h.
|
protected |
Definition at line 291 of file vtkvmtkPolyDataBoundaryLabeler.h.
|
protected |
Definition at line 293 of file vtkvmtkPolyDataBoundaryLabeler.h.
|
protected |
Definition at line 294 of file vtkvmtkPolyDataBoundaryLabeler.h.
|
protected |
Definition at line 295 of file vtkvmtkPolyDataBoundaryLabeler.h.