ubit
Public Member Functions | List of all members
ubit::UPolygon Class Reference

2D Polygon or Polyline. More...

#include <ugeom.hpp>

Inheritance diagram for ubit::UPolygon:
ubit::UShape ubit::UObject

Public Member Functions

virtual int getShapeType () const
 
 UPolygon (bool closed=true)
 creates an empty polygon ('closed'=true) or polyline ('closed'=false).
 
 UPolygon (const std::vector< UPoint > &points, bool closed=true)
 creates and initalizes a polygon ('closed'=true) or polyline ('closed'=false).
 
 UPolygon (const UPolygon &poly2)
 creates a new polygon (or a polyline) that is a copy of 'poly2'.
 
UPolygonoperator= (const UPolygon &poly2)
 copies the content of 'poly2' to this polygon.
 
UPolygonaddPoint (const UPoint &point)
 adds a point to the polygon.
 
UPolygonaddPoints (const std::vector< UPoint > &points)
 adds these points to the polygon.
 
UPolygonaddPoints (const float *_points, int _npoints)
 adds these points to the polygon.
 
URect getBounds () const
 returns the bounding box of the polygon.
 
void translate (float dx, float dy)
 translates the polygon.
 
void reset ()
 resets this Polygon object to an empty polygon.
 
bool contains (const UPoint &) const
 tests if a given point is inside the boundary of this Shape.
 
bool contains (const URect &) const
 tests if the interior of this Shape entirely contains the specified Rectangle
 
bool intersects (const URect &) const
 tests if this Shape intersects the interior of a specified Rectangle.
 
void draw (const UGraph &) const
 
void fill (const UGraph &) const
 
- Public Member Functions inherited from ubit::UObject
 UObject (const UObject &)
 
UObjectoperator= (const UObject &)
 
virtual const UClassgetClass () const
 instance method that returns the metaclass of this object. More...
 
const UStrgetClassName () const
 returns getClass().getName().
 
virtual void error (const char *function_name, const char *format,...) const
 prints out an error message. More...
 
virtual void warning (const char *function_name, const char *format,...) const
 prints out a warning message: More...
 
bool isDeletable () const
 checks if this object can be destroyed by 'delete'. More...
 
bool isConst () const
 checks whether the content of this object can be modified ( More...
 
UObjectsetConst ()
 specifies that the content of this object cannot be modified. More...
 
bool isAutoUpdate () const
 return current update policy: More...
 
UObjectsetAutoUpdate (bool state=true)
 changes the update policy of this object when its is modified. More...
 
bool isIgnoringChangeCallbacks () const
 return true if change callbacks are fired.
 
UObjectignoreChangeCallbacks (bool state)
 change callbacks are not fired if argument is true.
 
virtual UNodetoNode ()
 dynamic cast: returns this object if it derives from UNode and null otherwise.
 
virtual const UNodetoNode () const
 dynamic cast: returns this object if it derives from UNode and null otherwise.
 
virtual UAttrtoAttr ()
 dynamic cast: returns this object if it derives from UAttr and null otherwise.
 
virtual const UAttrtoAttr () const
 dynamic cast: returns this object if it derives from UAttr and null otherwise.
 
virtual UElemtoElem ()
 dynamic cast: returns this object if it derives from UElem and null otherwise.
 
virtual const UElemtoElem () const
 dynamic cast: returns this object if it derives from UElem and null otherwise.
 
virtual UDatatoData ()
 dynamic cast: returns this object if it derives from UData and null otherwise.
 
virtual const UDatatoData () const
 dynamic cast: returns this object if it derives from UData and null otherwise.
 
virtual UStrtoStr ()
 dynamic cast: returns this object if it derives from UStr and null otherwise.
 
virtual const UStrtoStr () const
 dynamic cast: returns this object if it derives from UStr and null otherwise.
 
virtual UCalltoCall ()
 dynamic cast: returns this object if it derives from UCall and null otherwise.
 
virtual const UCalltoCall () const
 dynamic cast: returns this object if it derives from UCall and null otherwise.
 
virtual UBoxtoBox ()
 dynamic cast: returns this object if it derives from UBox and null otherwise.
 
virtual const UBoxtoBox () const
 dynamic cast: returns this object if it derives from UBox and null otherwise.
 
virtual UWintoWin ()
 dynamic cast: returns this object if it derives from UWin and null otherwise.
 
virtual const UWintoWin () const
 dynamic cast: returns this object if it derives from UWin and null otherwise.
 
virtual UMenutoMenu ()
 dynamic cast: returns this object if it derives from UMenu and null otherwise.
 
virtual const UMenutoMenu () const
 dynamic cast: returns this object if it derives from UMenu and null otherwise.
 
State getState () const
 returns the current object state.
 
void setState (State s)
 changes the object state.
 
PtrCount getPtrCount () const
 [impl] returns the number of uptr<> smart pointers that are pointing to this object.
 
bool checkConst () const
 [impl] produces an error if this object is logically constant ( More...
 
bool isDestructed () const
 [impl] this object has been destructed (but memory has not been freed yet).
 
bool isDestructing () const
 [impl] this object is being destructed (one of its destructors has been called).
 
virtual bool hasSceneGraphParent () const
 
void * operator new (size_t)
 < [impl] returns true if there is at least one scene graph parent (redefined by UNode). More...
 
void operator delete (void *)
 delete operator is forbidden on instances that derive from UObject.
 
void addPtr () const
 [Impl] a uptr is added to this object.
 
void removePtr () const
 [Impl] a uptr is removed from this object.
 

Additional Inherited Members

- Public Types inherited from ubit::UShape
enum  ShapeType {
  LINE = 1, RECT = 2, ELLIPSE = 3, ARC = 4,
  POLYGON = 5
}
 
- Public Types inherited from ubit::UObject
typedef unsigned char State
 
typedef short PtrCount
 
- Static Public Member Functions inherited from ubit::UObject
static const char * getVersion ()
 returns the version of the Ubit package.
 
static const UClassClass ()
 class method that returns the metaclass of this class. More...
 
static UStylecreateStyle ()
 
- Static Public Attributes inherited from ubit::UObject
static UConst UCONST
 UCONST can be given as an argument to some constructors to make the object constant. More...
 
- Protected Attributes inherited from ubit::UObject
PtrCount ptr_count
 
Modes omodes
 
State ostate
 

Detailed Description

2D Polygon or Polyline.


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