Class: Wx::Rect2DDouble

Inherits:
Object
  • Object
show all
Defined in:
lib/wx/doc/gen/geometry.rb,
lib/wx/doc/geometry.rb

Overview

Note:

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.

Note:

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

Requires:

  • USE_GEOMETRY

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeWx::Rect2DDouble #initialize(x, y, width, height) ⇒ Wx::Rect2DDouble #initialize(rect) ⇒ Wx::Rect2DDouble

Returns a new instance of Rect2DDouble.

Overloads:



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.

Parameters:

Returns:



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.

Parameters:

Returns:



648
# File 'lib/wx/doc/gen/geometry.rb', line 648

def self.union(src1, src2) end

Instance Method Details

#==(rect) ⇒ Boolean

Equality operator.

Parameters:

Returns:

  • (Boolean)


291
# File 'lib/wx/doc/gen/geometry.rb', line 291

def ==(rect) end

#assign(pt) ⇒ self

Parameters:

Returns:

  • (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.

Parameters:



606
# File 'lib/wx/doc/gen/geometry.rb', line 606

def constrain_to(rect) end

#contains(pt) ⇒ Boolean #contains(rect) ⇒ Boolean

Overloads:

  • #contains(pt) ⇒ Boolean

    Returns true if the given point is inside the rectangle (or on its boundary) and false otherwise.

    Parameters:

    Returns:

    • (Boolean)
  • #contains(rect) ⇒ Boolean

    Returns true if the given rectangle is completely inside this rectangle (or touches its boundary) and false otherwise.

    Parameters:

    Returns:

    • (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.

Parameters:

Returns:



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.

Parameters:

Returns:



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

Overloads:

  • #deflate(dx, dy) ⇒ Wx::Rect2DDouble

    Decrease the rectangle size.

    This method is the opposite from #inflate: Deflate(a, b) is equivalent to Inflate(-a, -b). Please refer to #inflate for full description.

    Parameters:

    • dx (Float)
    • dy (Float)

    Returns:

  • #deflate(d) ⇒ Wx::Rect2DDouble

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    Returns:

  • #deflate(d) ⇒ Wx::Rect2DDouble

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    • d (Float)

    Returns:

  • #deflate(dx, dy) ⇒ Wx::Rect2DDouble

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    • dx (Float)
    • dy (Float)

    Returns:



286
# File 'lib/wx/doc/gen/geometry.rb', line 286

def deflate(*args) end

#get_bottomFloat Also known as: bottom

Returns the bottom point of the rectangle.

Returns:

  • (Float)


399
# File 'lib/wx/doc/gen/geometry.rb', line 399

def get_bottom; end

#get_centreWx::Point2DDouble Also known as: centre

Returns the centre point of the rectangle.

Returns:



531
# File 'lib/wx/doc/gen/geometry.rb', line 531

def get_centre; end

#get_heightFloat Also known as: height

Returns the height.

Returns:

  • (Float)


164
# File 'lib/wx/doc/geometry.rb', line 164

def get_height; end

#get_leftFloat Also known as: left

Returns the left point of the rectangle (the same as #get_x).

Returns:

  • (Float)


355
# File 'lib/wx/doc/gen/geometry.rb', line 355

def get_left; end

#get_left_bottomWx::Point2DDouble Also known as: left_bottom

Returns the position of the bottom left corner.

Returns:



465
# File 'lib/wx/doc/gen/geometry.rb', line 465

def get_left_bottom; end

#get_left_topWx::Point2DDouble Also known as: left_top

Returns the position of the top left corner of the rectangle, same as #get_position.

Returns:



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).

Parameters:

Returns:



548
# File 'lib/wx/doc/gen/geometry.rb', line 548

def get_out_code(pt) end

#get_positionWx::Point2DDouble Also known as: position

Returns the position.

Returns:



313
# File 'lib/wx/doc/gen/geometry.rb', line 313

def get_position; end

#get_rightFloat Also known as: right

Returns the right point of the rectangle.

Returns:

  • (Float)


421
# File 'lib/wx/doc/gen/geometry.rb', line 421

def get_right; end

#get_right_bottomWx::Point2DDouble Also known as: right_bottom

Returns the position of the bottom right corner.

Returns:



509
# File 'lib/wx/doc/gen/geometry.rb', line 509

def get_right_bottom; end

#get_right_topWx::Point2DDouble Also known as: right_top

Returns the position of the top right corner.

Returns:



487
# File 'lib/wx/doc/gen/geometry.rb', line 487

def get_right_top; end

#get_sizeWx::Size Also known as: size

Returns the size.

Returns:



318
# File 'lib/wx/doc/gen/geometry.rb', line 318

def get_size; end

#get_topFloat Also known as: top

Returns the top point of the rectangle (the same as #get_y).

Returns:

  • (Float)


377
# File 'lib/wx/doc/gen/geometry.rb', line 377

def get_top; end

#get_widthFloat Also known as: width

Returns the width.

Returns:

  • (Float)


156
# File 'lib/wx/doc/geometry.rb', line 156

def get_width; end

#get_xFloat Also known as: x

Returns the left position of the rectangle.

Returns:

  • (Float)


140
# File 'lib/wx/doc/geometry.rb', line 140

def get_x; end

#get_yFloat Also known as: y

Returns the top position of the rect.

Returns:

  • (Float)


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.

Parameters:

Returns:

  • (Boolean)


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

Overloads:

  • #inflate(dx, dy) ⇒ Wx::Rect2DDouble

    Increases the size of the rectangle.

    The left border is moved farther left and the right border is moved farther right by dx. The upper border is moved farther up and the bottom border is moved farther down by dy. (Note that the width and height of the rectangle thus change by 2dx and 2dy, respectively.) If one or both of dx and dy are negative, the opposite happens: the rectangle size decreases in the respective direction. Inflating and deflating behaves “naturally”. Defined more precisely, that means:

    • “Real” inflates (that is, dx and/or dy = 0) are not constrained. Thus inflating a rectangle can cause its upper left corner to move into the negative numbers. (2.5.4 and older forced the top left coordinate to not fall below (0, 0), which implied a forced move of the rectangle.)

    • Deflates are clamped to not reduce the width or height of the rectangle below zero. In such cases, the top-left corner is nonetheless handled properly. For example, a rectangle at (10, 10) with size (20, 40) that is inflated by (-15, -15) will become located at (20, 25) at size (0, 10). Finally, observe that the width and height are treated independently. In the above example, the width is reduced by 20, whereas the height is reduced by the full 30 (rather than also stopping at 20, when the width reached zero).

    Parameters:

    • dx (Float)
    • dy (Float)

    Returns:

    See Also:

  • #inflate(d) ⇒ Wx::Rect2DDouble

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    Returns:

  • #inflate(d) ⇒ Wx::Rect2DDouble

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    • d (Float)

    Returns:

  • #inflate(dx, dy) ⇒ Wx::Rect2DDouble

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    • dx (Float)
    • dy (Float)

    Returns:



264
# File 'lib/wx/doc/gen/geometry.rb', line 264

def inflate(*args) end

#inset(x, y) ⇒ void #inset(left, top, right, bottom) ⇒ void

Overloads:

  • #inset(x, y) ⇒ void

    This method returns an undefined value.

    Offsets the rectangle by x and y, but maintains the bottom right corner.

    Note:

    This will affect the width and height of the rectangle.

    Parameters:

    • x (Float)
    • y (Float)
  • #inset(left, top, right, bottom) ⇒ void

    This method returns an undefined value.

    Parameters:

    • left (Float)
    • top (Float)
    • right (Float)
    • bottom (Float)


588
# File 'lib/wx/doc/gen/geometry.rb', line 588

def inset(*args) end

#interpolate(widthfactor, heightfactor) ⇒ Wx::Point2DDouble

Parameters:

  • widthfactor (Integer)
  • heightfactor (Integer)

Returns:



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.

Parameters:



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.

Parameters:

Returns:

  • (Boolean)


632
# File 'lib/wx/doc/gen/geometry.rb', line 632

def intersects(rect) end

#is_emptyBoolean Also known as: empty?

Returns true if this rectangle has a width or height less than or equal to 0 and false otherwise.

Returns:

  • (Boolean)


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.

Parameters:

  • n (Float)


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.

Parameters:



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.

Parameters:



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.

Parameters:

  • n (Float)


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.

Parameters:



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.

Parameters:



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.

Parameters:

  • n (Float)


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.

Parameters:



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.

Parameters:

  • n (Float)


395
# File 'lib/wx/doc/gen/geometry.rb', line 395

def move_top_to(n) end

#offset(pt) ⇒ void #offset(dx, dy) ⇒ void

Overloads:

  • #offset(pt) ⇒ void

    This method returns an undefined value.

    Moves the rectangle by the specified offset.

    If X of pt is positive, the rectangle is moved to the right, if Y of pt is positive, it is moved to the bottom, otherwise it is moved to the left or top respectively.

    Parameters:

  • #offset(dx, dy) ⇒ void

    This method returns an undefined value.

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    • dx (Float)
    • dy (Float)


601
# File 'lib/wx/doc/gen/geometry.rb', line 601

def offset(*args) end

#scale(f) ⇒ void #scale(num, denum) ⇒ void

Overloads:

  • #scale(f) ⇒ void

    This method returns an undefined value.

    Parameters:

    • f (Float)
  • #scale(num, denum) ⇒ void

    This method returns an undefined value.

    Parameters:

    • num (Integer)
    • denum (Integer)


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.

Note:

This will preserve the top position and alter the height of the rectangle. Use #move_bottom_to to only move the bottom.

Parameters:

  • n (Float)


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.

Parameters:



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.

Parameters:

  • h (Float)


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.

Note:

This will preserve the width of the rectangle. Use #move_left_to to change the left position of the rectangle, adjusting its width accordingly.

Parameters:

  • n (Float)


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.

Note:

This will alter the width and height of the rectangle. Use #move_left_bottom_to to only move the left bottom corner.

Parameters:



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.

Note:

This will alter the height of the rectangle. Use #move_left_top_to to only move the top.

Parameters:



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.

Note:

This will preserve the left position and alter the width of the rectangle. Use #move_right_to to only move the bottom.

Parameters:

  • n (Float)


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.

Note:

This will alter the width and height of the rectangle. Use #move_right_bottom_to to only move the right bottom corner.

Parameters:



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.

Note:

This will alter the width and height of the rectangle. Use #move_right_top_to to only move the right top corner.

Parameters:



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.

Note:

This will alter the height of the rectangle. Use #move_top_to to only move the top.

Parameters:

  • n (Float)


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.

Parameters:

  • w (Float)


160
# File 'lib/wx/doc/geometry.rb', line 160

def set_width(v) end

#set_x(v) ⇒ Float Also known as: x=

Parameters:

  • v (Float)

Returns:

  • (Float)


144
# File 'lib/wx/doc/geometry.rb', line 144

def set_x(v) end

#set_y(v) ⇒ Float

Parameters:

  • v (Float)

Returns:

  • (Float)


152
# File 'lib/wx/doc/geometry.rb', line 152

def set_y(v) end

#to_rectWx::Rect

Returns the rectangle as a Wx::Rect.

Returns:



666
# File 'lib/wx/doc/gen/geometry.rb', line 666

def to_rect; end

#union(otherRect) ⇒ void #union(pt) ⇒ void

Overloads:

  • #union(otherRect) ⇒ void

    This method returns an undefined value.

    Expands the rectangle to the union with another rectangle.

    Parameters:

  • #union(pt) ⇒ void

    This method returns an undefined value.

    Expands the rectangle to include the point at pt.

    Parameters:



642
# File 'lib/wx/doc/gen/geometry.rb', line 642

def union(*args) end

#y=Float

Parameters:

  • v (Float)

Returns:

  • (Float)


153
# File 'lib/wx/doc/geometry.rb', line 153

def set_height(v) end