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 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
|
||||||
|
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user