47 #ifdef ENABLE_BSPLINECURVE_SUPPORT 48 bool FileOBJPlugin::writeCurve(std::ostream& _out, QString _filename,
BSplineCurve* _curve )
50 if ( !OpenFlipper::Options::savingSettings() && saveOptions_ != 0) {
51 _out.precision(savePrecision_->value());
54 _out <<
"# " << _filename.toStdString() <<
"\n";
59 _out <<
"v " << cp[0] <<
" " << cp[1] <<
" " << cp[2] <<
"\n";
62 _out <<
"cstype bspline\n";
63 _out <<
"deg " << _curve->
degree() <<
"\n";
64 _out <<
"g " << _filename.toStdString() <<
"\n";
75 for (
unsigned int i = 0; i < _curve->
n_knots(); ++i)
85 #ifdef ENABLE_BSPLINESURFACE_SUPPORT 86 bool FileOBJPlugin::writeSurface(std::ostream& _out, QString _filename,
BSplineSurface* _surface ){
87 if ( !OpenFlipper::Options::savingSettings() && saveOptions_ != 0) {
88 _out.precision(savePrecision_->value());
91 _out <<
"# " << _filename.toStdString() <<
"\n";
97 for (
unsigned int i = 0; i < num_cp_m; ++i)
99 for (
unsigned int j = 0; j < num_cp_n; ++j)
102 _out <<
"v " << cp[0] <<
" " << cp[1] <<
" " << cp[2] <<
"\n";
106 _out <<
"cstype bspline\n";
107 _out <<
"deg " << _surface->
degree_m() <<
" " << _surface->
degree_n() <<
"\n";
108 _out <<
"g " << _filename.toStdString() <<
"\n";
115 for (
unsigned int j = 0; j < num_cp_n; ++j)
116 for (
unsigned int i = 0; i < num_cp_m; ++i)
117 _out << (i*num_cp_n) + j+1 <<
" ";
123 for (
unsigned int i = 0; i < _surface->
n_knots_m(); ++i)
129 for (
unsigned int i = 0; i < _surface->
n_knots_n(); ++i)
unsigned int n_control_points() const
Returns the number of control points.
int degree_n() const
Returns the spline degree in n direction.
unsigned int n_knots_n()
Returns the number of knots in n direction.
unsigned int degree() const
Returns the spline degree.
Scalar get_knot_n(int _i)
Get knot i in n direction.
unsigned int n_knots() const
Returns the number of knots.
Scalar get_knot_m(int _i)
Get knot i in m direction.
unsigned int n_control_points_n() const
Returns the number of controlpoints in n direction.
unsigned int n_control_points_m() const
Returns the number of controlpoints in m direction.
Point & get_control_point(int _i)
get control point i
unsigned int n_knots_m()
Returns the number of knots in m direction.
int degree_m() const
Returns the spline degree in m direction.
Scalar get_knot(int _i)
get knot i