path class
The path class is derived from a shape. A path is represented by a list of vertices, plus a width, style, beginExtent and endExtent. This class is normally created in a cellView using the dbCreatePath() function.
path::width(int32_t w)
Sets the path width to w.
int32_t path::width()
Gets the path width.
path::setStyle(int32_t s)
Sets the path style, i.e. the type of the path end. The style can be one of: 0 - truncate, 1 - round, 2 - extend, 4 - varextend, 8 - octagonal. Python global variables TRUNCATE, ROUND, EXTEND, VAREXTEND, OCTAGONAL are defined to these values.
int32_t path::getStyle()
Gets the path style.
path::beginExt(int32_t e)
Set the path begin extent. For a path style 2 (extend) or 4 (varextend) , this is the begin extent of the path.
int32_t path::beginExt()
Get the path begin extent. For a path style of 2 (extend) this is half the path's width. For a path style 4 (varextend), this is the begin extent of the path.
path::endExt(int32_t e)
Set the path end extent. For a path style 2 (extend) or 4 (varextend), this is the end extent of the path.
int32_t path::endExt()
Get the path end extent. For a path style of 2 (extend) this is half the path's width. For a path style 4 (varextend), this is the end extent of the path.
Rect path::bBox()
Get the bounding box of this path.
path::bBox(Rect b)
Set the bounding box of this path. Not useful and will throw an exception if called.
dbtype_t path::objType()
Returns the object type of this path as PATH.
char * path::objName()
Returns the object name of this path as "PATH".
int32_t n = path::nPoints()
Returns the number of points of the path.
Point * path::ptlist()
Returns the point list of this path as a C array of Points.
Point p[index]
Returns the Point p at the index into the list of points.
path::bias(int32_t bias, double grid)
Bias this path by bias, snapping to the grid grid.
path::scale(double scale, double grid)
Scale this path by scale, snapping to the grid grid.
int32_t path::getNearestEdge(Point p, segment &s)
Get the distance of the nearest segment s of this path to the point p;
int32_t d = path::getNearestVertex(Point p, vertex &s)
Get the distance of the nearest vertex s of this path to the point p;
double a = path::area()
Get the area of this path.
int32_t p = path::perimeter()
Get the perimeter of this path.
path::transform(transform trans)
Transform this path using trans.
bool path::ptInPoly(Point p)
Returns true if the Point p is contained in the path or on its edges.
path::Move(cellView *cv, Point delta, bool opt = true)
Move this path by distance delta. If opt is true then the database is re-optimised for the new path position. If there are a lot of objects to move it makes sense to turn this off and instead use the cellView update() function after moving them all.
dbObj * path::Copy(cellView *cv, Point delta, int32_t layerNum = -1)
Copy this path to cellView cv, with offset delta. If layerNum is a positive integer the path will be copied to the new layer number.
dbObj * path::Flatten(cellView *cv, transform trans)
Flatten this path into cellView cv with transformation trans.
path::Stretch(Point delta, segment seg)
Stretch segment seg of this path by delta.
path::compressPoints()
Removes colinear points from the path.
polygon * path::shapeToPoly ()
Converts this path to a polygon.