50 #include "BSplineSurfaceSelectionPlugin.hh" 57 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
67 surface->select_controlpoint(i, j);
76 emit scriptInfo(
"selectAllControlPoints(ObjectId)");
84 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
92 surface->deselect_controlpoint(i,j);
97 emit scriptInfo(
"deselectAllControlPoints(ObjectId)");
105 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
115 if(surface->controlpoint_selected(i,j))
116 surface->deselect_controlpoint(i,j);
118 surface->select_controlpoint(i,j);
127 emit scriptInfo(
"invertControlPointSelection(ObjectId)");
204 if(_ids.empty() )
return;
209 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
215 for(IdList::const_iterator it = _ids.begin(); it != _ids.end(); ++it) {
221 if(_deselect) surface->deselect_controlpoint(idx_m, idx_n);
222 else surface->select_controlpoint(idx_m, idx_n);
227 QString selection =
"selectControlPoints(ObjectId, [ " + QString::number(_ids[0]);
229 for (uint i = 1 ; i < _ids.size(); ++i) {
230 selection +=
", " + QString::number(_ids[i]);
236 emit scriptInfo(selection);
246 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
254 if(surface->controlpoint_selected(i,j))
270 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
278 for(
unsigned int i = 0; i < surface->
n_knots_m(); ++i) {
281 for(
unsigned int i = 0; i < surface->
n_knots_n(); ++i) {
290 emit scriptInfo(
"selectAllKnots(ObjectId)");
298 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
305 for(
unsigned int i = 0; i < surface->
n_knots_m(); ++i) {
308 for(
unsigned int i = 0; i < surface->
n_knots_n(); ++i) {
313 emit scriptInfo(
"deselectAllKnots(ObjectId)");
321 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
329 for(
unsigned int i = 0; i < surface->
n_knots_m(); ++i) {
335 for(
unsigned int i = 0; i < surface->
n_knots_n(); ++i) {
347 emit scriptInfo(
"invertKnotSelection(ObjectId)");
417 if(_ids_u.empty())
return;
422 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
428 for(IdList::const_iterator it = _ids_u.begin(); it != _ids_u.end(); ++it) {
434 for(IdList::const_iterator it = _ids_v.begin(); it != _ids_v.end(); ++it) {
442 QString selection =
"selectKnots(ObjectId, [ " + QString::number(_ids_u[0]);
444 for (uint i = 1 ; i < _ids_u.size(); ++i) {
445 selection +=
", " + QString::number(_ids_u[i]);
450 for (uint i = 0 ; i < _ids_v.size(); ++i) {
451 selection +=
", " + QString::number(_ids_v[i]);
457 emit scriptInfo(selection);
467 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
473 for(
unsigned int i = 0; i < surface->
n_knots_m(); ++i) {
475 list.push_back((
int)i);
489 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
495 for(
unsigned int i = 0; i < surface->
n_knots_n(); ++i) {
497 list.push_back((
int)i);
unsigned int n_knots_m()
Returns the number of knots in m direction.
IdList getKnotSelectionU(int _objectId)
Get current knot selection.
void invertKnotSelection(int _objectId)
Invert knot selection.
bool getObject(int _identifier, BSplineCurveObject *&_object)
BSplineSurfaceObject * bsplineSurfaceObject(BaseObjectData *_object)
Cast an BaseObject to a BSplineSurfaceObject if possible.
void selectAllKnots(int _objectId)
Select all knots of a curve.
void invertControlPointSelection(int _objectId)
Invert control point selection.
unsigned int n_control_points_m() const
Returns the number of controlpoints in m direction.
void deleteSelectedKnotsV(int _objectId)
Select all control points of a curve.
Knotvector * get_knotvector_n_ref()
Get a reference to the knotvector in n direction.
IdList getKnotSelectionV(int _objectId)
Select all control points of a curve.
void selectKnots(int _objectId, const IdList &_ids_u, const IdList &_ids_v, bool _deselect=false)
Select specific knots of a curve.
std::vector< int > IdList
Standard Type for id Lists used for scripting.
unsigned int n_control_points_n() const
Returns the number of controlpoints in n direction.
void selectControlPoints(int _objectId, const IdList &_ids, bool _deselect=false)
Delete selected control points.
void deselectAllControlPoints(int _objectId)
Deselect all control points of a curve.
BSplineSurface * splineSurface(BaseObjectData *_object)
Get a Bspline Surface from an object.
ACG::SceneGraph::BSplineSurfaceNodeT< BSplineSurface > * splineSurfaceNode()
Return pointer to the bspline surface node.
Knotvector * get_knotvector_m_ref()
Get a reference to the knotvector in m direction.
IdList getControlPointSelection(int _objectId)
Get current control point selection.
void deleteSelectedKnotsU(int _objectId)
Delete selected knots.
void selectAllControlPoints(int _objectId)
Select all control points of a curve.
unsigned int n_knots_n()
Returns the number of knots in n direction.
void deselectAllKnots(int _objectId)
Deselect all knots of a curve.