Class: Wx::RealPoint
- Inherits:
-
Object
- Object
- Wx::RealPoint
- Includes:
- Comparable
- Defined in:
- lib/wx/doc/gen/gdi_common.rb,
lib/wx/doc/gdi_common.rb
Overview
This class is untracked and should not be derived from nor instances extended!
A RealPoint is a useful data structure for graphics operations.
It contains floating point x and y members. See Point for an integer version. Note that the coordinates stored inside a RealPoint object may be negative and that RealPoint functions do not perform any check against negative values.
Category: Data Structures
Instance Method Summary collapse
-
#*(num) ⇒ Wx::RealPoint
Return a new Wx::RealPoint with the x and y values both multiplied by parameter
num
, which should be a Numeric. -
#+(arg) ⇒ Wx::RealPoint
Return a new Wx::RealPoint with the x and y values both increased by parameter
arg
. -
#-(arg) ⇒ Wx::RealPoint
Return a new Wx::RealPoint with the x and y values both reduced by parameter
arg
. -
#/(num) ⇒ Wx::RealPoint
Return a new Wx::RealPoint with the x and y parameters both divided by parameter
num
, which should be a Numeric. -
#<=>(other) ⇒ Boolean?
Compare point values (Wx::RealPoint or point array).
-
#==(other) ⇒ Boolean
Compare point values (Wx::RealPoint or point array).
-
#assign(pt) ⇒ self
Set this point to the given point’s x,y values.
-
#eql?(other) ⇒ Boolean
Compare points.
-
#hash ⇒ Object
Returns hash for point.
-
#initialize(*args) ⇒ RealPoint
constructor
A new instance of RealPoint.
-
#to_ary ⇒ Array(Float,Float)
Returns point array (
[x, y]
). -
#to_point ⇒ Wx::Point
Converts real point to Wx::Point.
-
#to_real_point ⇒ self
(also: #to_real)
Returns self.
-
#x ⇒ Float
X coordinate of this point.
-
#x=(val) ⇒ void
X coordinate of this point.
-
#y ⇒ Float
Y coordinate of this point.
-
#y=(val) ⇒ void
Y coordinate of this point.
Constructor Details
#initialize ⇒ Wx::RealPoint #initialize(x, y) ⇒ Wx::RealPoint #initialize(pt) ⇒ Wx::RealPoint
Returns a new instance of RealPoint.
1006 |
# File 'lib/wx/doc/gen/gdi_common.rb', line 1006 def initialize(*args) end |
Instance Method Details
#*(num) ⇒ Wx::RealPoint
Return a new Wx::RealPoint with the x and y values both multiplied by parameter num
, which should be a Numeric
187 |
# File 'lib/wx/doc/gdi_common.rb', line 187 def *(num) end |
#+(arg) ⇒ Wx::RealPoint
Return a new Wx::RealPoint with the x and y values both increased by parameter arg
. If arg
is another Wx::(Real)Point (or Wx::Size or 2-element array), increase x by the other’s x (or width) and y by the other’s y (or height); if arg
is a numeric value, increase both x and y by that value.
203 |
# File 'lib/wx/doc/gdi_common.rb', line 203 def +(arg) end |
#-(arg) ⇒ Wx::RealPoint
Return a new Wx::RealPoint with the x and y values both reduced by parameter arg
. If arg
is another Wx::(Real)Point (or Wx::Size or 2-element array), reduce x by the other’s x (or width) and y by the other’s y (or height); if arg
is a numeric value, reduce x and y both by that value.
195 |
# File 'lib/wx/doc/gdi_common.rb', line 195 def -(arg) end |
#/(num) ⇒ Wx::RealPoint
Return a new Wx::RealPoint with the x and y parameters both divided by parameter num
, which should be a Numeric
181 |
# File 'lib/wx/doc/gdi_common.rb', line 181 def /(num) end |
#<=>(other) ⇒ Boolean?
Compare point values (Wx::RealPoint or point array). Returns -1,0 or 1 to indicate if this point is smaller, equal or greater than other (comparing xy
with other.xother.y
). Returns nil if incompatible.
167 |
# File 'lib/wx/doc/gdi_common.rb', line 167 def <=>(other)end |
#==(other) ⇒ Boolean
Compare point values (Wx::RealPoint or point array). Throws exception if incompatible.
160 |
# File 'lib/wx/doc/gdi_common.rb', line 160 def ==(other)end |
#assign(pt) ⇒ self
Set this point to the given point’s x,y values
217 |
# File 'lib/wx/doc/gdi_common.rb', line 217 def assign(pt) end |
#eql?(other) ⇒ Boolean
Compare points.
172 |
# File 'lib/wx/doc/gdi_common.rb', line 172 def eql?(other)end |
#to_ary ⇒ Array(Float,Float)
Returns point array ([x, y]
)
155 |
# File 'lib/wx/doc/gdi_common.rb', line 155 def to_ary; end |
#to_point ⇒ Wx::Point
Converts real point to Wx::Point
207 |
# File 'lib/wx/doc/gdi_common.rb', line 207 def to_point; end |
#to_real_point ⇒ self Also known as: to_real
Returns self.
211 |
# File 'lib/wx/doc/gdi_common.rb', line 211 def to_real_point; end |
#x ⇒ Float
X coordinate of this point.
974 |
# File 'lib/wx/doc/gen/gdi_common.rb', line 974 def x; end |
#x=(val) ⇒ void
This method returns an undefined value.
X coordinate of this point.
980 |
# File 'lib/wx/doc/gen/gdi_common.rb', line 980 def x=(val); end |
#y ⇒ Float
Y coordinate of this point.
986 |
# File 'lib/wx/doc/gen/gdi_common.rb', line 986 def y; end |
#y=(val) ⇒ void
This method returns an undefined value.
Y coordinate of this point.
992 |
# File 'lib/wx/doc/gen/gdi_common.rb', line 992 def y=(val); end |