GArc Class Reference

[libgfc Index] [libgfc Hierarchy] [Headers]


The Arc ADT represents a linear feature with branches More...

#include <src/gadt_arc.h>

Inherits: GSpatial

Public Members


Detailed Description

The Arc ADT represents a linear feature with branches. An arc consists of multiple branch polylines which are not necessarily connected to each other. Each polyline is a sereis of connected points or segments.


Result input(const char* in) [public virtual]

user format: "n_polylines, num_points_1, num_points_2,...num_pooints_N, x1 y1 x2 y2 ... xm ym"

Result output(char*& out) [public virtual]

generates a stpolyline with same format for input

Result pack(DataPipe& p) [public virtual]

pack the arc into a binary structure. The structure is the same as the geometry part of the Arc record in ArcView Shapefile (ie, no record header, no type info.)

Result unpack(DataPipe& p) [public virtual]

unpack a binary stream into an Arc. The binary stream should have same structure as the geometry part of the Arc record in an ArcView shapefile.

Result mbr(GRect& box) const [public virtual]

return the mbr of the Arc.

int cmp(const GADT&) const [public virtual]

compares the length with the arc 'a's area. Returns -1 if 'a' has larger length; zero if equal, otherwise 1.

void set(int n_parts, int n_pnts, const int* parts, const Coord* coord) [public virtual]

this method accepts severl "parts" each of which are a series of ordered points. All existing data will be replaced by the new data.

int numVerticies(void) const [public]

return total number of verticies in all polylines.

int numBranches(void) const [public]

return number of branches.

double length() const [public]

return length of the arc

double branchLength(int nth) const [public]

return the length of the nth branch.

Result addBranch(int, Coord*) [public]

add a polyline (branch) to this arc

int getBranch(int nth, Coord*& coords) [public]

get information about a particular branch/polyline.

Parameters:
coords where its coordinates are stored
nth which branch to retrieve
Returns:
the number of vertices in the branch

int hasLoop() const [public]

check if there is a loop in this Arc. Having a loop means it either has duplicate points or the some polylines intersect themselves. We need an algorithm better than O(N*N). Currently two iterators are used to loop over all the possible combination of vertices. currently always returns false!!!

int covers(const GSpatial&) const [public virtual]

This function is not defined for Arcs. it always returns 0.

int intersects(const GSpatial&) const [public virtual]

check if this arc intersects a segment. This method calls the segment's intersects(GSegment) function for each edge of the arc.

int intersects(int n_point, Coord* coo) const [public virtual]

check if this polygon intersects with a linear series of connected coordinates.

int intersects(const GOps& ops) const [public virtual]

check if the arc intersects a set of ordered point series.

int isInside(const GRect& other) const [public]

Check if this arc completely falls within a rectangle.

int isInside(const GCircle& other) const [public]

check if this polyline complete falls inside a circle. simply loop through all nodes.

Result genMbr(GRect& ) [public]

scan the verticies and generate an MBR

void setMbr(const GRect& b) [public]

set the MBR


Documentation generated by lqian@lqian-sun on Wed Jul 14 09:36:10 EDT 1999
Kdoc