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.
309 |
# File 'lib/wx/doc/gen/geometry.rb', line 309 def initialize(*args) end |
Class Method Details
.intersect(src1, src2) ⇒ Wx::Rect2DDouble
Returns the intersecting rectangle of two rectangles.
622 |
# File 'lib/wx/doc/gen/geometry.rb', line 622 def self.intersect(src1, src2) end |
.union(src1, src2) ⇒ Wx::Rect2DDouble
Returns the union rectangle of two rectangles.
648 |
# File 'lib/wx/doc/gen/geometry.rb', line 648 def self.union(src1, src2) end |
Instance Method Details
#==(rect) ⇒ Boolean
Equality operator.
291 |
# File 'lib/wx/doc/gen/geometry.rb', line 291 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.
606 |
# File 'lib/wx/doc/gen/geometry.rb', line 606 def constrain_to(rect) end |
#contains(pt) ⇒ Boolean #contains(rect) ⇒ Boolean
559 |
# File 'lib/wx/doc/gen/geometry.rb', line 559 def contains(*args) end |
#create_intersection(otherRect) ⇒ Wx::Rect2DDouble
Returns the intersecting rectangle of this rectangle with another one.
627 |
# File 'lib/wx/doc/gen/geometry.rb', line 627 def create_intersection(otherRect) end |
#create_union(otherRect) ⇒ Wx::Rect2DDouble
Returns the union of this rectangle with another one.
653 |
# File 'lib/wx/doc/gen/geometry.rb', line 653 def create_union(otherRect) end |
#deflate(dx, dy) ⇒ Wx::Rect2DDouble #deflate(d) ⇒ Wx::Rect2DDouble #deflate(d) ⇒ Wx::Rect2DDouble #deflate(dx, dy) ⇒ Wx::Rect2DDouble
286 |
# File 'lib/wx/doc/gen/geometry.rb', line 286 def deflate(*args) end |
#get_bottom ⇒ Float Also known as: bottom
Returns the bottom point of the rectangle.
399 |
# File 'lib/wx/doc/gen/geometry.rb', line 399 def get_bottom; end |
#get_centre ⇒ Wx::Point2DDouble Also known as: centre
Returns the centre point of the rectangle.
531 |
# File 'lib/wx/doc/gen/geometry.rb', line 531 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).
355 |
# File 'lib/wx/doc/gen/geometry.rb', line 355 def get_left; end |
#get_left_bottom ⇒ Wx::Point2DDouble Also known as: left_bottom
Returns the position of the bottom left corner.
465 |
# File 'lib/wx/doc/gen/geometry.rb', line 465 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.
443 |
# File 'lib/wx/doc/gen/geometry.rb', line 443 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).
548 |
# File 'lib/wx/doc/gen/geometry.rb', line 548 def get_out_code(pt) end |
#get_position ⇒ Wx::Point2DDouble Also known as: position
Returns the position.
313 |
# File 'lib/wx/doc/gen/geometry.rb', line 313 def get_position; end |
#get_right ⇒ Float Also known as: right
Returns the right point of the rectangle.
421 |
# File 'lib/wx/doc/gen/geometry.rb', line 421 def get_right; end |
#get_right_bottom ⇒ Wx::Point2DDouble Also known as: right_bottom
Returns the position of the bottom right corner.
509 |
# File 'lib/wx/doc/gen/geometry.rb', line 509 def get_right_bottom; end |
#get_right_top ⇒ Wx::Point2DDouble Also known as: right_top
Returns the position of the top right corner.
487 |
# File 'lib/wx/doc/gen/geometry.rb', line 487 def get_right_top; end |
#get_size ⇒ Wx::Size Also known as: size
Returns the size.
318 |
# File 'lib/wx/doc/gen/geometry.rb', line 318 def get_size; end |
#get_top ⇒ Float Also known as: top
Returns the top point of the rectangle (the same as #get_y).
377 |
# File 'lib/wx/doc/gen/geometry.rb', line 377 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.
569 |
# File 'lib/wx/doc/gen/geometry.rb', line 569 def have_equal_size(rect) end |
#inflate(dx, dy) ⇒ Wx::Rect2DDouble #inflate(d) ⇒ Wx::Rect2DDouble #inflate(d) ⇒ Wx::Rect2DDouble #inflate(dx, dy) ⇒ Wx::Rect2DDouble
264 |
# File 'lib/wx/doc/gen/geometry.rb', line 264 def inflate(*args) end |
#inset(x, y) ⇒ void #inset(left, top, right, bottom) ⇒ void
588 |
# File 'lib/wx/doc/gen/geometry.rb', line 588 def inset(*args) end |
#interpolate(widthfactor, heightfactor) ⇒ Wx::Point2DDouble
611 |
# File 'lib/wx/doc/gen/geometry.rb', line 611 def interpolate(widthfactor, heightfactor) end |
#intersect(otherRect) ⇒ void
This method returns an undefined value.
Constrains the rectangle to the intersection of another rectangle.
616 |
# File 'lib/wx/doc/gen/geometry.rb', line 616 def intersect(otherRect) end |
#intersects(rect) ⇒ Boolean
Returns true if this rectangle has a non-empty intersection with the rectangle rect and false otherwise.
632 |
# File 'lib/wx/doc/gen/geometry.rb', line 632 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.
563 |
# File 'lib/wx/doc/gen/geometry.rb', line 563 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.
417 |
# File 'lib/wx/doc/gen/geometry.rb', line 417 def move_bottom_to(n) end |
#move_centre_to(pt) ⇒ void
This method returns an undefined value.
An alias for #move_centre_to.
543 |
# File 'lib/wx/doc/gen/geometry.rb', line 543 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.
483 |
# File 'lib/wx/doc/gen/geometry.rb', line 483 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.
373 |
# File 'lib/wx/doc/gen/geometry.rb', line 373 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.
461 |
# File 'lib/wx/doc/gen/geometry.rb', line 461 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.
527 |
# File 'lib/wx/doc/gen/geometry.rb', line 527 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.
439 |
# File 'lib/wx/doc/gen/geometry.rb', line 439 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.
505 |
# File 'lib/wx/doc/gen/geometry.rb', line 505 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.
395 |
# File 'lib/wx/doc/gen/geometry.rb', line 395 def move_top_to(n) end |
#offset(pt) ⇒ void #offset(dx, dy) ⇒ void
601 |
# File 'lib/wx/doc/gen/geometry.rb', line 601 def offset(*args) end |
#scale(f) ⇒ void #scale(num, denum) ⇒ void
662 |
# File 'lib/wx/doc/gen/geometry.rb', line 662 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.
411 |
# File 'lib/wx/doc/gen/geometry.rb', line 411 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.
537 |
# File 'lib/wx/doc/gen/geometry.rb', line 537 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.
367 |
# File 'lib/wx/doc/gen/geometry.rb', line 367 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.
477 |
# File 'lib/wx/doc/gen/geometry.rb', line 477 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.
455 |
# File 'lib/wx/doc/gen/geometry.rb', line 455 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.
433 |
# File 'lib/wx/doc/gen/geometry.rb', line 433 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.
521 |
# File 'lib/wx/doc/gen/geometry.rb', line 521 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.
499 |
# File 'lib/wx/doc/gen/geometry.rb', line 499 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.
389 |
# File 'lib/wx/doc/gen/geometry.rb', line 389 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.
666 |
# File 'lib/wx/doc/gen/geometry.rb', line 666 def to_rect; end |
#union(otherRect) ⇒ void #union(pt) ⇒ void
642 |
# File 'lib/wx/doc/gen/geometry.rb', line 642 def union(*args) end |
#y= ⇒ Float
153 |
# File 'lib/wx/doc/geometry.rb', line 153 def set_height(v) end |