Skip to content

Commit 0706e62

Browse files
authored
Merge pull request #327 from VibekeSkytt/lr_doc
Lr doc
2 parents bbeebb4 + 2841fba commit 0706e62

28 files changed

+1147
-752
lines changed

lrsplines2D/include/GoTools/lrsplines2D/BSplineUniLR.h

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
namespace Go
5252
{
5353

54-
54+
/// Univariate B-spline from which the bivariate B-splines are constructed by
55+
/// a tensor product operation
5556
class BSplineUniLR : public Streamable
5657
//==============================================================================
5758
{
@@ -66,6 +67,12 @@ class BSplineUniLR : public Streamable
6667
: count_(0)
6768
{ };
6869

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
6976
template<typename Iterator>
7077
BSplineUniLR(int pardir, int deg,
7178
Iterator kvec_start, const MeshLR* mesh)
@@ -83,6 +90,7 @@ class BSplineUniLR : public Streamable
8390
std::swap(pardir_, rhs.pardir_);
8491
}
8592

93+
/// Destructor
8694
~BSplineUniLR()
8795
{
8896
//std::cout << "Delete LRBSpline " << this << std::endl;
@@ -116,110 +124,128 @@ class BSplineUniLR : public Streamable
116124
// --- QUERY FUNCTIONS ---
117125
// -----------------------
118126

119-
// Parameter direction
127+
/// Parameter direction (1/2)
120128
int pardir() const
121129
{
122130
return pardir_;
123131
}
124132

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).
127135
const std::vector<int>& kvec() const
128136
{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).
129139
const std::vector<int>& kvec_const() const
130140
{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).
131143
std::vector<int>& kvec()
132144
{return kvec_;}
133145

134-
// Get the polynomial degree of the spline.
146+
/// Get the polynomial degree of the spline.
135147
const int degree() const
136148
{return (int)kvec().size() - 2;}
137149

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.
139151
// (The vector of the actual knot values is stored outside of the LRBSpline2D, as it
140152
// is shared among many LRBSpline2Ds).
141153
const int suppMin() const
142154
{return kvec().front();}
155+
/// Get the index to the knot that defines the end of the LRBSpline2D's support.
143156
const int suppMax() const
144157
{return kvec().back();}
145158

146-
/// Information about the parameter interval covered by this B-spline
159+
/// Information about start of the parameter interval covered by this B-spline
147160
double min() const
148161
{
149162
return mesh_->kval(pardir_, kvec_[0]);
150163
};
164+
/// Information about end of the parameter interval covered by this B-spline
151165
double max() const
152166
{
153167
return mesh_->kval(pardir_, kvec_[kvec_.size()-1]);
154168
};
155169

170+
/// Knot value corresponding to a given knot index
156171
double knotval(int kn) const
157172
{
158173
return mesh_->kval(pardir_, kn);
159174
}
160175

161-
// Count multiplicity in the ends of the B-spline
176+
/// Count multiplicity in the end of the B-spline
162177
int endmult(bool atstart) const;
163178

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.
166181
bool coversPar(int ix) const {
167182
return (ix >= suppMin() && ix < suppMax());
168183
}
169184

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
171186
bool useKnot(int ix) const {
172187
std::vector<int>::const_iterator it =
173188
std::find(kvec_.begin(), kvec_.end(), ix);
174189
return (it != kvec_.end());
175190
}
176191

192+
/// Return the Greville parameter corresponding to this function
177193
double getGrevilleParameter() const;
178194

195+
/// Check if the support of this B-spline overlaps the given interval ([pmin,pmax])
179196
bool overlaps(double pmin, double pmax) const;
180197

198+
/// Set the mesh corresponding to this B-spline
199+
/// Note! Not expected to be used externally
181200
void setMesh(const MeshLR* mesh)
182201
{
183202
mesh_ = mesh;
184203
}
185204

205+
/// Get the mesh corresponding to this B-spline
186206
const MeshLR* getMesh()
187207
{
188208
return mesh_;
189209
}
190210

211+
/// Set the parameter direction corresponding to this B-spline
212+
/// Note! Not expected to be used externally
191213
void setPardir(int pardir)
192214
{
193215
pardir_ = pardir;
194216
}
195217

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
196220
void subtractKnotIdx(int del);
197221

222+
/// Reverse parameter direction of B-spline. Called by LR B-spline surface or volume
198223
void reverseParameterDirection();
199224

200225
// -----------------
201226
// --- OPERATORS ---
202227
// -----------------
203228

204-
// Operator defining a partial ordering of LRBSpline2Ds.
229+
/// Operator defining a partial ordering of LRBSpline2Ds.
205230
int operator<(const BSplineUniLR& rhs) const;
206231

207-
// Equality operator
232+
/// Equality operator
208233
bool operator==(const BSplineUniLR& rhs) const;
209234

210235

211-
// Increase instance counter
236+
/// Increase instance counter
212237
void incrCount() const
213238
{
214239
count_++;
215240
}
216241

217-
// Decrease counter
242+
/// Decrease counter
218243
void decrCount() const
219244
{
220245
count_--;
221246
}
222247

248+
/// Return instance counter
223249
int getCount() const
224250
{
225251
return count_;

lrsplines2D/include/GoTools/lrsplines2D/BSplineUniUtils.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
namespace Go
4848
{
4949

50+
/// Utility functionality for keeping track of univariate B-splines (BSplineUniLR)
51+
/// in LR spline context.
5052
namespace BSplineUniUtils
5153
{
5254
bool identify_bsplineuni(const BSplineUniLR* bspline,

lrsplines2D/include/GoTools/lrsplines2D/Direction2D.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
namespace Go
4444
{
4545

46+
/// Specifies parameter direction of surface (along first (x) parameter: d = XFIXED; along second (y) parameter: YFIXED)
4647
enum Direction2D {XFIXED=0, YFIXED=1};
4748

4849
}; // end namespace Go

0 commit comments

Comments
 (0)