Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pathplan(3) [suse man page]

LIBPATH(3)						     Library Functions Manual							LIBPATH(3)

NAME
libpathplan - finds and smooths shortest paths SYNOPSIS
#include <graphviz/pathplan.h> typedef struct Pxy_t { double x, y; } Pxy_t; typedef struct Pxy_t Ppoint_t; typedef struct Pxy_t Pvector_t; typedef struct Ppoly_t { Ppoint_t *ps; int pn; } Ppoly_t; typedef Ppoly_t Ppolyline_t; typedef struct Pedge_t { Ppoint_t a, b; } Pedge_t; typedef struct vconfig_s vconfig_t; #define POLYID_NONE #define POLYID_UNKNOWN FUNCTIONS
int Pshortestpath(Ppoly_t *boundary, Ppoint_t endpoints[2], Ppolyline_t *output_route); Finds a shortest path between two points in a simple polygon. You pass endpoints interior to the polygon boundary. A shortest path con- necting the points that remains in the polygon is returned in output_route. If either endpoint does not lie in the polygon, an error code is returned. (what code!!) vconfig_t *Pobsopen(Ppoly_t **obstacles, int n_obstacles); int Pobspath(vconfig_t *config, Ppoint_t p0, int poly0, Ppoint_t p1, int poly1, Ppolyline_t *output_route); void Pobsclose(vconfig_t *config); These functions find a shortest path between two points in a simple polygon that possibly contains polygonal obstacles (holes). Pobsopen creates a configuration (an opaque struct of type vconfig_t) on a set of obstacles. Pobspath finds a shortest path between the endpoints that remains outside the obstacles. If the endpoints are known to lie inside obstacles, poly0 or poly1 should be set to the index in the obstacles array. If an endpoint is definitely not inside an obstacle, then POLYID_NONE should be passed. If the caller has not checked, then POLYID_UNKNOWN should be passed, and the path library will perform the test. (!! there is no boundary polygon in this model?!!!) int Proutespline (Pedge_t *barriers, int n_barriers, Ppolyline_t input_route, Pvector_t endpoint_slopes[2], Ppolyline_t *output_route); This function fits a Bezier curve to a polyline path. The curve must avoid a set of barrier segments. The polyline is usually the out- put_route of one of the shortest path finders, but it can be any simple path that doesn't cross any obstacles. The input also includes endpoint slopes and 0,0 means unconstrained slope. Finally, this utility function converts an input list of polygons into an output list of barrier segments: int Ppolybarriers(Ppoly_t **polys, int n_polys, Pedge_t **barriers, int *n_barriers); AUTHORS
David Dobkin (dpd@cs.princeton.edu), Eleftherios Koutsofios (ek@research.att.com), Emden Gansner (erg@research.att.com). 01 APRIL 1997 LIBPATH(3)

Check Out this Related Man Page

XFillPolygon()															    XFillPolygon()

Name
  XFillPolygon - fill a polygon.

Synopsis
  XFillPolygon(display, drawable, gc, points, npoints, shape, mode)
	Display *display;
	Drawable drawable;
	GC gc;
	XPoint *points;
	int npoints;
	int shape;
	int mode;

Arguments
  display   Specifies a connection to an X server; returned from XOpenDisplay().

  drawable  Specifies the drawable.

  gc	    Specifies the graphics context.

  points    Specifies a pointer to an array of points.

  npoints   Specifies the number of points in the array.

  shape     Specifies  an  argument  that helps the server to improve performance.  Pass the last constant in this list that is valid for the
	    polygon to be filled: Complex, Nonconvex, or Convex.

  mode	    Specifies the coordinate mode.  Pass either CoordModeOrigin or CoordModePrevious.

Description
  XFillPolygon() fills the region closed by the specified path.  Some but not all of the path itself will be drawn.  The path is closed auto-
  matically if the last point in the list does not coincide with the first point.  No pixel of the region is drawn more than once.

  The mode argument affects the interpretation of the points that define the polygon:

  o  CoordModeOrigin indicates that all points are relative to the drawable's origin.

  o  CoordModePrevious	indicates that all points after the first are relative to the previous point.  (The first point is always relative to
     the drawable's origin.)

  The shape argument allows the fill routine to optimize its performance given tips on the configuration of the area.

  o  Complex indicates the path may self-intersect.  The fill_rule of the GC must be consulted to determine which areas are filled.  See Vol-
     ume One, Chapter 5, The Graphics Context, for a discussion of the fill rules EvenOddRule and WindingRule.

  o  Nonconvex	indicates the path does not self-intersect, but the shape is not wholly convex.  If known by the client, specifying Nonconvex
     instead of Complex may improve performance.  If you specify Nonconvex for a self-intersecting path, the graphics results are undefined.

  o  Convex means that for every pair of points inside the polygon, the line segment connecting them does not intersect the path.  Convex can
     improve performance even more than Nonconvex, but if the path is not convex, the graphics results are undefined.

  Contiguous coincident points in the path are not treated as self-intersection.

  XFillPolygon()  uses these graphics context components when filling the polygon area:  function, plane_mask, fill_style, fill_rule, subwin-
  dow_mode, clip_ x_origin, clip_y_origin, and clip_mask.  This function also uses these mode-dependent components  of	the  GC:  foreground,
  background,					  tile, 				    stipple,					ts_x_
  origin, and ts_y_origin.

  For more information, see Volume One, Chapter 6, Drawing Graphics and Text, and Chapter 5, The Graphics Context.

Structures
     typedef struct {
	 short x, y;
     } XPoint;

Errors
  BadDrawable
  BadGC
  BadMatch
  BadValue

See Also
  XClearArea(), XClearWindow(), XCopyArea(), XCopyPlane(), XDraw, XDrawArc(), XDrawArcs(), XDrawFilled(), XDrawLine(),	XDrawLines(),  XDraw-
  Point(), XDrawPoints(), XDrawRectangle(), XDrawRectangles(), XDrawSegments(), XFillArc(), XFillArcs(), XFillRectangle(), XFillRectangles().

Xlib - Drawing Primitives													    XFillPolygon()
Man Page