44 #include "VolumeMeshSelectionPlugin.hh" 54 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
63 for(OpenVolumeMesh::StatusAttrib::vstatus_iterator vst_it = status.vstatus_begin();
64 vst_it != status.vstatus_end(); ++vst_it) {
65 vst_it->set_selected(
true);
68 emit scriptInfo(
"selectAllVertices(ObjectId)");
77 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
86 for(OpenVolumeMesh::StatusAttrib::vstatus_iterator vst_it = status.vstatus_begin();
87 vst_it != status.vstatus_end(); ++vst_it) {
88 vst_it->set_selected(
false);
91 emit scriptInfo(
"deselectAllVertices(ObjectId)");
100 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
109 for(OpenVolumeMesh::StatusAttrib::vstatus_iterator vst_it = status.vstatus_begin();
110 vst_it != status.vstatus_end(); ++vst_it) {
111 vst_it->set_selected(!vst_it->selected());
114 emit scriptInfo(
"invertVertexSelection(ObjectId)");
120 if(_ids.empty())
return;
125 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
134 for(IdList::const_iterator v_it = _ids.begin(); v_it != _ids.end(); ++v_it) {
138 QString selection =
"selectVertices(ObjectId, [ " + QString::number(_ids[0]);
140 for (uint i = 1 ; i < _ids.size(); ++i) {
141 selection +=
", " + QString::number(_ids[i]);
146 emit scriptInfo(selection);
157 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
167 for(OpenVolumeMesh::StatusAttrib::vstatus_iterator vst_it = status.vstatus_begin();
168 vst_it != status.vstatus_end(); ++vst_it, ++id) {
169 if(vst_it->selected()) list.push_back(
id);
180 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
189 for(OpenVolumeMesh::StatusAttrib::vstatus_iterator vst_it = status.vstatus_begin();
190 vst_it != status.vstatus_end(); ++vst_it) {
191 if(vst_it->selected()) vst_it->set_deleted(
true);
196 emit scriptInfo(
"deleteSelectedVertices(ObjectId)");
208 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
217 for(OpenVolumeMesh::StatusAttrib::estatus_iterator est_it = status.estatus_begin();
218 est_it != status.estatus_end(); ++est_it) {
219 est_it->set_selected(
true);
222 emit scriptInfo(
"selectAllEdges(ObjectId)");
231 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
240 for(OpenVolumeMesh::StatusAttrib::estatus_iterator est_it = status.estatus_begin();
241 est_it != status.estatus_end(); ++est_it) {
242 est_it->set_selected(
false);
245 emit scriptInfo(
"deselectAllEdges(ObjectId)");
254 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
263 for(OpenVolumeMesh::StatusAttrib::estatus_iterator est_it = status.estatus_begin();
264 est_it != status.estatus_end(); ++est_it) {
265 est_it->set_selected(!est_it->selected());
268 emit scriptInfo(
"invertEdgeSelection(ObjectId)");
274 if(_ids.empty())
return;
279 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
288 for(IdList::const_iterator v_it = _ids.begin(); v_it != _ids.end(); ++v_it) {
292 QString selection =
"selectEdges(ObjectId, [ " + QString::number(_ids[0]);
294 for (uint i = 1 ; i < _ids.size(); ++i) {
295 selection +=
", " + QString::number(_ids[i]);
300 emit scriptInfo(selection);
311 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
321 for(OpenVolumeMesh::StatusAttrib::estatus_iterator est_it = status.estatus_begin();
322 est_it != status.estatus_end(); ++est_it, ++id) {
323 if(est_it->selected()) list.push_back(
id);
334 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
343 for(OpenVolumeMesh::StatusAttrib::estatus_iterator est_it = status.estatus_begin();
344 est_it != status.estatus_end(); ++est_it) {
345 if(est_it->selected()) est_it->set_deleted(
true);
350 emit scriptInfo(
"deleteSelectedEdges(ObjectId)");
362 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
371 for(OpenVolumeMesh::StatusAttrib::hestatus_iterator hest_it = status.hestatus_begin();
372 hest_it != status.hestatus_end(); ++hest_it) {
373 hest_it->set_selected(
true);
376 emit scriptInfo(
"selectAllHalfEdges(ObjectId)");
385 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
394 for(OpenVolumeMesh::StatusAttrib::hestatus_iterator hest_it = status.hestatus_begin();
395 hest_it != status.hestatus_end(); ++hest_it) {
396 hest_it->set_selected(
false);
399 emit scriptInfo(
"deselectAllHalfEdges(ObjectId)");
408 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
417 for(OpenVolumeMesh::StatusAttrib::hestatus_iterator hest_it = status.hestatus_begin();
418 hest_it != status.hestatus_end(); ++hest_it) {
419 hest_it->set_selected(!hest_it->selected());
422 emit scriptInfo(
"invertHalfEdgeSelection(ObjectId)");
428 if(_ids.empty())
return;
433 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
442 for(IdList::const_iterator v_it = _ids.begin(); v_it != _ids.end(); ++v_it) {
446 QString selection =
"selectHalfEdges(ObjectId, [ " + QString::number(_ids[0]);
448 for (uint i = 1 ; i < _ids.size(); ++i) {
449 selection +=
", " + QString::number(_ids[i]);
454 emit scriptInfo(selection);
465 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
475 for(OpenVolumeMesh::StatusAttrib::hestatus_iterator hest_it = status.hestatus_begin();
476 hest_it != status.hestatus_end(); ++hest_it, ++id) {
477 if(hest_it->selected()) list.push_back(
id);
491 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
500 for(OpenVolumeMesh::StatusAttrib::fstatus_iterator fst_it = status.fstatus_begin();
501 fst_it != status.fstatus_end(); ++fst_it) {
502 fst_it->set_selected(
true);
505 emit scriptInfo(
"selectAllFaces(ObjectId)");
514 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
523 for(OpenVolumeMesh::StatusAttrib::fstatus_iterator fst_it = status.fstatus_begin();
524 fst_it != status.fstatus_end(); ++fst_it) {
525 fst_it->set_selected(
false);
528 emit scriptInfo(
"deselectAllFaces(ObjectId)");
537 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
546 for(OpenVolumeMesh::StatusAttrib::fstatus_iterator fst_it = status.fstatus_begin();
547 fst_it != status.fstatus_end(); ++fst_it) {
548 fst_it->set_selected(!fst_it->selected());
551 emit scriptInfo(
"invertFaceSelection(ObjectId)");
557 if(_ids.empty())
return;
562 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
571 for(IdList::const_iterator v_it = _ids.begin(); v_it != _ids.end(); ++v_it) {
575 QString selection =
"selectFaces(ObjectId, [ " + QString::number(_ids[0]);
577 for (uint i = 1 ; i < _ids.size(); ++i) {
578 selection +=
", " + QString::number(_ids[i]);
583 emit scriptInfo(selection);
594 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
604 for(OpenVolumeMesh::StatusAttrib::fstatus_iterator fst_it = status.fstatus_begin();
605 fst_it != status.fstatus_end(); ++fst_it, ++id) {
606 if(fst_it->selected()) list.push_back(
id);
617 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
626 for(OpenVolumeMesh::StatusAttrib::fstatus_iterator fst_it = status.fstatus_begin();
627 fst_it != status.fstatus_end(); ++fst_it) {
628 if(fst_it->selected()) fst_it->set_deleted(
true);
633 emit scriptInfo(
"deleteSelectedFaces(ObjectId)");
645 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
654 for(OpenVolumeMesh::StatusAttrib::hfstatus_iterator hfst_it = status.hfstatus_begin();
655 hfst_it != status.hfstatus_end(); ++hfst_it) {
656 hfst_it->set_selected(
true);
659 emit scriptInfo(
"selectAllHalfFaces(ObjectId)");
668 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
677 for(OpenVolumeMesh::StatusAttrib::hfstatus_iterator hfst_it = status.hfstatus_begin();
678 hfst_it != status.hfstatus_end(); ++hfst_it) {
679 hfst_it->set_selected(
false);
682 emit scriptInfo(
"deselectAllHalfFaces(ObjectId)");
691 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
700 for(OpenVolumeMesh::StatusAttrib::hfstatus_iterator hfst_it = status.hfstatus_begin();
701 hfst_it != status.hfstatus_end(); ++hfst_it) {
702 hfst_it->set_selected(!hfst_it->selected());
705 emit scriptInfo(
"invertHalfFaceSelection(ObjectId)");
711 if(_ids.empty())
return;
716 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
725 for(IdList::const_iterator v_it = _ids.begin(); v_it != _ids.end(); ++v_it) {
729 QString selection =
"selectHalfFaces(ObjectId, [ " + QString::number(_ids[0]);
731 for (uint i = 1 ; i < _ids.size(); ++i) {
732 selection +=
", " + QString::number(_ids[i]);
737 emit scriptInfo(selection);
748 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
758 for(OpenVolumeMesh::StatusAttrib::hfstatus_iterator hfst_it = status.hfstatus_begin();
759 hfst_it != status.hfstatus_end(); ++hfst_it, ++id) {
760 if(hfst_it->selected()) list.push_back(
id);
773 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
782 for(OpenVolumeMesh::StatusAttrib::cstatus_iterator cst_it = status.cstatus_begin();
783 cst_it != status.cstatus_end(); ++cst_it) {
784 cst_it->set_selected(
true);
787 emit scriptInfo(
"selectAllCells(ObjectId)");
796 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
805 for(OpenVolumeMesh::StatusAttrib::cstatus_iterator cst_it = status.cstatus_begin();
806 cst_it != status.cstatus_end(); ++cst_it) {
807 cst_it->set_selected(
false);
810 emit scriptInfo(
"deselectAllCells(ObjectId)");
819 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
828 for(OpenVolumeMesh::StatusAttrib::cstatus_iterator cst_it = status.cstatus_begin();
829 cst_it != status.cstatus_end(); ++cst_it) {
830 cst_it->set_selected(!cst_it->selected());
833 emit scriptInfo(
"invertCellSelection(ObjectId)");
839 if(_ids.empty())
return;
844 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
853 for(IdList::const_iterator v_it = _ids.begin(); v_it != _ids.end(); ++v_it) {
857 QString selection =
"selectCells(ObjectId, [ " + QString::number(_ids[0]);
859 for (uint i = 1 ; i < _ids.size(); ++i) {
860 selection +=
", " + QString::number(_ids[i]);
865 emit scriptInfo(selection);
876 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
886 for(OpenVolumeMesh::StatusAttrib::cstatus_iterator cst_it = status.cstatus_begin();
887 cst_it != status.cstatus_end(); ++cst_it, ++id) {
888 if(cst_it->selected()) list.push_back(
id);
899 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
908 for(OpenVolumeMesh::StatusAttrib::cstatus_iterator cst_it = status.cstatus_begin();
909 cst_it != status.cstatus_end(); ++cst_it) {
910 if(cst_it->selected()) cst_it->set_deleted(
true);
915 emit scriptInfo(
"deleteSelectedCells(ObjectId)");
void selectFaces(int _objectId, const IdList &_ids, bool _deselect=false)
Select specific faces of a volume mesh.
void selectAllCells(int _objectId)
Select all cells of a volume mesh.
void selectAllHalfEdges(int _objectId)
Select all half-edges of a volume mesh.
void deselectAllEdges(int _objectId)
Deselect all edges of a volume mesh.
void selectHalfEdges(int _objectId, const IdList &_ids, bool _deselect=false)
Select specific half-edges of a volume mesh.
void selectCells(int _objectId, const IdList &_ids, bool _deselect=false)
Select specific cells of a volume mesh.
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.
void deleteSelectedEdges(int _objectId, bool _preserveManifoldness=true)
Delete selected edges from mesh.
void selectAllVertices(int _objectId)
Select all vertices of a volume mesh.
void selectEdges(int _objectId, const IdList &_ids, bool _deselect=false)
Select specific edges of a volume mesh.
bool getObject(const int _identifier, BaseObject *&_object)
Get the object which has the given identifier.
const UpdateType UPDATE_SELECTION(UpdateTypeSet(16))
Selection updated.
OpenVolumeMesh::StatusAttrib * getStatus(int _objectId)
Handle to selection environment.
IdList getCellSelection(int _objectId)
Get current cell selection.
void garbage_collection(bool _preserveManifoldness=false)
Delete all entities that have been marked as deleted.
void deleteSelectedFaces(int _objectId, bool _preserveManifoldness=true)
Delete selected faces from mesh.
IdList getHalfFaceSelection(int _objectId)
Get current half-face selection.
void deselectAllVertices(int _objectId)
Deselect all vertices of a volume mesh.
void selectHalfFaces(int _objectId, const IdList &_ids, bool _deselect=false)
Select specific half-faces of a volume mesh.
IdList getEdgeSelection(int _objectId)
Get current edge selection.
std::vector< int > IdList
Standard Type for id Lists used for scripting.
void deleteSelectedVertices(int _objectId, bool _preserveManifoldness=true)
Delete selected vertices from mesh.
void invertHalfEdgeSelection(int _objectId)
Invert half-edge selection.
void selectAllFaces(int _objectId)
Select all faces of a volume mesh.
void selectAllHalfFaces(int _objectId)
Select all half-faces of a volume mesh.
void deselectAllFaces(int _objectId)
Deselect all faces of a volume mesh.
void deselectAllCells(int _objectId)
Deselect all cells of a volume mesh.
void deleteSelectedCells(int _objectId, bool _preserveManifoldness=true)
Delete selected cells from mesh.
void invertEdgeSelection(int _objectId)
Invert edge selection.
void invertCellSelection(int _objectId)
Invert cell selection.
IdList getFaceSelection(int _objectId)
Get current face selection.
void deselectAllHalfFaces(int _objectId)
Deselect all half-faces of a volume mesh.
void selectAllEdges(int _objectId)
Select all edges of a volume mesh.
IdList getVertexSelection(int _objectId)
Get current vertex selection.
void deselectAllHalfEdges(int _objectId)
Deselect all half-edges of a volume mesh.
void selectVertices(int _objectId, const IdList &_ids, bool _deselect=false)
Select specific vertices of a volume mesh.
void invertFaceSelection(int _objectId)
Invert face selection.
void invertVertexSelection(int _objectId)
Invert vertex selection.
IdList getHalfEdgeSelection(int _objectId)
Get current half-edge selection.
void invertHalfFaceSelection(int _objectId)
Invert half-face selection.