|
ubit
|
2D Rectangle. More...
#include <ugeom.hpp>
Public Types | |
| enum | { OUT_LEFT = 1, OUT_TOP = 2, OUT_RIGHT = 4, OUT_BOTTOM = 8 } |
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 |
Public Member Functions | |
| int | getShapeType () const |
| URect (float _x, float _y, float _w, float _h) | |
| URect (const UPoint &p1, const UPoint &p2) | |
| URect | getBounds () const |
| returns the bounding box of this shape. | |
| bool | isEmpty () const |
| void | setRect (const URect &r) |
| void | setRect (float x, float y, float width, float height) |
| void | setRect (const UPoint &p1, const UPoint &p2) |
| void | setFrame (const URect &r) |
| 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 Rectangle intersects the interior of a specified Rectangle. | |
| bool | intersectsLine (const ULine &) const |
| tests if the specified line segment intersects the interior of this Rectangle. | |
| bool | doIntersection (const URect &) |
| performs the intersection with the rectangle that is given as an argument. More... | |
| void | doUnion (const URect &) |
| performs the union with the rectangle that is given as an argument. More... | |
| int | outcode (const UPoint &p) const |
| determines where the specified coordinates lie with respect to this Rectangle. | |
| virtual void | draw (const UGraph &) const |
| virtual void | fill (const UGraph &) const |
Public Member Functions inherited from ubit::UObject | |
| UObject (const UObject &) | |
| UObject & | operator= (const UObject &) |
| virtual const UClass & | getClass () const |
| instance method that returns the metaclass of this object. More... | |
| const UStr & | getClassName () 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... | |
| UObject & | setConst () |
| specifies that the content of this object cannot be modified. More... | |
| bool | isAutoUpdate () const |
| return current update policy: More... | |
| UObject & | setAutoUpdate (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. | |
| UObject & | ignoreChangeCallbacks (bool state) |
| change callbacks are not fired if argument is true. | |
| virtual UNode * | toNode () |
| dynamic cast: returns this object if it derives from UNode and null otherwise. | |
| virtual const UNode * | toNode () const |
| dynamic cast: returns this object if it derives from UNode and null otherwise. | |
| virtual UAttr * | toAttr () |
| dynamic cast: returns this object if it derives from UAttr and null otherwise. | |
| virtual const UAttr * | toAttr () const |
| dynamic cast: returns this object if it derives from UAttr and null otherwise. | |
| virtual UElem * | toElem () |
| dynamic cast: returns this object if it derives from UElem and null otherwise. | |
| virtual const UElem * | toElem () const |
| dynamic cast: returns this object if it derives from UElem and null otherwise. | |
| virtual UData * | toData () |
| dynamic cast: returns this object if it derives from UData and null otherwise. | |
| virtual const UData * | toData () const |
| dynamic cast: returns this object if it derives from UData and null otherwise. | |
| virtual UStr * | toStr () |
| dynamic cast: returns this object if it derives from UStr and null otherwise. | |
| virtual const UStr * | toStr () const |
| dynamic cast: returns this object if it derives from UStr and null otherwise. | |
| virtual UCall * | toCall () |
| dynamic cast: returns this object if it derives from UCall and null otherwise. | |
| virtual const UCall * | toCall () const |
| dynamic cast: returns this object if it derives from UCall and null otherwise. | |
| virtual UBox * | toBox () |
| dynamic cast: returns this object if it derives from UBox and null otherwise. | |
| virtual const UBox * | toBox () const |
| dynamic cast: returns this object if it derives from UBox and null otherwise. | |
| virtual UWin * | toWin () |
| dynamic cast: returns this object if it derives from UWin and null otherwise. | |
| virtual const UWin * | toWin () const |
| dynamic cast: returns this object if it derives from UWin and null otherwise. | |
| virtual UMenu * | toMenu () |
| dynamic cast: returns this object if it derives from UMenu and null otherwise. | |
| virtual const UMenu * | toMenu () 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. | |
Public Attributes | |
| float | x |
| float | y |
| float | width |
| float | height |
Additional Inherited Members | |
Static Public Member Functions inherited from ubit::UObject | |
| static const char * | getVersion () |
| returns the version of the Ubit package. | |
| static const UClass & | Class () |
| class method that returns the metaclass of this class. More... | |
| static UStyle * | createStyle () |
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 |
2D Rectangle.
| bool URect::doIntersection | ( | const URect & | clip2 | ) |
performs the intersection with the rectangle that is given as an argument.
returns false if there is no intersection (this rectangle is then left unchanged)
| void URect::doUnion | ( | const URect & | clip2 | ) |
performs the union with the rectangle that is given as an argument.
Note: empty regions are not taken into account.
1.8.12