From a65d41ca39df7b064d34105af77b5973f5b61799 Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Sun, 15 Mar 2020 21:48:51 +0100 Subject: [PATCH] move Volume --- src/Plots.jl | 33 +++++++++++++++++++++++++-------- src/components.jl | 24 ------------------------ 2 files changed, 25 insertions(+), 32 deletions(-) diff --git a/src/Plots.jl b/src/Plots.jl index 080707bf..27f3faad 100644 --- a/src/Plots.jl +++ b/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 diff --git a/src/components.jl b/src/components.jl index ecc81d61..6157c53a 100644 --- a/src/components.jl +++ b/src/components.jl @@ -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