-
Notifications
You must be signed in to change notification settings - Fork 79
/
isparametrized.jl
65 lines (37 loc) · 1.58 KB
/
isparametrized.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# ------------------------------------------------------------------
# Licensed under the MIT License. See LICENSE in the project root.
# ------------------------------------------------------------------
"""
isparametrized(geometry)
Tells whether or not the `geometry` is parametrized,
i.e. can be called as `geometry(u₁, u₂, ..., uₙ)` with
local coordinates `(u₁, u₂, ..., uₙ) ∈ [0,1]ⁿ` where
`n` is the parametric dimension.
See also [`paramdim`](@ref).
"""
function isparametrized end
isparametrized(g::Geometry) = isparametrized(typeof(g))
isparametrized(::Type{<:Geometry}) = false
isparametrized(::Type{<:Segment}) = true
isparametrized(::Type{<:Ray}) = true
isparametrized(::Type{<:Line}) = true
isparametrized(::Type{<:Plane}) = true
isparametrized(::Type{<:BezierCurve}) = true
isparametrized(::Type{<:Box}) = true
isparametrized(::Type{<:Ball}) = true
isparametrized(::Type{<:Sphere}) = true
isparametrized(::Type{<:Ellipsoid}) = true
isparametrized(::Type{<:Disk}) = true
isparametrized(::Type{<:Circle}) = true
isparametrized(::Type{<:Cylinder}) = true
isparametrized(::Type{<:CylinderSurface}) = true
isparametrized(::Type{<:ConeSurface}) = true
isparametrized(::Type{<:FrustumSurface}) = true
isparametrized(::Type{<:ParaboloidSurface}) = true
isparametrized(::Type{<:Torus}) = true
isparametrized(::Type{<:Triangle}) = true
isparametrized(::Type{<:Quadrangle}) = true
isparametrized(::Type{<:Tetrahedron}) = true
isparametrized(::Type{<:Hexahedron}) = true
isparametrized(d::Domain) = isparametrized(typeof(d))
isparametrized(::Type{<:Domain}) = false