#include <BoundarySegment.h>
Public Member Functions | |
BoundarySegment () | |
Default constructor. | |
BoundarySegment (vtkPolyData *surface, const Array< int > &ptIds) | |
BoundarySegment (const BoundarySegment &) | |
Copy constructor. | |
void | ClearSelection () |
Deselect all points. | |
Vector | ComputeEdgeLengths () const |
Compute edge lengths. | |
double | ComputeLength () const |
Compute length of boundary segment. | |
bool | Contains (int ptId) const |
void | DeselectPoint (int i) |
double | EdgeLength (int i, int di=+1) const |
Vector | EdgeLengths () const |
Get lengths of boundary segment edges. | |
int | Find (int ptId) const |
int | FindClosestPoint (const class Point &x, double *dist2=nullptr) const |
void | GetPoint (int i, double p[3]) const |
void | GetSelectedPoint (int i, double p[3]) const |
int | IndexModuloNumberOfPoints (int i) const |
Get boundary segment point index in range [0, N) | |
void | InitializeIndex () |
Pre-compute map of surface point ID to boundary segment point index. | |
bool | IsSelected (int i) const |
double | Length () const |
Get total length of boundary segment. | |
int | NumberOfPoints () const |
Number of boundary segment points. | |
int | NumberOfSelectedPoints () const |
Number of selected curve points. | |
BoundarySegment & | operator= (const BoundarySegment &) |
Assignment operator. | |
class Point | Point (int i) const |
void | Point (int i, const class Point &p) |
int | PointId (int i) const |
void | RemoveSelection (int i) |
void | ReserveSelection (int n) |
class Point | SelectedPoint (int i) const |
int | SelectedPointId (int i) const |
int | SelectedPointIndex (int i) const |
void | SelectPoint (int i) |
void | SetPoint (int i, const double p[3]) |
virtual | ~BoundarySegment () |
Destructor. | |
Public Member Functions inherited from mirtk::Object | |
virtual const char * | NameOfClass () const =0 |
Get name of class, which this object is an instance of. | |
virtual ParameterList | Parameter () const |
Get parameter name/value pairs. | |
bool | Parameter (const ParameterList &) |
Set parameters from name/value pairs. | |
virtual bool | Set (const char *name, const char *value) |
virtual | ~Object () |
Destructor. | |
Additional Inherited Members | |
Static Public Member Functions inherited from mirtk::Object | |
static const char * | NameOfType () |
Get name of this class type. | |
Protected Member Functions inherited from mirtk::Object | |
template<typename... Args> | |
void | Throw (ErrorType err, const char *func, Args... args) const |
Static Protected Member Functions inherited from mirtk::Object | |
template<typename... Args> | |
static void | ThrowStatic (ErrorType err, const char *cls, const char *func, Args... args) |
Closed boundary segment of surface mesh
A boundary segment is a closed line strip defined by an ordered list of point indices with an edge between each consecutive pair of points. The boundary loop is closed by the edge connecting the last point with the first point. A surface mesh may have any number of boundary segments, including no boundary at all in case of a closed genus-0 surface mesh which is topologically equivalent to a sphere. This class represents a single boundary segment.
Definition at line 46 of file BoundarySegment.h.
mirtk::BoundarySegment::BoundarySegment | ( | vtkPolyData * | surface, |
const Array< int > & | ptIds | ||
) |
Constructor
[in] | surface | Surface mesh. |
[in] | ptIds | Ordered list of IDs of surface points making up this boundary segment. |
|
inline |
Whether this boundary segment contains a given surface point
[in] | ptId | Surface point ID. |
Definition at line 337 of file BoundarySegment.h.
void mirtk::BoundarySegment::DeselectPoint | ( | int | i | ) |
Remove i-th boundary segment point from selection
[in] | i | Boundary segment point index. |
|
inline |
Length of boundary segment edge
[in] | i | Index of first boundary segment point. |
[in] | di | Index increment +1 or -1, i.e., traversal direction. |
Definition at line 361 of file BoundarySegment.h.
int mirtk::BoundarySegment::Find | ( | int | ptId | ) | const |
Find surface point in boundary segment
[in] | ptId | Surface point ID. |
int mirtk::BoundarySegment::FindClosestPoint | ( | const class Point & | x, |
double * | dist2 = nullptr |
||
) | const |
Find closest boundary point
[in] | x | Point coordinates. |
[in] | dist2 | Squared distance of closest boundary point. |
|
inline |
Get boundary segment point coordinates
[in] | i | Index of boundary segment point. |
[out] | p | Coordinates of i-th boundary segment point. |
Definition at line 309 of file BoundarySegment.h.
|
inline |
Get selected boundary segment point coordinates
[in] | i | Index of selected boundary segment point. |
[out] | p | Coordinates of i-th selected boundary segment point. |
Definition at line 393 of file BoundarySegment.h.
|
inline |
Check if boundary segment point is selected
[in] | i | Index of boundary segment point. The index is taken modulo the number of boundary points and negative values count from the end of the list of boundary points. |
Definition at line 405 of file BoundarySegment.h.
|
inline |
Get boundary segment point coordinates
[in] | i | Index of boundary segment point. |
Definition at line 323 of file BoundarySegment.h.
|
inline |
Set boundary segment point coordinates
[in] | i | Index of boundary segment point. |
[in] | p | New coordinates of i-th boundary segment point. |
Definition at line 331 of file BoundarySegment.h.
|
inline |
Get surface point ID of i-th boundary segment point
[in] | i | Index of boundary segment point. |
Definition at line 302 of file BoundarySegment.h.
void mirtk::BoundarySegment::RemoveSelection | ( | int | i | ) |
Remove the i-th selected point
[in] | i | Selected point index. |
void mirtk::BoundarySegment::ReserveSelection | ( | int | n | ) |
Reserve space for n selected points
[in] | n | Number of points to be selected. |
|
inline |
Get selected boundary segment point coordinates
[in] | i | Index of selected boundary segment point. |
Definition at line 399 of file BoundarySegment.h.
|
inline |
Get surface point ID of i-th selected boundary point
[in] | i | Index of selected point. |
Definition at line 387 of file BoundarySegment.h.
|
inline |
Get boundary segment point index of i-th selected boundary point
[in] | i | Index of selected point. |
Definition at line 381 of file BoundarySegment.h.
void mirtk::BoundarySegment::SelectPoint | ( | int | i | ) |
Add i-th boundary segment point to selection
[in] | i | Boundary segment point index. |
|
inline |
Set boundary segment point coordinates
[in] | i | Index of boundary segment point. |
[in] | p | New coordinates of i-th boundary segment point. |
Definition at line 316 of file BoundarySegment.h.