# coding: utf-8 # contour.rb: the style of a contour plot # copyright (c) 2009 by Vincent Fourmond # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details (in the COPYING file). require 'ctioga2/utils' require 'ctioga2/log' # This module contains all the classes used by ctioga module CTioga2 module Graphics module Styles StyleAspectRE = { /^marker[_-]color$/i => :marker_color, /^marker[_-]fill[_-]color$/i => :marker_fill_color, /^marker[_-]line[_-]color$/i => :marker_line_color, /^marker[_-](size|scale)$/i => :marker_scale, } StyleAspect = CmdType.new('style-aspect', {:type => :re_list, :list => StyleAspectRE}, < mm z = zvalue[idx] style.scale = if min_scale min_scale + (max_scale - min_scale) * (z - zm)/(zM - zm) else zvalue[idx].abs/mm * max_scale end end end for bs in [:color, :line_color, :fill_color] stl = "marker_#{bs}".to_sym if @reversed[stl] idx = @reversed[stl] if idx < zvalue.size map = curve_style.send("#{stl}_map") if map style.send("#{bs}=",map.z_color(zvalue[idx], zmin[idx], zmax[idx])) end end end end return style end end CumulativeHistogramsType = CmdType.new('cumulative-histograms', { :type => :integer, :shortcuts => { /next/i => :next, /no|false/i => false } }, < false, /^min(dx)?$/i => :mindx, } ComputeDx = CmdType.new('compute-dx', {:type => :re_list, :list => ComputeDxRE}, <