Class: Wx::Rect2DDouble
- Inherits:
-
Object
- Object
- Wx::Rect2DDouble
- Defined in:
- lib/wx/doc/gen/geometry.rb,
lib/wx/doc/geometry.rb
Overview
This class is untracked and should not be derived from nor instances extended!
Rect2DDouble is an axis-aligned rectangle; each side of the rect is parallel to the X or Y axis.
The rectangle is either defined by the top left and bottom right corner, or by the top left corner and size. A point is contained within the rectangle if left <= m_x < right and top <= m_y < bottom; thus, it is a half open interval.
Rect2DDouble has subtle differences from Rect in how its edge and corner functions work. With Rect2DDouble, there are two counterparts: - SetXXX functions, which keep the other corners at their position whenever sensible - MoveXXX functions, which keep the size of the rectangle and move the other corners appropriately
Class Method Summary collapse
-
.intersect(src1, src2) ⇒ Wx::Rect2DDouble
Returns the intersecting rectangle of two rectangles.
-
.union(src1, src2) ⇒ Wx::Rect2DDouble
Returns the union rectangle of two rectangles.
Instance Method Summary collapse
-
#==(rect) ⇒ Boolean
Equality operator.
- #assign(pt) ⇒ self
-
#constrain_to(rect) ⇒ void
Resizes the rectangle to fit within the dimensions of another rectangle.
- #contains(*args) ⇒ Object
-
#create_intersection(otherRect) ⇒ Wx::Rect2DDouble
Returns the intersecting rectangle of this rectangle with another one.
-
#create_union(otherRect) ⇒ Wx::Rect2DDouble
Returns the union of this rectangle with another one.
- #deflate(*args) ⇒ Object
-
#get_bottom ⇒ Float
(also: #bottom)
Returns the bottom point of the rectangle.
-
#get_centre ⇒ Wx::Point2DDouble
(also: #centre)
Returns the centre point of the rectangle.
-
#get_height ⇒ Float
(also: #height)
Returns the height.
-
#get_left ⇒ Float
(also: #left)
Returns the left point of the rectangle (the same as #get_x).
-
#get_left_bottom ⇒ Wx::Point2DDouble
(also: #left_bottom)
Returns the position of the bottom left corner.
-
#get_left_top ⇒ Wx::Point2DDouble
(also: #left_top)
Returns the position of the top left corner of the rectangle, same as #get_position.
-
#get_out_code(pt) ⇒ Wx::OutCode
(also: #out_code)
Returns the relative location of a point to the rectangle (e.g., inside or to the left of it).
-
#get_position ⇒ Wx::Point2DDouble
(also: #position)
Returns the position.
-
#get_right ⇒ Float
(also: #right)
Returns the right point of the rectangle.
-
#get_right_bottom ⇒ Wx::Point2DDouble
(also: #right_bottom)
Returns the position of the bottom right corner.
-
#get_right_top ⇒ Wx::Point2DDouble
(also: #right_top)
Returns the position of the top right corner.
-
#get_size ⇒ Wx::Size
(also: #size)
Returns the size.
-
#get_top ⇒ Float
(also: #top)
Returns the top point of the rectangle (the same as #get_y).
-
#get_width ⇒ Float
(also: #width)
Returns the width.
-
#get_x ⇒ Float
(also: #x)
Returns the left position of the rectangle.
-
#get_y ⇒ Float
(also: #y)
Returns the top position of the rect.
-
#have_equal_size(rect) ⇒ Boolean
Returns true if another rectangle has the same width and height.
- #inflate(*args) ⇒ Object
-
#initialize(*args) ⇒ Rect2DDouble
constructor
A new instance of Rect2DDouble.
- #inset(*args) ⇒ Object
- #interpolate(widthfactor, heightfactor) ⇒ Wx::Point2DDouble
-
#intersect(otherRect) ⇒ void
Constrains the rectangle to the intersection of another rectangle.
-
#intersects(rect) ⇒ Boolean
Returns true if this rectangle has a non-empty intersection with the rectangle rect and false otherwise.
-
#is_empty ⇒ Boolean
(also: #empty?)
Returns true if this rectangle has a width or height less than or equal to 0 and false otherwise.
-
#move_bottom_to(n) ⇒ void
Set the bottom edge of the rectangle, preserving the height.
-
#move_centre_to(pt) ⇒ void
An alias for #move_centre_to.
-
#move_left_bottom_to(pt) ⇒ void
Set the bottom-left point of the rectangle, while preserving the width and height of the rectangle.
-
#move_left_to(n) ⇒ void
Sets the left position, which may adjust the width of the rectangle.
-
#move_left_top_to(pt) ⇒ void
Set the top-left point of the rectangle, while preserving the width and height of the rectangle.
-
#move_right_bottom_to(pt) ⇒ void
Set the bottom-right point of the rectangle, while preserving the width and height of the rectangle.
-
#move_right_to(n) ⇒ void
Set the right side of the rectangle, preserving the width.
-
#move_right_top_to(pt) ⇒ void
Set the top-right point of the rectangle, while preserving the width and height of the rectangle.
-
#move_top_to(n) ⇒ void
Set the top edge of the rectangle, preserving the height.
- #offset(*args) ⇒ Object
- #scale(*args) ⇒ Object
-
#set_bottom(n) ⇒ void
(also: #bottom=)
Set the bottom edge of the rectangle.
-
#set_centre(pt) ⇒ void
(also: #centre=)
Recenters (i.e., moves) the rectangle to the given point.
-
#set_height(h) ⇒ void
(also: #height=)
Sets the height.
-
#set_left(n) ⇒ void
(also: #left=)
Set the left side of the rectangle.
-
#set_left_bottom(pt) ⇒ void
(also: #left_bottom=)
Set the bottom-left point of the rectangle.
-
#set_left_top(pt) ⇒ void
(also: #left_top=)
Set the top-left point of the rectangle.
-
#set_right(n) ⇒ void
(also: #right=)
Set the right side of the rectangle.
-
#set_right_bottom(pt) ⇒ void
(also: #right_bottom=)
Set the bottom-right point of the rectangle.
-
#set_right_top(pt) ⇒ void
(also: #right_top=)
Set the top-right point of the rectangle.
-
#set_top(n) ⇒ void
(also: #top=)
Set the top edge of the rectangle.
-
#set_width(w) ⇒ void
(also: #width=)
Sets the width.
- #set_x(v) ⇒ Float (also: #x=)
- #set_y(v) ⇒ Float
-
#to_rect ⇒ Wx::Rect
Returns the rectangle as a Rect.
- #union(*args) ⇒ Object
- #y= ⇒ Float
Constructor Details
#initialize ⇒ Wx::Rect2DDouble #initialize(x, y, width, height) ⇒ Wx::Rect2DDouble #initialize(rect) ⇒ Wx::Rect2DDouble
Returns a new instance of Rect2DDouble.
299 |
# File 'lib/wx/doc/gen/geometry.rb', line 299 def initialize(*args) end |
Class Method Details
.intersect(src1, src2) ⇒ Wx::Rect2DDouble
Returns the intersecting rectangle of two rectangles.
612 |
# File 'lib/wx/doc/gen/geometry.rb', line 612 def self.intersect(src1, src2) end |
.union(src1, src2) ⇒ Wx::Rect2DDouble
Returns the union rectangle of two rectangles.
638 |
# File 'lib/wx/doc/gen/geometry.rb', line 638 def self.union(src1, src2) end |
Instance Method Details
#==(rect) ⇒ Boolean
Equality operator.
281 |
# File 'lib/wx/doc/gen/geometry.rb', line 281 def ==(rect) end |
#assign(pt) ⇒ self
173 |
# File 'lib/wx/doc/geometry.rb', line 173 def assign(pt) end |
#constrain_to(rect) ⇒ void
This method returns an undefined value.
Resizes the rectangle to fit within the dimensions of another rectangle.
596 |
# File 'lib/wx/doc/gen/geometry.rb', line 596 def constrain_to(rect) end |
#contains(pt) ⇒ Boolean #contains(rect) ⇒ Boolean
549 |
# File 'lib/wx/doc/gen/geometry.rb', line 549 def contains(*args) end |
#create_intersection(otherRect) ⇒ Wx::Rect2DDouble
Returns the intersecting rectangle of this rectangle with another one.
617 |
# File 'lib/wx/doc/gen/geometry.rb', line 617 def create_intersection(otherRect) end |
#create_union(otherRect) ⇒ Wx::Rect2DDouble
Returns the union of this rectangle with another one.
643 |
# File 'lib/wx/doc/gen/geometry.rb', line 643 def create_union(otherRect) end |
#deflate(dx, dy) ⇒ Wx::Rect2DDouble #deflate(d) ⇒ Wx::Rect2DDouble #deflate(d) ⇒ Wx::Rect2DDouble
276 |
# File 'lib/wx/doc/gen/geometry.rb', line 276 def deflate(*args) end |
#get_bottom ⇒ Float Also known as: bottom
Returns the bottom point of the rectangle.
389 |
# File 'lib/wx/doc/gen/geometry.rb', line 389 def get_bottom; end |
#get_centre ⇒ Wx::Point2DDouble Also known as: centre
Returns the centre point of the rectangle.
521 |
# File 'lib/wx/doc/gen/geometry.rb', line 521 def get_centre; end |
#get_height ⇒ Float Also known as: height
Returns the height.
164 |
# File 'lib/wx/doc/geometry.rb', line 164 def get_height; end |
#get_left ⇒ Float Also known as: left
Returns the left point of the rectangle (the same as #get_x).
345 |
# File 'lib/wx/doc/gen/geometry.rb', line 345 def get_left; end |
#get_left_bottom ⇒ Wx::Point2DDouble Also known as: left_bottom
Returns the position of the bottom left corner.
455 |
# File 'lib/wx/doc/gen/geometry.rb', line 455 def get_left_bottom; end |
#get_left_top ⇒ Wx::Point2DDouble Also known as: left_top
Returns the position of the top left corner of the rectangle, same as #get_position.
433 |
# File 'lib/wx/doc/gen/geometry.rb', line 433 def get_left_top; end |
#get_out_code(pt) ⇒ Wx::OutCode Also known as: out_code
Returns the relative location of a point to the rectangle (e.g., inside or to the left of it).
538 |
# File 'lib/wx/doc/gen/geometry.rb', line 538 def get_out_code(pt) end |
#get_position ⇒ Wx::Point2DDouble Also known as: position
Returns the position.
303 |
# File 'lib/wx/doc/gen/geometry.rb', line 303 def get_position; end |
#get_right ⇒ Float Also known as: right
Returns the right point of the rectangle.
411 |
# File 'lib/wx/doc/gen/geometry.rb', line 411 def get_right; end |
#get_right_bottom ⇒ Wx::Point2DDouble Also known as: right_bottom
Returns the position of the bottom right corner.
499 |
# File 'lib/wx/doc/gen/geometry.rb', line 499 def get_right_bottom; end |
#get_right_top ⇒ Wx::Point2DDouble Also known as: right_top
Returns the position of the top right corner.
477 |
# File 'lib/wx/doc/gen/geometry.rb', line 477 def get_right_top; end |
#get_size ⇒ Wx::Size Also known as: size
Returns the size.
308 |
# File 'lib/wx/doc/gen/geometry.rb', line 308 def get_size; end |
#get_top ⇒ Float Also known as: top
Returns the top point of the rectangle (the same as #get_y).
367 |
# File 'lib/wx/doc/gen/geometry.rb', line 367 def get_top; end |
#get_width ⇒ Float Also known as: width
Returns the width.
156 |
# File 'lib/wx/doc/geometry.rb', line 156 def get_width; end |
#get_x ⇒ Float Also known as: x
Returns the left position of the rectangle.
140 |
# File 'lib/wx/doc/geometry.rb', line 140 def get_x; end |
#get_y ⇒ Float Also known as: y
Returns the top position of the rect.
148 |
# File 'lib/wx/doc/geometry.rb', line 148 def get_y; end |
#have_equal_size(rect) ⇒ Boolean
Returns true if another rectangle has the same width and height.
559 |
# File 'lib/wx/doc/gen/geometry.rb', line 559 def have_equal_size(rect) end |
#inflate(dx, dy) ⇒ Wx::Rect2DDouble #inflate(d) ⇒ Wx::Rect2DDouble #inflate(d) ⇒ Wx::Rect2DDouble
259 |
# File 'lib/wx/doc/gen/geometry.rb', line 259 def inflate(*args) end |
#inset(x, y) ⇒ void #inset(left, top, right, bottom) ⇒ void
578 |
# File 'lib/wx/doc/gen/geometry.rb', line 578 def inset(*args) end |
#interpolate(widthfactor, heightfactor) ⇒ Wx::Point2DDouble
601 |
# File 'lib/wx/doc/gen/geometry.rb', line 601 def interpolate(widthfactor, heightfactor) end |
#intersect(otherRect) ⇒ void
This method returns an undefined value.
Constrains the rectangle to the intersection of another rectangle.
606 |
# File 'lib/wx/doc/gen/geometry.rb', line 606 def intersect(otherRect) end |
#intersects(rect) ⇒ Boolean
Returns true if this rectangle has a non-empty intersection with the rectangle rect and false otherwise.
622 |
# File 'lib/wx/doc/gen/geometry.rb', line 622 def intersects(rect) end |
#is_empty ⇒ Boolean Also known as: empty?
Returns true if this rectangle has a width or height less than or equal to 0 and false otherwise.
553 |
# File 'lib/wx/doc/gen/geometry.rb', line 553 def is_empty; end |
#move_bottom_to(n) ⇒ void
This method returns an undefined value.
Set the bottom edge of the rectangle, preserving the height.
407 |
# File 'lib/wx/doc/gen/geometry.rb', line 407 def move_bottom_to(n) end |
#move_centre_to(pt) ⇒ void
This method returns an undefined value.
An alias for #move_centre_to.
533 |
# File 'lib/wx/doc/gen/geometry.rb', line 533 def move_centre_to(pt) end |
#move_left_bottom_to(pt) ⇒ void
This method returns an undefined value.
Set the bottom-left point of the rectangle, while preserving the width and height of the rectangle.
473 |
# File 'lib/wx/doc/gen/geometry.rb', line 473 def move_left_bottom_to(pt) end |
#move_left_to(n) ⇒ void
This method returns an undefined value.
Sets the left position, which may adjust the width of the rectangle.
363 |
# File 'lib/wx/doc/gen/geometry.rb', line 363 def move_left_to(n) end |
#move_left_top_to(pt) ⇒ void
This method returns an undefined value.
Set the top-left point of the rectangle, while preserving the width and height of the rectangle.
451 |
# File 'lib/wx/doc/gen/geometry.rb', line 451 def move_left_top_to(pt) end |
#move_right_bottom_to(pt) ⇒ void
This method returns an undefined value.
Set the bottom-right point of the rectangle, while preserving the width and height of the rectangle.
517 |
# File 'lib/wx/doc/gen/geometry.rb', line 517 def move_right_bottom_to(pt) end |
#move_right_to(n) ⇒ void
This method returns an undefined value.
Set the right side of the rectangle, preserving the width.
429 |
# File 'lib/wx/doc/gen/geometry.rb', line 429 def move_right_to(n) end |
#move_right_top_to(pt) ⇒ void
This method returns an undefined value.
Set the top-right point of the rectangle, while preserving the width and height of the rectangle.
495 |
# File 'lib/wx/doc/gen/geometry.rb', line 495 def move_right_top_to(pt) end |
#move_top_to(n) ⇒ void
This method returns an undefined value.
Set the top edge of the rectangle, preserving the height.
385 |
# File 'lib/wx/doc/gen/geometry.rb', line 385 def move_top_to(n) end |
#offset(pt) ⇒ void #offset(dx, dy) ⇒ void
591 |
# File 'lib/wx/doc/gen/geometry.rb', line 591 def offset(*args) end |
#scale(f) ⇒ void #scale(num, denum) ⇒ void
652 |
# File 'lib/wx/doc/gen/geometry.rb', line 652 def scale(*args) end |
#set_bottom(n) ⇒ void Also known as: bottom=
This method returns an undefined value.
Set the bottom edge of the rectangle.
This will preserve the top position and alter the height of the rectangle. Use #move_bottom_to to only move the bottom.
401 |
# File 'lib/wx/doc/gen/geometry.rb', line 401 def set_bottom(n) end |
#set_centre(pt) ⇒ void Also known as: centre=
This method returns an undefined value.
Recenters (i.e., moves) the rectangle to the given point.
527 |
# File 'lib/wx/doc/gen/geometry.rb', line 527 def set_centre(pt) end |
#set_height(h) ⇒ void Also known as: height=
This method returns an undefined value.
Sets the height.
168 |
# File 'lib/wx/doc/geometry.rb', line 168 def set_height(v) end |
#set_left(n) ⇒ void Also known as: left=
This method returns an undefined value.
Set the left side of the rectangle.
This will preserve the width of the rectangle. Use #move_left_to to change the left position of the rectangle, adjusting its width accordingly.
357 |
# File 'lib/wx/doc/gen/geometry.rb', line 357 def set_left(n) end |
#set_left_bottom(pt) ⇒ void Also known as: left_bottom=
This method returns an undefined value.
Set the bottom-left point of the rectangle.
This will alter the width and height of the rectangle. Use #move_left_bottom_to to only move the left bottom corner.
467 |
# File 'lib/wx/doc/gen/geometry.rb', line 467 def set_left_bottom(pt) end |
#set_left_top(pt) ⇒ void Also known as: left_top=
This method returns an undefined value.
Set the top-left point of the rectangle.
This will alter the height of the rectangle. Use #move_left_top_to to only move the top.
445 |
# File 'lib/wx/doc/gen/geometry.rb', line 445 def set_left_top(pt) end |
#set_right(n) ⇒ void Also known as: right=
This method returns an undefined value.
Set the right side of the rectangle.
This will preserve the left position and alter the width of the rectangle. Use #move_right_to to only move the bottom.
423 |
# File 'lib/wx/doc/gen/geometry.rb', line 423 def set_right(n) end |
#set_right_bottom(pt) ⇒ void Also known as: right_bottom=
This method returns an undefined value.
Set the bottom-right point of the rectangle.
This will alter the width and height of the rectangle. Use #move_right_bottom_to to only move the right bottom corner.
511 |
# File 'lib/wx/doc/gen/geometry.rb', line 511 def set_right_bottom(pt) end |
#set_right_top(pt) ⇒ void Also known as: right_top=
This method returns an undefined value.
Set the top-right point of the rectangle.
This will alter the width and height of the rectangle. Use #move_right_top_to to only move the right top corner.
489 |
# File 'lib/wx/doc/gen/geometry.rb', line 489 def set_right_top(pt) end |
#set_top(n) ⇒ void Also known as: top=
This method returns an undefined value.
Set the top edge of the rectangle.
This will alter the height of the rectangle. Use #move_top_to to only move the top.
379 |
# File 'lib/wx/doc/gen/geometry.rb', line 379 def set_top(n) end |
#set_width(w) ⇒ void Also known as: width=
This method returns an undefined value.
Sets the width.
160 |
# File 'lib/wx/doc/geometry.rb', line 160 def set_width(v) end |
#set_x(v) ⇒ Float Also known as: x=
144 |
# File 'lib/wx/doc/geometry.rb', line 144 def set_x(v) end |
#set_y(v) ⇒ Float
152 |
# File 'lib/wx/doc/geometry.rb', line 152 def set_y(v) end |
#to_rect ⇒ Wx::Rect
Returns the rectangle as a Wx::Rect.
656 |
# File 'lib/wx/doc/gen/geometry.rb', line 656 def to_rect; end |
#union(otherRect) ⇒ void #union(pt) ⇒ void
632 |
# File 'lib/wx/doc/gen/geometry.rb', line 632 def union(*args) end |
#y= ⇒ Float
153 |
# File 'lib/wx/doc/geometry.rb', line 153 def set_height(v) end |