21template<
short_t d,
class T>
22class gsPatchReparameterized
26 gsPatchReparameterized()
30 : m_patchRotated(patch), m_basisRotated(singlePatch)
73 gsMatrix<T> mpar(dimU * dimV, m_patchRotated.targetDim());
77 for (index_t j = 0; j < dimU; j++)
78 for (index_t i = 0; i < dimV; i++)
79 mpar.row(i + j * dimV) = m_patchRotated.patch(0).coefs().row(j + dimU * i);
89 m_patchRotated.swap(newpatch);
95 for (index_t j = 0; j < dimU; j++)
97 for (index_t i = 0; i < dimV; i++)
99 mpar.row(i + j * dimV) = m_patchRotated.patch(0).coefs().row(j + dimU * i);
100 weight_rep.row(i + j * dimV) = mb->weights().row(j + dimU * i);
111 m_patchRotated.swap(newpatch);
114 gsInfo <<
"Only gsTensorBSplineBasis<d, T> and gsTensorNurbsBasis<d, T> are implemented \n";
119 m_basisRotated.basis(0).reverse();
131 void rotateParamAntiClock(){
163 gsMatrix<T> mpar(dimU * dimV, m_patchRotated.targetDim());
167 for (index_t j = 0; j < dimU; j++)
168 for (index_t i = 0; i < dimV; i++)
169 mpar.row(i + j * dimV) = m_patchRotated.patch(0).coefs().row((dimU - 1 - j) + dimU * i);
172 temp_L.knots(0).reverse();
179 m_patchRotated.swap(newpatch);
185 for (index_t j = (dimU - 1 ) ; j >= 0; j--)
187 for (index_t i = 0; i < dimV; i++)
189 mpar.row(i + j * dimV) = m_patchRotated.patch(0).coefs().row((dimU - 1 - j) + dimU * i);
190 weight_rep.row(i + j * dimV) = mb->weights().row((dimU - 1 - j) + dimU * i);
195 temp_L.knots(0).reverse();
202 m_patchRotated.swap(newpatch);
205 gsInfo <<
"Only gsTensorBSplineBasis<d, T> and gsTensorNurbsBasis<d, T> are implemented \n";
211 m_basisRotated.basis(0).reverse();
214 if (getOrient() == 0)
234 void rotateParamClock()
249 gsMatrix<T> mpar(dimU * dimV, m_patchRotated.targetDim());
253 for (index_t j = (dimU - 1 ) ; j >= 0; j--)
254 for (index_t i = 0; i < dimV; i++)
255 mpar.row(i + (dimU - j - 1) * dimV) = m_patchRotated.patch(0).coefs().row((dimV * dimU -1 - j) - dimU * i);
259 temp_L.knots(1).reverse();
266 m_patchRotated.swap(newpatch);
272 for (index_t j = (dimU - 1 ) ; j >= 0; j--)
274 for (index_t i = 0; i < dimV; i++)
276 mpar.row(i + (dimU - j - 1) * dimV) = m_patchRotated.patch(0).coefs().row((dimV * dimU -1 - j) - dimU * i);
277 weight_rep.row(i + (dimU - j - 1) * dimV) = mb->weights().row((dimV * dimU -1 - j) - dimU * i);
282 temp_L.knots(1).reverse();
289 m_patchRotated.swap(newpatch);
292 gsInfo <<
"Only gsTensorBSplineBasis<d, T> and gsTensorNurbsBasis<d, T> are implemented \n";
297 m_basisRotated.basis(0).reverse();
300 if (getOrient() == 0)
320 void rotateParamAntiClockTwice()
351 gsMatrix<T> mpar(dimU * dimV, m_patchRotated.targetDim());
355 for (index_t i = 0; i < ( dimU * dimV ); i++)
356 mpar.row(i) = m_patchRotated.patch(0).coefs().row((dimU * dimV - 1) - i);
359 temp_L.knots(0).reverse();
360 temp_L.knots(1).reverse();
367 m_patchRotated.swap(newpatch);
373 for (index_t i = 0; i < ( dimU * dimV ); i++)
375 mpar.row(i) = m_patchRotated.patch(0).coefs().row((dimU * dimV - 1) - i);
376 weight_rep.row(i) = mb->weights().row((dimU * dimV - 1) - i);
380 temp_L.knots(0).reverse();
381 temp_L.knots(1).reverse();
388 m_patchRotated.swap(newpatch);
391 gsInfo <<
"Only gsTensorBSplineBasis<d, T> and gsTensorNurbsBasis<d, T> are implemented \n";
395 if (getOrient() == 0)
421 rotateBasisAntiClockTwice(g1Basis);
425 rotateBasisAntiClock(g1Basis);
429 rotateBasisClock(g1Basis);
439 swapBasisAxis(g1Basis);
446 for(
size_t np = 0; np < g1Basis.
nPatches(); np++)
459 for (index_t i = 0; i < (dimU * dimV); i++)
461 mpar.row(i) = g1Basis.
patch(np).coefs().row((dimU * dimV - 1) - i);
468 g1Basis.
swap(newpatch);
474 for(
size_t np = 0; np < g1Basis.
nPatches(); np++)
488 for (index_t j = 0; j < dimU; j++)
490 for (index_t i = 0; i < dimV; i++)
492 mpar.row(i + j * dimV) = g1Basis.
patch(np).coefs().row((dimU - 1 - j) + dimU * i);
501 g1Basis.
swap(newpatch);
507 for(
size_t np = 0; np < g1Basis.
nPatches(); np++)
520 for (index_t j = (dimU - 1); j >= 0; j--)
522 for (index_t i = 0; i < dimV; i++)
524 mpar.row(i + (dimU - j - 1) * dimV) =
525 g1Basis.
patch(np).coefs().row((dimV * dimU - 1 - j) - dimU * i);
534 g1Basis.
swap(newpatch);
540 for(
size_t np = 0; np < g1Basis.
nPatches(); np++)
552 for (index_t j = 0; j < dimU; j++)
554 for (index_t i = 0; i < dimV; i++)
556 mpar.row(i + j * dimV) = g1Basis.
patch(np).coefs().row(j + dimU * i);
565 g1Basis.
swap(newpatch);
571 return axisOrientation;
580 void setNumberOfRotation(index_t numRot)
582 rotationNum = numRot;
590 gsGeometry<T> & getPatchRotated() {
return m_patchRotated.patch(0); }
593 index_t getMapIndex(index_t glSide)
const {
return mapIndex[glSide-1]; }
607 bool axisOrientation;
A univariate B-spline basis.
Definition gsBSplineBasis.h:700
A basis represents a family of scalar basis functions defined over a common parameter domain.
Definition gsBasis.h:79
virtual const gsBasis< T > & component(short_t i) const
For a tensor product basis, return the (const) 1-d basis for the i-th parameter component.
Definition gsBasis.hpp:563
const gsBasis< T > & basis(const index_t k) const
Helper which casts and returns the k-th piece of this function set as a gsBasis.
Definition gsFunctionSet.hpp:33
Abstract base class representing a geometry map.
Definition gsGeometry.h:93
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
Holds a set of patch-wise bases and their topology information.
Definition gsMultiBasis.h:37
Container class for a set of geometry patches and their topology, that is, the interface connections ...
Definition gsMultiPatch.h:100
gsGeometry< T > & patch(size_t i) const
Return the i-th patch.
Definition gsMultiPatch.h:292
index_t addPatch(typename gsGeometry< T >::uPtr g)
Add a patch from a gsGeometry<T>::uPtr.
Definition gsMultiPatch.hpp:211
void swap(gsMultiPatch &other)
Swap with another gsMultiPatch.
Definition gsMultiPatch.h:236
size_t nPatches() const
Number of patches.
Definition gsMultiPatch.h:274
const KnotVectorType & knots(int i=0) const
Returns the knot vector of the basis.
Definition gsBSplineBasis.h:371
A tensor product B-spline basis.
Definition gsTensorBSplineBasis.h:37
const Basis_t & component(short_t dir) const
For a tensor product basis, return the (const) 1-d basis for the i-th parameter component.
Definition gsTensorBSplineBasis.h:202
A tensor product of d B-spline functions, with arbitrary target dimension.
Definition gsTensorBSpline.h:45
index_t size() const
Returns the number of elements in the basis.
Definition gsTensorBasis.h:108
A tensor product Non-Uniform Rational B-spline (NURBS) basis.
Definition gsTensorNurbsBasis.h:38
A tensor product Non-Uniform Rational B-spline function (NURBS) of parametric dimension d,...
Definition gsTensorNurbs.h:41
A vector with arbitrary coefficient type and fixed or dynamic size.
Definition gsVector.h:37
Main header to be included by clients using the G+Smo library.
#define index_t
Definition gsConfig.h:32
Provides declaration of Basis abstract interface. Similar to gsMultiBasis, but without topology.
#define gsInfo
Definition gsDebug.h:43
The G+Smo namespace, containing all definitions for the library.