2
2
3
3
Rect (p:: AbstractGeometry{N, T} ) where {N, T} = Rect {N, T} (p)
4
4
RectT {T} (p:: AbstractGeometry{N} ) where {N, T} = Rect {N, T} (p)
5
- Rect {N} (p:: AbstractGeometry{_N, T} ) where {N, _N, T} = Rect {N, T} (p)
5
+ Rect {N} (p:: AbstractGeometry{_N, T} ) where {N <: Val , _N, T} = Rect {N, T} (p)
6
6
7
7
Rect (p:: AbstractArray{<: VecTypes{N, T}} ) where {N, T} = Rect {N, T} (p)
8
8
RectT {T} (p:: AbstractArray{<: VecTypes{N}} ) where {N, T} = Rect {N, T} (p)
9
9
Rect {N} (p:: AbstractArray{<: VecTypes{_N, T}} ) where {N, _N, T} = Rect {N, T} (p)
10
10
11
- # compat: bounding boxes also defined Rect{T} constructors
12
- # This is not really compatible with Rect{N}...
13
- # How do you even deprecate this?
14
- # @deprecate Rect{T}(x::AbstractGeometry) where {T <: Number} RectT{T}(x) where {T}
15
- # @deprecate Rect{T}(x::AbstractArray) where {T <: Number} RectT{T}(x) where {T}
16
-
17
11
# Implementations
18
12
# Specialize fully typed Rect constructors
19
- Rect {N, T} (p:: AbstractGeometry ) where {N, T} = Rect {N, T} (coordinates (p))
13
+ function Rect {N, T} (geom:: AbstractGeometry ) where {N, T <: Number }
14
+ if applicable (Rect{T}, geom)
15
+ @warn " `Rect{T}(geom)` is deprecated as the final boundingbox method. Define `Rect{N, T}(geom)` instead."
16
+ return Rect {T} (geom)
17
+ else
18
+ return Rect {N, T} (coordinates (geom))
19
+ end
20
+ end
20
21
21
22
function bbox_dim_check (trg, src:: Integer )
22
23
@assert trg isa Integer " Rect{$trg , $T1 } is invalid. This may have happened due to calling Rect{$N1 }(obj) to get a bounding box."
68
69
# TODO : exact implementation that doesn't rely on coordinates
69
70
# function Rect{N, T}(a::Cylinder) where {N, T}
70
71
# return Rect{N, T}(...)
71
- # end
72
+ # end
0 commit comments