Public Member Functions | List of all members
mirtk::BoundarySegment Class Reference

#include <BoundarySegment.h>

Inheritance diagram for mirtk::BoundarySegment:
Inheritance graph
Collaboration diagram for mirtk::BoundarySegment:
Collaboration graph

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.
 
BoundarySegmentoperator= (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)
 

Detailed Description

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.

Constructor & Destructor Documentation

§ BoundarySegment()

mirtk::BoundarySegment::BoundarySegment ( vtkPolyData *  surface,
const Array< int > &  ptIds 
)

Constructor

Parameters
[in]surfaceSurface mesh.
[in]ptIdsOrdered list of IDs of surface points making up this boundary segment.

Member Function Documentation

§ Contains()

bool mirtk::BoundarySegment::Contains ( int  ptId) const
inline

Whether this boundary segment contains a given surface point

Parameters
[in]ptIdSurface point ID.
Returns
Whether surface point ID is part of this boundary segment.

Definition at line 337 of file BoundarySegment.h.

§ DeselectPoint()

void mirtk::BoundarySegment::DeselectPoint ( int  i)

Remove i-th boundary segment point from selection

Parameters
[in]iBoundary segment point index.

§ EdgeLength()

double mirtk::BoundarySegment::EdgeLength ( int  i,
int  di = +1 
) const
inline

Length of boundary segment edge

Parameters
[in]iIndex of first boundary segment point.
[in]diIndex increment +1 or -1, i.e., traversal direction.
Returns
Boundary segment edge lengths.

Definition at line 361 of file BoundarySegment.h.

§ Find()

int mirtk::BoundarySegment::Find ( int  ptId) const

Find surface point in boundary segment

Parameters
[in]ptIdSurface point ID.
Returns
Boundary segment point index or -1 if segment does not contain this point.

§ FindClosestPoint()

int mirtk::BoundarySegment::FindClosestPoint ( const class Point x,
double *  dist2 = nullptr 
) const

Find closest boundary point

Parameters
[in]xPoint coordinates.
[in]dist2Squared distance of closest boundary point.
Returns
Index of closest boundary segment point.

§ GetPoint()

void mirtk::BoundarySegment::GetPoint ( int  i,
double  p[3] 
) const
inline

Get boundary segment point coordinates

Parameters
[in]iIndex of boundary segment point.
[out]pCoordinates of i-th boundary segment point.

Definition at line 309 of file BoundarySegment.h.

§ GetSelectedPoint()

void mirtk::BoundarySegment::GetSelectedPoint ( int  i,
double  p[3] 
) const
inline

Get selected boundary segment point coordinates

Parameters
[in]iIndex of selected boundary segment point.
[out]pCoordinates of i-th selected boundary segment point.

Definition at line 393 of file BoundarySegment.h.

§ IsSelected()

bool mirtk::BoundarySegment::IsSelected ( int  i) const
inline

Check if boundary segment point is selected

Parameters
[in]iIndex 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.
Returns
Whether boundary segment point is selected.

Definition at line 405 of file BoundarySegment.h.

§ Point() [1/2]

Point mirtk::BoundarySegment::Point ( int  i) const
inline

Get boundary segment point coordinates

Parameters
[in]iIndex of boundary segment point.
Returns
Coordinates of i-th boundary segment point.

Definition at line 323 of file BoundarySegment.h.

§ Point() [2/2]

void mirtk::BoundarySegment::Point ( int  i,
const class Point p 
)
inline

Set boundary segment point coordinates

Parameters
[in]iIndex of boundary segment point.
[in]pNew coordinates of i-th boundary segment point.

Definition at line 331 of file BoundarySegment.h.

§ PointId()

int mirtk::BoundarySegment::PointId ( int  i) const
inline

Get surface point ID of i-th boundary segment point

Parameters
[in]iIndex of boundary segment point.
Returns
Surface point ID of i-th boundary segment point.

Definition at line 302 of file BoundarySegment.h.

§ RemoveSelection()

void mirtk::BoundarySegment::RemoveSelection ( int  i)

Remove the i-th selected point

Parameters
[in]iSelected point index.

§ ReserveSelection()

void mirtk::BoundarySegment::ReserveSelection ( int  n)

Reserve space for n selected points

Parameters
[in]nNumber of points to be selected.

§ SelectedPoint()

Point mirtk::BoundarySegment::SelectedPoint ( int  i) const
inline

Get selected boundary segment point coordinates

Parameters
[in]iIndex of selected boundary segment point.
Returns
Coordinates of i-th selected boundary segment point.

Definition at line 399 of file BoundarySegment.h.

§ SelectedPointId()

int mirtk::BoundarySegment::SelectedPointId ( int  i) const
inline

Get surface point ID of i-th selected boundary point

Parameters
[in]iIndex of selected point.
Returns
Index of corresponding surface point.

Definition at line 387 of file BoundarySegment.h.

§ SelectedPointIndex()

int mirtk::BoundarySegment::SelectedPointIndex ( int  i) const
inline

Get boundary segment point index of i-th selected boundary point

Parameters
[in]iIndex of selected point.
Returns
Index of corresponding boundary segment point.

Definition at line 381 of file BoundarySegment.h.

§ SelectPoint()

void mirtk::BoundarySegment::SelectPoint ( int  i)

Add i-th boundary segment point to selection

Parameters
[in]iBoundary segment point index.

§ SetPoint()

void mirtk::BoundarySegment::SetPoint ( int  i,
const double  p[3] 
)
inline

Set boundary segment point coordinates

Parameters
[in]iIndex of boundary segment point.
[in]pNew coordinates of i-th boundary segment point.

Definition at line 316 of file BoundarySegment.h.


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