This documentation is automatically generated from the openFrameworks source code using doxygen and refers to the most recent release, version 0.12.0.
ofRectangle.h
Go to the documentation of this file.
76};
void scaleTo(const ofRectangle &targetRect, ofScaleMode scaleMode=OF_SCALEMODE_FIT)
Scale the rectanle using a target ofRectangle and ofScaleMode.
Definition ofRectangle.cpp:233
const glm::vec3 & getPosition() const
Get the ofRectangle's position.
Definition ofRectangle.cpp:722
void alignToVert(const float &targetY, ofAlignVert sharedAnchor=OF_ALIGN_VERT_CENTER)
Vertically align a rectangle using a position and anchor edge.
Definition ofRectangle.cpp:355
float getMaxX() const
Get the largest x position of the ofRectangle as float.
Definition ofRectangle.cpp:626
float getMaxY() const
Get the largest y position of the ofRectangle as float.
Definition ofRectangle.cpp:636
float getArea() const
Get the area of the ofRectangle.
Definition ofRectangle.cpp:591
void setWidth(float w)
Set the width of the rectangle.
Definition ofRectangle.cpp:100
ofRectangle getStandardized() const
Get the standardized representation of this rectangle.
Definition ofRectangle.cpp:575
void scaleWidth(float sX)
Scale the width of the rectangle.
Definition ofRectangle.cpp:193
float getY() const
Gets the y position of the ofRectangle as float.
Definition ofRectangle.cpp:742
glm::vec3 getBottomRight() const
Get the bottom-right coordinates of the ofRectangle as glm::vec3.
Definition ofRectangle.cpp:676
glm::vec2 map(const glm::vec2 &coeff) const
Maps a normalized coordinate into this rectangle.
Definition ofRectangle.cpp:757
void scaleFromCenter(float s)
Scales both the width and height the ofRectangle from its center.
Definition ofRectangle.cpp:202
bool operator!=(const ofRectangle &rect) const
If the two ofRectangles differ in x, y, width, or height, they are considered unequal.
Definition ofRectangle.cpp:717
void growToInclude(float px, float py)
Grow the ofRectangle to include the given (x, y) coordinates.
Definition ofRectangle.cpp:494
float getMinX() const
Get the smallest x position of the ofRectangle as float.
Definition ofRectangle.cpp:621
float getRight() const
Gets the x position of the right edge of the ofRectangle as float.
Definition ofRectangle.cpp:646
float getX() const
Gets the x position of the ofRectangle as float.
Definition ofRectangle.cpp:737
void setHeight(float h)
Set the height of the rectangle.
Definition ofRectangle.cpp:105
float getAspectRatio() const
Gets the ratio of width to height of the ofRectangle.
Definition ofRectangle.cpp:601
float getBottom() const
Gets the y position of the bottom edge of the ofRectangle as float.
Definition ofRectangle.cpp:656
float getMinY() const
Get the smallest y position of the ofRectangle as float.
Definition ofRectangle.cpp:631
glm::vec3 position
The (x,y) position of the ofRectangle as an glm::vec3.
Definition ofRectangle.h:923
float getHorzAnchor(ofAlignHorz anchor) const
A convenience method that returns the value of one of the horizontal edges of the ofRectangle using t...
Definition ofRectangle.cpp:681
float getTop() const
Gets the y position of the top edge of the ofRectangle as float.
Definition ofRectangle.cpp:651
void alignTo(const glm::vec3 &targetPoint, ofAlignHorz thisHorzAnchor=OF_ALIGN_HORZ_CENTER, ofAlignVert thisVertAnchor=OF_ALIGN_VERT_CENTER)
Align this ofRectangle to an glm::vec3 in both x- and y dimentions.
Definition ofRectangle.cpp:391
ofRectangle operator+(const glm::vec3 &p)
Returns a new ofRectangle where the x and y positions of the rectangle are offset by the (x,...
Definition ofRectangle.cpp:795
bool isStandardized() const
Returns true if this ofRectangle is standardized.
Definition ofRectangle.cpp:586
float getVertAnchor(ofAlignVert anchor) const
A convenience method that returns the value of one of the vertical edges of the ofRectangle using the...
Definition ofRectangle.cpp:699
glm::vec3 getBottomLeft() const
Get the bottom-left coordinates of the ofRectangle as glm::vec3.
Definition ofRectangle.cpp:671
bool intersects(const ofRectangle &rect) const
Determines if another rectangle intersects with this rectangle.
Definition ofRectangle.cpp:465
glm::vec3 getTopLeft() const
Get the top-left coordinates of the ofRectangle as glm::vec3.
Definition ofRectangle.cpp:661
ofRectangle()
Construct a rectangle with zero width and zero height at 0, 0.
Definition ofRectangle.cpp:9
glm::vec3 getTopRight() const
Get the top-right coordinates of the ofRectangle as glm::vec3.
Definition ofRectangle.cpp:666
glm::vec3 getMax() const
Get the maximum x and y coordinates of the ofRectangle as glm::vec3.
Definition ofRectangle.cpp:616
glm::vec2 mapClamp(const glm::vec2 &coeff) const
Maps a normalized coordinate into this rectangle, clamping if out of bounds.
Definition ofRectangle.cpp:773
bool isEmpty() const
Determines if the ofRectangle's area is zero.
Definition ofRectangle.cpp:606
void setPosition(float px, float py)
Set the position of the rectangle.
Definition ofRectangle.cpp:110
void scaleHeight(float sY)
Scale the height of the rectangle.
Definition ofRectangle.cpp:197
float getPerimeter() const
Gets the perimeter of the ofRectangle.
Definition ofRectangle.cpp:596
glm::vec3 getCenter() const
Get the coordiantes of the ofRectangle's center as glm::vec3.
Definition ofRectangle.cpp:732
void setX(float px)
Set the x-position of the rectangle.
Definition ofRectangle.cpp:90
ofRectangle operator-(const glm::vec3 &p)
Returns a new ofRectangle where the x and y-positions of the rectangle are offset by the (x,...
Definition ofRectangle.cpp:808
void translateX(float dx)
Translate the x-position of the rectangle.
Definition ofRectangle.cpp:160
void setY(float py)
Set the y-position of the rectangle.
Definition ofRectangle.cpp:95
ofRectangle getUnion(const ofRectangle &rect) const
Get the union area between this rectangle and anohter.
Definition ofRectangle.cpp:555
bool inside(float px, float py) const
Determines if the coordinates (x, y) are within the ofRectangle.
Definition ofRectangle.cpp:431
void setSize(float w, float h)
Set the size of the rectangle.
Definition ofRectangle.cpp:121
void translate(float dx, float dy)
Translate the rectangle's position by an x and y amount.
Definition ofRectangle.cpp:143
glm::vec3 getMin() const
Get the minimum x and y coordinates of the ofRectangle as glm::vec3.
Definition ofRectangle.cpp:611
ofRectangle getIntersection(const ofRectangle &rect) const
Get the intersecting area between this rectangle and another.
Definition ofRectangle.cpp:537
ofRectangle & operator=(const ofRectangle &rect)
Assignment operator.
Definition ofRectangle.cpp:789
bool operator==(const ofRectangle &rect) const
If both ofRectangles have the same x, y, width, and height, they are considered equal.
Definition ofRectangle.cpp:821
void alignToHorz(const float &targetX, ofAlignHorz thisHorzAnchor=OF_ALIGN_HORZ_CENTER)
Horizontally align a rectangle using a position and anchor edge.
Definition ofRectangle.cpp:319
void translateY(float dy)
Translate the y-position of the rectangle.
Definition ofRectangle.cpp:165
void set(float px, float py, float w, float h)
Set the position and size of the rectangle.
Definition ofRectangle.cpp:47
float getWidth() const
Gets the width of the ofRectangle as float.
Definition ofRectangle.cpp:747
void setFromCenter(float px, float py, float w, float h)
Set position and size of the rectangle from the center.
Definition ofRectangle.cpp:128
float getHeight() const
Gets the height of the ofRectangle as float.
Definition ofRectangle.cpp:752
float getLeft() const
Gets the x position of the left edge of the ofRectangle as float.
Definition ofRectangle.cpp:641
OF_DEPRECATED_MSG("Use getPosition() instead.", glm::vec3 &getPositionRef())
std::ostream & operator<<(std::ostream &os, const ofMatrix3x3 &M)
Definition ofMatrix3x3.cpp:304
#define px
#define py
ofAlignVert
Used to represent the available vertical rectangle alignment modes.
Definition ofRectangle.h:22
@ OF_ALIGN_VERT_TOP
Use the upper edge of the rectangle to vertically anchor the alignment.
Definition ofRectangle.h:26
@ OF_ALIGN_VERT_IGNORE
Do not perform any vertical alignment.
Definition ofRectangle.h:24
@ OF_ALIGN_VERT_CENTER
Use the center of the rectangle to vertically anchor the alignment.
Definition ofRectangle.h:30
@ OF_ALIGN_VERT_BOTTOM
Use the bottom edge of the rectangle to vertically anchor the alignment.
Definition ofRectangle.h:28
ofScaleMode
Used to represent the available rectangle scaling modes.
Definition ofRectangle.h:52
@ OF_SCALEMODE_FIT
Center and scale the rectangle to fit inside the target.
Definition ofRectangle.h:59
@ OF_SCALEMODE_FILL
Move and scale the rectangle to completely enclose the target.
Definition ofRectangle.h:66
@ OF_SCALEMODE_CENTER
Move the rectangle to be centered on the target.
Definition ofRectangle.h:72
@ OF_SCALEMODE_STRETCH_TO_FILL
Match the target rectangle's position and dimensions.
Definition ofRectangle.h:75
ofAlignHorz
Used to represent the available horizontal rectangle alignment modes.
Definition ofRectangle.h:37
@ OF_ALIGN_HORZ_RIGHT
Use the right edge of the rectangle to horizontally anchor the alignment.
Definition ofRectangle.h:43
@ OF_ALIGN_HORZ_LEFT
Use the left edge of the rectangle to horizontally anchor the alignment.
Definition ofRectangle.h:41
@ OF_ALIGN_HORZ_CENTER
Use the center of the rectangle to horizontally anchor the alignment.
Definition ofRectangle.h:45
@ OF_ALIGN_HORZ_IGNORE
Do not perform any horizontal alignment.
Definition ofRectangle.h:39
ofAspectRatioMode
Used to represent the available rectangle aspect ratio scaling modes.
Definition ofRectangle.h:10
@ OF_ASPECT_RATIO_KEEP_BY_EXPANDING
Resizes the rectangle to completely enclose the target.
Definition ofRectangle.h:16
@ OF_ASPECT_RATIO_IGNORE
Set the rectangle's width and height to match the target.
Definition ofRectangle.h:12
@ OF_ASPECT_RATIO_KEEP
Resizes the rectangle to completely fit within the target.
Definition ofRectangle.h:14