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ā¦
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) ⇒ 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
54 55 56 |
# File 'lib/ctioga2/graphics/styles/drawable.rb', line 54 def color @color end |
#marker ⇒ Object
The marker
57 58 59 |
# File 'lib/ctioga2/graphics/styles/drawable.rb', line 57 def marker @marker end |
#scale ⇒ Object
The marker scale
60 61 62 |
# File 'lib/ctioga2/graphics/styles/drawable.rb', line 60 def scale @scale end |
Instance Method Details
#draw_markers_at(t, x, y) ⇒ Object
Shows the marker at a given location/set of locations.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/ctioga2/graphics/styles/drawable.rb', line 63 def draw_markers_at(t, x, y) if x.is_a? Numeric x = Dvector[x] y = Dvector[y] end t.context do # Always with line style solid (though that could change ?) t.line_type = LineStyles::Solid dict = { 'Xs' => x, 'Ys' => y, 'marker' => @marker, 'color' => @color } if @scale dict['scale'] = @scale end t.show_marker(dict) end end |