Class: CTioga2::Graphics::Styles::MarkerStyle
- Inherits:
-
BasicStyle
- Object
- BasicStyle
- CTioga2::Graphics::Styles::MarkerStyle
- Defined in:
- lib/ctioga2/graphics/styles/drawable.rb
Overview
This class represents all the stylistic information to draw a Marker.
todo many things are still missing here…
-
in particular, angles could be handled here, and they could be handled directly in the marker specification…
Constant Summary
Constants inherited from BasicStyle
Instance Attribute Summary collapse
-
#color ⇒ Object
The color.
-
#marker ⇒ Object
The marker.
-
#scale ⇒ Object
The marker scale.
Instance Method Summary collapse
-
#draw_markers_at(t, x, y, override = nil) ⇒ Object
Shows the marker at a given location/set of locations.
Methods inherited from BasicStyle
attr_accessor, attributes, from_hash, #instance_variable_defined?, #set_from_hash, #to_hash, #update_from_other
Instance Attribute Details
#color ⇒ Object
The color
57 58 59 |
# File 'lib/ctioga2/graphics/styles/drawable.rb', line 57 def color @color end |
#marker ⇒ Object
The marker
60 61 62 |
# File 'lib/ctioga2/graphics/styles/drawable.rb', line 60 def marker @marker end |
#scale ⇒ Object
The marker scale
63 64 65 |
# File 'lib/ctioga2/graphics/styles/drawable.rb', line 63 def scale @scale end |
Instance Method Details
#draw_markers_at(t, x, y, override = nil) ⇒ Object
Shows the marker at a given location/set of locations.
p override is a hash that can override part of the dictionnary specification.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/ctioga2/graphics/styles/drawable.rb', line 69 def draw_markers_at(t, x, y, override = nil) t.context do ## \todo allow custom line types for markers ? t.line_type = LineStyles::Solid dict = { 'marker' => @marker, 'color' => @color } if x.is_a? Numeric dict['x'] = x dict['y'] = y else dict['Xs'] = x dict['Ys'] = y end if @scale dict['scale'] = @scale end if override dict.merge!(override) end t.show_marker(dict) end end |