move Volume

This commit is contained in:
Simon Christ 2020-03-15 21:48:51 +01:00
parent dd25893a70
commit a65d41ca39
2 changed files with 25 additions and 32 deletions

View File

@ -18,14 +18,31 @@ using Base.Meta
import Showoff import Showoff
import StatsBase import StatsBase
import JSON import JSON
import RecipePipeline: _process_userrecipe, _process_plotrecipe, import RecipePipeline:
_process_seriesrecipe, _preprocess_args, _process_userrecipe,
preprocessArgs!, is_st_supported, _process_plotrecipe,
finalize_subplot!, recipe_pipeline!, _process_seriesrecipe,
_recipe_init!, _recipe_after_user!, _preprocess_args,
_recipe_after_plot!, _recipe_before_series!, preprocessArgs!,
_recipe_finish!, is_st_supported, Formatted, SliceIt, FuncOrFuncs, MaybeNumber, MaybeString, DataPoint, trueOrAllTrue, is_st_supported,
Surface, AbstractSurface 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 using Requires

View File

@ -669,30 +669,6 @@ end
# # I don't want to clash with ValidatedNumerics, but this would be nice: # # I don't want to clash with ValidatedNumerics, but this would be nice:
# ..(a::T, b::T) = (a,b) # ..(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) # style is :open or :closed (for now)
struct Arrow struct Arrow