Class: Wx::SF::CircleProngArrow

Inherits:
CircleArrow show all
Defined in:
lib/wx/shapes/arrows/circle_prong_arrow.rb

Overview

Class extends the Wx::CircleArrow class and encapsulates arrow shape consisting of single two lines bisecting before the end of the parent line shape with a preceding circle.

Constant Summary

Constants inherited from CircleArrow

Wx::SF::CircleArrow::RADIUS

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CircleArrow

#get_radius, #initialize

Methods inherited from FilledArrow

#get_fill, #initialize, #set_fill

Methods inherited from LineArrow

#get_pen, #get_pen_width, #initialize, #set_parent_shape, #set_pen

Methods inherited from ArrowBase

#get_parent_shape, #initialize, #set_parent_shape, #translate_arrow

Constructor Details

This class inherits a constructor from Wx::SF::CircleArrow

Class Method Details

.arrow(ratio) ⇒ Object



14
15
16
17
# File 'lib/wx/shapes/arrows/circle_prong_arrow.rb', line 14

def arrow(ratio)
  x = ratio*11; y = ratio*5
  [Wx::RealPoint.new(x,0), Wx::RealPoint.new(0, y), Wx::RealPoint.new(0,-y), Wx::RealPoint.new(0, 0)]
end

Instance Method Details

#draw(from, to, dc) ⇒ Wx::Point

Draw arrow shape at the end of a virtual line.

Parameters:

  • from (Wx::RealPoint)

    Start of the virtual line

  • to (Wx::RealPoint)

    End of the virtual line

  • dc (Wx::DC)

    Device context for drawing

Returns:

  • (Wx::Point)

    translated connection point for arrow



36
37
38
39
40
41
42
43
44
# File 'lib/wx/shapes/arrows/circle_prong_arrow.rb', line 36

def draw(from, to, dc)
  cp, wing1, wing2, tip = translate_arrow(vertices, from, to)
  dc.with_pen(pen) do |dc|
    dc.draw_line(cp, wing1)
    dc.draw_line(cp, wing2)
    dc.draw_line(cp, tip)
  end
  super(from, cp, dc)
end

#scaleObject (protected)



25
26
27
28
# File 'lib/wx/shapes/arrows/circle_prong_arrow.rb', line 25

def scale
  @vertices = nil
  super
end