move Volume
This commit is contained in:
parent
dd25893a70
commit
a65d41ca39
33
src/Plots.jl
33
src/Plots.jl
@ -18,14 +18,31 @@ using Base.Meta
|
||||
import Showoff
|
||||
import StatsBase
|
||||
import JSON
|
||||
import RecipePipeline: _process_userrecipe, _process_plotrecipe,
|
||||
_process_seriesrecipe, _preprocess_args,
|
||||
preprocessArgs!, is_st_supported,
|
||||
finalize_subplot!, recipe_pipeline!,
|
||||
_recipe_init!, _recipe_after_user!,
|
||||
_recipe_after_plot!, _recipe_before_series!,
|
||||
_recipe_finish!, is_st_supported, Formatted, SliceIt, FuncOrFuncs, MaybeNumber, MaybeString, DataPoint, trueOrAllTrue,
|
||||
Surface, AbstractSurface
|
||||
import RecipePipeline:
|
||||
_process_userrecipe,
|
||||
_process_plotrecipe,
|
||||
_process_seriesrecipe,
|
||||
_preprocess_args,
|
||||
preprocessArgs!,
|
||||
is_st_supported,
|
||||
finalize_subplot!,
|
||||
recipe_pipeline!,
|
||||
_recipe_init!,
|
||||
_recipe_after_user!,
|
||||
_recipe_after_plot!,
|
||||
_recipe_before_series!,
|
||||
_recipe_finish!,
|
||||
is_st_supported,
|
||||
Formatted,
|
||||
SliceIt,
|
||||
FuncOrFuncs,
|
||||
MaybeNumber,
|
||||
MaybeString,
|
||||
DataPoint,
|
||||
trueOrAllTrue,
|
||||
Surface,
|
||||
AbstractSurface,
|
||||
Volume
|
||||
|
||||
using Requires
|
||||
|
||||
|
||||
@ -669,30 +669,6 @@ end
|
||||
# # I don't want to clash with ValidatedNumerics, but this would be nice:
|
||||
# ..(a::T, b::T) = (a,b)
|
||||
|
||||
struct Volume{T}
|
||||
v::Array{T,3}
|
||||
x_extents::Tuple{T,T}
|
||||
y_extents::Tuple{T,T}
|
||||
z_extents::Tuple{T,T}
|
||||
end
|
||||
|
||||
default_extents(::Type{T}) where {T} = (zero(T), one(T))
|
||||
|
||||
function Volume(v::Array{T,3},
|
||||
x_extents = default_extents(T),
|
||||
y_extents = default_extents(T),
|
||||
z_extents = default_extents(T)) where T
|
||||
Volume(v, x_extents, y_extents, z_extents)
|
||||
end
|
||||
|
||||
Base.Array(vol::Volume) = vol.v
|
||||
for f in (:length, :size)
|
||||
@eval Base.$f(vol::Volume, args...) = $f(vol.v, args...)
|
||||
end
|
||||
Base.copy(vol::Volume{T}) where {T} = Volume{T}(copy(vol.v), vol.x_extents, vol.y_extents, vol.z_extents)
|
||||
Base.eltype(vol::Volume{T}) where {T} = T
|
||||
|
||||
# -----------------------------------------------------------------------
|
||||
|
||||
# style is :open or :closed (for now)
|
||||
struct Arrow
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user