51 #include "VolumeMeshSelectionPlugin.hh" 61 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
70 for(OpenVolumeMesh::StatusAttrib::vstatus_iterator vst_it = status.vstatus_begin();
71 vst_it != status.vstatus_end(); ++vst_it) {
72 vst_it->set_selected(
true);
75 emit scriptInfo(
"selectAllVertices(ObjectId)");
84 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
93 for(OpenVolumeMesh::StatusAttrib::vstatus_iterator vst_it = status.vstatus_begin();
94 vst_it != status.vstatus_end(); ++vst_it) {
95 vst_it->set_selected(
false);
98 emit scriptInfo(
"deselectAllVertices(ObjectId)");
107 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
116 for(OpenVolumeMesh::StatusAttrib::vstatus_iterator vst_it = status.vstatus_begin();
117 vst_it != status.vstatus_end(); ++vst_it) {
118 vst_it->set_selected(!vst_it->selected());
121 emit scriptInfo(
"invertVertexSelection(ObjectId)");
127 if(_ids.empty())
return;
132 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
141 for(IdList::const_iterator v_it = _ids.begin(); v_it != _ids.end(); ++v_it) {
145 QString selection =
"selectVertices(ObjectId, [ " + QString::number(_ids[0]);
147 for (uint i = 1 ; i < _ids.size(); ++i) {
148 selection +=
", " + QString::number(_ids[i]);
153 emit scriptInfo(selection);
164 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
174 for(OpenVolumeMesh::StatusAttrib::vstatus_iterator vst_it = status.vstatus_begin();
175 vst_it != status.vstatus_end(); ++vst_it, ++id) {
176 if(vst_it->selected()) list.push_back(
id);
187 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
196 for(OpenVolumeMesh::StatusAttrib::vstatus_iterator vst_it = status.vstatus_begin();
197 vst_it != status.vstatus_end(); ++vst_it) {
198 if(vst_it->selected()) vst_it->set_deleted(
true);
203 emit scriptInfo(
"deleteSelectedVertices(ObjectId)");
215 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
224 for(OpenVolumeMesh::StatusAttrib::estatus_iterator est_it = status.estatus_begin();
225 est_it != status.estatus_end(); ++est_it) {
226 est_it->set_selected(
true);
229 emit scriptInfo(
"selectAllEdges(ObjectId)");
238 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
247 for(OpenVolumeMesh::StatusAttrib::estatus_iterator est_it = status.estatus_begin();
248 est_it != status.estatus_end(); ++est_it) {
249 est_it->set_selected(
false);
252 emit scriptInfo(
"deselectAllEdges(ObjectId)");
261 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
270 for(OpenVolumeMesh::StatusAttrib::estatus_iterator est_it = status.estatus_begin();
271 est_it != status.estatus_end(); ++est_it) {
272 est_it->set_selected(!est_it->selected());
275 emit scriptInfo(
"invertEdgeSelection(ObjectId)");
281 if(_ids.empty())
return;
286 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
295 for(IdList::const_iterator v_it = _ids.begin(); v_it != _ids.end(); ++v_it) {
299 QString selection =
"selectEdges(ObjectId, [ " + QString::number(_ids[0]);
301 for (uint i = 1 ; i < _ids.size(); ++i) {
302 selection +=
", " + QString::number(_ids[i]);
307 emit scriptInfo(selection);
318 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
328 for(OpenVolumeMesh::StatusAttrib::estatus_iterator est_it = status.estatus_begin();
329 est_it != status.estatus_end(); ++est_it, ++id) {
330 if(est_it->selected()) list.push_back(
id);
341 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
350 for(OpenVolumeMesh::StatusAttrib::estatus_iterator est_it = status.estatus_begin();
351 est_it != status.estatus_end(); ++est_it) {
352 if(est_it->selected()) est_it->set_deleted(
true);
357 emit scriptInfo(
"deleteSelectedEdges(ObjectId)");
369 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
378 for(OpenVolumeMesh::StatusAttrib::hestatus_iterator hest_it = status.hestatus_begin();
379 hest_it != status.hestatus_end(); ++hest_it) {
380 hest_it->set_selected(
true);
383 emit scriptInfo(
"selectAllHalfEdges(ObjectId)");
392 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
401 for(OpenVolumeMesh::StatusAttrib::hestatus_iterator hest_it = status.hestatus_begin();
402 hest_it != status.hestatus_end(); ++hest_it) {
403 hest_it->set_selected(
false);
406 emit scriptInfo(
"deselectAllHalfEdges(ObjectId)");
415 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
424 for(OpenVolumeMesh::StatusAttrib::hestatus_iterator hest_it = status.hestatus_begin();
425 hest_it != status.hestatus_end(); ++hest_it) {
426 hest_it->set_selected(!hest_it->selected());
429 emit scriptInfo(
"invertHalfEdgeSelection(ObjectId)");
435 if(_ids.empty())
return;
440 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
449 for(IdList::const_iterator v_it = _ids.begin(); v_it != _ids.end(); ++v_it) {
453 QString selection =
"selectHalfEdges(ObjectId, [ " + QString::number(_ids[0]);
455 for (uint i = 1 ; i < _ids.size(); ++i) {
456 selection +=
", " + QString::number(_ids[i]);
461 emit scriptInfo(selection);
472 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
482 for(OpenVolumeMesh::StatusAttrib::hestatus_iterator hest_it = status.hestatus_begin();
483 hest_it != status.hestatus_end(); ++hest_it, ++id) {
484 if(hest_it->selected()) list.push_back(
id);
498 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
507 for(OpenVolumeMesh::StatusAttrib::fstatus_iterator fst_it = status.fstatus_begin();
508 fst_it != status.fstatus_end(); ++fst_it) {
509 fst_it->set_selected(
true);
512 emit scriptInfo(
"selectAllFaces(ObjectId)");
521 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
530 for(OpenVolumeMesh::StatusAttrib::fstatus_iterator fst_it = status.fstatus_begin();
531 fst_it != status.fstatus_end(); ++fst_it) {
532 fst_it->set_selected(
false);
535 emit scriptInfo(
"deselectAllFaces(ObjectId)");
544 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
553 for(OpenVolumeMesh::StatusAttrib::fstatus_iterator fst_it = status.fstatus_begin();
554 fst_it != status.fstatus_end(); ++fst_it) {
555 fst_it->set_selected(!fst_it->selected());
558 emit scriptInfo(
"invertFaceSelection(ObjectId)");
564 if(_ids.empty())
return;
569 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
578 for(IdList::const_iterator v_it = _ids.begin(); v_it != _ids.end(); ++v_it) {
582 QString selection =
"selectFaces(ObjectId, [ " + QString::number(_ids[0]);
584 for (uint i = 1 ; i < _ids.size(); ++i) {
585 selection +=
", " + QString::number(_ids[i]);
590 emit scriptInfo(selection);
601 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
611 for(OpenVolumeMesh::StatusAttrib::fstatus_iterator fst_it = status.fstatus_begin();
612 fst_it != status.fstatus_end(); ++fst_it, ++id) {
613 if(fst_it->selected()) list.push_back(
id);
624 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
633 for(OpenVolumeMesh::StatusAttrib::fstatus_iterator fst_it = status.fstatus_begin();
634 fst_it != status.fstatus_end(); ++fst_it) {
635 if(fst_it->selected()) fst_it->set_deleted(
true);
640 emit scriptInfo(
"deleteSelectedFaces(ObjectId)");
652 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
661 for(OpenVolumeMesh::StatusAttrib::hfstatus_iterator hfst_it = status.hfstatus_begin();
662 hfst_it != status.hfstatus_end(); ++hfst_it) {
663 hfst_it->set_selected(
true);
666 emit scriptInfo(
"selectAllHalfFaces(ObjectId)");
675 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
684 for(OpenVolumeMesh::StatusAttrib::hfstatus_iterator hfst_it = status.hfstatus_begin();
685 hfst_it != status.hfstatus_end(); ++hfst_it) {
686 hfst_it->set_selected(
false);
689 emit scriptInfo(
"deselectAllHalfFaces(ObjectId)");
698 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
707 for(OpenVolumeMesh::StatusAttrib::hfstatus_iterator hfst_it = status.hfstatus_begin();
708 hfst_it != status.hfstatus_end(); ++hfst_it) {
709 hfst_it->set_selected(!hfst_it->selected());
712 emit scriptInfo(
"invertHalfFaceSelection(ObjectId)");
718 if(_ids.empty())
return;
723 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
732 for(IdList::const_iterator v_it = _ids.begin(); v_it != _ids.end(); ++v_it) {
736 QString selection =
"selectHalfFaces(ObjectId, [ " + QString::number(_ids[0]);
738 for (uint i = 1 ; i < _ids.size(); ++i) {
739 selection +=
", " + QString::number(_ids[i]);
744 emit scriptInfo(selection);
755 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
765 for(OpenVolumeMesh::StatusAttrib::hfstatus_iterator hfst_it = status.hfstatus_begin();
766 hfst_it != status.hfstatus_end(); ++hfst_it, ++id) {
767 if(hfst_it->selected()) list.push_back(
id);
780 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
789 for(OpenVolumeMesh::StatusAttrib::cstatus_iterator cst_it = status.cstatus_begin();
790 cst_it != status.cstatus_end(); ++cst_it) {
791 cst_it->set_selected(
true);
794 emit scriptInfo(
"selectAllCells(ObjectId)");
803 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
812 for(OpenVolumeMesh::StatusAttrib::cstatus_iterator cst_it = status.cstatus_begin();
813 cst_it != status.cstatus_end(); ++cst_it) {
814 cst_it->set_selected(
false);
817 emit scriptInfo(
"deselectAllCells(ObjectId)");
826 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
835 for(OpenVolumeMesh::StatusAttrib::cstatus_iterator cst_it = status.cstatus_begin();
836 cst_it != status.cstatus_end(); ++cst_it) {
837 cst_it->set_selected(!cst_it->selected());
840 emit scriptInfo(
"invertCellSelection(ObjectId)");
846 if(_ids.empty())
return;
851 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
860 for(IdList::const_iterator v_it = _ids.begin(); v_it != _ids.end(); ++v_it) {
864 QString selection =
"selectCells(ObjectId, [ " + QString::number(_ids[0]);
866 for (uint i = 1 ; i < _ids.size(); ++i) {
867 selection +=
", " + QString::number(_ids[i]);
872 emit scriptInfo(selection);
883 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
893 for(OpenVolumeMesh::StatusAttrib::cstatus_iterator cst_it = status.cstatus_begin();
894 cst_it != status.cstatus_end(); ++cst_it, ++id) {
895 if(cst_it->selected()) list.push_back(
id);
906 emit log(
LOGERR, tr(
"Could not get object with id %1").arg(_objectId));
915 for(OpenVolumeMesh::StatusAttrib::cstatus_iterator cst_it = status.cstatus_begin();
916 cst_it != status.cstatus_end(); ++cst_it) {
917 if(cst_it->selected()) cst_it->set_deleted(
true);
922 emit scriptInfo(
"deleteSelectedCells(ObjectId)");
void invertFaceSelection(int _objectId)
Invert face selection.
void invertHalfFaceSelection(int _objectId)
Invert half-face selection.
void deselectAllEdges(int _objectId)
Deselect all edges of a volume mesh.
void deleteSelectedCells(int _objectId, bool _preserveManifoldness=true)
Delete selected cells from mesh.
IdList getHalfEdgeSelection(int _objectId)
Get current half-edge selection.
bool getObject(int _identifier, BSplineCurveObject *&_object)
void deselectAllCells(int _objectId)
Deselect all cells of a volume mesh.
void garbage_collection(bool _preserveManifoldness=false)
Delete all entities that have been marked as deleted.
IdList getHalfFaceSelection(int _objectId)
Get current half-face selection.
void invertVertexSelection(int _objectId)
Invert vertex selection.
void selectCells(int _objectId, const IdList &_ids, bool _deselect=false)
Select specific cells of a volume mesh.
IdList getCellSelection(int _objectId)
Get current cell selection.
void selectAllVertices(int _objectId)
Select all vertices of a volume mesh.
void selectAllEdges(int _objectId)
Select all edges of a volume mesh.
void selectVertices(int _objectId, const IdList &_ids, bool _deselect=false)
Select specific vertices of a volume mesh.
void invertEdgeSelection(int _objectId)
Invert edge selection.
void selectAllCells(int _objectId)
Select all cells of a volume mesh.
void deselectAllVertices(int _objectId)
Deselect all vertices of a volume mesh.
void selectAllFaces(int _objectId)
Select all faces of a volume mesh.
void selectFaces(int _objectId, const IdList &_ids, bool _deselect=false)
Select specific faces of a volume mesh.
OpenVolumeMesh::StatusAttrib * getStatus(int _objectId)
Handle to selection environment.
void selectAllHalfFaces(int _objectId)
Select all half-faces of a volume mesh.
std::vector< int > IdList
Standard Type for id Lists used for scripting.
IdList getEdgeSelection(int _objectId)
Get current edge selection.
void deselectAllHalfEdges(int _objectId)
Deselect all half-edges of a volume mesh.
void selectHalfEdges(int _objectId, const IdList &_ids, bool _deselect=false)
Select specific half-edges of a volume mesh.
const UpdateType UPDATE_SELECTION(UpdateTypeSet(1)<< 4)
Selection updated.
IdList getVertexSelection(int _objectId)
Get current vertex selection.
void deleteSelectedVertices(int _objectId, bool _preserveManifoldness=true)
Delete selected vertices from mesh.
void deselectAllFaces(int _objectId)
Deselect all faces of a volume mesh.
void deleteSelectedEdges(int _objectId, bool _preserveManifoldness=true)
Delete selected edges from mesh.
void deleteSelectedFaces(int _objectId, bool _preserveManifoldness=true)
Delete selected faces from mesh.
void selectAllHalfEdges(int _objectId)
Select all half-edges of a volume mesh.
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.
void deselectAllHalfFaces(int _objectId)
Deselect all half-faces of a volume mesh.
void selectEdges(int _objectId, const IdList &_ids, bool _deselect=false)
Select specific edges of a volume mesh.
void selectHalfFaces(int _objectId, const IdList &_ids, bool _deselect=false)
Select specific half-faces of a volume mesh.
IdList getFaceSelection(int _objectId)
Get current face selection.
void invertCellSelection(int _objectId)
Invert cell selection.
void invertHalfEdgeSelection(int _objectId)
Invert half-edge selection.