ctioga2 0.2 → 0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog +11 -0
- data/lib/ctioga2/commands/arguments.rb +1 -1
- data/lib/ctioga2/commands/commands.rb +1 -1
- data/lib/ctioga2/commands/doc/doc.rb +1 -1
- data/lib/ctioga2/commands/doc/documentation-commands.rb +1 -1
- data/lib/ctioga2/commands/doc/help.rb +1 -1
- data/lib/ctioga2/commands/doc/html.rb +1 -1
- data/lib/ctioga2/commands/doc/introspection.rb +1 -1
- data/lib/ctioga2/commands/doc/man.rb +1 -1
- data/lib/ctioga2/commands/doc/markup.rb +1 -1
- data/lib/ctioga2/commands/doc/wordwrap.rb +1 -1
- data/lib/ctioga2/commands/general-commands.rb +1 -1
- data/lib/ctioga2/commands/general-types.rb +1 -1
- data/lib/ctioga2/commands/groups.rb +1 -1
- data/lib/ctioga2/commands/interpreter.rb +8 -2
- data/lib/ctioga2/commands/parsers/command-line.rb +1 -1
- data/lib/ctioga2/commands/parsers/file.rb +4 -1
- data/lib/ctioga2/commands/strings.rb +1 -1
- data/lib/ctioga2/commands/type.rb +1 -1
- data/lib/ctioga2/commands/variables.rb +6 -6
- data/lib/ctioga2/data/backends/backend.rb +1 -1
- data/lib/ctioga2/data/backends/backends.rb +3 -2
- data/lib/ctioga2/data/backends/backends/direct.rb +72 -0
- data/lib/ctioga2/data/backends/backends/gnuplot.rb +1 -1
- data/lib/ctioga2/data/backends/backends/math.rb +1 -1
- data/lib/ctioga2/data/backends/backends/text.rb +8 -14
- data/lib/ctioga2/data/backends/description.rb +9 -5
- data/lib/ctioga2/data/backends/factory.rb +1 -1
- data/lib/ctioga2/data/backends/parameter.rb +1 -1
- data/lib/ctioga2/data/datacolumn.rb +1 -1
- data/lib/ctioga2/data/dataset.rb +50 -4
- data/lib/ctioga2/data/filters.rb +1 -1
- data/lib/ctioga2/data/indexed-dtable.rb +1 -1
- data/lib/ctioga2/data/point.rb +1 -1
- data/lib/ctioga2/data/stack.rb +151 -25
- data/lib/ctioga2/git-fools-svn.rb +7 -0
- data/lib/ctioga2/graphics/coordinates.rb +1 -1
- data/lib/ctioga2/graphics/elements.rb +1 -1
- data/lib/ctioga2/graphics/elements/containers.rb +1 -1
- data/lib/ctioga2/graphics/elements/contour.rb +5 -2
- data/lib/ctioga2/graphics/elements/curve2d.rb +1 -1
- data/lib/ctioga2/graphics/elements/element.rb +1 -1
- data/lib/ctioga2/graphics/elements/gradient-region.rb +1 -1
- data/lib/ctioga2/graphics/elements/parametric2d.rb +1 -2
- data/lib/ctioga2/graphics/elements/primitive.rb +1 -1
- data/lib/ctioga2/graphics/elements/redirecting-container.rb~ +123 -0
- data/lib/ctioga2/graphics/elements/region.rb +1 -1
- data/lib/ctioga2/graphics/elements/subplot.rb +1 -1
- data/lib/ctioga2/graphics/elements/tangent.rb +1 -1
- data/lib/ctioga2/graphics/elements/xyz-map.rb +1 -1
- data/lib/ctioga2/graphics/generator.rb +21 -4
- data/lib/ctioga2/graphics/legends.rb +1 -1
- data/lib/ctioga2/graphics/legends/area.rb +1 -1
- data/lib/ctioga2/graphics/legends/items.rb +1 -1
- data/lib/ctioga2/graphics/legends/provider.rb +1 -1
- data/lib/ctioga2/graphics/legends/storage.rb +1 -1
- data/lib/ctioga2/graphics/root.rb +1 -1
- data/lib/ctioga2/graphics/styles/axes.rb +2 -1
- data/lib/ctioga2/graphics/styles/background.rb +1 -1
- data/lib/ctioga2/graphics/styles/base.rb +1 -1
- data/lib/ctioga2/graphics/styles/carrays.rb +1 -1
- data/lib/ctioga2/graphics/styles/colormap.rb +1 -1
- data/lib/ctioga2/graphics/styles/curve.rb +1 -1
- data/lib/ctioga2/graphics/styles/drawable.rb +1 -1
- data/lib/ctioga2/graphics/styles/errorbar.rb +1 -1
- data/lib/ctioga2/graphics/styles/factory.rb +1 -1
- data/lib/ctioga2/graphics/styles/gradients.rb +1 -1
- data/lib/ctioga2/graphics/styles/legend.rb +1 -1
- data/lib/ctioga2/graphics/styles/location.rb +1 -1
- data/lib/ctioga2/graphics/styles/plot.rb +10 -1
- data/lib/ctioga2/graphics/styles/sets.rb +1 -1
- data/lib/ctioga2/graphics/styles/texts.rb +1 -1
- data/lib/ctioga2/graphics/subplot-commands.rb +1 -1
- data/lib/ctioga2/graphics/types.rb +1 -1
- data/lib/ctioga2/graphics/types/bijection.rb +1 -1
- data/lib/ctioga2/graphics/types/boundaries.rb +1 -1
- data/lib/ctioga2/graphics/types/boxes.rb +1 -1
- data/lib/ctioga2/graphics/types/dimensions.rb +1 -1
- data/lib/ctioga2/graphics/types/grid.rb +1 -1
- data/lib/ctioga2/graphics/types/location.rb +1 -1
- data/lib/ctioga2/graphics/types/point.rb +1 -1
- data/lib/ctioga2/log.rb +4 -1
- data/lib/ctioga2/metabuilder/type.rb +1 -1
- data/lib/ctioga2/metabuilder/types/coordinates.rb +1 -1
- data/lib/ctioga2/metabuilder/types/data.rb +1 -1
- data/lib/ctioga2/metabuilder/types/dates.rb +1 -1
- data/lib/ctioga2/metabuilder/types/generic.rb~ +225 -0
- data/lib/ctioga2/metabuilder/types/lists.rb +1 -1
- data/lib/ctioga2/metabuilder/types/numbers.rb +1 -1
- data/lib/ctioga2/metabuilder/types/strings.rb +1 -1
- data/lib/ctioga2/metabuilder/types/styles.rb +1 -1
- data/lib/ctioga2/plotmaker.rb +12 -7
- data/lib/ctioga2/postprocess.rb +1 -1
- data/lib/ctioga2/utils.rb +27 -3
- metadata +45 -56
@@ -18,7 +18,7 @@ require 'ctioga2/log'
|
|
18
18
|
# This module contains all the classes used by ctioga
|
19
19
|
module CTioga2
|
20
20
|
|
21
|
-
Version::register_svn_info('$Revision
|
21
|
+
Version::register_svn_info('$Revision$', '$Date$')
|
22
22
|
|
23
23
|
# This module contains all graphical elements of CTioga2
|
24
24
|
module Graphics
|
@@ -1,4 +1,3 @@
|
|
1
|
-
# -*- coding: undecided -*-
|
2
1
|
# parametric2d.rb: a 2D curve whose parameters depend on Z values
|
3
2
|
# copyright (c) 2006, 2007, 2008, 2009, 2010 by Vincent Fourmond
|
4
3
|
|
@@ -20,7 +19,7 @@ require 'Dobjects/Function'
|
|
20
19
|
|
21
20
|
module CTioga2
|
22
21
|
|
23
|
-
Version::register_svn_info('$Revision
|
22
|
+
Version::register_svn_info('$Revision$', '$Date$')
|
24
23
|
|
25
24
|
module Graphics
|
26
25
|
|
@@ -21,7 +21,7 @@ require 'shellwords'
|
|
21
21
|
# This module contains all the classes used by ctioga
|
22
22
|
module CTioga2
|
23
23
|
|
24
|
-
Version::register_svn_info('$Revision
|
24
|
+
Version::register_svn_info('$Revision$', '$Date$')
|
25
25
|
|
26
26
|
module Graphics
|
27
27
|
|
@@ -0,0 +1,123 @@
|
|
1
|
+
# containers.rb: drawables that contains other drawables
|
2
|
+
# copyright (c) 2006, 2007, 2008, 2009 by Vincent Fourmond
|
3
|
+
|
4
|
+
# This program is free software; you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation; either version 2 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details (in the COPYING file).
|
13
|
+
|
14
|
+
|
15
|
+
require 'ctioga2/utils'
|
16
|
+
require 'ctioga2/log'
|
17
|
+
|
18
|
+
module CTioga2
|
19
|
+
|
20
|
+
Version::register_svn_info('$Revision$', '$Date$')
|
21
|
+
|
22
|
+
module Graphics
|
23
|
+
|
24
|
+
module Elements
|
25
|
+
|
26
|
+
# A Container is a drawable object that contains several others, its
|
27
|
+
# #elements.
|
28
|
+
class Container < TiogaElement
|
29
|
+
|
30
|
+
# All drawable Element contained in this object. It may
|
31
|
+
# contain other Container subobjects.
|
32
|
+
attr_accessor :elements
|
33
|
+
|
34
|
+
# The subframe position of this element with respect to its
|
35
|
+
# parent. It is a Types::Box object.
|
36
|
+
attr_accessor :subframe
|
37
|
+
|
38
|
+
# A reference to the RootObject
|
39
|
+
attr_accessor :root_object
|
40
|
+
|
41
|
+
# The Legends::LegendArea dedicated to the display of the
|
42
|
+
# legend of this object and its children, or _nil_ if the
|
43
|
+
# parent should handle the display.
|
44
|
+
attr_accessor :legend_area
|
45
|
+
|
46
|
+
# The Legends::LegendStorage that holds all the legends of the
|
47
|
+
# object
|
48
|
+
attr_accessor :legend_storage
|
49
|
+
|
50
|
+
# Creates an empty new Container with the given _parent_.
|
51
|
+
def initialize(parent = nil, root = nil)
|
52
|
+
@parent = parent
|
53
|
+
|
54
|
+
# elements to be given to tioga
|
55
|
+
@elements = []
|
56
|
+
|
57
|
+
# By default the frame takes up all the space.
|
58
|
+
@subframe = Types::MarginsBox.new(0, 0, 0, 0)
|
59
|
+
|
60
|
+
@root_object = root
|
61
|
+
|
62
|
+
@legend_storage = Legends::LegendStorage.new
|
63
|
+
|
64
|
+
# By default, don't display legends.
|
65
|
+
@legend_area = nil
|
66
|
+
end
|
67
|
+
|
68
|
+
# Returns the number of child elements
|
69
|
+
def size
|
70
|
+
return @elements.size
|
71
|
+
end
|
72
|
+
|
73
|
+
# Sometimes, the value of the subframe is _nil_ and determined
|
74
|
+
# during the plot. This function is guaranteed to return the
|
75
|
+
# correct value. It takes a reference to a FigureMaker object.
|
76
|
+
def actual_subframe(t)
|
77
|
+
return @subframe
|
78
|
+
end
|
79
|
+
|
80
|
+
# Adds an element
|
81
|
+
def add_element(element)
|
82
|
+
element.parent = self
|
83
|
+
@elements << element
|
84
|
+
|
85
|
+
# If the element has a curve_style, we add it as a
|
86
|
+
# CurveLegend
|
87
|
+
if element.respond_to?(:curve_style) and
|
88
|
+
element.curve_style.has_legend?
|
89
|
+
add_legend_item(Legends::CurveLegend.new(element.curve_style))
|
90
|
+
elsif element.is_a? Container
|
91
|
+
add_legend_item(element)
|
92
|
+
end
|
93
|
+
|
94
|
+
# We call LocationStyle#finalize! if possible
|
95
|
+
if(self.respond_to?(:style) and element.respond_to?(:location))
|
96
|
+
element.location.finalize!(self.style)
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
|
101
|
+
# Adds a legend item to the #associated_legend_storage
|
102
|
+
def add_legend_item(item)
|
103
|
+
@legend_storage.add_item(item)
|
104
|
+
end
|
105
|
+
|
106
|
+
# \todo provide coordinate conversion facilities...
|
107
|
+
|
108
|
+
protected
|
109
|
+
|
110
|
+
# Creates the appropriate subfigure and draws all its elements
|
111
|
+
# within.
|
112
|
+
def real_do(t)
|
113
|
+
t.subfigure(@subframe.to_frame_margins(t)) do
|
114
|
+
for el in @elements
|
115
|
+
el.do(t)
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
end
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
@@ -17,7 +17,7 @@ require 'ctioga2/graphics/elements/primitive'
|
|
17
17
|
# This module contains all the classes used by ctioga
|
18
18
|
module CTioga2
|
19
19
|
|
20
|
-
Version::register_svn_info('$Revision
|
20
|
+
Version::register_svn_info('$Revision$', '$Date$')
|
21
21
|
|
22
22
|
module Graphics
|
23
23
|
|
@@ -18,10 +18,12 @@ require 'ctioga2/graphics/coordinates'
|
|
18
18
|
|
19
19
|
module CTioga2
|
20
20
|
|
21
|
-
Version::register_svn_info('$Revision
|
21
|
+
Version::register_svn_info('$Revision$', '$Date$')
|
22
22
|
|
23
23
|
module Graphics
|
24
24
|
|
25
|
+
|
26
|
+
|
25
27
|
# This class is in charge of generating Elements::TiogaElement,
|
26
28
|
# such as Elements::Curve2D, from a dataset. It takes care of
|
27
29
|
# generating the appropriate style and of transforming the
|
@@ -46,16 +48,31 @@ module CTioga2
|
|
46
48
|
@current_curves = :xy_plot
|
47
49
|
end
|
48
50
|
|
51
|
+
PlotOptions = {
|
52
|
+
'bypass-transforms' => CmdArg.new('boolean')
|
53
|
+
}
|
54
|
+
|
55
|
+
|
49
56
|
# Creates a Elements::TiogaElement representing the _dataset_
|
50
57
|
# and returns it.
|
51
58
|
#
|
52
59
|
# \todo
|
53
|
-
# *
|
60
|
+
# * other kinds of coordinate transformations
|
54
61
|
# * other kinds of curves (pseudo-3D, surfaces, histograms...)
|
55
62
|
def curve_from_dataset(plot, dataset, options = {})
|
56
63
|
# Does coordinate transforms first ?
|
57
|
-
#
|
58
|
-
|
64
|
+
# @todo copy datasets here rather than overwriting them !
|
65
|
+
# -> this should be an option !
|
66
|
+
if ! options['bypass-transforms']
|
67
|
+
plot.style.apply_transforms!(dataset)
|
68
|
+
end
|
69
|
+
|
70
|
+
# Now, we trim options unrelated to the plotting
|
71
|
+
options.delete_if { |k,v|
|
72
|
+
! Graphics::Styles::
|
73
|
+
CurveStyleFactory::PlotCommandOptions.key?(k)
|
74
|
+
}
|
75
|
+
|
59
76
|
|
60
77
|
return send(@current_curves, plot, dataset, options)
|
61
78
|
end
|
@@ -21,7 +21,7 @@ require 'ctioga2/graphics/subplot-commands'
|
|
21
21
|
|
22
22
|
module CTioga2
|
23
23
|
|
24
|
-
Version::register_svn_info('$Revision
|
24
|
+
Version::register_svn_info('$Revision$', '$Date$')
|
25
25
|
|
26
26
|
# This module contains all graphical elements of CTioga2
|
27
27
|
module Graphics
|
@@ -17,7 +17,7 @@ require 'ctioga2/log'
|
|
17
17
|
# This module contains all the classes used by ctioga
|
18
18
|
module CTioga2
|
19
19
|
|
20
|
-
Version::register_svn_info('$Revision
|
20
|
+
Version::register_svn_info('$Revision$', '$Date$')
|
21
21
|
|
22
22
|
module Graphics
|
23
23
|
|
@@ -261,6 +261,7 @@ module CTioga2
|
|
261
261
|
PartialAxisStyle = {
|
262
262
|
'transform' => CmdArg.new('bijection'),
|
263
263
|
'location' => CmdArg.new('location'),
|
264
|
+
'log' => CmdArg.new('boolean'),
|
264
265
|
'stroke_color' => CmdArg.new('color')
|
265
266
|
}
|
266
267
|
|
@@ -16,7 +16,7 @@ require 'ctioga2/log'
|
|
16
16
|
# This module contains all the classes used by ctioga
|
17
17
|
module CTioga2
|
18
18
|
|
19
|
-
Version::register_svn_info('$Revision
|
19
|
+
Version::register_svn_info('$Revision$', '$Date$')
|
20
20
|
|
21
21
|
module Graphics
|
22
22
|
|
@@ -17,7 +17,7 @@ require 'ctioga2/log'
|
|
17
17
|
# This module contains all the classes used by ctioga
|
18
18
|
module CTioga2
|
19
19
|
|
20
|
-
Version::register_svn_info('$Revision
|
20
|
+
Version::register_svn_info('$Revision$', '$Date$')
|
21
21
|
|
22
22
|
module Graphics
|
23
23
|
|
@@ -17,7 +17,7 @@ require 'ctioga2/log'
|
|
17
17
|
# This module contains all the classes used by ctioga
|
18
18
|
module CTioga2
|
19
19
|
|
20
|
-
Version::register_svn_info('$Revision
|
20
|
+
Version::register_svn_info('$Revision$', '$Date$')
|
21
21
|
|
22
22
|
module Graphics
|
23
23
|
|
@@ -17,7 +17,7 @@ require 'ctioga2/log'
|
|
17
17
|
# This module contains all the classes used by ctioga
|
18
18
|
module CTioga2
|
19
19
|
|
20
|
-
Version::register_svn_info('$Revision
|
20
|
+
Version::register_svn_info('$Revision$', '$Date$')
|
21
21
|
|
22
22
|
module Graphics
|
23
23
|
|
@@ -17,7 +17,7 @@ require 'ctioga2/log'
|
|
17
17
|
# This module contains all the classes used by ctioga
|
18
18
|
module CTioga2
|
19
19
|
|
20
|
-
Version::register_svn_info('$Revision
|
20
|
+
Version::register_svn_info('$Revision$', '$Date$')
|
21
21
|
|
22
22
|
module Graphics
|
23
23
|
|
@@ -18,7 +18,7 @@ require 'ctioga2/log'
|
|
18
18
|
# This module contains all the classes used by ctioga
|
19
19
|
module CTioga2
|
20
20
|
|
21
|
-
Version::register_svn_info('$Revision
|
21
|
+
Version::register_svn_info('$Revision$', '$Date$')
|
22
22
|
|
23
23
|
module Graphics
|
24
24
|
|
@@ -17,7 +17,7 @@ require 'ctioga2/log'
|
|
17
17
|
# This module contains all the classes used by ctioga
|
18
18
|
module CTioga2
|
19
19
|
|
20
|
-
Version::register_svn_info('$Revision
|
20
|
+
Version::register_svn_info('$Revision$', '$Date$')
|
21
21
|
|
22
22
|
module Graphics
|
23
23
|
|
@@ -19,7 +19,7 @@ require 'ctioga2/graphics/coordinates'
|
|
19
19
|
# This module contains all the classes used by ctioga
|
20
20
|
module CTioga2
|
21
21
|
|
22
|
-
Version::register_svn_info('$Revision
|
22
|
+
Version::register_svn_info('$Revision$', '$Date$')
|
23
23
|
|
24
24
|
module Graphics
|
25
25
|
|
@@ -17,7 +17,7 @@ require 'ctioga2/log'
|
|
17
17
|
# This module contains all the classes used by ctioga
|
18
18
|
module CTioga2
|
19
19
|
|
20
|
-
Version::register_svn_info('$Revision
|
20
|
+
Version::register_svn_info('$Revision$', '$Date$')
|
21
21
|
|
22
22
|
module Graphics
|
23
23
|
|