Class: Wx::GraphicsPath

Inherits:
GraphicsObject show all
Defined in:
lib/wx/doc/gen/graphics_object.rb

Overview

A GraphicsPath is a native representation of a geometric path.

The contents are specific and private to the respective renderer. Instances are reference counted and can therefore be assigned as usual. The only way to get a valid instance is by using Wx::GraphicsContext#create_path or Wx::GraphicsRenderer#create_path.

Category: Graphics Device Interface (GDI)

Requires:

  • USE_GRAPHICS_CONTEXT

Instance Method Summary collapse

Methods inherited from GraphicsObject

#get_renderer, #is_null

Methods inherited from Object

#clone, #dup, #initialize, #is_same_as, #un_share

Constructor Details

This class inherits a constructor from Wx::Object

Instance Method Details

#add_arc(x, y, r, startAngle, endAngle, clockwise) ⇒ void #add_arc(c, r, startAngle, endAngle, clockwise) ⇒ void

Overloads:

  • #add_arc(x, y, r, startAngle, endAngle, clockwise) ⇒ void

    This method returns an undefined value.

    Adds an arc of a circle.

    The circle is defined by the coordinates of its centre (x, y) or c and its radius r. The arc goes from the starting angle startAngle to endAngle either clockwise or counter-clockwise, depending on the value of clockwise argument. The angles are measured in radians but, contrary to the usual mathematical convention, are always clockwise from the horizontal axis. If clockwise and arc endAngle is less than startAngle, it will be progressively increased by 2pi until it is greater than startAngle. If counter-clockwise and arc endAngle is greater than startAngle, it will be progressively decreased by 2pi until it is less than startAngle. If there is a current point set, an initial line segment will be added to the path to connect the current point to the beginning of the arc.

    Parameters:

    • x (Float)
    • y (Float)
    • r (Float)
    • startAngle (Float)
    • endAngle (Float)
    • clockwise (Boolean)
  • #add_arc(c, r, startAngle, endAngle, clockwise) ⇒ void

    This method returns an undefined value.

    Adds an arc of a circle.

    The circle is defined by the coordinates of its centre (x, y) or c and its radius r. The arc goes from the starting angle startAngle to endAngle either clockwise or counter-clockwise, depending on the value of clockwise argument. The angles are measured in radians but, contrary to the usual mathematical convention, are always clockwise from the horizontal axis. If clockwise and arc endAngle is less than startAngle, it will be progressively increased by 2pi until it is greater than startAngle. If counter-clockwise and arc endAngle is greater than startAngle, it will be progressively decreased by 2pi until it is less than startAngle. If there is a current point set, an initial line segment will be added to the path to connect the current point to the beginning of the arc.

    Parameters:

    • c (Wx::Point2DDouble)
    • r (Float)
    • startAngle (Float)
    • endAngle (Float)
    • clockwise (Boolean)


255
# File 'lib/wx/doc/gen/graphics_object.rb', line 255

def add_arc(*args) end

#add_arc_to_point(x1, y1, x2, y2, r) ⇒ void

This method returns an undefined value.

Adds an arc (of a circle with radius r) that is tangent to the line connecting the current point and (x1, y1) and to the line connecting (x1, y1) and (x2, y2).

If the current point and the starting point of the arc are different, then a straight line connecting these points is also appended. If there is no current point before the call to #add_arc_to_point, then this function will behave as if preceded by a call to MoveToPoint(0, 0). After this call, the current point will be at the ending point of the arc.

Parameters:

  • x1 (Float)
  • y1 (Float)
  • x2 (Float)
  • y2 (Float)
  • r (Float)


266
# File 'lib/wx/doc/gen/graphics_object.rb', line 266

def add_arc_to_point(x1, y1, x2, y2, r) end

#add_circle(x, y, r) ⇒ void

This method returns an undefined value.

Appends a circle around (x,y) with radius r as a new closed subpath.

After this call, the current point will be at (x+r, y).

Parameters:

  • x (Float)
  • y (Float)
  • r (Float)


275
# File 'lib/wx/doc/gen/graphics_object.rb', line 275

def add_circle(x, y, r) end

#add_curve_to_point(cx1, cy1, cx2, cy2, x, y) ⇒ void #add_curve_to_point(c1, c2, e) ⇒ void

Overloads:

  • #add_curve_to_point(cx1, cy1, cx2, cy2, x, y) ⇒ void

    This method returns an undefined value.

    Adds a cubic Bézier curve from the current point, using two control points and an end point.

    If there is no current point before the call to #add_curve_to_point, then this function will behave as if preceded by a call to MoveToPoint(cx1, cy1). This is useful for pulling a section of a path in two directions, providing a smoother bump (or wave) in its appearance compared to a quadratic Bézier curve.

    Parameters:

    • cx1 (Float)

      The x coordinate of the first control point.

    • cy1 (Float)

      The y coordinate of the first control point.

    • cx2 (Float)

      The x coordinate of the second control point.

    • cy2 (Float)

      The y coordinate of the second control point.

    • x (Float)

      The x coordinate of the end point.

    • y (Float)

      The y coordinate of the end point.

  • #add_curve_to_point(c1, c2, e) ⇒ void

    This method returns an undefined value.

    Adds a cubic Bézier curve from the current point, using two control points and an end point.

    If there is no current point before the call to #add_curve_to_point, then this function will behave as if preceded by a call to MoveToPoint(c1). This is useful for pulling a section of a path in two directions, providing a smoother bump (or wave) in its appearance compared to a quadratic Bézier curve.

    Parameters:



298
# File 'lib/wx/doc/gen/graphics_object.rb', line 298

def add_curve_to_point(*args) end

#add_ellipse(x, y, w, h) ⇒ void #add_ellipse(rect) ⇒ void

Overloads:

  • #add_ellipse(x, y, w, h) ⇒ void

    This method returns an undefined value.

    Appends an ellipse fitting into the passed-in rectangle as a new closed subpath.

    After this call, the current point will be at (x+w, y+h/2).

    Parameters:

    • x (Float)
    • y (Float)
    • w (Float)
    • h (Float)
  • #add_ellipse(rect) ⇒ 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:



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

def add_ellipse(*args) end

#add_line_to_point(x, y) ⇒ void #add_line_to_point(p) ⇒ void

Overloads:

  • #add_line_to_point(x, y) ⇒ void

    This method returns an undefined value.

    Adds a straight line from the current point to (x,y).

    If current point is not yet set before the call to #add_line_to_point, then this function will behave as #move_to_point.

    Parameters:

    • x (Float)
    • y (Float)
  • #add_line_to_point(p) ⇒ void

    This method returns an undefined value.

    Adds a straight line from the current point to p.

    If current point is not yet set before the call to #add_line_to_point, then this function will behave as #move_to_point.

    Parameters:



328
# File 'lib/wx/doc/gen/graphics_object.rb', line 328

def add_line_to_point(*args) end

#add_path(path) ⇒ void

This method returns an undefined value.

Adds another path onto the current path.

After this call, the current point will be at the added path’s current point. For Direct2D, the path being appended shouldn’t contain a started non-empty subpath when this function is called.

Parameters:



335
# File 'lib/wx/doc/gen/graphics_object.rb', line 335

def add_path(path) end

#add_quad_curve_to_point(cx, cy, x, y) ⇒ void #add_quad_curve_to_point(cp, e) ⇒ void

Overloads:

  • #add_quad_curve_to_point(cx, cy, x, y) ⇒ void

    This method returns an undefined value.

    Adds a quadratic Bézier curve from the current point, using a control point and an end point.

    If there is no current point before the call to #add_quad_curve_to_point, then this function will behave as if preceded by a call to MoveToPoint(cx, cy). This is useful for pulling a section of a path in one direction, providing a sharper bump in its appearance compared to a cubic Bézier curve.

    Parameters:

    • cx (Float)

      The x coordinate of the control point.

    • cy (Float)

      The y coordinate of the control point.

    • x (Float)

      The x coordinate of the end point.

    • y (Float)

      The y coordinate of the end point.

  • #add_quad_curve_to_point(cp, e) ⇒ 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:



352
# File 'lib/wx/doc/gen/graphics_object.rb', line 352

def add_quad_curve_to_point(*args) end

#add_rectangle(x, y, w, h) ⇒ void #add_rectangle(rect) ⇒ void

Overloads:

  • #add_rectangle(x, y, w, h) ⇒ void

    This method returns an undefined value.

    Appends a rectangle as a new closed subpath.

    After this call the current point will be at (x, y).

    Parameters:

    • x (Float)
    • y (Float)
    • w (Float)
    • h (Float)
  • #add_rectangle(rect) ⇒ 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:



367
# File 'lib/wx/doc/gen/graphics_object.rb', line 367

def add_rectangle(*args) end

#add_rounded_rectangle(x, y, w, h, radius) ⇒ void #add_rounded_rectangle(rect, radius) ⇒ void

Overloads:

  • #add_rounded_rectangle(x, y, w, h, radius) ⇒ void

    This method returns an undefined value.

    Appends a rounded rectangle as a new closed subpath.

    If radius equals 0, then this function will behave as #add_rectangle; otherwise, after this call, the current point will be at (x+w, y+h/2).

    Parameters:

    • x (Float)
    • y (Float)
    • w (Float)
    • h (Float)
    • radius (Float)
  • #add_rounded_rectangle(rect, radius) ⇒ 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:



384
# File 'lib/wx/doc/gen/graphics_object.rb', line 384

def add_rounded_rectangle(*args) end

#close_subpathvoid

This method returns an undefined value.

Closes the current sub-path.

After this call, the current point will be at the joined end point of the sub-path.



390
# File 'lib/wx/doc/gen/graphics_object.rb', line 390

def close_subpath; end

#contains(c, fillStyle = Wx::PolygonFillMode::ODDEVEN_RULE) ⇒ Boolean #contains(x, y, fillStyle = Wx::PolygonFillMode::ODDEVEN_RULE) ⇒ Boolean

Overloads:

  • #contains(c, fillStyle = Wx::PolygonFillMode::ODDEVEN_RULE) ⇒ Boolean

    true if the point is within the path.

    Parameters:

    Returns:

    • (Boolean)
  • #contains(x, y, fillStyle = Wx::PolygonFillMode::ODDEVEN_RULE) ⇒ Boolean

    true if the point is within the path.

    Parameters:

    • x (Float)
    • y (Float)
    • fillStyle (Wx::PolygonFillMode) (defaults to: Wx::PolygonFillMode::ODDEVEN_RULE)

    Returns:

    • (Boolean)


407
# File 'lib/wx/doc/gen/graphics_object.rb', line 407

def contains(*args) end

#get_boxWx::Rect2DDouble Also known as: box

Gets the bounding box enclosing all points (possibly including control points).

Returns:



411
# File 'lib/wx/doc/gen/graphics_object.rb', line 411

def get_box; end

#get_current_pointWx::Point2DDouble Also known as: current_point

Gets the last point of the current path, (0,0) if not yet set.

Returns:



416
# File 'lib/wx/doc/gen/graphics_object.rb', line 416

def get_current_point; end

#move_to_point(x, y) ⇒ void #move_to_point(p) ⇒ void

Overloads:

  • #move_to_point(x, y) ⇒ void

    This method returns an undefined value.

    Begins a new subpath at (x,y).

    Parameters:

    • x (Float)
    • y (Float)
  • #move_to_point(p) ⇒ void

    This method returns an undefined value.

    Begins a new subpath at p.

    Parameters:



428
# File 'lib/wx/doc/gen/graphics_object.rb', line 428

def move_to_point(*args) end

#transform(matrix) ⇒ void

This method returns an undefined value.

Transforms each point of this path by the matrix.

For Direct2D, the current path shouldn’t contain a started non-empty subpath when this function is called.

Parameters:



435
# File 'lib/wx/doc/gen/graphics_object.rb', line 435

def transform(matrix) end