42 #include "MeshObjectSelectionPlugin.hh" 43 #include "widgets/ParameterWidget.hh" 48 #include <QDesktopWidget> 49 #include <QColorDialog> 52 #define VERTEX_TYPE "selection_vertex.png" 53 #define EDGE_TYPE "selection_edge.png" 54 #define HEDGE_TYPE "selection_halfedge.png" 55 #define FACE_TYPE "selection_face.png" 60 #define G_CLEAR_HANDLE "Clear Handle Region" 61 #define G_CLEAR_MODEL "Clear Modeling Region" 62 #define G_CONVERT "Convert Selection" 64 #define V_SELECT_ALL "Select All Vertices" 65 #define V_CLEAR "Clear Vertex Selection" 66 #define V_INVERT "Invert Vertex Selection" 67 #define V_BOUNDARY "Select Boundary Vertices" 68 #define V_SHRINK "Shrink Vertex Selection" 69 #define V_GROW "Grow Vertex Selection" 70 #define V_DELETE "Delete selected Vertices" 71 #define V_COLORIZE "Colorize selected Vertices" 72 #define V_COPYSELECTION "Create mesh from Vertex Selection" 73 #define V_HANDLE "Set to Handle Region" 74 #define V_MODELING "Set to Modeling Region" 75 #define V_LOAD_FLIPPER "Load Flipper Selection" 77 #define E_SELECT_ALL "Select All Edges" 78 #define E_CLEAR "Clear Edge Selection" 79 #define E_INVERT "Invert Edge Selection" 80 #define E_DELETE "Delete selected Edges" 81 #define E_BOUNDARY "Select Boundary Edges" 82 #define E_COLORIZE "Colorize selected Edges" 83 #define E_COPYSELECTION "Create mesh from Edge Selection" 84 #define E_TRACE_PATH "Trace Edge Path" 87 #define HE_SELECT_ALL "Select All Halfedges" 88 #define HE_CLEAR "Clear Halfedge Selection" 89 #define HE_INVERT "Invert Halfedge Selection" 90 #define HE_BOUNDARY "Select Boundary Halfedges" 91 #define HE_COLORIZE "Colorize selected Halfedges" 93 #define F_SELECT_ALL "Select All Faces" 94 #define F_CLEAR "Clear Face Selection" 95 #define F_INVERT "Invert Face Selection" 96 #define F_DELETE "Delete selected Faces" 97 #define F_BOUNDARY "Select Boundary Faces" 98 #define F_SHRINK "Shrink Face Selection" 99 #define F_GROW "Grow Face Selection" 100 #define F_COLORIZE "Colorize selected Faces" 101 #define F_COPYSELECTION "Create mesh from Face Selection" 104 #define C_SELECTIONCOLOR "Selection Color" 105 #define C_FEATURECOLOR "Feature Color" 106 #define C_HANDLECOLOR "Handle Color" 107 #define C_AREACOLOR "Area Color" 115 allSupportedTypes_(0u),
116 conversionDialog_(0),
117 parameterWidget_(nullptr),
118 colorButtonSelection_(0),
120 colorButtonHandle_(0),
121 colorButtonFeature_(0),
122 dihedral_angle_threshold_(0.0),
133 void MeshObjectSelectionPlugin::initializePlugin() {
139 if(!OpenFlipper::Options::nogui()) {
141 QRect scr = QApplication::desktop()->screenGeometry();
149 QString(
"Vertex Selection;Edge Selection;Halfedge Selection;Face Selection;" \
150 "Feature Vertices;Feature Edges;Feature Faces;Handle Region;Modeling Region").split(
";"));
152 QString(
"Vertex Selection;Edge Selection;Halfedge Selection;Face Selection;" \
153 "Feature Vertices;Feature Edges;Feature Faces;Handle Region;Modeling Region").split(
";"));
160 void MeshObjectSelectionPlugin::pluginsInitialized() {
165 QString iconPath = OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator();
167 emit addSelectionEnvironment(
"Mesh Object Selections",
"Select mesh object primitives such as vertices, (half-)edges and faces.",
195 QStringList generalOperations;
196 generalOperations.append(G_CLEAR_HANDLE);
197 generalOperations.append(G_CLEAR_MODEL);
198 generalOperations.append(G_CONVERT);
201 QStringList vertexOperations;
202 vertexOperations.append(V_SELECT_ALL);
203 vertexOperations.append(V_CLEAR);
204 vertexOperations.append(V_INVERT);
205 vertexOperations.append(V_BOUNDARY);
206 vertexOperations.append(V_SHRINK);
207 vertexOperations.append(V_GROW);
208 vertexOperations.append(V_DELETE);
209 vertexOperations.append(V_COLORIZE);
210 vertexOperations.append(V_COPYSELECTION);
211 vertexOperations.append(V_HANDLE);
212 vertexOperations.append(V_MODELING);
213 vertexOperations.append(V_LOAD_FLIPPER);
216 QStringList edgeOperations;
217 edgeOperations.append(E_SELECT_ALL);
218 edgeOperations.append(E_CLEAR);
219 edgeOperations.append(E_INVERT);
220 edgeOperations.append(E_DELETE);
221 edgeOperations.append(E_BOUNDARY);
222 edgeOperations.append(E_COLORIZE);
223 edgeOperations.append(E_COPYSELECTION);
224 edgeOperations.append(E_TRACE_PATH);
227 QStringList hedgeOperations;
228 hedgeOperations.append(HE_SELECT_ALL);
229 hedgeOperations.append(HE_CLEAR);
230 hedgeOperations.append(HE_INVERT);
231 hedgeOperations.append(HE_BOUNDARY);
232 hedgeOperations.append(HE_COLORIZE);
235 QStringList faceOperations;
236 faceOperations.append(F_SELECT_ALL);
237 faceOperations.append(F_CLEAR);
238 faceOperations.append(F_INVERT);
239 faceOperations.append(F_DELETE);
240 faceOperations.append(F_BOUNDARY);
241 faceOperations.append(F_SHRINK);
242 faceOperations.append(F_GROW);
243 faceOperations.append(F_COLORIZE);
244 faceOperations.append(F_COPYSELECTION);
247 QStringList colorOperations;
248 colorOperations.append(C_SELECTIONCOLOR);
249 colorOperations.append(C_FEATURECOLOR);
250 colorOperations.append(C_AREACOLOR);
251 colorOperations.append(C_HANDLECOLOR);
253 emit addSelectionOperations(
environmentHandle_, generalOperations,
"Selection Operations");
258 emit addSelectionOperations(
environmentHandle_, colorOperations,
"Highlight Operations");
260 if(!OpenFlipper::Options::nogui())
266 emit registerKeyShortcut(Qt::Key_A, Qt::ControlModifier);
268 emit registerKeyShortcut(Qt::Key_C, Qt::NoModifier);
270 emit registerKeyShortcut(Qt::Key_I, Qt::NoModifier);
272 emit registerKeyShortcut(Qt::Key_Delete, Qt::NoModifier);
275 std::string statusStr =
OpenFlipperQSettings().
value(
"SelectionMeshObject/StatusColor",QString()).toString().toStdString();
276 std::string handleStr =
OpenFlipperQSettings().
value(
"SelectionMeshObject/HandleColor",QString()).toString().toStdString();
277 std::string featureStr =
OpenFlipperQSettings().
value(
"SelectionMeshObject/FeatureColor",QString()).toString().toStdString();
279 if (statusStr.empty() || handleStr.empty() || featureStr.empty() || areaStr.empty())
285 std::stringstream sstream;
287 sstream.str(statusStr);
292 sstream.str(handleStr);
297 sstream.str(featureStr);
302 sstream.str(areaStr);
311 emit setSlotDescription(
"selectVertices(int,IdList)", tr(
"Select the specified vertices"),
312 QString(
"objectId,vertexList").split(
","), QString(
"Id of object,List of vertices").split(
","));
313 emit setSlotDescription(
"unselectVertices(int,IdList)", tr(
"Unselect the specified vertices"),
314 QString(
"objectId,vertexList").split(
","), QString(
"Id of object,List of vertices").split(
","));
315 emit setSlotDescription(
"selectAllVertices(int)", tr(
"Select all vertices of an object"),
316 QStringList(
"objectId"), QStringList(
"Id of object"));
317 emit setSlotDescription(
"clearVertexSelection(int)", tr(
"Clear vertex selection of an object"),
318 QStringList(
"objectId"), QStringList(
"Id of an object"));
319 emit setSlotDescription(
"invertVertexSelection(int)", tr(
"Invert vertex selection of an object"),
320 QStringList(
"objectId"), QStringList(
"Id of an object"));
321 emit setSlotDescription(
"selectBoundaryVertices(int)", tr(
"Select all boundary vertices of an object"),
322 QStringList(
"objectId"), QStringList(
"Id of an object"));
323 emit setSlotDescription(
"selectClosestBoundaryVertices(int,int)", tr(
"Select boundary vertices closest to a specific vertex"),
324 QString(
"objectId,vertexId").split(
","), QString(
"Id of an object,Id of closest vertex").split(
","));
325 emit setSlotDescription(
"shrinkVertexSelection(int)", tr(
"Shrink vertex selection by outer selection ring"),
326 QStringList(
"objectId"), QStringList(
"Id of an object"));
327 emit setSlotDescription(
"growVertexSelection(int)", tr(
"Grow vertex selection by an-ring of selection"),
328 QStringList(
"objectId"), QStringList(
"Id of an object"));
329 emit setSlotDescription(
"deleteVertexSelection(int)", tr(
"Delete selected vertices"),
330 QStringList(
"objectId"), QStringList(
"Id of an object"));
331 emit setSlotDescription(
"createMeshFromVertexSelection(int)", tr(
"Take vertex selection and create a new mesh from it"),
332 QString(
"objectId").split(
","), QString(
"Id of an object where the selection should be used to create a new mesh").split(
","));
334 emit setSlotDescription(
"selectVerticesByValue(int,QString,bool,double)", tr(
"Select vertices based on the value of their component"),
335 QString(
"objectId,component,greater,value").split(
","),
336 QString(
"Id of an object where the selection should be used to create a new mesh,component specification: \"x\" or \"y\" or \"z\" ,true: select vertex if component greater than value; false: select if component less than value ,value to test").split(
","));
338 emit setSlotDescription(
"colorizeVertexSelection(int,int,int,int)", tr(
"Colorize the selected vertices"),
339 QString(
"objectId,r,g,b").split(
","), QString(
"Id of an object,Red,Green,Blue").split(
","));
340 emit setSlotDescription(
"selectHandleVertices(int,IdList)", tr(
"Add specified vertices to handle area"),
341 QString(
"objectId,vertexList").split(
","), QString(
"Id of an object,List of vertices").split(
","));
342 emit setSlotDescription(
"unselectHandleVertices(int,IdList)", tr(
"Remove specified vertices from handle area"),
343 QString(
"objectId,vertexList").split(
","), QString(
"Id of an object,List of vertices").split(
","));
344 emit setSlotDescription(
"clearHandleVertices(int)", tr(
"Clear handle area"),
345 QStringList(
"objectId"), QStringList(
"Id of an object"));
346 emit setSlotDescription(
"setAllHandleVertices(int)", tr(
"Add all vertices of an object to handle area"),
347 QStringList(
"objectId"), QStringList(
"Id of an object"));
348 emit setSlotDescription(
"selectModelingVertices(int,IdList)", tr(
"Add specified vertices to modeling area"),
349 QString(
"objectId,vertexList").split(
","), QString(
"Id of an object,List of vertices").split(
","));
350 emit setSlotDescription(
"unselectModelingVertices(int,IdList)", tr(
"Remove specified vertices to modeling area"),
351 QString(
"objectId,vertexList").split(
","), QString(
"Id of an object,List of vertices").split(
","));
352 emit setSlotDescription(
"clearModelingVertices(int)", tr(
"Clear modeling area"),
353 QStringList(
"objectId"), QStringList(
"Id of an object"));
354 emit setSlotDescription(
"setAllModelingVertices(int)", tr(
"Add al vertices of an object to modeling area"),
355 QStringList(
"objectId"), QStringList(
"Id of an object"));
357 emit setSlotDescription(
"loadSelection(int,QString)", tr(
"Load selection from selection file"),
358 QString(
"objectId,filename").split(
","), QString(
"Id of an object,Selection file").split(
","));
360 emit setSlotDescription(
"loadFlipperModelingSelection(int,QString)", tr(
"Load selection from Flipper selection file"),
361 QString(
"objectId,filename").split(
","), QString(
"Id of an object,Flipper selection file").split(
","));
362 emit setSlotDescription(
"saveFlipperModelingSelection(int,QString)", tr(
"Save selection into Flipper selection file"),
363 QString(
"objectId,filename").split(
","), QString(
"Id of an object,Flipper selection file").split(
","));
365 emit setSlotDescription(
"selectEdges(int,IdList)", tr(
"Select the specified edges"),
366 QString(
"objectId,edgeList").split(
","), QString(
"Id of an object,List of edges").split(
","));
367 emit setSlotDescription(
"unselectEdges(int,IdList)", tr(
"Unselect the specified edges"),
368 QString(
"objectId,edgeList").split(
","), QString(
"Id of an object,List of edges").split(
","));
369 emit setSlotDescription(
"selectAllEdges(int)", tr(
"Select all edges of an object"),
370 QStringList(
"objectId"), QStringList(
"Id of an object"));
371 emit setSlotDescription(
"invertEdgeSelection(int)", tr(
"Invert edge selection of an object"),
372 QStringList(
"objectId"), QStringList(
"Id of an object"));
373 emit setSlotDescription(
"clearEdgeSelection(int)", tr(
"Clear edge selection of an object"),
374 QStringList(
"objectId"), QStringList(
"Id of an object"));
375 emit setSlotDescription(
"selectBoundaryEdges(int)", tr(
"Select all boundary edges of an object"),
376 QStringList(
"objectId"), QStringList(
"Id of an object"));
378 emit setSlotDescription(
"colorizeEdgeSelection(int,int,int,int)", tr(
"Colorize the selected edges"),
379 QString(
"objectId,r,g,b").split(
","), QString(
"Id of an object,Red,Green,Blue").split(
","));
380 emit setSlotDescription(
"createMeshFromEdgeSelection(int)", tr(
"Take edge selection and create a new mesh from it"),
381 QString(
"objectId").split(
","), QString(
"Id of an object where the selection should be used to create a new mesh").split(
","));
383 emit setSlotDescription(
"selectHalfedges(int,IdList)", tr(
"Select the specified halfedges"),
384 QString(
"objectId,halfedgeList").split(
","), QString(
"Id of an object,List of halfedges").split(
","));
385 emit setSlotDescription(
"unselectHalfedges(int,IdList)", tr(
"Unselect the specified halfedges"),
386 QString(
"objectId,halfedgeList").split(
","), QString(
"Id of an object,List of halfedges").split(
","));
387 emit setSlotDescription(
"selectAllHalfedges(int)", tr(
"Select all halfedges of an object"),
388 QStringList(
"objectId"), QStringList(
"Id of an object"));
389 emit setSlotDescription(
"invertHalfedgeSelection(int)", tr(
"Invert halfedge selection of an object"),
390 QStringList(
"objectId"), QStringList(
"Id of an object"));
391 emit setSlotDescription(
"clearHalfedgeSelection(int)", tr(
"Clear halfedge selection of an object"),
392 QStringList(
"objectId"), QStringList(
"Id of an object"));
393 emit setSlotDescription(
"selectBoundaryHalfedges(int)", tr(
"Select all boundary halfedges of an object"),
394 QStringList(
"objectId"), QStringList(
"Id of an object"));
396 emit setSlotDescription(
"colorizeHalfedgeSelection(int,int,int,int)", tr(
"Colorize the selected halfedges"),
397 QString(
"objectId,r,g,b").split(
","), QString(
"Id of an object,Red,Green,Blue").split(
","));
399 emit setSlotDescription(
"selectFaces(int,IdList)", tr(
"Select the specified faces"),
400 QString(
"objectId,faceList").split(
","), QString(
"Id of an object,List of faces").split(
","));
401 emit setSlotDescription(
"unselectFaces(int,IdList)", tr(
"Unselect the specified faces"),
402 QString(
"objectId,faceList").split(
","), QString(
"Id of an object,List of faces").split(
","));
403 emit setSlotDescription(
"selectAllFaces(int)", tr(
"Select all vertices of an object"),
404 QStringList(
"objectId"), QStringList(
"Id of an object"));
405 emit setSlotDescription(
"clearFaceSelection(int)", tr(
"Clear face selection of an object"),
406 QStringList(
"objectId"), QStringList(
"Id of an object"));
407 emit setSlotDescription(
"invertFaceSelection(int)", tr(
"Invert face selection of an object"),
408 QStringList(
"objectId"), QStringList(
"Id of an object"));
409 emit setSlotDescription(
"selectBoundaryFaces(int)", tr(
"Select all boundary faces of an object"),
410 QStringList(
"objectId"), QStringList(
"Id of an object"));
411 emit setSlotDescription(
"shrinkFaceSelection(int)", tr(
"Shrink face selection by outer face ring of selection"),
412 QStringList(
"objectId"), QStringList(
"Id of an object"));
413 emit setSlotDescription(
"growFaceSelection(int)", tr(
"Grow face selection by an-ring of faces around selection"),
414 QStringList(
"objectId"), QStringList(
"Id of an object"));
415 emit setSlotDescription(
"colorizeFaceSelection(int,int,int,int)", tr(
"Colorize the selected faces"),
416 QString(
"objectId,r,g,b").split(
","), QString(
"Id of an object,Red,Green,Blue").split(
","));
418 emit setSlotDescription(
"createMeshFromFaceSelection(int)", tr(
"Take face selection and create a new mesh from it"),
419 QString(
"objectId").split(
","), QString(
"Id of an object where the selection should be used to create a new mesh").split(
","));
422 QString conversionStrings = tr(
" Possible strings:\n" 423 "- Vertex/Edge/Halfedge/Face Selection\n" 424 "- Model/Handle Region\n" 425 "- Feature Vertices/Edges/Faces");
427 emit setSlotDescription(
"convertSelection(int,QString,QString,bool)", tr(
"Convert the selection on given object. Conversion must be given as strings.")+conversionStrings ,
428 QString(
"objectId,from,to,deselect").split(
","), QString(
"Id of an object,string of selection which will be converted,resulting selection or area,deselect selection after conversion").split(
","));
430 emit setSlotDescription(
"conversion(QString,QString,bool)", tr(
"Convert selection on all target Objects.")+conversionStrings,
431 QString(
"from,to,deselect").split(
","), QString(
"string of selection which will be converted,resulting selection region or feature,deselect selection after conversion").split(
","));
433 emit setSlotDescription(
"convertEdgesToVertexPairs(int,IdList)", tr(
"Convert edge ids to vertex pair ids. Returns vertex Idlist."),
434 QString(
"objectId, edgeIds").split(
","), QString(
"Id of an object, Ids of edges").split(
","));
435 emit setSlotDescription(
"convertHalfedgesToVertexPairs(int,IdList)", tr(
"Convert halfedge ids to vertex pair ids. Returns vertex Idlist."),
436 QString(
"objectId, halfedgeIds").split(
","), QString(
"Id of an object, Ids of halfedges").split(
","));
438 emit setSlotDescription(
"convertVertexPairsToHalfedges(int,IdList)", tr(
"Convert vertex pair ids to halfedge ids. Returns halfedge Idlist."),
439 QString(
"objectId, vertexIds").split(
","), QString(
"Id of an object, Ids of paired vertices").split(
","));
440 emit setSlotDescription(
"convertVertexPairsToEdges(int,IdList)", tr(
"Convert vertex pair ids to edge ids. Returns edge Idlist."),
441 QString(
"objectId, vertexIds").split(
","), QString(
"Id of an object, Ids of paired vertices").split(
","));
446 SelectionInterface::PrimitiveType type = 0u;
447 emit getActivePrimitiveType(type);
453 bool targetsOnly =
false;
454 emit targetObjectsOnly(targetsOnly);
458 if(_operation == G_CLEAR_HANDLE) {
465 }
else if(_operation == G_CLEAR_MODEL) {
472 }
else if(_operation == G_CONVERT) {
474 if(!OpenFlipper::Options::nogui())
476 }
else if(_operation == V_SELECT_ALL) {
483 }
else if(_operation == V_CLEAR) {
490 }
else if(_operation == V_INVERT) {
497 }
else if(_operation == V_BOUNDARY) {
504 }
else if(_operation == V_SHRINK) {
511 }
else if(_operation == V_GROW) {
518 }
else if(_operation == V_DELETE) {
522 if (o_it->visible()){
528 }
else if(_operation == V_COLORIZE) {
532 if (o_it->visible()) {
536 }
else if(_operation == V_COPYSELECTION) {
538 std::vector<int> objects;
541 if (o_it->visible()) {
542 objects.push_back(o_it->id());
546 for (
unsigned int i = 0 ; i < objects.size() ; ++i)
549 }
else if(_operation == V_HANDLE) {
553 if (o_it->visible()) {
559 }
else if(_operation == V_MODELING) {
563 if (o_it->visible()) {
569 }
else if(_operation == V_LOAD_FLIPPER) {
571 QString fileName = QFileDialog::getOpenFileName(0,
572 tr(
"Open Flipper Selection File"), OpenFlipper::Options::dataDirStr(),
573 tr(
"Flipper Selection Files (*.sel)"));
576 if (o_it->visible()) {
580 }
else if(_operation == E_SELECT_ALL) {
587 }
else if(_operation == E_CLEAR) {
594 }
else if(_operation == E_INVERT) {
601 }
else if(_operation == E_DELETE) {
608 }
else if(_operation == E_BOUNDARY) {
615 }
else if(_operation == E_COLORIZE) {
619 if (o_it->visible()) {
623 }
else if(_operation == E_COPYSELECTION) {
625 std::vector<int> objects;
628 if (o_it->visible()) {
629 objects.push_back(o_it->id());
633 for (
unsigned int i = 0 ; i < objects.size() ; ++i)
636 }
else if (_operation == E_TRACE_PATH) {
639 if (o_it->visible()) {
643 }
else if(_operation == HE_SELECT_ALL) {
650 }
else if(_operation == HE_CLEAR) {
657 }
else if(_operation == HE_INVERT) {
664 }
else if(_operation == HE_BOUNDARY) {
671 }
else if(_operation == HE_COLORIZE) {
675 if (o_it->visible()) {
679 }
else if(_operation == F_SELECT_ALL) {
686 }
else if(_operation == F_CLEAR) {
693 }
else if(_operation == F_INVERT) {
700 }
else if(_operation == F_DELETE) {
707 }
else if(_operation == F_BOUNDARY) {
714 }
else if(_operation == F_SHRINK) {
721 }
else if(_operation == F_GROW) {
728 }
else if(_operation == F_COLORIZE) {
732 if (o_it->visible()) {
736 }
else if(_operation == F_COPYSELECTION) {
738 std::vector<int> objects;
741 if (o_it->visible()) {
742 objects.push_back(o_it->id());
746 for (
unsigned int i = 0 ; i < objects.size() ; ++i)
748 }
else if(_operation == C_SELECTIONCOLOR) {
750 if (newColor.isValid())
767 }
else if(_operation == C_FEATURECOLOR) {
769 if (newColor.isValid())
786 }
else if(_operation == C_HANDLECOLOR) {
788 if (newColor.isValid())
805 }
else if(_operation == C_AREACOLOR) {
807 if (newColor.isValid())
829 QColor c = QColorDialog::getColor(Qt::red, 0, tr(
"Choose color"),QColorDialog::ShowAlphaChannel);
835 }
else if (_primitiveTypes &
edgeType_) {
841 }
else if (_primitiveTypes &
faceType_) {
855 if(from == to)
return;
857 bool deselect =
true;
858 if(!OpenFlipper::Options::nogui()) {
871 emit log(
LOGERR,
"Object not found in convertSelection");
875 if(_from ==
"Vertex Selection") {
876 if (_to ==
"Edge Selection") {
881 }
else if (_to ==
"Halfedge Selection") {
886 }
else if (_to ==
"Face Selection") {
891 }
else if (_to ==
"Feature Vertices") {
896 }
else if (_to ==
"Handle Region") {
898 }
else if (_to ==
"Modeling Region") {
906 }
else if (_from ==
"Edge Selection") {
907 if(_to ==
"Vertex Selection") {
912 }
else if (_to ==
"Halfedge Selection") {
917 }
else if (_to ==
"Face Selection") {
922 }
else if (_to ==
"Feature Edges") {
927 }
else if (_to ==
"Handle Region") {
930 std::vector<int> ids;
931 for(TriMesh::EdgeIter e_it = mesh->edges_begin(); e_it != mesh->edges_end(); ++e_it) {
932 if(mesh->status(*e_it).selected()) {
933 ids.push_back(mesh->to_vertex_handle(mesh->halfedge_handle(*e_it, 0)).idx());
934 ids.push_back(mesh->to_vertex_handle(mesh->halfedge_handle(*e_it, 1)).idx());
940 std::vector<int> ids;
941 for(PolyMesh::EdgeIter e_it = mesh->edges_begin(); e_it != mesh->edges_end(); ++e_it) {
942 if(mesh->status(*e_it).selected()) {
943 ids.push_back(mesh->to_vertex_handle(mesh->halfedge_handle(*e_it, 0)).idx());
944 ids.push_back(mesh->to_vertex_handle(mesh->halfedge_handle(*e_it, 1)).idx());
949 }
else if (_to ==
"Modeling Region") {
952 std::vector<int> ids;
953 for(TriMesh::EdgeIter e_it = mesh->edges_begin(); e_it != mesh->edges_end(); ++e_it) {
954 if(mesh->status(*e_it).selected()) {
955 ids.push_back(mesh->to_vertex_handle(mesh->halfedge_handle(*e_it, 0)).idx());
956 ids.push_back(mesh->to_vertex_handle(mesh->halfedge_handle(*e_it, 1)).idx());
962 std::vector<int> ids;
963 for(PolyMesh::EdgeIter e_it = mesh->edges_begin(); e_it != mesh->edges_end(); ++e_it) {
964 if(mesh->status(*e_it).selected()) {
965 ids.push_back(mesh->to_vertex_handle(mesh->halfedge_handle(*e_it, 0)).idx());
966 ids.push_back(mesh->to_vertex_handle(mesh->halfedge_handle(*e_it, 1)).idx());
976 }
else if (_from ==
"Halfedge Selection") {
977 if(_to ==
"Vertex Selection") {
982 }
else if (_to ==
"Edge Selection") {
987 }
else if (_to ==
"Face Selection") {
992 }
else if (_to ==
"Handle Region") {
995 std::vector<int> ids;
996 for(TriMesh::HalfedgeIter h_it = mesh->halfedges_begin(); h_it != mesh->halfedges_end(); ++h_it) {
997 if(mesh->status(*h_it).selected()) {
998 ids.push_back(mesh->to_vertex_handle(*h_it).idx());
999 ids.push_back(mesh->from_vertex_handle(*h_it).idx());
1005 std::vector<int> ids;
1006 for(PolyMesh::HalfedgeIter h_it = mesh->halfedges_begin(); h_it != mesh->halfedges_end(); ++h_it) {
1007 if(mesh->status(*h_it).selected()) {
1008 ids.push_back(mesh->to_vertex_handle(*h_it).idx());
1009 ids.push_back(mesh->from_vertex_handle(*h_it).idx());
1014 }
else if (_to ==
"Modeling Region") {
1017 std::vector<int> ids;
1018 for(TriMesh::HalfedgeIter h_it = mesh->halfedges_begin(); h_it != mesh->halfedges_end(); ++h_it) {
1019 if(mesh->status(*h_it).selected()) {
1020 ids.push_back(mesh->to_vertex_handle(*h_it).idx());
1021 ids.push_back(mesh->from_vertex_handle(*h_it).idx());
1027 std::vector<int> ids;
1028 for(PolyMesh::HalfedgeIter h_it = mesh->halfedges_begin(); h_it != mesh->halfedges_end(); ++h_it) {
1029 if(mesh->status(*h_it).selected()) {
1030 ids.push_back(mesh->to_vertex_handle(*h_it).idx());
1031 ids.push_back(mesh->from_vertex_handle(*h_it).idx());
1041 }
else if (_from ==
"Face Selection") {
1042 if(_to ==
"Vertex Selection") {
1047 }
else if (_to ==
"Edge Selection") {
1052 }
else if (_to ==
"Feature Faces") {
1057 }
else if (_to ==
"Halfedge Selection") {
1062 }
else if (_to ==
"Handle Region") {
1065 std::vector<int> ids;
1066 for(TriMesh::FaceIter f_it = mesh->faces_begin(); f_it != mesh->faces_end(); ++f_it) {
1067 if(mesh->status(*f_it).selected()) {
1069 ids.push_back(fv_it->idx());
1076 std::vector<int> ids;
1077 for(PolyMesh::FaceIter f_it = mesh->faces_begin(); f_it != mesh->faces_end(); ++f_it) {
1078 if(mesh->status(*f_it).selected()) {
1080 ids.push_back(fv_it->idx());
1086 }
else if (_to ==
"Modeling Region") {
1089 std::vector<int> ids;
1090 for(TriMesh::FaceIter f_it = mesh->faces_begin(); f_it != mesh->faces_end(); ++f_it) {
1091 if(mesh->status(*f_it).selected()) {
1093 ids.push_back(fv_it->idx());
1100 std::vector<int> ids;
1101 for(PolyMesh::FaceIter f_it = mesh->faces_begin(); f_it != mesh->faces_end(); ++f_it) {
1102 if(mesh->status(*f_it).selected()) {
1104 ids.push_back(fv_it->idx());
1115 }
else if (_from ==
"Feature Vertices") {
1117 if (_to ==
"Vertex Selection") {
1130 }
else if (_from ==
"Feature Edges") {
1132 if (_to ==
"Edge Selection") {
1145 }
else if (_from ==
"Feature Faces") {
1147 if (_to ==
"Face Selection") {
1160 }
else if (_from ==
"Handle Region") {
1162 if(_to ==
"Vertex Selection") {
1164 }
else if (_to ==
"Edge Selection") {
1169 }
else if (_to ==
"Halfedge Selection") {
1174 }
else if (_to ==
"Face Selection") {
1179 }
else if (_to ==
"Modeling Region") {
1187 }
else if (_from ==
"Modeling Region") {
1189 if(_to ==
"Vertex Selection") {
1191 }
else if (_to ==
"Edge Selection") {
1196 }
else if (_to ==
"Halfedge Selection") {
1201 }
else if (_to ==
"Face Selection") {
1206 }
else if (_to ==
"Handle Region") {
1235 size_t node_idx, target_idx;
1240 _event->pos(), node_idx, target_idx, &hit_point)) {
1257 if (mesh->n_vertices() && !mesh->n_faces()) {
1261 mesh->status(vh).set_selected(!mesh->status(vh).selected());
1263 if (mesh->status(vh).selected())
1264 emit scriptInfo(
"selectVertices(ObjectId(" + QString::number(object->
id()) +
") , [" + QString::number(vh.idx()) +
"])");
1266 emit scriptInfo(
"unselectVertices(ObjectId(" + QString::number(object->
id()) +
") , [" + QString::number(vh.idx()) +
"])");
1290 if(_event->type() == QEvent::MouseButtonPress) {
1297 }
else if(_event->type() == QEvent::MouseButtonDblClick) {
1317 if(_event->type() == QEvent::MouseButtonPress) {
1324 }
else if(_event->type() == QEvent::MouseButtonDblClick) {
1331 QRegion region = QRegion(p);
1348 size_t node_idx, target_idx;
1364 if ( _event->type() == QEvent::MouseButtonRelease )
1375 size_t node_idx, target_idx;
1415 size_t node_idx, target_idx;
1418 if(!OpenFlipper::Options::nogui())
1423 _event->pos(), node_idx, target_idx, &hit_point)) {
1440 _currentType, _deselect);
1458 _currentType, _deselect);
1466 emit log(
LOGERR,tr(
"floodFillSelection: Unsupported dataType"));
1477 size_t node_idx, target_idx;
1482 _event->pos(), node_idx, target_idx, &hit_point)) {
1494 object->
id(), target_idx, hit_point, _currentType);
1503 object->
id(), target_idx, hit_point, _currentType);
1512 void MeshObjectSelectionPlugin::loadSelection(
int _objId,
const QString& _filename) {
1517 if(!file.
connect(_filename,
false)) {
1518 emit log(
LOGERR, QString(
"Could not read file '%1'!").arg(_filename));
1523 loadIniFile(file, _objId);
1526 void MeshObjectSelectionPlugin::loadIniFile(
INIFile& _ini,
int _id) {
1530 emit log(
LOGERR,tr(
"Cannot find object for id ") + QString::number(_id) + tr(
" in saveFile") );
1534 std::vector<int> ids;
1535 bool invert =
false;
1537 bool updated_selection =
false;
1538 bool updated_modeling_regions =
false;
1540 QString sectionName =
object->name();
1542 if (_ini.
get_entry(ids, sectionName ,
"ModelingRegion")) {
1544 _ini.
get_entry(invert, sectionName,
"InvertModeling");
1562 updated_modeling_regions =
true;
1565 if(_ini.
get_entry(ids, sectionName,
"HandleRegion")) {
1567 _ini.
get_entry(invert, sectionName,
"InvertHandle");
1585 updated_modeling_regions =
true;
1588 if(_ini.
get_entry(ids, sectionName,
"VertexSelection")) {
1590 _ini.
get_entry(invert, sectionName,
"InvertVertexSelection");
1600 updated_selection =
true;
1603 if(_ini.
get_entry(ids, sectionName,
"EdgeSelection")) {
1605 _ini.
get_entry(invert, sectionName,
"InvertEdgeSelection");
1617 updated_selection =
true;
1620 if(_ini.
get_entry(ids, sectionName,
"FaceSelection")) {
1622 _ini.
get_entry(invert, sectionName,
"InvertFaceSelection");
1632 updated_selection =
true;
1635 if(updated_modeling_regions) {
1640 }
else if(updated_selection) {
1646 if ( updated_modeling_regions || updated_selection )
1650 void MeshObjectSelectionPlugin::saveIniFile(
INIFile& _ini,
int _id) {
1654 emit log(
LOGERR,tr(
"Cannot find object for id ") + QString::number(_id) + tr(
" in saveFile") );
1659 QString sectionName =
object->name();
1661 emit log(
LOGERR,tr(
"Cannot find object section id ") + QString::number(_id) + tr(
" in saveFile") );
1684 QString section = QString(
"MeshObjectSelection") +
"//" + o_it->name();
1689 std::vector<int> ids;
1691 _file.
get_entry(ids, section,
"VertexSelection");
1695 _file.
get_entry(ids, section,
"EdgeSelection");
1699 _file.
get_entry(ids, section,
"HalfedgeSelection");
1703 _file.
get_entry(ids, section,
"FaceSelection");
1707 _file.
get_entry(ids, section,
"HandleRegion");
1711 _file.
get_entry(ids, section,
"ModelingRegion");
1729 QString section = QString(
"MeshObjectSelection") +
"//" + o_it->name();
1748 SelectionInterface::PrimitiveType type = 0u;
1749 emit getActivePrimitiveType(type);
1756 bool targetsOnly =
false;
1757 emit targetObjectsOnly(targetsOnly);
1761 if(_key == Qt::Key_A && _modifiers == Qt::ControlModifier) {
1765 if (o_it->visible()) {
1779 }
else if (_key == Qt::Key_C && _modifiers == Qt::NoModifier) {
1783 if (o_it->visible()) {
1797 }
else if(_key == Qt::Key_I && _modifiers == Qt::NoModifier) {
1801 if (o_it->visible()) {
1815 }
else if (_key == Qt::Key_Delete && _modifiers == Qt::NoModifier) {
1819 if (o_it->visible()) {
1837 SelectionInterface::PrimitiveType type = 0u;
1838 emit getActivePrimitiveType(type);
1847 bool targetsOnly =
false;
1848 emit targetObjectsOnly(targetsOnly);
1852 if(event->modifiers() == Qt::ShiftModifier) {
1854 if (event->delta() > 0) {
1857 if (o_it->visible()) {
1871 if (o_it->visible()) {
1886 PrimitiveType _primitiveType,
1887 bool _deselection) {
1890 QList <QPair<size_t, size_t> > list;
1895 std::set<int> alreadySelectedObjects;
1897 for(
int i = 0; i < list.size(); ++i) {
1899 if(alreadySelectedObjects.count(list[i].first) != 0)
1907 for(
int j = 0; j < list.size(); ++j) {
1908 if(list[j].first == list[i].first) {
1910 elements.push_back(list[j].second);
1917 alreadySelectedObjects.insert(list[i].first);
1926 std::set<int> alreadySelectedObjects;
1928 for(
int i = 0; i < list.size(); ++i) {
1930 if(alreadySelectedObjects.count(list[i].first) != 0)
1938 for(
int j = 0; j < list.size(); ++j) {
1939 if(list[j].first == list[i].first) {
1941 elements.push_back(list[j].second);
1948 alreadySelectedObjects.insert(list[i].first);
1957 std::set<int> alreadySelectedObjects;
1959 for(
int i = 0; i < list.size(); ++i) {
1961 if(alreadySelectedObjects.count(list[i].first) != 0)
1969 for(
int j = 0; j < list.size(); ++j) {
1970 if(list[j].first == list[i].first) {
1972 elements.push_back(list[j].second);
2005 alreadySelectedObjects.insert(list[i].first);
2014 std::set<int> alreadySelectedObjects;
2016 for(
int i = 0; i < list.size(); ++i) {
2018 if(alreadySelectedObjects.count(list[i].first) != 0)
2026 for(
int j = 0; j < list.size(); ++j) {
2027 if(list[j].first == list[i].first) {
2029 elements.push_back(list[j].second);
2036 alreadySelectedObjects.insert(list[i].first);
2050 bool selected =
false;
2054 selected = plugin_->volumeSelection(m, object->
id(), state_, ®ion_, type_, deselection_);
2059 selected = plugin_->volumeSelection(m, object->
id(), state_, ®ion_, type_, deselection_);
2079 emit log(
LOGERR, tr(
"Unable to get object"));
2087 emit log(
LOGERR, tr(
"Unable to get mesh"));
2096 emit log(
LOGERR, tr(
"Unable to add empty object"));
2106 emit log(
LOGERR, tr(
"Unable to get mesh"));
2121 emit log(
LOGERR, tr(
"Unable to get mesh"));
2130 emit log(
LOGERR, tr(
"Unable to add empty object"));
2140 emit log(
LOGERR, tr(
"Unable to get mesh"));
2151 emit log(
LOGERR, tr(
"DataType not supported"));
2159 if (OpenFlipper::Options::gui())
2168 std::stringstream sstream;
2201 _widget =
new QWidget();
2202 QVBoxLayout* vLayout =
new QVBoxLayout();
2203 QHBoxLayout* hLayout =
new QHBoxLayout();
2205 hLayout->addWidget(
new QLabel(
"Select default colors for newly created objects. Does not affect already created objects."));
2206 vLayout->addLayout(hLayout);
2208 hLayout =
new QHBoxLayout();
2210 hLayout->addWidget(
new QLabel(
"Selection Color: "));
2212 vLayout->addLayout(hLayout);
2214 hLayout =
new QHBoxLayout();
2216 hLayout->addWidget(
new QLabel(
"Handle Color: "));
2218 vLayout->addLayout(hLayout);
2220 hLayout =
new QHBoxLayout();
2222 hLayout->addWidget(
new QLabel(
"Feature Color: "));
2224 vLayout->addLayout(hLayout);
2226 hLayout =
new QHBoxLayout();
2228 hLayout->addWidget(
new QLabel(
"Area Color: "));
2230 vLayout->addLayout(hLayout);
2232 hLayout =
new QHBoxLayout();
2233 QPushButton* restoreDefault =
new QPushButton();
2235 restoreDefault->setText(
"Restore Default");
2236 hLayout->addWidget(restoreDefault);
2237 hLayout->addStretch();
2238 vLayout->addLayout(hLayout);
2240 _widget->setLayout(vLayout);
2245 void MeshObjectSelectionPlugin::applyOptions()
2257 if (OpenFlipper::Options::nogui())
void invertEdgeSelection(int objectId)
Unselect all Edges.
void convertSelection(const int &_objectId, const QString &_from, const QString &_to, bool _deselect)
Convert the selection on one object.
void slotToggleSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a toggle selection.
void colorizeHalfedgeSelection(int objectId, int r, int g, int b, int a)
Colorize the edge selection.
IdList getModelingVertices(int objectId)
Get a list of all modeling vertices.
void deleteFaceSelection(int _objectId)
Delete face that are currently selected.
const UpdateType UPDATE_SELECTION_VERTICES(UpdateTypeSet(1)<< 5)
Vertex selection has changed.
void shrinkFaceSelection(int objectId)
Shrink the current face selection.
void selectAllHalfedges(int objectId)
Select all Halfedges.
void set_max_angle(const double _a)
set max angle for flood fill selection
SelectionInterface::PrimitiveType faceType_
Handle to selection environment.
void update_regions(MeshT *_mesh)
Update face selection to correspond to the vertex selection.
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.
void setAllModelingVertices(int objectId)
Set all vertices to be part of the modeling area.
void slotFloodFillSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a flood fill selection.
void slotMouseWheelEvent(QWheelEvent *event, std::string const &mode)
Wheel Event from main application.
void unselectFaces(int objectId, IdList _facesList)
Unselect given faces.
ACG::Vec4f statusColor_
Handle to selection environment.
bool scenegraphPick(ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mousePos, size_t &_nodeIdx, size_t &_targetIdx, ACG::Vec3d *_hitPointPtr=0)
Execute picking operation on scenegraph.
void selectBoundaryHalfedges(int objectId)
Select boundary edges.
pick any of the prior targets (should be implemented for all nodes)
void setFeatureColor(const ACG::Vec4f &_color)
set color for features
void invertHalfedgeSelection(int objectId)
Unselect all Halfedges.
SelectionInterface::PrimitiveType vertexType_
Primitive type handles:
QtColorChooserButton * colorButtonHandle_
Handle to selection environment.
void set_updateGL(bool _b)
should GL matrices be updated after each matrix operation
bool getPickedObject(const size_t _node_idx, BaseObjectData *&_object)
Get the picked mesh.
const UpdateType UPDATE_SELECTION(UpdateTypeSet(1)<< 4)
Selection updated.
void colorizeEdgeSelection(int objectId, int r, int g, int b, int a)
Colorize the edge selection.
void slotClosestBoundarySelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a closest boundary selection.
void clearFaceSelection(int objectId)
Unselect all faces.
~MeshObjectSelectionPlugin()
Default destructor.
void createMeshFromSelection(MeshT &_mesh, MeshT &_newMesh, PrimitiveType _primitiveType)
Create a new mesh from the selection.
PolyMeshObject * polyMeshObject(BaseObjectData *_object)
Cast an BaseObject to a PolyMeshObject if possible.
IdList convertEdgesToVertexPairs(int _id, const IdList &_edges)
Convert edge ids to vertex pairs.
bool section_exists(const QString &_section) const
Check if given section exists in the current INI file.
void conversion(const QString &_from, const QString &_to, bool _deselect)
Convert the selection on all target objects.
VectorT< float, 4 > Vec4f
ACG::Vec4f areaColor_
Handle to selection environment.
QPolygon lasso_2Dpoints_
Used for lasso selection tool.
void slotSphereSelection(QMouseEvent *_event, double _radius, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a sphere selection.
void lassoSelect(QRegion &_region, PrimitiveType _primitiveType, bool _deselection)
Lasso selection tool.
void updateColorValues()
Set descriptions for local public slots.
void clearEdgeSelection(int objectId)
Invert the current edge selection.
void unselectVertices(int objectId, IdList _vertexList)
unselect given vertices
void setValue(const QString &key, const QVariant &value)
Wrapper function which makes it possible to enable Debugging output with -DOPENFLIPPER_SETTINGS_DEBUG...
void slotKeyShortcutEvent(int _key, Qt::KeyboardModifiers _modifiers)
One of the previously registered keys has been pressed.
void slotVolumeLassoSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a volume lasso selection.
Kernel::FaceVertexIter FaceVertexIter
Circulator.
bool dataType(DataType _type) const
const QStringList TARGET_OBJECTS("target")
Iterable object range.
void colorizeVertexSelection(int _objectId, int _r, int _g, int _b, int a)
Colorize the vertex selection.
QStringList IteratorRestriction
Iterable object range.
QtColorChooserButton * colorButtonFeature_
Handle to selection environment.
void conversionRequested()
Show selection conversion dialog.
QtColorChooserButton * colorButtonSelection_
Options.
TriMeshObject * triMeshObject(BaseObjectData *_object)
Cast an BaseObject to a TriMeshObject if possible.
void setColorForSelection(const int _objectId, const PrimitiveType _primitiveType)
Set color for selection.
QVector< QPoint > volumeLassoPoints_
Used for volume lasso tool.
bool connect(const QString &name, const bool create)
Connect INIFile object with given filename.
void clearModelingVertices(int objectId)
Clear Modeling Area.
ParameterWidget * parameterWidget_
Handle to selection environment.
IdList getFaceSelection(int objectId)
Return a list of all selected faces.
Kernel::VertexHandle VertexHandle
Handle for referencing the corresponding item.
TriMesh * triMesh(BaseObjectData *_object)
Get a triangle mesh from an object.
const QStringList ALL_OBJECTS
Iterable object range.
void selectBoundaryVertices(int _objectId)
Select all boundary vertices of the given object.
double max_angle_
Handle to selection environment.
void selectAllVertices(int _objectId)
Select all Vertices.
ACG::SceneGraph::BaseNode * getRootNode()
Get the root node for data objects.
void closestBoundarySelection(MeshT *_mesh, int _vh, PrimitiveType _primitiveTypes, bool _deselection)
Select all entities that are incident to closest boundary.
void growFaceSelection(int objectId)
Grow the current face selection.
void clearHalfedgeSelection(int objectId)
Invert the current edge selection.
void selectHandleVertices(int objectId, IdList _vertexList)
Set vertices to be part of the handle area.
IdList convertHalfedgesToVertexPairs(int _id, const IdList &_halfedges)
Convert halfedge ids to vertex pairs.
void selectAllEdges(int objectId)
Select all Edges.
IdList getHalfedgeSelection(int objectId)
Return a list of all selected edges.
QtColorChooserButton * colorButtonArea_
Handle to selection environment.
void toggleMeshSelection(int _objectId, MeshT *_mesh, uint _fh, ACG::Vec3d &_hit_point, PrimitiveType _primitiveType)
Toggle mesh selection.
void unselectEdges(int objectId, IdList _edgeList)
Unselect given Edges.
SelectionInterface::PrimitiveType edgeType_
Handle to selection environment.
bool getObject(const int _identifier, BaseObject *&_object)
Get the object which has the given identifier.
Type for a MeshObject containing a triangle mesh.
void update_dihedral_angle_threshold_from_ui()
set dihedral angle threshold for edge selection
void selectModelingVertices(int objectId, IdList _vertexList)
Set vertices to be part of the modeling area.
void unselectHandleVertices(int objectId, IdList _vertexList)
Remove vertices from handle area.
void setSelectionColor(const ACG::Vec4f &_color)
set color for selection
Viewer::ViewerProperties & viewerProperties(int _id)
Get the viewer properties Use this functions to get basic viewer properties such as backgroundcolor o...
void setAllHandleVertices(int objectId)
Set all vertices to be part of the handle area.
const UpdateType UPDATE_GEOMETRY(UpdateTypeSet(1)<< 2)
Geometry updated.
std::vector< int > IdList
Standard Type for id Lists used for scripting.
void colorizeFaceSelection(int objectId, int r, int g, int b, int a)
Colorize the face selection.
void clearVertexSelection(int _objectId)
Unselect all vertices.
Functions for selection on a mesh.
IdList convertVertexPairsToHalfedges(int _id, const IdList &_vertices)
Inverse of function above.
bool scenegraphRegionPick(ACG::SceneGraph::PickTarget _pickTarget, const QRegion &_region, QList< QPair< size_t, size_t > > &_list, QVector< float > *_depths, QVector< ACG::Vec3d > *_points)
void invertVertexSelection(int _objectId)
Invert the current vertex selection.
void selectHalfedges(int objectId, IdList _vertexList)
Select given Halfedges.
ACG::Vec4f handleColor_
Handle to selection environment.
void selectBoundaryEdges(int objectId)
select boundary edges
QString environmentHandle_
Handle to selection environment.
void slotSaveSelection(INIFile &_file)
Save selection for all objects in the scene.
bool initializeOptionsWidget(QWidget *&_widget)
Initialize the Options Widget.
bool operator()(BaseNode *_node)
Traverse the scenegraph and call the selection function for all mesh nodes.
void setDefaultColorValues()
sets the default color values for selection/handle/region/feature nodes for all objects of this type ...
void deleteEdgeSelection(int _objectId)
Delete edges that are currently selected.
SelectionInterface::PrimitiveType allSupportedTypes_
Handle to selection environment.
void invertFaceSelection(int objectId)
Invert the current face selection.
bool updateGL() const
should GL matrices be updated after each matrix operation
double get_max_angle()
get max angle for flood fill selection
void componentsMeshSelection(MeshT *_mesh, int _objectId, uint _fh, ACG::Vec3d &_hit_point, PrimitiveType _primitiveType)
Connected component mesh selection.
void selectAllFaces(int objectId)
Select all faces.
void slotLassoSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a lasso selection.
void add_entry(const QString &_section, const QString &_key, const QString &_value)
Addition / modification of a string entry.
MeshObjectSelectionPlugin()
Default constructor.
IdList getHandleVertices(int objectId)
Get a list of all handle vertices.
Traverse the scenegraph and call the selection function for all mesh nodes.
QVariant value(const QString &key, const QVariant &defaultValue=QVariant()) const
DLLEXPORT ObjectIterator objectsEnd()
Return Iterator to Object End.
IdList getVertexSelection(int _objectId)
Return a list of all selected vertices.
void traverse(BaseNode *_node, Action &_action)
picks only visible front verices (may not be implemented for all nodes)
void slotSelectionOperation(QString _operation)
A specific operation is requested.
void floodFillSelection(MeshT *_mesh, int _objectId, uint _fh, double _maxAngle, PrimitiveType _primitiveTypes, bool _deselection)
Select all entities that are connected (and do not exceed the maximum dihedral angle) ...
ACG::GLState & glState()
Get the glState of the Viewer.
void updateSlotDescriptions()
Set descriptions for local public slots.
void set_dihedral_angle_threshold(const double _a)
set dihedral angle threshold for edge selection
PolyMesh * polyMesh(BaseObjectData *_object)
Get a poly mesh from an object.
void growVertexSelection(int _objectId)
Grow the current vertex selection.
picks faces (should be implemented for all nodes)
void loadFlipperModelingSelection(int _objectId, QString _filename)
Load a selection from an Flipper selection file for the given object.
void selectBoundaryFaces(int objectId)
Select all boundary faces of the given object.
const UpdateType UPDATE_TOPOLOGY(UpdateTypeSet(1)<< 3)
Topology updated.
void slotLoadSelection(const INIFile &_file)
Load selection for specific objects in the scene.
void paintSphereSelection(MeshT *_mesh, int _objectId, int _target_idx, typename MeshT::Point _hitpoint, double _radius, PrimitiveType _primitiveTypes, bool _deselection)
Use the event to paint selection with a sphere.
void clearHandleVertices(int objectId)
Clear handle Area.
virtual bool picked(uint _node_idx)
detect if the node has been picked
void deleteVertexSelection(int _objectId)
Delete vertices and faces that are currently selected.
double get_dihedral_angle_threshold()
get dihedral angle threshold for edge selection
void selectEdges(int objectId, IdList _edgeList, const double _dihedral_angle_threshold=0.0)
Select given Edges.
#define DATA_TRIANGLE_MESH
const DataType DATA_ALL(UINT_MAX)
Identifier for all available objects.
ACG::Vec4f featureColor_
Handle to selection environment.
IdList getEdgeSelection(int objectId)
Return a list of all selected edges.
void setAreaColor(const ACG::Vec4f &_color)
set color for areas
Type for a Meshobject containing a poly mesh.
picks verices (may not be implemented for all nodes)
void traceEdgePath(int objectId, double threshold)
Trace Edge Path.
void selectFaces(int objectId, IdList _facesList)
Select given faces.
void setHandleColor(const ACG::Vec4f &_color)
set color for handles
double dihedral_angle_threshold_
Handle to selection environment.
SelectionInterface::PrimitiveType halfedgeType_
Handle to selection environment.
IdList convertVertexPairsToEdges(int _id, const IdList &_vertices)
Inverse of function above.
void slotComponentsSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a connected components selection.
Class for the handling of simple configuration files.
picks only visible front edges (may not be implemented for all nodes)
void addedEmptyObject(int _id)
An empty object has been added.
void shrinkVertexSelection(int _objectId)
Shrink the current vertex selection.
ConversionDialog * conversionDialog_
Handle to selection environment.
bool get_entry(QString &_val, const QString &_section, const QString &_key) const
Access to a string entry.
void unselectModelingVertices(int objectId, IdList _vertexList)
Remove vertices from modeling area.
void selectVertices(int objectId, IdList _vertexList)
select given vertices