Learn R Programming

retistruct (version 0.6.3)

AnnotatedOutline: Class containing functions and data relating to annotating outlines

Description

An AnnotatedOutline contains a function to annotate tears on the outline.

Arguments

Value

AnnotatedOutline object, with extra fields for tears latitude of rim phi0 and index of fixed point i0.

Public fields

tears

Matrix in which each row represents a tear by the indices into the outline points of the apex (V0) and backward (VB) and forward (VF) points

phi0

rim angle in radians

lambda0

longitude of fixed point

i0

index of fixed point

Methods

Public methods

Method new()

Constructor

Usage

AnnotatedOutline$new(...)

Arguments

...

Parameters to PathOutline

Method labelTearPoints()

Label a set of three unlabelled points supposed to refer to the apex and vertices of a cut and tear with the V0 (Apex), VF (forward vertex) and VB (backward vertex) labels.

Usage

AnnotatedOutline$labelTearPoints(pids)

Arguments

pids

the vector of three indices

Returns

Vector of indices labelled with V0, VF and VB

Method whichTear()

Return index of tear in an AnnotatedOutline in which a point appears

Usage

AnnotatedOutline$whichTear(pid)

Arguments

pid

ID of point

Returns

ID of tear

Method getTear()

Return indices of tear in AnnotatedOutline

Usage

AnnotatedOutline$getTear(tid)

Arguments

tid

Tear ID, which can be returned from whichTear()

Returns

Vector of three point IDs, labelled with V0, VF and VB

Method getTears()

Get tears

Usage

AnnotatedOutline$getTears()

Returns

Matrix of tears

Method computeTearRelationships()

Compute the parent relationships for a potential set of tears. The function throws an error if tears overlap.

Usage

AnnotatedOutline$computeTearRelationships(tears = NULL)

Arguments

tears

Matrix containing columns V0 (Apices of tears) VB (Backward vertices of tears) and VF (Forward vertices of tears)

Returns

List containing

  • Rsetthe set of points on the rim

  • TFsetlist containing indices of points in each forward tear

  • TBsetlist containing indices of points in each backward tear

  • hcorrespondence mapping

  • hfcorrespondence mapping in forward direction for points on boundary

  • hbcorrespondence mapping in backward direction for points on boundary

Method addTear()

Add tear to an AnnotatedOutline

Usage

AnnotatedOutline$addTear(pids)

Arguments

pids

Vector of three point IDs to be added

Method removeTear()

Remove tear from an AnnotatedOutline

Usage

AnnotatedOutline$removeTear(tid)

Arguments

tid

Tear ID, which can be returned from whichTear()

Method checkTears()

Check that all tears are correct.

Usage

AnnotatedOutline$checkTears()

Returns

If all is OK, returns empty vector. If not, returns indices of problematic tears.

Method setFixedPoint()

Set fixed point

Usage

AnnotatedOutline$setFixedPoint(i0, name)

Arguments

i0

Index of fixed point

name

Name of fixed point

Method getFixedPoint()

Get point ID of fixed point

Usage

AnnotatedOutline$getFixedPoint()

Returns

Point ID of fixed point

Method getRimSet()

Get point IDs of points on rim

Usage

AnnotatedOutline$getRimSet()

Returns

Point IDs of points on rim

Method ensureFixedPointInRim()

Ensure that the fixed point i0 is in the rim, not a tear. Alters object in which i0 may have been changed.

Usage

AnnotatedOutline$ensureFixedPointInRim()

Method getRimLengths()

Get lengths of edges on rim

Usage

AnnotatedOutline$getRimLengths()

Returns

Vector of rim lengths

Method clone()

The objects of this class are cloneable with this method.

Usage

AnnotatedOutline$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

Run this code
# NOT RUN {
P <- rbind(c(1,1),   c(2,1),  c(2,-1),
           c(1,-1),  c(1,-2), c(-1,-2),
           c(-1,-1), c(-2,-1),c(-2,1),
           c(-1,1),  c(-1,2), c(1,2))
o <- TriangulatedOutline$new(P)
o$addTear(c(3, 4, 5))
o$addTear(c(6, 7, 8))
o$addTear(c(9, 10, 11))
o$addTear(c(12, 1, 2))
flatplot(o)
# }

Run the code above in your browser using DataLab