53 #ifdef ENABLE_BSPLINECURVE_SUPPORT 54 bool FileOBJPlugin::writeCurve(std::ostream& _out, QString _filename,
BSplineCurve* _curve )
56 if ( !OpenFlipper::Options::savingSettings() && saveOptions_ != 0) {
57 _out.precision(savePrecision_->value());
60 _out <<
"# " << _filename.toStdString() <<
"\n";
65 _out <<
"v " << cp[0] <<
" " << cp[1] <<
" " << cp[2] <<
"\n";
68 _out <<
"cstype bspline\n";
69 _out <<
"deg " << _curve->
degree() <<
"\n";
70 _out <<
"g " << _filename.toStdString() <<
"\n";
81 for (
unsigned int i = 0; i < _curve->
n_knots(); ++i)
91 #ifdef ENABLE_BSPLINESURFACE_SUPPORT 92 bool FileOBJPlugin::writeSurface(std::ostream& _out, QString _filename,
BSplineSurface* _surface ){
93 if ( !OpenFlipper::Options::savingSettings() && saveOptions_ != 0) {
94 _out.precision(savePrecision_->value());
97 _out <<
"# " << _filename.toStdString() <<
"\n";
103 for (
unsigned int i = 0; i < num_cp_m; ++i)
105 for (
unsigned int j = 0; j < num_cp_n; ++j)
108 _out <<
"v " << cp[0] <<
" " << cp[1] <<
" " << cp[2] <<
"\n";
112 _out <<
"cstype bspline\n";
113 _out <<
"deg " << _surface->
degree_m() <<
" " << _surface->
degree_n() <<
"\n";
114 _out <<
"g " << _filename.toStdString() <<
"\n";
121 for (
unsigned int j = 0; j < num_cp_n; ++j)
122 for (
unsigned int i = 0; i < num_cp_m; ++i)
123 _out << (i*num_cp_n) + j+1 <<
" ";
129 for (
unsigned int i = 0; i < _surface->
n_knots_m(); ++i)
135 for (
unsigned int i = 0; i < _surface->
n_knots_n(); ++i)
unsigned int n_knots_m()
Returns the number of knots in m direction.
int degree_n() const
Returns the spline degree in n direction.
Scalar get_knot(int _i)
get knot i
Point & get_control_point(int _i)
get control point i
unsigned int n_control_points() const
Returns the number of control points.
unsigned int n_knots() const
Returns the number of knots.
unsigned int n_control_points_m() const
Returns the number of controlpoints in m direction.
Scalar get_knot_n(int _i)
Get knot i in n direction.
unsigned int degree() const
Returns the spline degree.
Scalar get_knot_m(int _i)
Get knot i in m direction.
int degree_m() const
Returns the spline degree in m direction.
unsigned int n_control_points_n() const
Returns the number of controlpoints in n direction.
unsigned int n_knots_n()
Returns the number of knots in n direction.