ruby-gr 0.58.1.0 → 0.64.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +32 -82
- data/lib/gr/ffi.rb +10 -0
- data/lib/gr.rb +116 -9
- data/lib/gr3/ffi.rb +11 -0
- data/lib/gr3.rb +1 -0
- data/lib/gr_commons/fiddley.rb +1 -1
- data/lib/gr_commons/version.rb +1 -1
- data/lib/grm/ffi.rb +0 -3
- data/lib/grm.rb +1 -0
- metadata +8 -79
- data/lib/gr/plot.rb +0 -1550
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4227a0ab868cbed63c7d88eaa5d74f95d319bf13aaaf27f6a69864aac452320
|
4
|
+
data.tar.gz: 6fd396df74a2192b5bdb3e2cb02105bd96d9436bbccfce5cca092cb41e9f1980
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c50e7d93397d4349919810f0c954e8a63c1b3c7ac2cd8a861cb51e2a6efcb22543a99c7b6bde1023e04fc0e86f4b0a6b393b91d272006effe64075cbd9a34bb
|
7
|
+
data.tar.gz: 50ec885a694e5d4383638bf538cb792ea0d0d0c6120ccca2079d304fc81c7f0e07e7842fc5382c9607e740e4ff0c51553dc2409838170330d501d00c86c29165
|
data/README.md
CHANGED
@@ -27,23 +27,22 @@
|
|
27
27
|
|
28
28
|
GR.rb supports Ruby 2.5+.
|
29
29
|
|
30
|
-
First, [install GR](#gr-installation). Then install `
|
30
|
+
First, [install GR](#gr-installation). Then install [`gr-plot`](https://github.com/red-data-tools/gr-plot) gem.
|
31
31
|
|
32
32
|
```sh
|
33
|
-
gem install
|
33
|
+
gem install gr-plot
|
34
34
|
```
|
35
|
-
Note: If you are using [RubyInstaller](https://rubyinstaller.org/) (Windows), pacman will automatically install [mingw-w64-gr](https://packages.msys2.org/base/mingw-w64-gr).
|
36
35
|
|
37
|
-
|
36
|
+
[pkg-config](https://github.com/ruby-gnome/pkg-config) will detect the location of the shared library. Otherwise, you need to specify the environment variable.
|
38
37
|
|
39
38
|
```sh
|
40
39
|
export GRDIR="/your/path/to/gr"
|
41
40
|
```
|
42
41
|
|
43
|
-
If you use package managers to install GR, [pkg-config](https://github.com/ruby-gnome/pkg-config) may automatically detect the shared library location without specifying the `GRDIR` environment variable.
|
44
|
-
|
45
42
|
## Quick Start
|
46
43
|
|
44
|
+
:point_right: [Wiki -plotting functions](https://github.com/red-data-tools/GR.rb/wiki/Plotting-functions)
|
45
|
+
|
47
46
|
<p align="center">
|
48
47
|
<img src="https://user-images.githubusercontent.com/5798442/69689128-74cb1480-110b-11ea-9097-29e878a19e8f.png">
|
49
48
|
</p>
|
@@ -54,50 +53,25 @@ require 'gr/plot'
|
|
54
53
|
x = [0, 0.2, 0.4, 0.6, 0.8, 1.0]
|
55
54
|
y = [0.3, 0.5, 0.4, 0.2, 0.6, 0.7]
|
56
55
|
|
56
|
+
# show the figure
|
57
57
|
GR.plot(x, y)
|
58
|
-
```
|
59
|
-
|
60
|
-
<p align="center">
|
61
|
-
<img src="https://user-images.githubusercontent.com/5798442/84570709-242ab880-adca-11ea-9099-3a6b3418bf19.png">
|
62
|
-
</p>
|
63
|
-
|
64
|
-
```ruby
|
65
|
-
require 'gr/plot'
|
66
|
-
|
67
|
-
x = Numo::DFloat.linspace(0, 10, 101)
|
68
|
-
y1 = Numo::NMath.sin(x)
|
69
|
-
y2 = Numo::NMath.cos(x)
|
70
|
-
|
71
|
-
GR.plot(
|
72
|
-
[x, y1, 'bo'], [x, y2, 'g*'],
|
73
|
-
title: "Multiple plot example",
|
74
|
-
xlabel: "x",
|
75
|
-
ylabel: "y",
|
76
|
-
ylim: [-1.2, 1.2],
|
77
|
-
labels: ["sin(x)", "cos(x)"],
|
78
|
-
location: 11
|
79
|
-
)
|
80
|
-
```
|
81
58
|
|
82
|
-
Save the figure in PNG format.
|
83
|
-
|
84
|
-
```ruby
|
59
|
+
# Save the figure in PNG format.
|
85
60
|
GR.savefig("figure.png")
|
86
61
|
```
|
87
62
|
|
88
|
-
|
63
|
+
GR.rb supports [Jupyter Notebook / Lab](../../wiki/Jupyter-Notebook).
|
89
64
|
|
90
|
-
|
65
|
+
## API Overview
|
91
66
|
|
92
|
-
#### GR::Plot - A simple, matlab-style API.
|
67
|
+
#### [GR::Plot - A simple, matlab-style API](https://github.com/red-data-tools/gr-plot)
|
93
68
|
|
94
69
|
```ruby
|
95
70
|
require 'gr/plot'
|
96
71
|
GR.plot(x, y)
|
97
72
|
```
|
98
73
|
|
99
|
-
|
100
|
-
Some GR module methods are overwritten.
|
74
|
+
List of available functions.
|
101
75
|
|
102
76
|
[`plot`](../../wiki/Plotting-functions#plot)
|
103
77
|
[`step`](../../wiki/Plotting-functions#step)
|
@@ -123,7 +97,10 @@ Some GR module methods are overwritten.
|
|
123
97
|
[`imshow`](../../wiki/Plotting-functions#imshow)
|
124
98
|
[`isosurface`](../../wiki/Plotting-functions#isosurface)
|
125
99
|
|
126
|
-
|
100
|
+
See [GR.rb Wiki](https://github.com/red-data-tools/GR.rb/wiki) for details.
|
101
|
+
Some GR module methods are overwritten. Code has been moved to [gr-plot](https://github.com/red-data-tools/gr-plot).
|
102
|
+
|
103
|
+
#### GR - A module for calling native GR functions
|
127
104
|
|
128
105
|
2-D Plots and common 3-D Plots.
|
129
106
|
|
@@ -135,7 +112,7 @@ GR.setviewport(0.1, 0.9, 0.1, 0.9)
|
|
135
112
|
GR.setwindow(0.0, 20.0, 0.0, 20.0)
|
136
113
|
```
|
137
114
|
|
138
|
-
#### GR3 - A module for calling native GR3 functions
|
115
|
+
#### GR3 - A module for calling native GR3 functions
|
139
116
|
|
140
117
|
Complex 3D scenes.
|
141
118
|
|
@@ -159,60 +136,38 @@ export GKS_WSTYPE=100
|
|
159
136
|
## Documentation
|
160
137
|
|
161
138
|
- [GR.rb Wiki](https://github.com/red-data-tools/GR.rb/wiki)
|
162
|
-
- [GR
|
163
|
-
- [GR
|
164
|
-
|
165
|
-
Although GR.rb adds methods dynamically, we try our best to provide a complete yard document. If you want to see more up-to-date information, we recommend using the official GR reference.
|
139
|
+
- [GR.rb API Documentation](https://rubydoc.info/gems/ruby-gr) - Yard documents.
|
140
|
+
- [GR Framework](https://gr-framework.org/) - The official GR reference.
|
166
141
|
|
167
142
|
## GR Installation
|
168
143
|
|
169
144
|
### Installing an official release (recommended)
|
170
145
|
|
171
|
-
Download the [latest release](https://github.com/sciapp/gr/releases).
|
172
|
-
|
173
|
-
Set environment variable GRDIR.
|
146
|
+
Download the [latest release](https://github.com/sciapp/gr/releases) and place it where you want. Then set environment variable `GRDIR`.
|
174
147
|
|
175
148
|
```sh
|
176
149
|
export GRDIR="your/path/to/gr"
|
177
150
|
```
|
178
151
|
|
179
|
-
macOS :
|
152
|
+
macOS : See ["How to open apps from un-notarized or unidentified developers"](https://support.apple.com/en-us/HT202491) in the Apple documentation.
|
180
153
|
|
181
154
|
### Using package managers
|
182
155
|
|
183
|
-
|
184
|
-
* If you find any problem, please report the issue [here](https://github.com/red-data-tools/GR.rb/issues).
|
185
|
-
* Note: These packages may not have some features such as video output.
|
156
|
+
The third party GR packages for Mac, Linux and Windows are available for advanced users. However, these packages are provided by OSS volunteers and may not be the latest version or support some features (such as video output). If you find any problem, please report the issue [here](https://github.com/red-data-tools/GR.rb/issues).
|
186
157
|
|
187
158
|
#### Mac - Homebrew
|
188
159
|
|
189
160
|
```sh
|
190
161
|
brew install libgr
|
191
|
-
export GKS_WSTYPE=411 # gksqt (recommended)
|
192
|
-
```
|
193
|
-
|
194
|
-
#### Linux - APT
|
195
|
-
|
196
|
-
[packages.red-data-tools.org](https://github.com/red-data-tools/packages.red-data-tools.org) provides `libgr-dev`, `libgr3-dev` and `libgrm-dev`
|
197
|
-
|
198
|
-
Debian GNU/Linux and Ubuntu
|
199
|
-
|
200
|
-
```sh
|
201
|
-
sudo apt install -y -V ca-certificates lsb-release wget
|
202
|
-
wget https://packages.red-data-tools.org/$(lsb_release --id --short | tr 'A-Z' 'a-z'\
|
203
|
-
)/red-data-tools-apt-source-latest-$(lsb_release --codename --short).deb
|
204
|
-
sudo apt install -y -V ./red-data-tools-apt-source-latest-$(lsb_release --codename --short).deb
|
205
|
-
sudo apt update
|
206
|
-
sudo apt install libgrm-dev
|
162
|
+
export GKS_WSTYPE=411 # Set the workstation type to gksqt (recommended)
|
207
163
|
```
|
208
164
|
|
209
|
-
#### Linux -
|
165
|
+
#### Linux - openSUSE Build service
|
210
166
|
|
211
|
-
CentOS
|
167
|
+
GR releases are also available from the [openSUSE Build service](https://software.opensuse.org//download.html?project=science%3Agr-framework&package=gr) for CentOS, Debian, Fedora openSUSE and Ubuntu. Obtain a packaged release [here](https://software.opensuse.org//download.html?project=science%3Agr-framework&package=gr).
|
212
168
|
|
213
169
|
```sh
|
214
|
-
|
215
|
-
sudo dnf install -y gr-devel
|
170
|
+
export GRDIR="/usr/gr" # Check the location with `dpkg -L gr`
|
216
171
|
```
|
217
172
|
|
218
173
|
#### Windows - MSYS2
|
@@ -231,21 +186,16 @@ Please feel free to send us your PR.
|
|
231
186
|
* Update GR packages ( Homebrew, MinGW, red-data-tools )
|
232
187
|
* Create visualization tools based on GR.rb
|
233
188
|
|
234
|
-
|
189
|
+
If you are not familiar with Ruby gem development, please see
|
190
|
+
[I'm new to Ruby](https://github.com/red-data-tools/GR.rb/wiki/I%27m-new-to-Ruby)
|
235
191
|
|
236
|
-
```
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
bundle exec rake test
|
192
|
+
```
|
193
|
+
Do you need commit rights to my repository?
|
194
|
+
Do you want to get admin rights and take over the project?
|
195
|
+
If so, please feel free to contact us.
|
241
196
|
```
|
242
197
|
|
243
|
-
|
244
|
-
|
245
|
-
## Future plans
|
246
|
-
|
247
|
-
* GR.rb will be the default backend for [Charty](https://github.com/red-data-tools/charty).
|
248
|
-
* [Object-oriented interface](https://github.com/kojix2/GRUtils.rb) based on [GRUtils.jl](https://github.com/heliosdrm/GRUtils.jl).
|
198
|
+
I've seen a lot of OSS abandoned because no one has commit rights to the original repository anymore; the right to request commit rights for GR.rb is always open.
|
249
199
|
|
250
200
|
## Acknowledgements
|
251
201
|
|
data/lib/gr/ffi.rb
CHANGED
@@ -33,7 +33,9 @@ module GR
|
|
33
33
|
try_extern 'void gr_polyline(int, double *, double *)'
|
34
34
|
try_extern 'void gr_polymarker(int, double *, double *)'
|
35
35
|
try_extern 'void gr_text(double, double, char *)'
|
36
|
+
try_extern 'void gr_textx(double, double, char *, int)'
|
36
37
|
try_extern 'void gr_inqtext(double, double, char *, double *, double *)'
|
38
|
+
try_extern 'void gr_inqtextx(double, double, char *, int, double *, double *)'
|
37
39
|
try_extern 'void gr_fillarea(int, double *, double *)'
|
38
40
|
try_extern 'void gr_cellarray(double, double, double, double, ' \
|
39
41
|
'int, int, int, int, int, int, int *)'
|
@@ -209,5 +211,13 @@ module GR
|
|
209
211
|
try_extern 'void gr_inqtextencoding(int *)'
|
210
212
|
try_extern 'void gr_loadfont(char *, int *)'
|
211
213
|
# gr_setcallback(char *(*)(const char *));
|
214
|
+
try_extern 'void gr_setthreadnumber(int)'
|
215
|
+
try_extern 'void gr_setpicturesizeforvolume(int, int)'
|
216
|
+
try_extern 'void gr_setvolumebordercalculation(int)'
|
217
|
+
try_extern 'void gr_setapproximativecalculation(int)'
|
218
|
+
try_extern 'void gr_inqvolumeflags(int *, int *, int *, int *, int *)'
|
219
|
+
try_extern 'void gr_cpubasedvolume(int, int, int, double *, int, double *, double *, double *, double *)'
|
220
|
+
try_extern 'void gr_inqvpsize(int *, int *, double *)'
|
221
|
+
try_extern 'void gr_polygonmesh3d(int, const double *, const double *, const double *, int, const int *, const int *)'
|
212
222
|
end
|
213
223
|
end
|
data/lib/gr.rb
CHANGED
@@ -66,6 +66,7 @@ module GR
|
|
66
66
|
when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
|
67
67
|
[['libGR.dll'], 'gr']
|
68
68
|
when /darwin|mac os/
|
69
|
+
ENV['GKSwstype'] ||= 'gksqt'
|
69
70
|
[['libGR.dylib', 'libGR.so'], 'gr']
|
70
71
|
else
|
71
72
|
[['libGR.so'], 'gr']
|
@@ -267,12 +268,38 @@ module GR
|
|
267
268
|
#
|
268
269
|
# @!method text
|
269
270
|
|
271
|
+
# Draw a text at position `x`, `y` using the given options and current text
|
272
|
+
# attributes.
|
273
|
+
#
|
274
|
+
# @param x [Numeric] The X coordinate of the starting position of the text string
|
275
|
+
# @param y [Numeric] The Y coordinate of the starting position of the text string
|
276
|
+
# @param string [String] The text to be drawn
|
277
|
+
# @param opts [Integer] Bit mask including text options (GR_TEXT_USE_WC,
|
278
|
+
# GR_TEXT_ENABLE_INLINE_MATH)
|
279
|
+
#
|
280
|
+
# The values for `x` and `y` specify the text position. If the GR_TEXT_USE_WC
|
281
|
+
# option is set, they are interpreted as world cordinates, otherwise as
|
282
|
+
# normalized device coordinates. The string may contain new line characters
|
283
|
+
# and inline math expressions ($...$). The latter are only taken into account,
|
284
|
+
# if the GR_TEXT_ENABLE_INLINE_MATH option is set.
|
285
|
+
# The attributes that control the appearance of text are text font and
|
286
|
+
# precision, character expansion factor, character spacing, text color index,
|
287
|
+
# character height, character up vector, text path and text alignment.
|
288
|
+
#
|
289
|
+
# @!method textx
|
290
|
+
|
270
291
|
def inqtext(x, y, string)
|
271
292
|
inquiry [{ double: 4 }, { double: 4 }] do |tbx, tby|
|
272
293
|
super(x, y, string, tbx, tby)
|
273
294
|
end
|
274
295
|
end
|
275
296
|
|
297
|
+
def inqtextx(x, y, string, opts)
|
298
|
+
inquiry [{ double: 4 }, { double: 4 }] do |tbx, tby|
|
299
|
+
super(x, y, string, opts, tbx, tby)
|
300
|
+
end
|
301
|
+
end
|
302
|
+
|
276
303
|
# Allows you to specify a polygonal shape of an area to be filled.
|
277
304
|
#
|
278
305
|
# @param x [Array, NArray] A list containing the X coordinates
|
@@ -1703,7 +1730,7 @@ module GR
|
|
1703
1730
|
def readimage(path)
|
1704
1731
|
# Feel free to make a pull request if you catch a mistake
|
1705
1732
|
# or you have an idea to improve it.
|
1706
|
-
data = Fiddle::Pointer.malloc(Fiddle::SIZEOF_INTPTR_T)
|
1733
|
+
data = Fiddle::Pointer.malloc(Fiddle::SIZEOF_INTPTR_T, Fiddle::RUBY_FREE)
|
1707
1734
|
w, h = inquiry [:int, :int] do |width, height|
|
1708
1735
|
# data is a pointer of a pointer
|
1709
1736
|
super(path, width, height, data.ref)
|
@@ -1841,7 +1868,7 @@ module GR
|
|
1841
1868
|
# Feel free to make a pull request if you catch a mistake
|
1842
1869
|
# or you have an idea to improve it.
|
1843
1870
|
npoints = equal_length(x, y)
|
1844
|
-
triangles = Fiddle::Pointer.malloc(Fiddle::SIZEOF_INTPTR_T)
|
1871
|
+
triangles = Fiddle::Pointer.malloc(Fiddle::SIZEOF_INTPTR_T, Fiddle::RUBY_FREE)
|
1845
1872
|
dim = 3
|
1846
1873
|
n_tri = inquiry_int do |ntri|
|
1847
1874
|
super(npoints, x, y, ntri, triangles.ref)
|
@@ -2148,9 +2175,9 @@ module GR
|
|
2148
2175
|
#
|
2149
2176
|
# @param flag [Integer] projection type
|
2150
2177
|
# The available options are:
|
2151
|
-
# * 0 :
|
2152
|
-
# * 1 :
|
2153
|
-
# * 2 :
|
2178
|
+
# * 0 : PROJECTION_DEFAULT - default
|
2179
|
+
# * 1 : PROJECTION_ORTHOGRAPHIC - orthographic
|
2180
|
+
# * 2 : PROJECTION_PERSPECTIVE - perspective
|
2154
2181
|
#
|
2155
2182
|
# @!method setprojectiontype
|
2156
2183
|
|
@@ -2314,6 +2341,76 @@ module GR
|
|
2314
2341
|
super(str, font)
|
2315
2342
|
end
|
2316
2343
|
end
|
2344
|
+
|
2345
|
+
# Set the number of threads which can run parallel.
|
2346
|
+
# The default value is the number of threads the cpu has.
|
2347
|
+
#
|
2348
|
+
# @param num [Integer] num number of threads
|
2349
|
+
#
|
2350
|
+
# @!method setthreadnumber
|
2351
|
+
|
2352
|
+
# Set the width and height of the resulting picture.
|
2353
|
+
# These values are only used for gr_volume and gr_cpubasedvolume.
|
2354
|
+
# The default values are 1000 for both.
|
2355
|
+
#
|
2356
|
+
# @param width [Integer] width of the resulting image
|
2357
|
+
# @param height [Integer] height of the resulting image
|
2358
|
+
#
|
2359
|
+
# @!method setpicturesizeforvolume
|
2360
|
+
|
2361
|
+
# Set the gr_volume border type with this flag.
|
2362
|
+
# This inflicts how the volume is calculated. When the flag is set to
|
2363
|
+
# GR_VOLUME_WITH_BORDER the border will be calculated the same as the points
|
2364
|
+
# inside the volume.
|
2365
|
+
#
|
2366
|
+
# @param flag [Integer] calculation of the gr_volume border
|
2367
|
+
# The available options are:
|
2368
|
+
# * 0 : VOLUME_WITHOUT_BORDER - default value
|
2369
|
+
# * 1 : VOLUME_WITH_BORDER - gr_volume with border
|
2370
|
+
#
|
2371
|
+
# @!method setvolumebordercalculation # @!method setthreadnumber
|
2372
|
+
|
2373
|
+
# Set if gr_cpubasedvolume is calculated approximative or exact.
|
2374
|
+
# To use the exact calculation set approximative_calculation to 0.
|
2375
|
+
# The default value is the approximative version, which can be set with the
|
2376
|
+
# number 1.
|
2377
|
+
#
|
2378
|
+
# @param approximative_calculation [Integer] exact or approximative calculation
|
2379
|
+
# of the volume
|
2380
|
+
#
|
2381
|
+
# @!method setapproximativecalculation
|
2382
|
+
|
2383
|
+
# Inquire the parameters which can be set for cpubasedvolume.
|
2384
|
+
# The size of the resulting image, the way the volumeborder is calculated and
|
2385
|
+
# the amount of threads which are used.
|
2386
|
+
#
|
2387
|
+
# @return [Array]
|
2388
|
+
# * border - flag which tells how the border is calculated
|
2389
|
+
# * max_threads - number of threads
|
2390
|
+
# * picture_width - width of the resulting image
|
2391
|
+
# * picture_height - height of the resulting image
|
2392
|
+
# * approximative_calculation - exact or approximative calculation of gr_cpubasedvolume
|
2393
|
+
#
|
2394
|
+
def inqvolumeflags
|
2395
|
+
inquiry([:int] * 5) do |*pts|
|
2396
|
+
super(*pts)
|
2397
|
+
end
|
2398
|
+
end
|
2399
|
+
|
2400
|
+
# FIXME! (#61)
|
2401
|
+
# @!method cpubasedvolume
|
2402
|
+
|
2403
|
+
def inqvpsize
|
2404
|
+
inquiry %i[int int double] do |*pts|
|
2405
|
+
super(*pts)
|
2406
|
+
end
|
2407
|
+
end
|
2408
|
+
|
2409
|
+
def polygonmesh3d(px, py, pz, connections, colors)
|
2410
|
+
n_points = equal_length(px, py, pz)
|
2411
|
+
n_connections = colors.length
|
2412
|
+
super(n_points, px, py, pz, n_connections, int(connections), int(colors))
|
2413
|
+
end
|
2317
2414
|
end
|
2318
2415
|
|
2319
2416
|
ASF_BUNDLED = 0
|
@@ -2522,8 +2619,8 @@ module GR
|
|
2522
2619
|
PATH_CURVE4 = 0x04
|
2523
2620
|
PATH_CLOSEPOLY = 0x4f
|
2524
2621
|
|
2525
|
-
GDP_DRAW_PATH
|
2526
|
-
GDP_DRAW_LINES
|
2622
|
+
GDP_DRAW_PATH = 1
|
2623
|
+
GDP_DRAW_LINES = 2
|
2527
2624
|
GDP_DRAW_MARKERS = 3
|
2528
2625
|
|
2529
2626
|
MPL_SUPPRESS_CLEAR = 1
|
@@ -2569,7 +2666,17 @@ module GR
|
|
2569
2666
|
(UPSAMPLE_VERTICAL_LANCZOS | UPSAMPLE_HORIZONTAL_LANCZOS |
|
2570
2667
|
DOWNSAMPLE_VERTICAL_LANCZOS | DOWNSAMPLE_HORIZONTAL_LANCZOS)
|
2571
2668
|
|
2572
|
-
PROJECTION_DEFAULT
|
2669
|
+
PROJECTION_DEFAULT = 0
|
2573
2670
|
PROJECTION_ORTHOGRAPHIC = 1
|
2574
|
-
PROJECTION_PERSPECTIVE
|
2671
|
+
PROJECTION_PERSPECTIVE = 2
|
2672
|
+
|
2673
|
+
VOLUME_WITHOUT_BORDER = 0
|
2674
|
+
VOLUME_WITH_BORDER = 1
|
2675
|
+
|
2676
|
+
VOLUME_EMISSION = 0
|
2677
|
+
VOLUME_ABSORPTION = 1
|
2678
|
+
VOLUME_MIP = 2
|
2679
|
+
|
2680
|
+
TEXT_USE_WC = (1 << 0)
|
2681
|
+
TEXT_ENABLE_INLINE_MATH = (1 << 1)
|
2575
2682
|
end
|
data/lib/gr3/ffi.rb
CHANGED
@@ -91,6 +91,8 @@ module GR3
|
|
91
91
|
'double offset_x, double offset_y, double offset_z)'
|
92
92
|
try_extern 'int gr3_createsurfacemesh(int *mesh, int nx, int ny, ' \
|
93
93
|
'float *px, float *py, float *pz, int option)'
|
94
|
+
try_extern 'int gr3_createsurface3dmesh(int *mesh, int ncols, int nrows, ' \
|
95
|
+
'float *px, float *py, float *pz);'
|
94
96
|
try_extern 'void gr3_drawmesh_grlike(int mesh, int n, ' \
|
95
97
|
'const float *positions, const float *directions, const float *ups, ' \
|
96
98
|
'const float *colors, const float *scales)'
|
@@ -140,5 +142,14 @@ module GR3
|
|
140
142
|
'int algorithm, double *dmin_ptr, double *dmax_ptr)'
|
141
143
|
try_extern 'void gr3_setorthographicprojection' \
|
142
144
|
'(float left, float right, float bottom, float top, float znear, float zfar)'
|
145
|
+
try_extern 'void gr3_setsurfaceoption(int option)'
|
146
|
+
try_extern 'int gr3_getsurfaceoption(void)'
|
147
|
+
try_extern 'int gr3_getlightsources(int max_num_lights, float *positions, float *colors)'
|
148
|
+
try_extern 'int gr3_setlightsources(int num_lights, float *positions, float *colors)'
|
149
|
+
try_extern 'void gr3_setlightparameters(float ambient, float diffuse, float specular, float specular_power)'
|
150
|
+
try_extern 'void gr3_getlightparameters(float *ambient, float *diffuse, float *specular, float *specular_power)'
|
151
|
+
try_extern 'void gr3_setdefaultlightparameters()'
|
152
|
+
try_extern 'void gr3_setclipping(float xmin, float xmax, float ymin, float ymax, float zmin, float zmax)'
|
153
|
+
try_extern 'void gr3_getclipping(float *xmin, float *xmax, float *ymin, float *ymax, float *zmin, float *zmax)'
|
143
154
|
end
|
144
155
|
end
|
data/lib/gr3.rb
CHANGED
data/lib/gr_commons/fiddley.rb
CHANGED
data/lib/gr_commons/version.rb
CHANGED
data/lib/grm/ffi.rb
CHANGED
@@ -70,8 +70,5 @@ module GRM
|
|
70
70
|
try_extern 'int grm_merge_named(const grm_args_t *args, const char *identificator)'
|
71
71
|
try_extern 'int grm_plot(const grm_args_t *args)'
|
72
72
|
try_extern 'int grm_switch(unsigned int id)'
|
73
|
-
|
74
|
-
# https://github.com/sciapp/gr/blob/master/lib/grm/util.h
|
75
|
-
try_extern 'FILE *grm_get_stdout(void)'
|
76
73
|
end
|
77
74
|
end
|
data/lib/grm.rb
CHANGED
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-gr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.64.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kojix2
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: fiddle
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: histogram
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: numo-narray
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
@@ -53,83 +53,13 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: pry
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: rake
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "~>"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: 12.3.3
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - "~>"
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: 12.3.3
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: rubocop
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - ">="
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - ">="
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: simplecov
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - ">="
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '0'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - ">="
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '0'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: test-unit
|
56
|
+
name: pkg-config
|
127
57
|
requirement: !ruby/object:Gem::Requirement
|
128
58
|
requirements:
|
129
59
|
- - ">="
|
130
60
|
- !ruby/object:Gem::Version
|
131
61
|
version: '0'
|
132
|
-
type: :
|
62
|
+
type: :runtime
|
133
63
|
prerelease: false
|
134
64
|
version_requirements: !ruby/object:Gem::Requirement
|
135
65
|
requirements:
|
@@ -147,7 +77,6 @@ files:
|
|
147
77
|
- lib/gr.rb
|
148
78
|
- lib/gr/ffi.rb
|
149
79
|
- lib/gr/grbase.rb
|
150
|
-
- lib/gr/plot.rb
|
151
80
|
- lib/gr/version.rb
|
152
81
|
- lib/gr3.rb
|
153
82
|
- lib/gr3/ffi.rb
|
@@ -186,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
186
115
|
- !ruby/object:Gem::Version
|
187
116
|
version: '0'
|
188
117
|
requirements: []
|
189
|
-
rubygems_version: 3.
|
118
|
+
rubygems_version: 3.3.7
|
190
119
|
signing_key:
|
191
120
|
specification_version: 4
|
192
121
|
summary: GR for Ruby
|