PCB Environment 2
Loading...
Searching...
No Matches
AShape Class Referenceabstract

#include <AShape.hpp>

Inheritance diagram for AShape:
CircleEx IsoRectEx PolygonEx TriangleEx WideSegment_25

Public Member Functions

template<typename T>
T * as ()
template<typename T>
const T * as () const
virtual AShapeclone () const =0
virtual uint vertexCount () const =0
virtual uint indexCountWithRestart () const
virtual bool canDrawAsTriFan () const
virtual bool isRound () const
virtual Real unsignedArea () const =0
virtual Bbox_2 bbox () const =0
Real boundingRadius () const
virtual bool transformPreservesType (const CGAL::Aff_transformation_2< Kernel > &) const
virtual void transform (const CGAL::Aff_transformation_2< Kernel > &)=0
virtual void translate (const Vector_2 &)=0
virtual AShapetransformType (const CGAL::Aff_transformation_2< Kernel > &)
virtual bool contains (const Point_2 &) const =0
virtual Real squared_distance (const AShape &) const =0
virtual Real squared_distance (const ::Point_2 &) const =0
virtual Real squared_distance (const Segment_2 &) const =0
virtual Real squared_distance (const Circle_2 &) const =0
virtual Real squared_distance (const Iso_rectangle_2 &) const =0
Real squared_distance (const Bbox_2 &) const
virtual Real squared_distance (const Triangle_2 &) const =0
virtual Real squared_distance (const Polygon_2 &) const =0
virtual Real squared_distance (const WideSegment_25 &) const =0
virtual bool intersects (const AShape &) const =0
virtual bool intersects (const Circle_2 &) const =0
virtual bool intersects (const Iso_rectangle_2 &) const =0
bool intersects (const Bbox_2 &) const
virtual bool intersects (const Triangle_2 &) const =0
virtual bool intersects (const Polygon_2 &) const =0
virtual bool intersects (const WideSegment_25 &) const =0
virtual::Point_2 centroid () const =0
virtual std::string str () const =0
virtual PyObject * getPy () const =0

Detailed Description

Abstract shape class, or simply "a shape".

Member Function Documentation

◆ getPy()

virtual PyObject * AShape::getPy ( ) const
pure virtual

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)

Implemented in CircleEx, IsoRectEx, PolygonEx, TriangleEx, and WideSegment_25.

◆ transform()

virtual void AShape::transform ( const CGAL::Aff_transformation_2< Kernel > & )
pure virtual

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

Implemented in CircleEx, IsoRectEx, PolygonEx, TriangleEx, and WideSegment_25.

◆ transformPreservesType()

virtual bool AShape::transformPreservesType ( const CGAL::Aff_transformation_2< Kernel > & ) const
inlinevirtual

Check whether the transformation would change the shape's underlying type (sorry).

  • Iso_rectangle_2 may become a Polygon_2 when (angle % 90) != 0
  • Circle_2 may become an ellipse when scaled (this is not supported)

Reimplemented in CircleEx, and IsoRectEx.

◆ transformType()

virtual AShape * AShape::transformType ( const CGAL::Aff_transformation_2< Kernel > & )
virtual

Transform this shape without restrictions.

Returns
@this or a new AShape.

Reimplemented in IsoRectEx.

◆ vertexCount()

virtual uint AShape::vertexCount ( ) const
pure virtual

For rendering:

Implemented in CircleEx, IsoRectEx, PolygonEx, TriangleEx, and WideSegment_25.


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