@@ -760,6 +760,16 @@ class GO_API SplineSurface : public ParamSurface
760760 const BsplineBasis& basis (int i) const
761761 { return (i==0 ) ? basis_u_ : basis_v_; }
762762
763+
764+ // / Query the number of control points along the specified parameter direction
765+ // / \param pardir specify whether to return the number of coefs for the first
766+ // / parameter (0) or for the second parameter (1).
767+ // / \return the number of control points along the specified parameter direction
768+ int numCoefs (int pardir) const
769+ {
770+ return (pardir == 0 ) ? basis_u_.numCoefs () : basis_v_.numCoefs ();
771+ }
772+
763773 // / Query the number of control points along the first parameter direction
764774 // / \return the number of control points along the first parameter direction
765775 int numCoefs_u () const
@@ -771,17 +781,28 @@ class GO_API SplineSurface : public ParamSurface
771781 { return basis_v_.numCoefs (); }
772782
773783 // / Query the number of elements in the SplineSurface
784+ // / \return the number of 2D elements in the surface
774785 int numElem () const
775786 {
776787 return basis_u_.numElem ()*basis_v_.numElem ();
777788 }
778789
779790 // / Query the number of elements in one parameter direction of
780791 // / the SplineSurface
792+ // / \param pardir specify whether to return the order for the first
793+ // / parameter (0) or for the second parameter (1).
781794 int numElem (int pardir) const
782795 {
783- return (pardir == 0 ) ? basis_u_.numElem () :
784- basis_v_.numElem ();
796+ return (pardir == 0 ) ? basis_u_.numElem () : basis_v_.numElem ();
797+ }
798+
799+ // / Query the order of the BsplineBasis for the specified parameter
800+ // / \param pardir specify whether to return the order for the first
801+ // / parameter (0) or for the second parameter (1).
802+ // / \return the order of the BsplineBasis for the specified parameter direction
803+ int order (int pardir) const
804+ {
805+ return (pardir == 0 ) ? basis_u_.order () : basis_v_.order ();
785806 }
786807
787808 // / Query the order of the BsplineBasis for the first parameter
@@ -909,6 +930,25 @@ class GO_API SplineSurface : public ParamSurface
909930 // / \param v2 new max. value of second parameter span
910931 virtual void setParameterDomain (double u1, double u2, double v1, double v2);
911932
933+ // / Insert a new knot in the knotvector of the given parameter direction
934+ // / \param pardir parameter direction in which to insert the knots
935+ // / (u=0, v=1)
936+ // / \param apar the parameter value at which a new knot will be inserted
937+ void insertKnot (int pardir, double apar)
938+ {
939+ (pardir == 0 ) ? insertKnot_u (apar) : insertKnot_v (apar);
940+ }
941+
942+ // / Insert new knots in the knotvector of the given parameter direction
943+ // / \param pardir parameter direction in which to insert the knots
944+ // / (u=0, v=1, w=2)
945+ // / \param new_knots a vector containing the parameter values of the
946+ // / new knots to insert.
947+ void insertKnot (int pardir, const std::vector<double >& new_knots)
948+ {
949+ (pardir == 0 ) ? insertKnot_u (new_knots) : insertKnot_v (new_knots);
950+ }
951+
912952 // / Insert a new knot in the knotvector of the first parameter
913953 // / \param apar the parameter value at which a new knot will be inserted
914954 void insertKnot_u (double apar);
@@ -927,6 +967,14 @@ class GO_API SplineSurface : public ParamSurface
927967 // / new knots to insert.
928968 void insertKnot_v (const std::vector<double >& new_knots);
929969
970+ // / Remove a knot from the knotvector of the given parameter direction.
971+ // / \param pardir the parameter direction (u=0, v=1)
972+ // / \param tpar the parameter value of the knot to be removed
973+ void removeKnot (int pardir, double tpar)
974+ {
975+ (pardir == 0 ) ? removeKnot_u (tpar) : removeKnot_v (tpar);
976+ }
977+
930978 // / Remove a knot from the knotvector of the first parameter.
931979 // / \param tpar the parameter value of the knot to be removed
932980 void removeKnot_u (double tpar);
@@ -935,6 +983,14 @@ class GO_API SplineSurface : public ParamSurface
935983 // / \param tpar the parameter value of the knot to be removed.
936984 void removeKnot_v (double tpar);
937985
986+ // / Inserts knots in the specified knot vector, such that all knots
987+ // / have multiplicity order
988+ // / \param pardir the parameter direction (u=0, v=1)
989+ void makeBernsteinKnots (int pardir)
990+ {
991+ (pardir == 0 ) ? makeBernsteinKnotsU () : makeBernsteinKnotsV ();
992+ }
993+
938994 // / Inserts knots in the u knot vector, such that all knots
939995 // / have multiplicity order
940996 void makeBernsteinKnotsU ();
@@ -946,6 +1002,15 @@ class GO_API SplineSurface : public ParamSurface
9461002 // / Ensure k-regularity of this surface in both parameter directions
9471003 void makeSurfaceKRegular ();
9481004
1005+ // / Returns the number of knot intervals in the specified knot vector.
1006+ // / \param pardir parameter direction (u=0, v=1)
1007+ // / \return the number of knot intervals in the knotvector for the
1008+ // / specified parameter direction
1009+ int numberOfPatches (int pardir) const
1010+ {
1011+ return (pardir == 0 ) ? numberOfPatches_u () : numberOfPatches_v ();
1012+ }
1013+
9491014 // / Returns the number of knot intervals in u knot vector.
9501015 // / \return the number of knot intervals in the knotvector for the first
9511016 // / parameter
0 commit comments