@@ -115,29 +115,29 @@ struct FaceView{
115
115
F <: AbstractVector{Face}
116
116
} <: AbstractVector{Element}
117
117
118
- points :: P
118
+ elements :: P
119
119
faces:: F
120
120
end
121
+ function Base. getproperty (x:: FaceView , name:: Symbol )
122
+ getproperty (getfield (x, :elements ), name)
123
+ end
121
124
122
- Tables. schema (fw:: FaceView ) = Tables. schema (getfield (fw, :points ))
123
-
124
- column_names (fw:: FaceView ) = column_names (getfield (fw, :points ))
125
- column_types (fw:: FaceView ) = column_types (getfield (fw, :points ))
125
+ Tables. schema (fw:: FaceView ) = Tables. schema (getfield (fw, :elements ))
126
126
127
127
128
- Base. size (x:: FaceView ) = size (x . faces)
128
+ Base. size (x:: FaceView ) = size (getfield (x, : faces) )
129
129
130
130
Base. show (io:: IO , x:: Type{<: FaceView{Element}} ) where Element = print (io, " FaceView{" , Element, " }" )
131
131
132
132
133
133
@propagate_inbounds function Base. getindex (x:: FaceView{Element} , i) where Element
134
- Element (map (idx-> x . points [idx], x . faces[i]))
134
+ Element (map (idx-> coordinates (x) [idx], faces (x) [i]))
135
135
end
136
136
137
137
@propagate_inbounds function Base. setindex! (x:: FaceView{Element} , element:: Element , i) where Element
138
- face = x . faces[i]
138
+ face = faces (x) [i]
139
139
for (i, f) in enumerate (face) # TODO unroll!?
140
- x . points [face[i]] = element[i]
140
+ coordinates (x) [face[i]] = element[i]
141
141
end
142
142
return element
143
143
end
@@ -146,13 +146,10 @@ function connect(points::AbstractVector{P}, faces::AbstractVector{F}) where {P <
146
146
FaceView {Polytope(P, F), P, F, typeof(points), typeof(faces)} (points, faces)
147
147
end
148
148
149
-
150
-
151
149
const FaceMesh{Dim, T, Element} = Mesh{Dim, T, Element, <: FaceView{Element} }
152
150
153
- function coordinates (mesh:: FaceMesh )
154
- mesh. simplices. points
155
- end
156
- function faces (mesh:: FaceMesh )
157
- mesh. simplices. faces
158
- end
151
+ coordinates (mesh:: FaceView ) = getfield (mesh, :elements )
152
+ faces (mesh:: FaceView ) = getfield (mesh, :faces )
153
+
154
+ coordinates (mesh:: FaceMesh ) = coordinates (getfield (mesh, :simplices ))
155
+ faces (mesh:: FaceMesh ) = faces (getfield (mesh, :simplices ))
0 commit comments