Adaptagrams
Public Member Functions | Static Public Member Functions | Friends | List of all members
dialect::PeeledNode Class Reference

A PeeledNode is a type of GhostNode, used in the peeling process. More...

#include <peeling.h>

Inheritance diagram for dialect::PeeledNode:
Inheritance graph
Collaboration diagram for dialect::PeeledNode:
Collaboration graph

Public Member Functions

PeeledNodeoperator= (const PeeledNode &)=default
 Copy-assignment operator.
 
virtual ~PeeledNode (void)=default
 Destructor.
 
- Public Member Functions inherited from dialect::GhostNode
virtual id_type id (void) const
 Return an appropriate ID number. More...
 
id_type trueID (void) const
 Simple way to get the true ID of this GhostNode, even if it is currently set to masquerade as the Node it represents.
 
virtual Nodes getChildren (void) const
 As in the Node class, get the neighbours of this Node that sit as the target end of the connecting Edge. More...
 
void setMasquerade (bool doMasquerade)
 Say whether the GhostNode should masquerade as the original Node.
 
- Public Member Functions inherited from dialect::Node
GhostNode_SP makeGhost (void) const
 Allocate a GhostNode of this Node.
 
dialect::Nodeoperator= (const dialect::Node &)=default
 Copy-assignment operator.
 
virtual ~Node (void)=default
 Destructor.
 
unsigned getDegree (void) const
 Check the degree (number of incident Edges) of the Node. More...
 
void setGraph (Graph &graph)
 Tell the Node which Graph it belongs to. More...
 
GraphgetGraph (void)
 Access the Graph to which the Node belongs.
 
void addEdge (const Edge_SP &edge)
 Add an incident Edge.
 
void removeEdge (const dialect::Edge &edge)
 Remove an incident Edge.
 
const EdgesById & getEdgeLookup (void) const
 Read-only access to this Node's lookup map for Edges by their ID.
 
EdgesById getCopyOfEdgeLookup (void) const
 Get a copy of this Node's lookup map for Edges by their ID.
 
void copyGeometry (const dialect::Node &other)
 Give this Node the same coordinates and dimensions as another.
 
void copyOtherGhostProperties (const dialect::Node &other)
 Besides copying geometry, there may be other properties we wish to copy; in particular, properties that are suitable to be copied by a GhostNode.
 
dimensions getHalfDimensions (void) const
 Get an ordered pair (half-width, half-height) for this Node.
 
dimensions getDimensions (void) const
 Get an ordered pair (width, height) for this Node.
 
BoundingBox getBoundingBox (void) const
 Get the bounding box for this Node.
 
Avoid::Point getBoundaryCompassPt (CompassDir dir) const
 Get the point on the boundary of this Node in a given direction from its centre.
 
void setCentre (double cx, double cy)
 Set the position of the node, by setting its centre coordinates.
 
void translate (double dx, double dy)
 Update the position of the node, by adding to its centre coordinates.
 
void applyPlaneMap (PlaneMap map)
 Apply a mapping from libavoid Points to libavoid Points, to this Node's centre.
 
Avoid::Point getCentre (void) const
 Get the centre coordinates of the node.
 
void setExternalId (unsigned id)
 Set an externally-determined ID. (This is useful for TGLF and other interfacing operations.)
 
int getExternalId (void)
 Get the external ID.
 
dialect::Nodes getNeighbours (void) const
 Get the neighbours of this Node.
 
dialect::Nodes getNeighboursCwCyclic (void) const
 Get the neighbours of this Node, listed in clockwise cyclic order (assuming the usual graphics convention of x increasing to the right and y increasing downward).
 
void setDims (double w, double h)
 Set the dimensions of the node.
 
void setBoundingBox (double x, double X, double y, double Y)
 Set the bounding box of the node. This sets both the dimensions and the centre point. More...
 
void addPadding (double dw, double dh)
 Add padding to the node's dimensions. More...
 
void updatePosnFromRect (vpsc::Rectangle *r)
 Update the position of this Node to equal that of the given Rectangle.
 
void updateXCoordFromRect (vpsc::Rectangle *r)
 Update the x-coordinate of this Node to equal that of the given Rectangle.
 
void updateYCoordFromRect (vpsc::Rectangle *r)
 Update the y-coordinate of this Node to equal that of the given Rectangle.
 
Avoid::Polygon makeLibavoidPolygon (void) const
 Build and return a Polygon to represent this Node in libavoid.
 
bool isRoot (void) const
 Check whether this Node has been marked as being a root. This is useful when working with trees, and can be safely ignored when working with other sorts of graphs.
 
void setIsRoot (bool isRoot)
 Say whether this Node is a root. This is useful when working with trees, and can be safely ignored when working with other sorts of graphs.
 
bool liesOppositeSegment (const LineSegment &seg, bool openInterval=false)
 Check whether this Node lies opposite a LineSegment, i.e. whether the sides of the Node lying parallel to the segment intersect its interval. More...
 
std::string writeSvg (bool useExternalId=false) const
 Write SVG to represent this Node. More...
 

Static Public Member Functions

static PeeledNode_SP allocate (const Node &node)
 Factory function. More...
 
- Static Public Member Functions inherited from dialect::GhostNode
static GhostNode_SP allocate (const Node &node)
 Factory function. More...
 
- Static Public Member Functions inherited from dialect::Node
static Node_SP allocate (void)
 Factory function, to get a shared pointer to a Node allocated on the heap. We make the constructors protected, in order to ensure that Nodes always come with a control block. More...
 
static Node_SP allocate (double w, double h)
 Convenience factory function to set dimensions.
 
static Node_SP allocate (double cx, double dy, double w, double h)
 Convenience factory function to set position and dimensions.
 

Friends

PeeledNode_SP identifyRootNode (const Graph &graph)
 Mark as "root" the PeeledNode having largest serial number. More...
 

Additional Inherited Members

- Protected Member Functions inherited from dialect::GhostNode
 GhostNode (const Node &node)
 We always make a GhostNode as a copy of a plain Node.
 
- Protected Member Functions inherited from dialect::Node
 Node (void)
 Default constructor. More...
 
 Node (double w, double h)
 Construct with dimensions.
 
 Node (double cx, double cy, double w, double h)
 Construct with position and dimensions.
 
 Node (const dialect::Node &)=default
 Copy constructor.
 
- Protected Attributes inherited from dialect::Node
const id_type m_ID
 An instance's own unique ID:
 
int m_externalID = -1
 
EdgesById m_edges
 Lookup table for incident Edges by Edge's ID:
 

Detailed Description

A PeeledNode is a type of GhostNode, used in the peeling process.

Member Function Documentation

◆ allocate()

static PeeledNode_SP dialect::PeeledNode::allocate ( const Node node)
inlinestatic

Factory function.

Returns
A shared_ptr to PeeledNode (PeeledNode_SP).

Friends And Related Function Documentation

◆ identifyRootNode

PeeledNode_SP identifyRootNode ( const Graph graph)
friend

Mark as "root" the PeeledNode having largest serial number.

Note
The Graph must contain only PeeledNodes.
Returns
The PeeledNode identified as root.

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