Class: CTioga::Styles::CTiogaMarkerParameter

Inherits:
MetaBuilder::ParameterType show all
Defined in:
lib/CTioga/styles.rb

Overview

A CTioga marker

Instance Method Summary collapse

Methods inherited from MetaBuilder::ParameterType

#default_value, from_string, get_param_type, get_type, #initialize, #lookup_const, #option_parser_long_option, #option_parser_option, #option_parser_raw, #qt4_create_input_widget, #qt4_get, #string_to_type, #stt_run_hook, #type_name, type_name, #type_to_string, #type_to_variant, #variant_to_type

Constructor Details

This class inherits a constructor from MetaBuilder::ParameterType

Instance Method Details

#string_to_type_internal(str) ⇒ Object



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/CTioga/styles.rb', line 91

def string_to_type_internal(str)
  if str =~ /(\d+)\s*,\s*(\d+)(?:\s*,\s*([\d.e+-]+))?/
    ar = [$1.to_i, $2.to_i]
    if $3
      ar << $3.to_f
    end
    return ar
  else
    begin
      return Tioga::MarkerConstants.const_get(str)
    rescue
      raise IncorrectInput, "'#{str}' is not a valid marker"
    end
  end
end

#type_to_string_internal(val) ⇒ Object



107
108
109
# File 'lib/CTioga/styles.rb', line 107

def type_to_string_internal(val)
  return val.map {|i| i.to_s}.join(',')
end