44 #include "BSplineSurfaceSelectionPlugin.hh" 51 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
61 surface->select_controlpoint(i, j);
70 emit scriptInfo(
"selectAllControlPoints(ObjectId)");
78 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
86 surface->deselect_controlpoint(i,j);
91 emit scriptInfo(
"deselectAllControlPoints(ObjectId)");
99 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
109 if(surface->controlpoint_selected(i,j))
110 surface->deselect_controlpoint(i,j);
112 surface->select_controlpoint(i,j);
121 emit scriptInfo(
"invertControlPointSelection(ObjectId)");
198 if(_ids.empty() )
return;
203 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
209 for(IdList::const_iterator it = _ids.begin(); it != _ids.end(); ++it) {
215 if(_deselect) surface->deselect_controlpoint(idx_m, idx_n);
216 else surface->select_controlpoint(idx_m, idx_n);
221 QString selection =
"selectControlPoints(ObjectId, [ " + QString::number(_ids[0]);
223 for (uint i = 1 ; i < _ids.size(); ++i) {
224 selection +=
", " + QString::number(_ids[i]);
230 emit scriptInfo(selection);
240 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
248 if(surface->controlpoint_selected(i,j))
264 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
272 for(
unsigned int i = 0; i < surface->
n_knots_m(); ++i) {
275 for(
unsigned int i = 0; i < surface->
n_knots_n(); ++i) {
284 emit scriptInfo(
"selectAllKnots(ObjectId)");
292 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
299 for(
unsigned int i = 0; i < surface->
n_knots_m(); ++i) {
302 for(
unsigned int i = 0; i < surface->
n_knots_n(); ++i) {
307 emit scriptInfo(
"deselectAllKnots(ObjectId)");
315 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
323 for(
unsigned int i = 0; i < surface->
n_knots_m(); ++i) {
329 for(
unsigned int i = 0; i < surface->
n_knots_n(); ++i) {
341 emit scriptInfo(
"invertKnotSelection(ObjectId)");
411 if(_ids_u.empty())
return;
416 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
422 for(IdList::const_iterator it = _ids_u.begin(); it != _ids_u.end(); ++it) {
428 for(IdList::const_iterator it = _ids_v.begin(); it != _ids_v.end(); ++it) {
436 QString selection =
"selectKnots(ObjectId, [ " + QString::number(_ids_u[0]);
438 for (uint i = 1 ; i < _ids_u.size(); ++i) {
439 selection +=
", " + QString::number(_ids_u[i]);
444 for (uint i = 0 ; i < _ids_v.size(); ++i) {
445 selection +=
", " + QString::number(_ids_v[i]);
451 emit scriptInfo(selection);
461 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
467 for(
unsigned int i = 0; i < surface->
n_knots_m(); ++i) {
469 list.push_back((
int)i);
483 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
489 for(
unsigned int i = 0; i < surface->
n_knots_n(); ++i) {
491 list.push_back((
int)i);
BSplineSurfaceObject * bsplineSurfaceObject(BaseObjectData *_object)
Cast an BaseObject to a BSplineSurfaceObject if possible.
BSplineSurface * splineSurface(BaseObjectData *_object)
Get a Bspline Surface from an object.
void selectControlPoints(int _objectId, const IdList &_ids, bool _deselect=false)
Delete selected control points.
void deleteSelectedKnotsU(int _objectId)
Delete selected knots.
Knotvector * get_knotvector_m_ref()
Get a reference to the knotvector in m direction.
IdList getKnotSelectionU(int _objectId)
Get current knot selection.
unsigned int n_control_points_n() const
Returns the number of controlpoints in n direction.
bool getObject(const int _identifier, BaseObject *&_object)
Get the object which has the given identifier.
void invertControlPointSelection(int _objectId)
Invert control point selection.
void selectKnots(int _objectId, const IdList &_ids_u, const IdList &_ids_v, bool _deselect=false)
Select specific knots of a curve.
unsigned int n_control_points_m() const
Returns the number of controlpoints in m direction.
ACG::SceneGraph::BSplineSurfaceNodeT< BSplineSurface > * splineSurfaceNode()
Return pointer to the bspline surface node.
Knotvector * get_knotvector_n_ref()
Get a reference to the knotvector in n direction.
void selectAllKnots(int _objectId)
Select all knots of a curve.
std::vector< int > IdList
Standard Type for id Lists used for scripting.
void deselectAllKnots(int _objectId)
Deselect all knots of a curve.
void deselectAllControlPoints(int _objectId)
Deselect all control points of a curve.
unsigned int n_knots_n()
Returns the number of knots in n direction.
void deleteSelectedKnotsV(int _objectId)
Select all control points of a curve.
void selectAllControlPoints(int _objectId)
Select all control points of a curve.
unsigned int n_knots_m()
Returns the number of knots in m direction.
void invertKnotSelection(int _objectId)
Invert knot selection.
IdList getControlPointSelection(int _objectId)
Get current control point selection.
IdList getKnotSelectionV(int _objectId)
Select all control points of a curve.