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 for clockwise arc endAngle is less than startAngle it will be progressively increased by 2pi until it is greater than startAngle. If for counter-clockwise 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 for clockwise arc endAngle is less than startAngle it will be progressively increased by 2pi until it is greater than startAngle. If for counter-clockwise 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 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, a straight line connecting these points is also appended. If there is no current point before the call to #add_arc_to_point 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 bezier 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 this function will behave as if preceded by a call to MoveToPoint(cx1, cy1).

    Parameters:

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

    This method returns an undefined value.

    Adds a cubic bezier 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 this function will behave as if preceded by a call to MoveToPoint(c1).



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

def add_curve_to_point(*args) end

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


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

def add_ellipse(x, y, w, h) 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 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 this function will behave as #move_to_point.

    Parameters:



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

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:



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

def add_path(path) end

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

This method returns an undefined value.

Adds a quadratic bezier 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 this function will behave as if preceded by a call to MoveToPoint(cx, cy).

Parameters:

  • cx (Float)
  • cy (Float)
  • x (Float)
  • y (Float)


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

def add_quad_curve_to_point(cx, cy, x, y) end

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


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

def add_rectangle(x, y, w, h) end

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


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

def add_rounded_rectangle(x, y, w, h, radius) 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 endpoint of the sub-path.



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

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)


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

def contains(*args) end

#get_boxArray(Float,Float,Float,Float) Also known as: box

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

Returns:

  • (Array(Float,Float,Float,Float))


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

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:



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

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:



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

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:



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

def transform(matrix) end