51
51
namespace Go
52
52
{
53
53
54
-
54
+ // / Univariate B-spline from which the bivariate B-splines are constructed by
55
+ // / a tensor product operation
55
56
class BSplineUniLR : public Streamable
56
57
// ==============================================================================
57
58
{
@@ -66,6 +67,12 @@ class BSplineUniLR : public Streamable
66
67
: count_(0 )
67
68
{ };
68
69
70
+ // / Constructor
71
+ // / \param pardir the direcion (1/2) of this basis in the bivariate B-spline
72
+ // / \param deg polynomial degree
73
+ // / \param kvec_start iterator to start of vector of indices to knots belonging
74
+ // / to this function
75
+ // / \param mesh the mesh where the actual knot values can be fetched given their indices
69
76
template <typename Iterator>
70
77
BSplineUniLR (int pardir, int deg,
71
78
Iterator kvec_start, const MeshLR* mesh)
@@ -83,6 +90,7 @@ class BSplineUniLR : public Streamable
83
90
std::swap (pardir_, rhs.pardir_ );
84
91
}
85
92
93
+ // / Destructor
86
94
~BSplineUniLR ()
87
95
{
88
96
// std::cout << "Delete LRBSpline " << this << std::endl;
@@ -116,110 +124,128 @@ class BSplineUniLR : public Streamable
116
124
// --- QUERY FUNCTIONS ---
117
125
// -----------------------
118
126
119
- // Parameter direction
127
+ // / Parameter direction (1/2)
120
128
int pardir () const
121
129
{
122
130
return pardir_;
123
131
}
124
132
125
- // Access the BSplineUni's knot vector in the given direction. (The knot vectors
126
- // only contain incices to an external, shared vector of knot values).
133
+ // / Access the BSplineUni's knot vector in the given direction. (The knot vectors
134
+ // / only contain incices to an external, shared vector of knot values).
127
135
const std::vector<int >& kvec () const
128
136
{return kvec_;}
137
+ // / Access the BSplineUni's knot vector in the given direction. (The knot vectors
138
+ // / only contain incices to an external, shared vector of knot values).
129
139
const std::vector<int >& kvec_const () const
130
140
{return kvec_;}
141
+ // / Return reference to the BSplineUni's knot vector in the given direction. (The knot vectors
142
+ // / only contain incices to an external, shared vector of knot values).
131
143
std::vector<int >& kvec ()
132
144
{return kvec_;}
133
145
134
- // Get the polynomial degree of the spline.
146
+ // / Get the polynomial degree of the spline.
135
147
const int degree () const
136
148
{return (int )kvec ().size () - 2 ;}
137
149
138
- // / Get the index to the knot that defines the start (end) of the LRBSpline2D's support.
150
+ // / Get the index to the knot that defines the start of the LRBSpline2D's support.
139
151
// (The vector of the actual knot values is stored outside of the LRBSpline2D, as it
140
152
// is shared among many LRBSpline2Ds).
141
153
const int suppMin () const
142
154
{return kvec ().front ();}
155
+ // / Get the index to the knot that defines the end of the LRBSpline2D's support.
143
156
const int suppMax () const
144
157
{return kvec ().back ();}
145
158
146
- // / Information about the parameter interval covered by this B-spline
159
+ // / Information about start of the parameter interval covered by this B-spline
147
160
double min () const
148
161
{
149
162
return mesh_->kval (pardir_, kvec_[0 ]);
150
163
};
164
+ // / Information about end of the parameter interval covered by this B-spline
151
165
double max () const
152
166
{
153
167
return mesh_->kval (pardir_, kvec_[kvec_.size ()-1 ]);
154
168
};
155
169
170
+ // / Knot value corresponding to a given knot index
156
171
double knotval (int kn) const
157
172
{
158
173
return mesh_->kval (pardir_, kn);
159
174
}
160
175
161
- // Count multiplicity in the ends of the B-spline
176
+ // / Count multiplicity in the end of the B-spline
162
177
int endmult (bool atstart) const ;
163
178
164
- // Query whether the parameter speficied by the knots indexed by 'ix'
165
- // is covered by the support of this BSplineUniLR.
179
+ // / Query whether the parameter speficied by the knots indexed by 'ix'
180
+ // / is covered by the support of this BSplineUniLR.
166
181
bool coversPar (int ix) const {
167
182
return (ix >= suppMin () && ix < suppMax ());
168
183
}
169
184
170
- // Check if the knot indexed by ix is used in the B-spline description
185
+ // / Check if the knot indexed by ix is used in the B-spline description
171
186
bool useKnot (int ix) const {
172
187
std::vector<int >::const_iterator it =
173
188
std::find (kvec_.begin (), kvec_.end (), ix);
174
189
return (it != kvec_.end ());
175
190
}
176
191
192
+ // / Return the Greville parameter corresponding to this function
177
193
double getGrevilleParameter () const ;
178
194
195
+ // / Check if the support of this B-spline overlaps the given interval ([pmin,pmax])
179
196
bool overlaps (double pmin, double pmax) const ;
180
197
198
+ // / Set the mesh corresponding to this B-spline
199
+ // / Note! Not expected to be used externally
181
200
void setMesh (const MeshLR* mesh)
182
201
{
183
202
mesh_ = mesh;
184
203
}
185
204
205
+ // / Get the mesh corresponding to this B-spline
186
206
const MeshLR* getMesh ()
187
207
{
188
208
return mesh_;
189
209
}
190
210
211
+ // / Set the parameter direction corresponding to this B-spline
212
+ // / Note! Not expected to be used externally
191
213
void setPardir (int pardir)
192
214
{
193
215
pardir_ = pardir;
194
216
}
195
217
218
+ // / Update knot indices. Used in the process of refining an LR B-spline surface or volume.
219
+ // / Note! Not expected to be used externally
196
220
void subtractKnotIdx (int del);
197
221
222
+ // / Reverse parameter direction of B-spline. Called by LR B-spline surface or volume
198
223
void reverseParameterDirection ();
199
224
200
225
// -----------------
201
226
// --- OPERATORS ---
202
227
// -----------------
203
228
204
- // Operator defining a partial ordering of LRBSpline2Ds.
229
+ // / Operator defining a partial ordering of LRBSpline2Ds.
205
230
int operator <(const BSplineUniLR& rhs) const ;
206
231
207
- // Equality operator
232
+ // / Equality operator
208
233
bool operator ==(const BSplineUniLR& rhs) const ;
209
234
210
235
211
- // Increase instance counter
236
+ // / Increase instance counter
212
237
void incrCount () const
213
238
{
214
239
count_++;
215
240
}
216
241
217
- // Decrease counter
242
+ // / Decrease counter
218
243
void decrCount () const
219
244
{
220
245
count_--;
221
246
}
222
247
248
+ // / Return instance counter
223
249
int getCount () const
224
250
{
225
251
return count_;
0 commit comments