AnnotatedOutline: Class containing functions and data relating to annotating...

AnnotatedOutlineR Documentation

Class containing functions and data relating to annotating outlines

Description

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

Value

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

Super classes

retistruct::OutlineCommon -> retistruct::Outline -> retistruct::PathOutline -> AnnotatedOutline

Public fields

tears

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

fullcuts

Matrix in which each row represents a cut 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

Inherited 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 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

Rset

the set of points on the rim

TFset

list containing indices of points in each forward tear

TBset

list containing indices of points in each backward tear

h

correspondence mapping

hf

correspondence mapping in forward direction for points on boundary

hb

correspondence 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. If the outline has been stitched (see StitchedOutline), the point IDs will be ordered in the direction of the forward pointer.


Method getBoundarySets()

Get point IDs of points on boundaries

Usage
AnnotatedOutline$getBoundarySets()
Returns

List of Point IDs of points on the boundaries. If the outline has been stitched (see StitchedOutline), the point IDs in each element of the list will be ordered in the direction of the forward pointer, and the boundary that is longest will be named as Rim. If the outline has not been stitched, the list will have one element named 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 labelFullCutPoints()

Label a set of four unlabelled points supposed to refer to a cut.

Usage
AnnotatedOutline$labelFullCutPoints(pids)
Arguments
pids

the vector of point indices


Method addFullCut()

Add cut to an AnnotatedOutline

Usage
AnnotatedOutline$addFullCut(pids)
Arguments
pids

Vector of three point IDs to be added


Method whichFullCut()

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

Usage
AnnotatedOutline$whichFullCut(pid)
Arguments
pid

ID of point

Returns

ID of cut


Method removeFullCut()

Remove cut from an AnnotatedOutline

Usage
AnnotatedOutline$removeFullCut(cid)
Arguments
cid

FullCut ID, which can be returned from whichFullCut


Method computeFullCutRelationships()

Compute the cut relationships between the points

Usage
AnnotatedOutline$computeFullCutRelationships(fullcuts)
Arguments
fullcuts

Matrix containing columns VB0, and VB1 (Backward vertices of fullcuts) and VF0 and VF1 (Forward vertices of fullcuts)

Returns

List containing

Rset

the set of points on the rim

TFset

list containing indices of points in each forward cut

TBset

list containing indices of points in each backward cut

h

correspondence mapping

hf

correspondence mapping in forward direction for points on boundary

hb

correspondence mapping in backward direction for points on boundary


Method getFullCut()

Return indices of fullcuts in AnnotatedOutline

Usage
AnnotatedOutline$getFullCut(cid)
Arguments
cid

FullCut ID, which can be returned from whichFullCut

Returns

Vector of four point IDs, labelled with VF1, VF1, VB0 and VB1


Method getFullCuts()

Return indices of fullcuts in AnnotatedOutline

Usage
AnnotatedOutline$getFullCuts()
Returns

Matrix in which each row contains point IDs, for the forward and backward sides of the cut: VF0, VF1, VB0 and VB1


Method addPoints()

Add points to the outline register of points

Usage
AnnotatedOutline$addPoints(P, fid)
Arguments
P

2 column matrix of points to add

fid

fragment id of the points

Returns

The ID of each added point in the register. If points already exist a point will not be created in the register, but an ID will be returned


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.

Author(s)

David Sterratt

Examples

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)

P <- list(rbind(c(1,1), c(2,1), c(2.5,2), c(3,1), c(4,1), c(1,4)),
          rbind(c(-1,1), c(-1,4), c(-2,3), c(-2,2), c(-3,2), c(-4,1)),
          rbind(c(-4,-1), c(-1,-1), c(-1,-4)),
          rbind(c(1,-1), c(2,-1), c(2.5,-2), c(3,-1), c(4,-1), c(1,-4)))
o <- AnnotatedOutline$new(P)
o$addTear(c(2, 3, 4))
o$addTear(c(17, 18, 19))
o$addTear(c(9, 10, 11))
o$addFullCut(c(1, 5, 16, 20))
flatplot(o)

retistruct documentation built on April 3, 2025, 5:58 p.m.