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 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?, options_hash, #set_from_hash, sub_style, sub_styles, #to_hash, typed_attribute, #update_from_other
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.
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/ctioga2/graphics/styles/drawable.rb', line 77 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 |