line class
The line class is derived from a shape. A line can be considered a zero width path, or wire. This class is normally created in a cellView using the dbCreateLine() function.
line::line()
Creates a new line object.
Rect line::bBox()
Get the bounding box of this line. This is the convex hull of the points in the line.
line::bBox(Rect b)
Set the bounding box of this line. Not useful and will throw an exception if called.
db_Type line::objType()
Returns the object type of this line as LINE.
const char * line::objName()
Returns the object name of this line as "LINE".
int32_t line::nPoints()
Returns the number of points of the line.
Point * line::ptlist()
Returns the point list of this line as a C array of Points.
Point line::at(index)
Returns the Point p at the index into the list of points.
bool line::addPoint(Point * p)
Adds a Point to the end of this line. Returns true is sucessful.
bool line::deletePoint(int32_t index)
Deletes the vertex given by index for this line. Returns true is sucessful.
line::setPoint(int index, Point p)
Sets the vertex index of the line to Point p.
line::setPoint(int32_t index, int32_t x, int32_t y)
Sets the vertex index of the line to the point given by x, y.
int line::getNearestEdge(Point p, segment &s)
Get the distance of the nearest segment s of this line to the point p;
int32_t line::getNearestVertex(Point p, vertex &s)
Get the distance of the nearest vertex s of this line to the point p;
float64_t line::area()
Get the area of this line.
int32_t line::perimeter()
Get the perimeter of this line.
int length = l.length()
Get the length of this line.
line::transform(transform trans)
Transform this line using trans.
bool b = l.ptInPoly(Point p, bool includeEnds = true)
Returns true if the point p is on the line. If includeEnds is true, this includes the line start and end point.
bool line::ptInRect(Rect r)
Returns true if the line crosses (intersects) a rectangle r.
line::Move(cellView *cv, Point delta, bool opt = true)
Move this line by distance delta.If opt is true then the database is re-optimised for the new line 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 *obj = l.Copy(cellView *cv, Point delta, int layerNum = -1)
Copy this line to cellView cv, with offset delta. If layerNum is non negative the line will be copied to the new layer number.
dbObj *obj = l.Flatten(cellView *cv, transform trans)
Flatten this line into cellView cv with transformation trans.
line::Stretch(Point delta, segment seg)
Stretch a segment seg of this line by delta.