|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Abstract base class for EEPIC-drawable geometric objects. More...
#include <eepicgeom.H>
Public Member Functions | |
| Eepic_Geom_Object (Geom_Object *ptr, const bool &__to_delete=false) | |
| Construct an EEPIC wrapper for a geometric object. | |
| virtual | ~Eepic_Geom_Object () |
| Virtual destructor. | |
| virtual void | draw (Eepic_Plane *plane, std::ostream &output) const |
| Generate EEPIC code for this object. | |
| virtual Eepic_Geom_Object * | clone () const =0 |
| Create a polymorphic copy of this object. | |
| virtual Point | highest_point () const =0 |
| Get the highest point (maximum y-coordinate) of this object. | |
| virtual Point | lowest_point () const =0 |
| Get the lowest point (minimum y-coordinate) of this object. | |
| virtual Point | leftmost_point () const =0 |
| Get the leftmost point (minimum x-coordinate) of this object. | |
| virtual Point | rightmost_point () const =0 |
| Get the rightmost point (maximum x-coordinate) of this object. | |
Protected Attributes | |
| const Geom_Object *const | geom_object_ptr |
| Pointer to the wrapped geometric object. | |
| bool | to_delete |
| Flag indicating ownership of geom_object_ptr. | |
Private Member Functions | |
| Eepic_Geom_Object () | |
| Eepic_Geom_Object (const Eepic_Geom_Object &) | |
Abstract base class for EEPIC-drawable geometric objects.
This class serves as the polymorphic base for all geometric objects that can be rendered in EEPIC format. Each derived class wraps a concrete geometric object (Point, Segment, Polygon, etc.) and provides:
The wrapped geometric object can be owned by this class (to_delete=true) or externally managed (to_delete=false). When owned, the destructor will delete the wrapped object.
Use the DEFINE_EEPIC_CLASS macro to create new drawable types:
Definition at line 107 of file eepicgeom.H.
|
private |
|
private |
|
inline |
Construct an EEPIC wrapper for a geometric object.
| ptr | Pointer to the geometric object to wrap |
| __to_delete | If true, this object takes ownership and will delete ptr in the destructor |
Definition at line 135 of file eepicgeom.H.
|
inlinevirtual |
Virtual destructor.
Deletes geom_object_ptr only if to_delete is true.
Definition at line 145 of file eepicgeom.H.
References geom_object_ptr, and to_delete.
|
pure virtual |
Create a polymorphic copy of this object.
Derived classes must implement this to return a new instance of their specific type.
Implemented in Eepic_Point, Eepic_Segment, Eepic_Arrow, Eepic_Thick_Segment, Eepic_Thick_Dash_Segment, Eepic_Thick_Arrow, Eepic_Dotted_Segment, Eepic_Dash_Segment, Eepic_Dotted_Arrow, Eepic_Dash_Arrow, Eepic_Thick_Dash_Arrow, Eepic_Triangle, Eepic_Ellipse, Eepic_Shade_Ellipse, Eepic_Thick_Ellipse, Eepic_Text, Eepic_Left_Text, Eepic_Right_Text, Eepic_Center_Text, Eepic_Polygon, Eepic_Polygon_With_Points, Eepic_Polygon_With_Arrows, Eepic_Dotted_Polygon, Eepic_Dash_Polygon, Eepic_Dotted_Polygon_With_Points, Eepic_Dash_Polygon_With_Points, Eepic_Dash_Polygon_With_Arrow, Eepic_Shade_Polygon, Eepic_Shade_Polygon_With_Points, Eepic_Shade_Polygon_With_Arrows, Eepic_Shade_Polygon_With_Text_Points, Eepic_Shade_Polygon_With_Vertex_Numbers, Eepic_Spline, Eepic_Dash_Spline, Eepic_Spline_Arrow, Eepic_Dash_Spline_Arrow, Eepic_Thick_Polygon_With_Points, Eepic_Thick_Polygon_With_Arrows, Eepic_Thick_Dotted_Polygon, Eepic_Thick_Dash_Polygon, Eepic_Thick_Dotted_Polygon_With_Points, Eepic_Thick_Dash_Polygon_With_Points, Eepic_Thick_Dash_Polygon_With_Arrow, Eepic_Thick_Shade_Polygon, Eepic_Thick_Shade_Polygon_With_Points, Eepic_Thick_Shade_Polygon_With_Arrows, Eepic_Thick_Shade_Polygon_With_Text_Points, Eepic_Thick_Shade_Polygon_With_Vertex_Numbers, Eepic_Thick_Spline, Eepic_Thick_Dash_Spline, Eepic_Thick_Spline_Arrow, Eepic_Thick_Dash_Spline_Arrow, Eepic_Regular_Polygon, Eepic_Regular_Polygon_With_Points, Eepic_Dotted_Regular_Polygon, Eepic_Dash_Regular_Polygon, Eepic_Dotted_Regular_Polygon_With_Points, Eepic_Dash_Regular_Polygon_With_Points, Eepic_Shade_Regular_Polygon, Eepic_Shade_Regular_Polygon_With_Points, Eepic_Shade_Regular_Polygon_With_Arrows, Eepic_Shade_Regular_Polygon_With_Text_Points, and Eepic_Shade_Regular_Polygon_With_Vertex_Numbers.
|
inlinevirtual |
Generate EEPIC code for this object.
Derived classes must override this method to produce the appropriate EEPIC LaTeX commands for their geometric type.
| plane | The Eepic_Plane providing coordinate transformation |
| output | The output stream to write EEPIC code to |
| std::domain_error | if geom_object_ptr is null |
| std::logic_error | if called on the base class (not overridden) |
Reimplemented in Eepic_Point, Eepic_Segment, Eepic_Arrow, Eepic_Thick_Segment, Eepic_Thick_Dash_Segment, Eepic_Thick_Arrow, Eepic_Dotted_Segment, Eepic_Dash_Segment, Eepic_Dotted_Arrow, Eepic_Dash_Arrow, Eepic_Thick_Dash_Arrow, Eepic_Triangle, Eepic_Ellipse, Eepic_Shade_Ellipse, Eepic_Thick_Ellipse, Eepic_Text, Eepic_Left_Text, Eepic_Right_Text, Eepic_Center_Text, Eepic_Polygon, Eepic_Polygon_With_Points, Eepic_Polygon_With_Arrows, Eepic_Dotted_Polygon, Eepic_Dash_Polygon, Eepic_Dotted_Polygon_With_Points, Eepic_Dash_Polygon_With_Points, Eepic_Dash_Polygon_With_Arrow, Eepic_Shade_Polygon, Eepic_Shade_Polygon_With_Points, Eepic_Shade_Polygon_With_Arrows, Eepic_Shade_Polygon_With_Text_Points, Eepic_Shade_Polygon_With_Vertex_Numbers, Eepic_Spline, Eepic_Dash_Spline, Eepic_Spline_Arrow, Eepic_Dash_Spline_Arrow, Eepic_Thick_Polygon_With_Points, Eepic_Thick_Polygon_With_Arrows, Eepic_Thick_Dotted_Polygon, Eepic_Thick_Dash_Polygon, Eepic_Thick_Dotted_Polygon_With_Points, Eepic_Thick_Dash_Polygon_With_Points, Eepic_Thick_Dash_Polygon_With_Arrow, Eepic_Thick_Shade_Polygon, Eepic_Thick_Shade_Polygon_With_Points, Eepic_Thick_Shade_Polygon_With_Arrows, Eepic_Thick_Shade_Polygon_With_Text_Points, Eepic_Thick_Shade_Polygon_With_Vertex_Numbers, Eepic_Thick_Spline, Eepic_Thick_Dash_Spline, Eepic_Thick_Spline_Arrow, Eepic_Thick_Dash_Spline_Arrow, Eepic_Regular_Polygon, Eepic_Regular_Polygon_With_Points, Eepic_Dotted_Regular_Polygon, Eepic_Dash_Regular_Polygon, Eepic_Dotted_Regular_Polygon_With_Points, Eepic_Dash_Regular_Polygon_With_Points, Eepic_Shade_Regular_Polygon, Eepic_Shade_Regular_Polygon_With_Points, Eepic_Shade_Regular_Polygon_With_Arrows, Eepic_Shade_Regular_Polygon_With_Text_Points, and Eepic_Shade_Regular_Polygon_With_Vertex_Numbers.
Definition at line 162 of file eepicgeom.H.
References ah_domain_error_if, ah_logic_error, geom_object_ptr, Aleph::maps(), and output.
Referenced by Eepic_Plane::draw().
Get the highest point (maximum y-coordinate) of this object.
Implemented in Eepic_Point, Eepic_Segment, Eepic_Arrow, Eepic_Thick_Segment, Eepic_Thick_Dash_Segment, Eepic_Thick_Arrow, Eepic_Dotted_Segment, Eepic_Dash_Segment, Eepic_Dotted_Arrow, Eepic_Dash_Arrow, Eepic_Thick_Dash_Arrow, Eepic_Triangle, Eepic_Ellipse, Eepic_Shade_Ellipse, Eepic_Thick_Ellipse, Eepic_Text, Eepic_Left_Text, Eepic_Right_Text, Eepic_Center_Text, Eepic_Polygon, Eepic_Polygon_With_Points, Eepic_Polygon_With_Arrows, Eepic_Dotted_Polygon, Eepic_Dash_Polygon, Eepic_Dotted_Polygon_With_Points, Eepic_Dash_Polygon_With_Points, Eepic_Dash_Polygon_With_Arrow, Eepic_Shade_Polygon, Eepic_Shade_Polygon_With_Points, Eepic_Shade_Polygon_With_Arrows, Eepic_Shade_Polygon_With_Text_Points, Eepic_Shade_Polygon_With_Vertex_Numbers, Eepic_Spline, Eepic_Dash_Spline, Eepic_Spline_Arrow, Eepic_Dash_Spline_Arrow, Eepic_Thick_Polygon_With_Points, Eepic_Thick_Polygon_With_Arrows, Eepic_Thick_Dotted_Polygon, Eepic_Thick_Dash_Polygon, Eepic_Thick_Dotted_Polygon_With_Points, Eepic_Thick_Dash_Polygon_With_Points, Eepic_Thick_Dash_Polygon_With_Arrow, Eepic_Thick_Shade_Polygon, Eepic_Thick_Shade_Polygon_With_Points, Eepic_Thick_Shade_Polygon_With_Arrows, Eepic_Thick_Shade_Polygon_With_Text_Points, Eepic_Thick_Shade_Polygon_With_Vertex_Numbers, Eepic_Thick_Spline, Eepic_Thick_Dash_Spline, Eepic_Thick_Spline_Arrow, Eepic_Thick_Dash_Spline_Arrow, Eepic_Regular_Polygon, Eepic_Regular_Polygon_With_Points, Eepic_Dotted_Regular_Polygon, Eepic_Dash_Regular_Polygon, Eepic_Dotted_Regular_Polygon_With_Points, Eepic_Dash_Regular_Polygon_With_Points, Eepic_Shade_Regular_Polygon, Eepic_Shade_Regular_Polygon_With_Points, Eepic_Shade_Regular_Polygon_With_Arrows, Eepic_Shade_Regular_Polygon_With_Text_Points, and Eepic_Shade_Regular_Polygon_With_Vertex_Numbers.
Referenced by Eepic_Plane::compute_extreme_points().
Get the leftmost point (minimum x-coordinate) of this object.
Implemented in Eepic_Point, Eepic_Segment, Eepic_Arrow, Eepic_Thick_Segment, Eepic_Thick_Dash_Segment, Eepic_Thick_Arrow, Eepic_Dotted_Segment, Eepic_Dash_Segment, Eepic_Dotted_Arrow, Eepic_Dash_Arrow, Eepic_Thick_Dash_Arrow, Eepic_Triangle, Eepic_Ellipse, Eepic_Shade_Ellipse, Eepic_Thick_Ellipse, Eepic_Text, Eepic_Left_Text, Eepic_Right_Text, Eepic_Center_Text, Eepic_Polygon, Eepic_Polygon_With_Points, Eepic_Polygon_With_Arrows, Eepic_Dotted_Polygon, Eepic_Dash_Polygon, Eepic_Dotted_Polygon_With_Points, Eepic_Dash_Polygon_With_Points, Eepic_Dash_Polygon_With_Arrow, Eepic_Shade_Polygon, Eepic_Shade_Polygon_With_Points, Eepic_Shade_Polygon_With_Arrows, Eepic_Shade_Polygon_With_Text_Points, Eepic_Shade_Polygon_With_Vertex_Numbers, Eepic_Spline, Eepic_Dash_Spline, Eepic_Spline_Arrow, Eepic_Dash_Spline_Arrow, Eepic_Thick_Polygon_With_Points, Eepic_Thick_Polygon_With_Arrows, Eepic_Thick_Dotted_Polygon, Eepic_Thick_Dash_Polygon, Eepic_Thick_Dotted_Polygon_With_Points, Eepic_Thick_Dash_Polygon_With_Points, Eepic_Thick_Dash_Polygon_With_Arrow, Eepic_Thick_Shade_Polygon, Eepic_Thick_Shade_Polygon_With_Points, Eepic_Thick_Shade_Polygon_With_Arrows, Eepic_Thick_Shade_Polygon_With_Text_Points, Eepic_Thick_Shade_Polygon_With_Vertex_Numbers, Eepic_Thick_Spline, Eepic_Thick_Dash_Spline, Eepic_Thick_Spline_Arrow, Eepic_Thick_Dash_Spline_Arrow, Eepic_Regular_Polygon, Eepic_Regular_Polygon_With_Points, Eepic_Dotted_Regular_Polygon, Eepic_Dash_Regular_Polygon, Eepic_Dotted_Regular_Polygon_With_Points, Eepic_Dash_Regular_Polygon_With_Points, Eepic_Shade_Regular_Polygon, Eepic_Shade_Regular_Polygon_With_Points, Eepic_Shade_Regular_Polygon_With_Arrows, Eepic_Shade_Regular_Polygon_With_Text_Points, and Eepic_Shade_Regular_Polygon_With_Vertex_Numbers.
Referenced by Eepic_Plane::compute_extreme_points().
Get the lowest point (minimum y-coordinate) of this object.
Implemented in Eepic_Point, Eepic_Segment, Eepic_Arrow, Eepic_Thick_Segment, Eepic_Thick_Dash_Segment, Eepic_Thick_Arrow, Eepic_Dotted_Segment, Eepic_Dash_Segment, Eepic_Dotted_Arrow, Eepic_Dash_Arrow, Eepic_Thick_Dash_Arrow, Eepic_Triangle, Eepic_Ellipse, Eepic_Shade_Ellipse, Eepic_Thick_Ellipse, Eepic_Text, Eepic_Left_Text, Eepic_Right_Text, Eepic_Center_Text, Eepic_Polygon, Eepic_Polygon_With_Points, Eepic_Polygon_With_Arrows, Eepic_Dotted_Polygon, Eepic_Dash_Polygon, Eepic_Dotted_Polygon_With_Points, Eepic_Dash_Polygon_With_Points, Eepic_Dash_Polygon_With_Arrow, Eepic_Shade_Polygon, Eepic_Shade_Polygon_With_Points, Eepic_Shade_Polygon_With_Arrows, Eepic_Shade_Polygon_With_Text_Points, Eepic_Shade_Polygon_With_Vertex_Numbers, Eepic_Spline, Eepic_Dash_Spline, Eepic_Spline_Arrow, Eepic_Dash_Spline_Arrow, Eepic_Thick_Polygon_With_Points, Eepic_Thick_Polygon_With_Arrows, Eepic_Thick_Dotted_Polygon, Eepic_Thick_Dash_Polygon, Eepic_Thick_Dotted_Polygon_With_Points, Eepic_Thick_Dash_Polygon_With_Points, Eepic_Thick_Dash_Polygon_With_Arrow, Eepic_Thick_Shade_Polygon, Eepic_Thick_Shade_Polygon_With_Points, Eepic_Thick_Shade_Polygon_With_Arrows, Eepic_Thick_Shade_Polygon_With_Text_Points, Eepic_Thick_Shade_Polygon_With_Vertex_Numbers, Eepic_Thick_Spline, Eepic_Thick_Dash_Spline, Eepic_Thick_Spline_Arrow, Eepic_Thick_Dash_Spline_Arrow, Eepic_Regular_Polygon, Eepic_Regular_Polygon_With_Points, Eepic_Dotted_Regular_Polygon, Eepic_Dash_Regular_Polygon, Eepic_Dotted_Regular_Polygon_With_Points, Eepic_Dash_Regular_Polygon_With_Points, Eepic_Shade_Regular_Polygon, Eepic_Shade_Regular_Polygon_With_Points, Eepic_Shade_Regular_Polygon_With_Arrows, Eepic_Shade_Regular_Polygon_With_Text_Points, and Eepic_Shade_Regular_Polygon_With_Vertex_Numbers.
Referenced by Eepic_Plane::compute_extreme_points().
Get the rightmost point (maximum x-coordinate) of this object.
Implemented in Eepic_Point, Eepic_Segment, Eepic_Arrow, Eepic_Thick_Segment, Eepic_Thick_Dash_Segment, Eepic_Thick_Arrow, Eepic_Dotted_Segment, Eepic_Dash_Segment, Eepic_Dotted_Arrow, Eepic_Dash_Arrow, Eepic_Thick_Dash_Arrow, Eepic_Triangle, Eepic_Ellipse, Eepic_Shade_Ellipse, Eepic_Thick_Ellipse, Eepic_Text, Eepic_Left_Text, Eepic_Right_Text, Eepic_Center_Text, Eepic_Polygon, Eepic_Polygon_With_Points, Eepic_Polygon_With_Arrows, Eepic_Dotted_Polygon, Eepic_Dash_Polygon, Eepic_Dotted_Polygon_With_Points, Eepic_Dash_Polygon_With_Points, Eepic_Dash_Polygon_With_Arrow, Eepic_Shade_Polygon, Eepic_Shade_Polygon_With_Points, Eepic_Shade_Polygon_With_Arrows, Eepic_Shade_Polygon_With_Text_Points, Eepic_Shade_Polygon_With_Vertex_Numbers, Eepic_Spline, Eepic_Dash_Spline, Eepic_Spline_Arrow, Eepic_Dash_Spline_Arrow, Eepic_Thick_Polygon_With_Points, Eepic_Thick_Polygon_With_Arrows, Eepic_Thick_Dotted_Polygon, Eepic_Thick_Dash_Polygon, Eepic_Thick_Dotted_Polygon_With_Points, Eepic_Thick_Dash_Polygon_With_Points, Eepic_Thick_Dash_Polygon_With_Arrow, Eepic_Thick_Shade_Polygon, Eepic_Thick_Shade_Polygon_With_Points, Eepic_Thick_Shade_Polygon_With_Arrows, Eepic_Thick_Shade_Polygon_With_Text_Points, Eepic_Thick_Shade_Polygon_With_Vertex_Numbers, Eepic_Thick_Spline, Eepic_Thick_Dash_Spline, Eepic_Thick_Spline_Arrow, Eepic_Thick_Dash_Spline_Arrow, Eepic_Regular_Polygon, Eepic_Regular_Polygon_With_Points, Eepic_Dotted_Regular_Polygon, Eepic_Dash_Regular_Polygon, Eepic_Dotted_Regular_Polygon_With_Points, Eepic_Dash_Regular_Polygon_With_Points, Eepic_Shade_Regular_Polygon, Eepic_Shade_Regular_Polygon_With_Points, Eepic_Shade_Regular_Polygon_With_Arrows, Eepic_Shade_Regular_Polygon_With_Text_Points, and Eepic_Shade_Regular_Polygon_With_Vertex_Numbers.
Referenced by Eepic_Plane::compute_extreme_points().
|
protected |
Pointer to the wrapped geometric object.
This pointer is const-qualified to prevent accidental modification. Memory management depends on the to_delete flag.
Definition at line 119 of file eepicgeom.H.
Referenced by ~Eepic_Geom_Object(), draw(), Eepic_Polygon::draw(), Eepic_Polygon_With_Points::draw(), Eepic_Polygon_With_Arrows::draw(), Eepic_Dotted_Polygon::draw(), Eepic_Dash_Polygon::draw(), Eepic_Dotted_Polygon_With_Points::draw(), Eepic_Dash_Polygon_With_Points::draw(), Eepic_Dash_Polygon_With_Arrow::draw(), Eepic_Shade_Polygon::draw(), Eepic_Shade_Polygon_With_Points::draw(), Eepic_Shade_Polygon_With_Arrows::draw(), Eepic_Shade_Polygon_With_Text_Points::draw(), Eepic_Shade_Polygon_With_Vertex_Numbers::draw(), Eepic_Spline::draw(), Eepic_Dash_Spline::draw(), Eepic_Spline_Arrow::draw(), Eepic_Dash_Spline_Arrow::draw(), Eepic_Thick_Polygon_With_Points::draw(), Eepic_Thick_Polygon_With_Arrows::draw(), Eepic_Thick_Dotted_Polygon::draw(), Eepic_Thick_Dash_Polygon::draw(), Eepic_Thick_Dotted_Polygon_With_Points::draw(), Eepic_Thick_Dash_Polygon_With_Points::draw(), Eepic_Thick_Dash_Polygon_With_Arrow::draw(), Eepic_Thick_Shade_Polygon::draw(), Eepic_Thick_Shade_Polygon_With_Points::draw(), Eepic_Thick_Shade_Polygon_With_Arrows::draw(), Eepic_Thick_Shade_Polygon_With_Text_Points::draw(), Eepic_Thick_Shade_Polygon_With_Vertex_Numbers::draw(), Eepic_Thick_Spline::draw(), Eepic_Thick_Dash_Spline::draw(), Eepic_Thick_Spline_Arrow::draw(), Eepic_Thick_Dash_Spline_Arrow::draw(), Eepic_Regular_Polygon::draw(), Eepic_Regular_Polygon_With_Points::draw(), Eepic_Dotted_Regular_Polygon::draw(), Eepic_Dash_Regular_Polygon::draw(), Eepic_Dotted_Regular_Polygon_With_Points::draw(), Eepic_Dash_Regular_Polygon_With_Points::draw(), Eepic_Shade_Regular_Polygon::draw(), Eepic_Shade_Regular_Polygon_With_Points::draw(), Eepic_Shade_Regular_Polygon_With_Arrows::draw(), Eepic_Shade_Regular_Polygon_With_Text_Points::draw(), and Eepic_Shade_Regular_Polygon_With_Vertex_Numbers::draw().
|
protected |
Flag indicating ownership of geom_object_ptr.
When true, the destructor will delete geom_object_ptr. When false, the caller is responsible for memory management.
Definition at line 126 of file eepicgeom.H.
Referenced by ~Eepic_Geom_Object().