segment class
A segment is an edge with two points. It is derived from a dbObj so it can be selectable; it also refers to a dbObj. Segments are used when selecting an edge of e.g. a rectangle or polygon.
segment::segment(const Point &p0, const Point &p1)
Creates a segment with coordinates p0 and p1.
segment::segment(int32_t x1, int32_t y1, int32_t x2, int32_t y2)
Creates a segment with the specified xy coordinates.
Edge segment::getEdge()
Returns an Edge from the segment's coordinates.
int32_t segment::length()
Get the euclidean length of the segment.
float64_t segment::DistanceToPoint(const &Point p)
Get the distance from a point p to this segment.
Point segment::NearestPoint(const Point &p)
Get the nearest point on a segment to another point.
db_Type segment::objType()
Returns the object's type, SEGMENT.
const char * segment::objName()
Returns the object's name, "SEGMENT".
segment::SetObj(dbObj * obj)
Sets the dbObj associated with this segment.
dbObj * segment::GetObj()
Gets the dbObj associated with this segment.
bool segment::isXSeg()
Returns true if this segment is horizontal.
bool segment::isYSeg()
Returns true if this segment is vertical.
bool segment::isManhattan()
Returns true if this segment is manhattan.
Rect segment::bBox()
Returns a fake bounding box 10 dbu larger than the segment itself.
segment::normalise()
Normalise a segment, i.e. ensure coord p0 is the lower left compared to p1.
bool segment::segInRect(const Rect &r)
Returns 1 if the segment is contained in Rect r.
segment::transform(transform trans)
Transforms this segment according to trans.
segment::Move(cellView *cv, Point delta, bool opt = true)
Moves this segment by delta. If opt is true then the database is re-optimised for the new segment 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.
Point segment::p0
The first point of the segment.
Point segment::p1
The last point of the segment.