PCB Environment: WideSegment_25 Class Reference

PCB Environment 2

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Attributes
WideSegment_25 Class Reference

`#include <AShape.hpp>`

Inheritance diagram for WideSegment_25:

## Public Member Functions
| WideSegment_25 (const Segment_25 &s, Real halfWidth)
| WideSegment_25 (const Segment_2 &s, int z, Real halfWidth)
| WideSegment_25 (const Point_2 &v0, const Point_2 &v1, int z, Real halfWidth)
void | _setBase (const Segment_25 &s)
Segment_25 & | _base ()
const Segment_25 & | base () const
Segment_2 | s2_extended (uint mask=0x3) const
Real | halfWidth () const
Real | width () const
Real | squared_width () const
int | z () const
Point_25 | source () const
Point_25 | target () const
const Point_2 & | source_2 () const
const Point_2 & | target_2 () const
Circle_2 | sourceCap () const
Circle_2 | targetCap () const
int | joins2D (const Point_2 &, Real leewaySquared=-1.0) const
bool | widerThanBaseLen () const
::Vector_2 | getHalfWidthSpan (Real delta=0.0) const
WideSegment_25 | swapWL (Real deltaHW=0.0, Real deltaL=0.0) const
WideSegment_25 | opposite () const
WideSegment_25 | orderedX () const
WideSegment_25 | orderedY () const
AShape * | clone () const override
uint | vertexCount () const override
bool | canDrawAsTriFan () const override
bool | isRound () const override
Real | unsignedArea () const override
Bbox_2 | bbox () const override
void | transform (const CGAL::Aff_transformation_2< Kernel > &) override
void | translate (const ::Vector_2 &) override
void | nudge (int s, int t)
WideSegment_25 & | rectify (Real angleTolerance)
WideSegment_25 | grown (Real) const
bool | contains (const ::Point_2 &) const override
Real | squared_distance (const AShape &S) const override
Real | squared_distance (const ::Point_2 &) const override
Real | squared_distance (const Segment_2 &) const override
Real | squared_distance (const Circle_2 &C) const override
Real | squared_distance (const Iso_rectangle_2 &R) const override
Real | squared_distance (const Triangle_2 &T) const override
Real | squared_distance (const Polygon_2 &P) const override
Real | squared_distance (const WideSegment_25 &) const override
bool | intersects (const AShape &S) const override
bool | intersects (const Circle_2 &C) const override
bool | intersects (const Iso_rectangle_2 &R) const override
bool | intersects (const Triangle_2 &T) const override
bool | intersects (const Polygon_2 &P) const override
bool | intersects (const WideSegment_25 &) const override
bool | violatesClearance (const WideSegment_25 &, Real clearance, Point_25 *=0) const
bool | violatesClearance2D (const WideSegment_25 &, Real clearance, Point_25 *=0) const
::Point_2 | centroid () const override
std::string | str () const override
PyObject * | getPy () const override
PyObject * | getShortPy () const
Public Member Functions inherited from AShape
template<typename T>
T * | as ()
template<typename T>
const T * | as () const
virtual uint | indexCountWithRestart () const
Real | boundingRadius () const
virtual bool | transformPreservesType (const CGAL::Aff_transformation_2< Kernel > &) const
virtual void | translate (const Vector_2 &)=0
virtual AShape * | transformType (const CGAL::Aff_transformation_2< Kernel > &)
virtual bool | contains (const Point_2 &) const =0
Real | squared_distance (const Bbox_2 &) const
bool | intersects (const Bbox_2 &) const

## Static Public Member Functions
static WideSegment_25 | fromPy (PyObject *)

## Protected Attributes
Segment_25 | mBase
Real | mHW

## Detailed Description

A segment in 2.5D with a given constant width and round caps with radius = width/2. This is the Minkowski sum of a segment and a circle. The caps extend beyond the endpoints and are not accounted for in the segment's length.

## Member Function Documentation

## ◆ bbox()

Bbox_2 WideSegment_25::bbox | ( |  | ) | const
| overridevirtual

Implements AShape.

## ◆ canDrawAsTriFan()

bool WideSegment_25::canDrawAsTriFan | ( |  | ) | const
| inlineoverridevirtual

Reimplemented from AShape.

## ◆ centroid()

::Point_2 WideSegment_25::centroid | ( |  | ) | const
| inlineoverridevirtual

Implements AShape.

## ◆ clone()

AShape * WideSegment_25::clone | ( |  | ) | const
| inlineoverridevirtual

Implements AShape.

## ◆ fromPy()

WideSegment_25 WideSegment_25::fromPy | ( | PyObject * |  | ) |
| static

Expects (x0,y0,x1,y1,z,w).

## ◆ getHalfWidthSpan()

::Vector_2 WideSegment_25::getHalfWidthSpan | ( | Real | delta = 0.0 | ) | const
| inline

Get a vector perpendicular to the segment of length halfwidth + @delta.

## ◆ getPy()

PyObject * WideSegment_25::getPy | ( |  | ) | const
| overridevirtual

Return a Python representation of this object. Formats:

- ('circle', radius, x, y)
- ('triangle', v0, v1, v2) where v is (x,y,z)
- ('rect_iso', xmin, ymin, xmax, ymax)
- ('wide_segment', x0, y0, x1, y1, z, width)
- ('polygon', [v0, v1, v2, v3, ...]) where v is (x,y,z)

Implements AShape.

## ◆ grown()

WideSegment_25 WideSegment_25::grown | ( | Real |  | ) | const

Get this segment extended by the specified value in both directions as well as its halfwidth.

## ◆ intersects() [1/6]

bool WideSegment_25::intersects | ( | const AShape & | S | ) | const
| inlineoverridevirtual

Implements AShape.

## ◆ intersects() [2/6]

bool WideSegment_25::intersects | ( | const Circle_2 & | C | ) | const
| overridevirtual

Implements AShape.

## ◆ intersects() [3/6]

bool WideSegment_25::intersects | ( | const Iso_rectangle_2 & | R | ) | const
| overridevirtual

Implements AShape.

## ◆ intersects() [4/6]

bool WideSegment_25::intersects | ( | const Polygon_2 & | P | ) | const
| overridevirtual

Implements AShape.

## ◆ intersects() [5/6]

bool WideSegment_25::intersects | ( | const Triangle_2 & | T | ) | const
| overridevirtual

Implements AShape.

## ◆ intersects() [6/6]

bool WideSegment_25::intersects | ( | const WideSegment_25 & |  | ) | const
| overridevirtual

Implements AShape.

## ◆ isRound()

bool WideSegment_25::isRound | ( |  | ) | const
| inlineoverridevirtual

Reimplemented from AShape.

## ◆ joins2D()

int WideSegment_25::joins2D | ( | const Point_2 & | ,
|  | Real | leewaySquared = -1.0 ) const

Test whether the segment ends at the specified point or within a certain distance.

Parameters

  leewaySquared | maximum squared distance from end, < 0 defaults to halfwidth

Returns
  -1 for source, 1 for target, 0 for no contact or too far from the ends

## ◆ nudge()

void WideSegment_25::nudge | ( | int | s,
|  | int | t )

Move the source/target point by @s/@t times (target - source) * halfwidth / 16.

## ◆ opposite()

WideSegment_25 WideSegment_25::opposite | ( |  | ) | const
| inline

swap endpoints

## ◆ rectify()

WideSegment_25 & WideSegment_25::rectify | ( | Real | angleTolerance | ) |
| inline

If the angle of this segment falls with @angleTolerance of the x- or y-axis, align it.

## ◆ s2_extended()

Segment_2 WideSegment_25::s2_extended | ( | uint | mask = 0x3 | ) | const

Get a segment extended by the radius of the caps (half its width).

Parameters

  mask | 0x1 to extend the source end | 0x2 to extend the target end

## ◆ squared_distance() [1/8]

Real WideSegment_25::squared_distance | ( | const ::Point_2 & |  | ) | const
| overridevirtual

Implements AShape.

## ◆ squared_distance() [2/8]

Real WideSegment_25::squared_distance | ( | const AShape & | S | ) | const
| inlineoverridevirtual

Implements AShape.

## ◆ squared_distance() [3/8]

Real WideSegment_25::squared_distance | ( | const Circle_2 & | C | ) | const
| overridevirtual

Implements AShape.

## ◆ squared_distance() [4/8]

Real WideSegment_25::squared_distance | ( | const Iso_rectangle_2 & | R | ) | const
| overridevirtual

Implements AShape.

## ◆ squared_distance() [5/8]

Real WideSegment_25::squared_distance | ( | const Polygon_2 & | P | ) | const
| overridevirtual

Implements AShape.

## ◆ squared_distance() [6/8]

Real WideSegment_25::squared_distance | ( | const Segment_2 & |  | ) | const
| overridevirtual

Implements AShape.

## ◆ squared_distance() [7/8]

Real WideSegment_25::squared_distance | ( | const Triangle_2 & | T | ) | const
| overridevirtual

Implements AShape.

## ◆ squared_distance() [8/8]

Real WideSegment_25::squared_distance | ( | const WideSegment_25 & |  | ) | const
| overridevirtual

Implements AShape.

## ◆ str()

std::string WideSegment_25::str | ( |  | ) | const
| overridevirtual

Implements AShape.

## ◆ swapWL()

WideSegment_25 WideSegment_25::swapWL | ( | Real | deltaHW = 0.0,
|  | Real | deltaL = 0.0 ) const
| inline

Get a new segment perpendicular to this one with width and length swapped.

Parameters

  deltaHW | value added to new halfwidth
  deltaL | value added to new length

## ◆ transform()

void WideSegment_25::transform | ( | const CGAL::Aff_transformation_2< Kernel > & |  | ) |
| overridevirtual

Use transformType() if you are not sure whether the transformation preserves the shape type.

Implements AShape.

## ◆ unsignedArea()

Real WideSegment_25::unsignedArea | ( |  | ) | const
| inlineoverridevirtual

Implements AShape.

## ◆ vertexCount()

uint WideSegment_25::vertexCount | ( |  | ) | const
| inlineoverridevirtual

For rendering:

Implements AShape.

## ◆ violatesClearance()

bool WideSegment_25::violatesClearance | ( | const WideSegment_25 & | ,
|  | Real | clearance,
|  | Point_25 * | = 0 ) const

Check if another segment falls within @clearance of this one. If nonzero, set the pointer value to the intersection or, if none, the endpoint with the smallest point to segment distance.

## Field Documentation

## ◆ mBase

Segment_25 WideSegment_25::mBase
| protected

(x0,y0,x1,y1,z,w)

The documentation for this class was generated from the following file:

- /home/chr/devel/PhD/Environment/pub/PCBEnv/pcbenv/cxx/AShape.hpp