50 #include "MeshObjectSelectionPlugin.hh" 55 #define VERTEX_TYPE "selection_vertex.png" 56 #define EDGE_TYPE "selection_edge.png" 57 #define HEDGE_TYPE "selection_halfedge.png" 58 #define FACE_TYPE "selection_face.png" 63 #define G_CLEAR_HANDLE "Clear Handle Region" 64 #define G_CLEAR_MODEL "Clear Modeling Region" 65 #define G_CONVERT "Convert Selection" 67 #define V_SELECT_ALL "Select All Vertices" 68 #define V_CLEAR "Clear Vertex Selection" 69 #define V_INVERT "Invert Vertex Selection" 70 #define V_BOUNDARY "Select Boundary Vertices" 71 #define V_SHRINK "Shrink Vertex Selection" 72 #define V_GROW "Grow Vertex Selection" 73 #define V_DELETE "Delete selected Vertices" 74 #define V_COLORIZE "Colorize selected Vertices" 75 #define V_COPYSELECTION "Create mesh from Vertex Selection" 76 #define V_HANDLE "Set to Handle Region" 77 #define V_MODELING "Set to Modeling Region" 78 #define V_LOAD_FLIPPER "Load Flipper Selection" 80 #define E_SELECT_ALL "Select All Edges" 81 #define E_CLEAR "Clear Edge Selection" 82 #define E_INVERT "Invert Edge Selection" 83 #define E_DELETE "Delete selected Edges" 84 #define E_BOUNDARY "Select Boundary Edges" 85 #define E_COLORIZE "Colorize selected Edges" 86 #define E_COPYSELECTION "Create mesh from Edge Selection" 87 #define E_TRACE_PATH "Trace Edge Path" 90 #define HE_SELECT_ALL "Select All Halfedges" 91 #define HE_CLEAR "Clear Halfedge Selection" 92 #define HE_INVERT "Invert Halfedge Selection" 93 #define HE_BOUNDARY "Select Boundary Halfedges" 94 #define HE_COLORIZE "Colorize selected Halfedges" 96 #define F_SELECT_ALL "Select All Faces" 97 #define F_CLEAR "Clear Face Selection" 98 #define F_INVERT "Invert Face Selection" 99 #define F_DELETE "Delete selected Faces" 100 #define F_BOUNDARY "Select Boundary Faces" 101 #define F_SHRINK "Shrink Face Selection" 102 #define F_GROW "Grow Face Selection" 103 #define F_COLORIZE "Colorize selected Faces" 104 #define F_COPYSELECTION "Create mesh from Face Selection" 107 #define C_SELECTIONCOLOR "Selection Color" 108 #define C_FEATURECOLOR "Feature Color" 109 #define C_HANDLECOLOR "Handle Color" 110 #define C_AREACOLOR "Area Color" 118 allSupportedTypes_(0u),
119 conversionDialog_(0),
120 colorButtonSelection_(0),
122 colorButtonHandle_(0),
123 colorButtonFeature_(0){
131 void MeshObjectSelectionPlugin::initializePlugin() {
137 if(!OpenFlipper::Options::nogui()) {
139 QRect scr = QApplication::desktop()->screenGeometry();
147 QString(
"Vertex Selection;Edge Selection;Halfedge Selection;Face Selection;" \
148 "Feature Vertices;Feature Edges;Feature Faces;Handle Region;Modeling Region").split(
";"));
150 QString(
"Vertex Selection;Edge Selection;Halfedge Selection;Face Selection;" \
151 "Feature Vertices;Feature Edges;Feature Faces;Handle Region;Modeling Region").split(
";"));
156 void MeshObjectSelectionPlugin::pluginsInitialized() {
161 QString iconPath = OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator();
163 emit addSelectionEnvironment(
"Mesh Object Selections",
"Select mesh object primitives such as vertices, (half-)edges and faces.",
191 QStringList generalOperations;
192 generalOperations.append(G_CLEAR_HANDLE);
193 generalOperations.append(G_CLEAR_MODEL);
194 generalOperations.append(G_CONVERT);
197 QStringList vertexOperations;
198 vertexOperations.append(V_SELECT_ALL);
199 vertexOperations.append(V_CLEAR);
200 vertexOperations.append(V_INVERT);
201 vertexOperations.append(V_BOUNDARY);
202 vertexOperations.append(V_SHRINK);
203 vertexOperations.append(V_GROW);
204 vertexOperations.append(V_DELETE);
205 vertexOperations.append(V_COLORIZE);
206 vertexOperations.append(V_COPYSELECTION);
207 vertexOperations.append(V_HANDLE);
208 vertexOperations.append(V_MODELING);
209 vertexOperations.append(V_LOAD_FLIPPER);
212 QStringList edgeOperations;
213 edgeOperations.append(E_SELECT_ALL);
214 edgeOperations.append(E_CLEAR);
215 edgeOperations.append(E_INVERT);
216 edgeOperations.append(E_DELETE);
217 edgeOperations.append(E_BOUNDARY);
218 edgeOperations.append(E_COLORIZE);
219 edgeOperations.append(E_COPYSELECTION);
220 edgeOperations.append(E_TRACE_PATH);
223 QStringList hedgeOperations;
224 hedgeOperations.append(HE_SELECT_ALL);
225 hedgeOperations.append(HE_CLEAR);
226 hedgeOperations.append(HE_INVERT);
227 hedgeOperations.append(HE_BOUNDARY);
228 hedgeOperations.append(HE_COLORIZE);
231 QStringList faceOperations;
232 faceOperations.append(F_SELECT_ALL);
233 faceOperations.append(F_CLEAR);
234 faceOperations.append(F_INVERT);
235 faceOperations.append(F_DELETE);
236 faceOperations.append(F_BOUNDARY);
237 faceOperations.append(F_SHRINK);
238 faceOperations.append(F_GROW);
239 faceOperations.append(F_COLORIZE);
240 faceOperations.append(F_COPYSELECTION);
243 QStringList colorOperations;
244 colorOperations.append(C_SELECTIONCOLOR);
245 colorOperations.append(C_FEATURECOLOR);
246 colorOperations.append(C_AREACOLOR);
247 colorOperations.append(C_HANDLECOLOR);
249 emit addSelectionOperations(
environmentHandle_, generalOperations,
"Selection Operations");
254 emit addSelectionOperations(
environmentHandle_, colorOperations,
"Highlight Operations");
259 emit registerKeyShortcut(Qt::Key_A, Qt::ControlModifier);
261 emit registerKeyShortcut(Qt::Key_C, Qt::NoModifier);
263 emit registerKeyShortcut(Qt::Key_I, Qt::NoModifier);
265 emit registerKeyShortcut(Qt::Key_Delete, Qt::NoModifier);
268 std::string statusStr =
OpenFlipperQSettings().
value(
"SelectionMeshObject/StatusColor",QString()).toString().toStdString();
269 std::string handleStr =
OpenFlipperQSettings().
value(
"SelectionMeshObject/HandleColor",QString()).toString().toStdString();
270 std::string featureStr =
OpenFlipperQSettings().
value(
"SelectionMeshObject/FeatureColor",QString()).toString().toStdString();
272 if (statusStr.empty() || handleStr.empty() || featureStr.empty() || areaStr.empty())
278 std::stringstream sstream;
280 sstream.str(statusStr);
285 sstream.str(handleStr);
290 sstream.str(featureStr);
295 sstream.str(areaStr);
304 emit setSlotDescription(
"selectVertices(int,IdList)", tr(
"Select the specified vertices"),
305 QString(
"objectId,vertexList").split(
","), QString(
"Id of object,List of vertices").split(
","));
306 emit setSlotDescription(
"unselectVertices(int,IdList)", tr(
"Unselect the specified vertices"),
307 QString(
"objectId,vertexList").split(
","), QString(
"Id of object,List of vertices").split(
","));
308 emit setSlotDescription(
"selectAllVertices(int)", tr(
"Select all vertices of an object"),
309 QStringList(
"objectId"), QStringList(
"Id of object"));
310 emit setSlotDescription(
"clearVertexSelection(int)", tr(
"Clear vertex selection of an object"),
311 QStringList(
"objectId"), QStringList(
"Id of an object"));
312 emit setSlotDescription(
"invertVertexSelection(int)", tr(
"Invert vertex selection of an object"),
313 QStringList(
"objectId"), QStringList(
"Id of an object"));
314 emit setSlotDescription(
"selectBoundaryVertices(int)", tr(
"Select all boundary vertices of an object"),
315 QStringList(
"objectId"), QStringList(
"Id of an object"));
316 emit setSlotDescription(
"selectClosestBoundaryVertices(int,int)", tr(
"Select boundary vertices closest to a specific vertex"),
317 QString(
"objectId,vertexId").split(
","), QString(
"Id of an object,Id of closest vertex").split(
","));
318 emit setSlotDescription(
"shrinkVertexSelection(int)", tr(
"Shrink vertex selection by outer selection ring"),
319 QStringList(
"objectId"), QStringList(
"Id of an object"));
320 emit setSlotDescription(
"growVertexSelection(int)", tr(
"Grow vertex selection by an-ring of selection"),
321 QStringList(
"objectId"), QStringList(
"Id of an object"));
322 emit setSlotDescription(
"deleteVertexSelection(int)", tr(
"Delete selected vertices"),
323 QStringList(
"objectId"), QStringList(
"Id of an object"));
324 emit setSlotDescription(
"createMeshFromVertexSelection(int)", tr(
"Take vertex selection and create a new mesh from it"),
325 QString(
"objectId").split(
","), QString(
"Id of an object where the selection should be used to create a new mesh").split(
","));
327 emit setSlotDescription(
"selectVerticesByValue(int,QString,bool,double)", tr(
"Select vertices based on the value of their component"),
328 QString(
"objectId,component,greater,value").split(
","),
329 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(
","));
331 emit setSlotDescription(
"colorizeVertexSelection(int,int,int,int)", tr(
"Colorize the selected vertices"),
332 QString(
"objectId,r,g,b").split(
","), QString(
"Id of an object,Red,Green,Blue").split(
","));
333 emit setSlotDescription(
"selectHandleVertices(int,IdList)", tr(
"Add specified vertices to handle area"),
334 QString(
"objectId,vertexList").split(
","), QString(
"Id of an object,List of vertices").split(
","));
335 emit setSlotDescription(
"unselectHandleVertices(int,IdList)", tr(
"Remove specified vertices from handle area"),
336 QString(
"objectId,vertexList").split(
","), QString(
"Id of an object,List of vertices").split(
","));
337 emit setSlotDescription(
"clearHandleVertices(int)", tr(
"Clear handle area"),
338 QStringList(
"objectId"), QStringList(
"Id of an object"));
339 emit setSlotDescription(
"setAllHandleVertices(int)", tr(
"Add all vertices of an object to handle area"),
340 QStringList(
"objectId"), QStringList(
"Id of an object"));
341 emit setSlotDescription(
"selectModelingVertices(int,IdList)", tr(
"Add specified vertices to modeling area"),
342 QString(
"objectId,vertexList").split(
","), QString(
"Id of an object,List of vertices").split(
","));
343 emit setSlotDescription(
"unselectModelingVertices(int,IdList)", tr(
"Remove specified vertices to modeling area"),
344 QString(
"objectId,vertexList").split(
","), QString(
"Id of an object,List of vertices").split(
","));
345 emit setSlotDescription(
"clearModelingVertices(int)", tr(
"Clear modeling area"),
346 QStringList(
"objectId"), QStringList(
"Id of an object"));
347 emit setSlotDescription(
"setAllModelingVertices(int)", tr(
"Add al vertices of an object to modeling area"),
348 QStringList(
"objectId"), QStringList(
"Id of an object"));
350 emit setSlotDescription(
"loadSelection(int,QString)", tr(
"Load selection from selection file"),
351 QString(
"objectId,filename").split(
","), QString(
"Id of an object,Selection file").split(
","));
353 emit setSlotDescription(
"loadFlipperModelingSelection(int,QString)", tr(
"Load selection from Flipper selection file"),
354 QString(
"objectId,filename").split(
","), QString(
"Id of an object,Flipper selection file").split(
","));
355 emit setSlotDescription(
"saveFlipperModelingSelection(int,QString)", tr(
"Save selection into Flipper selection file"),
356 QString(
"objectId,filename").split(
","), QString(
"Id of an object,Flipper selection file").split(
","));
358 emit setSlotDescription(
"selectEdges(int,IdList)", tr(
"Select the specified edges"),
359 QString(
"objectId,edgeList").split(
","), QString(
"Id of an object,List of edges").split(
","));
360 emit setSlotDescription(
"unselectEdges(int,IdList)", tr(
"Unselect the specified edges"),
361 QString(
"objectId,edgeList").split(
","), QString(
"Id of an object,List of edges").split(
","));
362 emit setSlotDescription(
"selectAllEdges(int)", tr(
"Select all edges of an object"),
363 QStringList(
"objectId"), QStringList(
"Id of an object"));
364 emit setSlotDescription(
"invertEdgeSelection(int)", tr(
"Invert edge selection of an object"),
365 QStringList(
"objectId"), QStringList(
"Id of an object"));
366 emit setSlotDescription(
"clearEdgeSelection(int)", tr(
"Clear edge selection of an object"),
367 QStringList(
"objectId"), QStringList(
"Id of an object"));
368 emit setSlotDescription(
"selectBoundaryEdges(int)", tr(
"Select all boundary edges of an object"),
369 QStringList(
"objectId"), QStringList(
"Id of an object"));
371 emit setSlotDescription(
"colorizeEdgeSelection(int,int,int,int)", tr(
"Colorize the selected edges"),
372 QString(
"objectId,r,g,b").split(
","), QString(
"Id of an object,Red,Green,Blue").split(
","));
373 emit setSlotDescription(
"createMeshFromEdgeSelection(int)", tr(
"Take edge selection and create a new mesh from it"),
374 QString(
"objectId").split(
","), QString(
"Id of an object where the selection should be used to create a new mesh").split(
","));
376 emit setSlotDescription(
"selectHalfedges(int,IdList)", tr(
"Select the specified halfedges"),
377 QString(
"objectId,halfedgeList").split(
","), QString(
"Id of an object,List of halfedges").split(
","));
378 emit setSlotDescription(
"unselectHalfedges(int,IdList)", tr(
"Unselect the specified halfedges"),
379 QString(
"objectId,halfedgeList").split(
","), QString(
"Id of an object,List of halfedges").split(
","));
380 emit setSlotDescription(
"selectAllHalfedges(int)", tr(
"Select all halfedges of an object"),
381 QStringList(
"objectId"), QStringList(
"Id of an object"));
382 emit setSlotDescription(
"invertHalfedgeSelection(int)", tr(
"Invert halfedge selection of an object"),
383 QStringList(
"objectId"), QStringList(
"Id of an object"));
384 emit setSlotDescription(
"clearHalfedgeSelection(int)", tr(
"Clear halfedge selection of an object"),
385 QStringList(
"objectId"), QStringList(
"Id of an object"));
386 emit setSlotDescription(
"selectBoundaryHalfedges(int)", tr(
"Select all boundary halfedges of an object"),
387 QStringList(
"objectId"), QStringList(
"Id of an object"));
389 emit setSlotDescription(
"colorizeHalfedgeSelection(int,int,int,int)", tr(
"Colorize the selected halfedges"),
390 QString(
"objectId,r,g,b").split(
","), QString(
"Id of an object,Red,Green,Blue").split(
","));
392 emit setSlotDescription(
"selectFaces(int,IdList)", tr(
"Select the specified faces"),
393 QString(
"objectId,faceList").split(
","), QString(
"Id of an object,List of faces").split(
","));
394 emit setSlotDescription(
"unselectFaces(int,IdList)", tr(
"Unselect the specified faces"),
395 QString(
"objectId,faceList").split(
","), QString(
"Id of an object,List of faces").split(
","));
396 emit setSlotDescription(
"selectAllFaces(int)", tr(
"Select all vertices of an object"),
397 QStringList(
"objectId"), QStringList(
"Id of an object"));
398 emit setSlotDescription(
"clearFaceSelection(int)", tr(
"Clear face selection of an object"),
399 QStringList(
"objectId"), QStringList(
"Id of an object"));
400 emit setSlotDescription(
"invertFaceSelection(int)", tr(
"Invert face selection of an object"),
401 QStringList(
"objectId"), QStringList(
"Id of an object"));
402 emit setSlotDescription(
"selectBoundaryFaces(int)", tr(
"Select all boundary faces of an object"),
403 QStringList(
"objectId"), QStringList(
"Id of an object"));
404 emit setSlotDescription(
"shrinkFaceSelection(int)", tr(
"Shrink face selection by outer face ring of selection"),
405 QStringList(
"objectId"), QStringList(
"Id of an object"));
406 emit setSlotDescription(
"growFaceSelection(int)", tr(
"Grow face selection by an-ring of faces around selection"),
407 QStringList(
"objectId"), QStringList(
"Id of an object"));
408 emit setSlotDescription(
"colorizeFaceSelection(int,int,int,int)", tr(
"Colorize the selected faces"),
409 QString(
"objectId,r,g,b").split(
","), QString(
"Id of an object,Red,Green,Blue").split(
","));
411 emit setSlotDescription(
"createMeshFromFaceSelection(int)", tr(
"Take face selection and create a new mesh from it"),
412 QString(
"objectId").split(
","), QString(
"Id of an object where the selection should be used to create a new mesh").split(
","));
415 QString conversionStrings = tr(
" Possible strings:\n" 416 "- Vertex/Edge/Halfedge/Face Selection\n" 417 "- Model/Handle Region\n" 418 "- Feature Vertices/Edges/Faces");
420 emit setSlotDescription(
"convertSelection(int,QString,QString,bool)", tr(
"Convert the selection on given object. Conversion must be given as strings.")+conversionStrings ,
421 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(
","));
423 emit setSlotDescription(
"conversion(QString,QString,bool)", tr(
"Convert selection on all target Objects.")+conversionStrings,
424 QString(
"from,to,deselect").split(
","), QString(
"string of selection which will be converted,resulting selection region or feature,deselect selection after conversion").split(
","));
426 emit setSlotDescription(
"convertEdgesToVertexPairs(int,IdList)", tr(
"Convert edge ids to vertex pair ids. Returns vertex Idlist."),
427 QString(
"objectId, edgeIds").split(
","), QString(
"Id of an object, Ids of edges").split(
","));
428 emit setSlotDescription(
"convertHalfedgesToVertexPairs(int,IdList)", tr(
"Convert halfedge ids to vertex pair ids. Returns vertex Idlist."),
429 QString(
"objectId, halfedgeIds").split(
","), QString(
"Id of an object, Ids of halfedges").split(
","));
431 emit setSlotDescription(
"convertVertexPairsToHalfedges(int,IdList)", tr(
"Convert vertex pair ids to halfedge ids. Returns halfedge Idlist."),
432 QString(
"objectId, vertexIds").split(
","), QString(
"Id of an object, Ids of paired vertices").split(
","));
433 emit setSlotDescription(
"convertVertexPairsToEdges(int,IdList)", tr(
"Convert vertex pair ids to edge ids. Returns edge Idlist."),
434 QString(
"objectId, vertexIds").split(
","), QString(
"Id of an object, Ids of paired vertices").split(
","));
439 SelectionInterface::PrimitiveType type = 0u;
440 emit getActivePrimitiveType(type);
446 bool targetsOnly =
false;
447 emit targetObjectsOnly(targetsOnly);
451 if(_operation == G_CLEAR_HANDLE) {
458 }
else if(_operation == G_CLEAR_MODEL) {
465 }
else if(_operation == G_CONVERT) {
467 if(!OpenFlipper::Options::nogui())
469 }
else if(_operation == V_SELECT_ALL) {
476 }
else if(_operation == V_CLEAR) {
483 }
else if(_operation == V_INVERT) {
490 }
else if(_operation == V_BOUNDARY) {
497 }
else if(_operation == V_SHRINK) {
504 }
else if(_operation == V_GROW) {
511 }
else if(_operation == V_DELETE) {
515 if (o_it->visible()){
521 }
else if(_operation == V_COLORIZE) {
525 if (o_it->visible()) {
529 }
else if(_operation == V_COPYSELECTION) {
531 std::vector<int> objects;
534 if (o_it->visible()) {
535 objects.push_back(o_it->id());
539 for (
unsigned int i = 0 ; i < objects.size() ; ++i)
542 }
else if(_operation == V_HANDLE) {
546 if (o_it->visible()) {
552 }
else if(_operation == V_MODELING) {
556 if (o_it->visible()) {
562 }
else if(_operation == V_LOAD_FLIPPER) {
564 QString fileName = QFileDialog::getOpenFileName(0,
565 tr(
"Open Flipper Selection File"), OpenFlipper::Options::dataDirStr(),
566 tr(
"Flipper Selection Files (*.sel)"));
569 if (o_it->visible()) {
573 }
else if(_operation == E_SELECT_ALL) {
580 }
else if(_operation == E_CLEAR) {
587 }
else if(_operation == E_INVERT) {
594 }
else if(_operation == E_DELETE) {
601 }
else if(_operation == E_BOUNDARY) {
608 }
else if(_operation == E_COLORIZE) {
612 if (o_it->visible()) {
616 }
else if(_operation == E_COPYSELECTION) {
618 std::vector<int> objects;
621 if (o_it->visible()) {
622 objects.push_back(o_it->id());
626 for (
unsigned int i = 0 ; i < objects.size() ; ++i)
629 }
else if (_operation == E_TRACE_PATH) {
632 if (o_it->visible()) {
636 }
else if(_operation == HE_SELECT_ALL) {
643 }
else if(_operation == HE_CLEAR) {
650 }
else if(_operation == HE_INVERT) {
657 }
else if(_operation == HE_BOUNDARY) {
664 }
else if(_operation == HE_COLORIZE) {
668 if (o_it->visible()) {
672 }
else if(_operation == F_SELECT_ALL) {
679 }
else if(_operation == F_CLEAR) {
686 }
else if(_operation == F_INVERT) {
693 }
else if(_operation == F_DELETE) {
700 }
else if(_operation == F_BOUNDARY) {
707 }
else if(_operation == F_SHRINK) {
714 }
else if(_operation == F_GROW) {
721 }
else if(_operation == F_COLORIZE) {
725 if (o_it->visible()) {
729 }
else if(_operation == F_COPYSELECTION) {
731 std::vector<int> objects;
734 if (o_it->visible()) {
735 objects.push_back(o_it->id());
739 for (
unsigned int i = 0 ; i < objects.size() ; ++i)
741 }
else if(_operation == C_SELECTIONCOLOR) {
743 if (newColor.isValid())
760 }
else if(_operation == C_FEATURECOLOR) {
762 if (newColor.isValid())
779 }
else if(_operation == C_HANDLECOLOR) {
781 if (newColor.isValid())
798 }
else if(_operation == C_AREACOLOR) {
800 if (newColor.isValid())
822 QColor c = QColorDialog::getColor(Qt::red, 0, tr(
"Choose color"),QColorDialog::ShowAlphaChannel);
828 }
else if (_primitiveTypes &
edgeType_) {
834 }
else if (_primitiveTypes &
faceType_) {
848 if(from == to)
return;
850 bool deselect =
true;
851 if(!OpenFlipper::Options::nogui()) {
864 emit log(
LOGERR,
"Object not found in convertSelection");
868 if(_from ==
"Vertex Selection") {
869 if (_to ==
"Edge Selection") {
874 }
else if (_to ==
"Halfedge Selection") {
879 }
else if (_to ==
"Face Selection") {
884 }
else if (_to ==
"Feature Vertices") {
889 }
else if (_to ==
"Handle Region") {
891 }
else if (_to ==
"Modeling Region") {
899 }
else if (_from ==
"Edge Selection") {
900 if(_to ==
"Vertex Selection") {
905 }
else if (_to ==
"Halfedge Selection") {
910 }
else if (_to ==
"Face Selection") {
915 }
else if (_to ==
"Feature Edges") {
920 }
else if (_to ==
"Handle Region") {
923 std::vector<int> ids;
924 for(TriMesh::EdgeIter e_it = mesh->edges_begin(); e_it != mesh->edges_end(); ++e_it) {
925 if(mesh->status(*e_it).selected()) {
926 ids.push_back(mesh->to_vertex_handle(mesh->halfedge_handle(*e_it, 0)).idx());
927 ids.push_back(mesh->to_vertex_handle(mesh->halfedge_handle(*e_it, 1)).idx());
933 std::vector<int> ids;
934 for(PolyMesh::EdgeIter e_it = mesh->edges_begin(); e_it != mesh->edges_end(); ++e_it) {
935 if(mesh->status(*e_it).selected()) {
936 ids.push_back(mesh->to_vertex_handle(mesh->halfedge_handle(*e_it, 0)).idx());
937 ids.push_back(mesh->to_vertex_handle(mesh->halfedge_handle(*e_it, 1)).idx());
942 }
else if (_to ==
"Modeling Region") {
945 std::vector<int> ids;
946 for(TriMesh::EdgeIter e_it = mesh->edges_begin(); e_it != mesh->edges_end(); ++e_it) {
947 if(mesh->status(*e_it).selected()) {
948 ids.push_back(mesh->to_vertex_handle(mesh->halfedge_handle(*e_it, 0)).idx());
949 ids.push_back(mesh->to_vertex_handle(mesh->halfedge_handle(*e_it, 1)).idx());
955 std::vector<int> ids;
956 for(PolyMesh::EdgeIter e_it = mesh->edges_begin(); e_it != mesh->edges_end(); ++e_it) {
957 if(mesh->status(*e_it).selected()) {
958 ids.push_back(mesh->to_vertex_handle(mesh->halfedge_handle(*e_it, 0)).idx());
959 ids.push_back(mesh->to_vertex_handle(mesh->halfedge_handle(*e_it, 1)).idx());
969 }
else if (_from ==
"Halfedge Selection") {
970 if(_to ==
"Vertex Selection") {
975 }
else if (_to ==
"Edge Selection") {
980 }
else if (_to ==
"Face Selection") {
985 }
else if (_to ==
"Handle Region") {
988 std::vector<int> ids;
989 for(TriMesh::HalfedgeIter h_it = mesh->halfedges_begin(); h_it != mesh->halfedges_end(); ++h_it) {
990 if(mesh->status(*h_it).selected()) {
991 ids.push_back(mesh->to_vertex_handle(*h_it).idx());
992 ids.push_back(mesh->from_vertex_handle(*h_it).idx());
998 std::vector<int> ids;
999 for(PolyMesh::HalfedgeIter h_it = mesh->halfedges_begin(); h_it != mesh->halfedges_end(); ++h_it) {
1000 if(mesh->status(*h_it).selected()) {
1001 ids.push_back(mesh->to_vertex_handle(*h_it).idx());
1002 ids.push_back(mesh->from_vertex_handle(*h_it).idx());
1007 }
else if (_to ==
"Modeling Region") {
1010 std::vector<int> ids;
1011 for(TriMesh::HalfedgeIter h_it = mesh->halfedges_begin(); h_it != mesh->halfedges_end(); ++h_it) {
1012 if(mesh->status(*h_it).selected()) {
1013 ids.push_back(mesh->to_vertex_handle(*h_it).idx());
1014 ids.push_back(mesh->from_vertex_handle(*h_it).idx());
1020 std::vector<int> ids;
1021 for(PolyMesh::HalfedgeIter h_it = mesh->halfedges_begin(); h_it != mesh->halfedges_end(); ++h_it) {
1022 if(mesh->status(*h_it).selected()) {
1023 ids.push_back(mesh->to_vertex_handle(*h_it).idx());
1024 ids.push_back(mesh->from_vertex_handle(*h_it).idx());
1034 }
else if (_from ==
"Face Selection") {
1035 if(_to ==
"Vertex Selection") {
1040 }
else if (_to ==
"Edge Selection") {
1045 }
else if (_to ==
"Feature Faces") {
1050 }
else if (_to ==
"Halfedge Selection") {
1055 }
else if (_to ==
"Handle Region") {
1058 std::vector<int> ids;
1059 for(TriMesh::FaceIter f_it = mesh->faces_begin(); f_it != mesh->faces_end(); ++f_it) {
1060 if(mesh->status(*f_it).selected()) {
1062 ids.push_back(fv_it->idx());
1069 std::vector<int> ids;
1070 for(PolyMesh::FaceIter f_it = mesh->faces_begin(); f_it != mesh->faces_end(); ++f_it) {
1071 if(mesh->status(*f_it).selected()) {
1073 ids.push_back(fv_it->idx());
1079 }
else if (_to ==
"Modeling Region") {
1082 std::vector<int> ids;
1083 for(TriMesh::FaceIter f_it = mesh->faces_begin(); f_it != mesh->faces_end(); ++f_it) {
1084 if(mesh->status(*f_it).selected()) {
1086 ids.push_back(fv_it->idx());
1093 std::vector<int> ids;
1094 for(PolyMesh::FaceIter f_it = mesh->faces_begin(); f_it != mesh->faces_end(); ++f_it) {
1095 if(mesh->status(*f_it).selected()) {
1097 ids.push_back(fv_it->idx());
1108 }
else if (_from ==
"Feature Vertices") {
1110 if (_to ==
"Vertex Selection") {
1123 }
else if (_from ==
"Feature Edges") {
1125 if (_to ==
"Edge Selection") {
1138 }
else if (_from ==
"Feature Faces") {
1140 if (_to ==
"Face Selection") {
1153 }
else if (_from ==
"Handle Region") {
1155 if(_to ==
"Vertex Selection") {
1157 }
else if (_to ==
"Edge Selection") {
1162 }
else if (_to ==
"Halfedge Selection") {
1167 }
else if (_to ==
"Face Selection") {
1172 }
else if (_to ==
"Modeling Region") {
1180 }
else if (_from ==
"Modeling Region") {
1182 if(_to ==
"Vertex Selection") {
1184 }
else if (_to ==
"Edge Selection") {
1189 }
else if (_to ==
"Halfedge Selection") {
1194 }
else if (_to ==
"Face Selection") {
1199 }
else if (_to ==
"Handle Region") {
1228 unsigned int node_idx, target_idx;
1233 _event->pos(), node_idx, target_idx, &hit_point)) {
1266 if(_event->type() == QEvent::MouseButtonPress) {
1273 }
else if(_event->type() == QEvent::MouseButtonDblClick) {
1293 if(_event->type() == QEvent::MouseButtonPress) {
1300 }
else if(_event->type() == QEvent::MouseButtonDblClick) {
1307 QRegion region = QRegion(p);
1324 unsigned int node_idx, target_idx;
1340 if ( _event->type() == QEvent::MouseButtonRelease )
1351 unsigned int node_idx, target_idx;
1391 unsigned int node_idx, target_idx;
1396 _event->pos(), node_idx, target_idx, &hit_point)) {
1412 object->
id(), target_idx, _maxAngle,
1413 _currentType, _deselect);
1430 object->
id(), target_idx, _maxAngle,
1431 _currentType, _deselect);
1439 emit log(
LOGERR,tr(
"floodFillSelection: Unsupported dataType"));
1450 unsigned int node_idx, target_idx;
1455 _event->pos(), node_idx, target_idx, &hit_point)) {
1467 object->
id(), target_idx, hit_point, _currentType);
1476 object->
id(), target_idx, hit_point, _currentType);
1485 void MeshObjectSelectionPlugin::loadSelection(
int _objId,
const QString& _filename) {
1490 if(!file.
connect(_filename,
false)) {
1491 emit log(
LOGERR, QString(
"Could not read file '%1'!").arg(_filename));
1496 loadIniFile(file, _objId);
1499 void MeshObjectSelectionPlugin::loadIniFile(
INIFile& _ini,
int _id) {
1503 emit log(
LOGERR,tr(
"Cannot find object for id ") + QString::number(_id) + tr(
" in saveFile") );
1507 std::vector<int> ids;
1508 bool invert =
false;
1510 bool updated_selection =
false;
1511 bool updated_modeling_regions =
false;
1513 QString sectionName =
object->name();
1515 if (_ini.
get_entry(ids, sectionName ,
"ModelingRegion")) {
1517 _ini.
get_entry(invert, sectionName,
"InvertModeling");
1535 updated_modeling_regions =
true;
1538 if(_ini.
get_entry(ids, sectionName,
"HandleRegion")) {
1540 _ini.
get_entry(invert, sectionName,
"InvertHandle");
1558 updated_modeling_regions =
true;
1561 if(_ini.
get_entry(ids, sectionName,
"VertexSelection")) {
1563 _ini.
get_entry(invert, sectionName,
"InvertVertexSelection");
1573 updated_selection =
true;
1576 if(_ini.
get_entry(ids, sectionName,
"EdgeSelection")) {
1578 _ini.
get_entry(invert, sectionName,
"InvertEdgeSelection");
1590 updated_selection =
true;
1593 if(_ini.
get_entry(ids, sectionName,
"FaceSelection")) {
1595 _ini.
get_entry(invert, sectionName,
"InvertFaceSelection");
1605 updated_selection =
true;
1608 if(updated_modeling_regions) {
1613 }
else if(updated_selection) {
1619 if ( updated_modeling_regions || updated_selection )
1623 void MeshObjectSelectionPlugin::saveIniFile(
INIFile& _ini,
int _id) {
1627 emit log(
LOGERR,tr(
"Cannot find object for id ") + QString::number(_id) + tr(
" in saveFile") );
1632 QString sectionName =
object->name();
1634 emit log(
LOGERR,tr(
"Cannot find object section id ") + QString::number(_id) + tr(
" in saveFile") );
1657 QString section = QString(
"MeshObjectSelection") +
"//" + o_it->name();
1662 std::vector<int> ids;
1664 _file.
get_entry(ids, section,
"VertexSelection");
1668 _file.
get_entry(ids, section,
"EdgeSelection");
1672 _file.
get_entry(ids, section,
"HalfedgeSelection");
1676 _file.
get_entry(ids, section,
"FaceSelection");
1680 _file.
get_entry(ids, section,
"HandleRegion");
1684 _file.
get_entry(ids, section,
"ModelingRegion");
1702 QString section = QString(
"MeshObjectSelection") +
"//" + o_it->name();
1721 SelectionInterface::PrimitiveType type = 0u;
1722 emit getActivePrimitiveType(type);
1729 bool targetsOnly =
false;
1730 emit targetObjectsOnly(targetsOnly);
1734 if(_key == Qt::Key_A && _modifiers == Qt::ControlModifier) {
1738 if (o_it->visible()) {
1752 }
else if (_key == Qt::Key_C && _modifiers == Qt::NoModifier) {
1756 if (o_it->visible()) {
1770 }
else if(_key == Qt::Key_I && _modifiers == Qt::NoModifier) {
1774 if (o_it->visible()) {
1788 }
else if (_key == Qt::Key_Delete && _modifiers == Qt::NoModifier) {
1792 if (o_it->visible()) {
1810 SelectionInterface::PrimitiveType type = 0u;
1811 emit getActivePrimitiveType(type);
1820 bool targetsOnly =
false;
1821 emit targetObjectsOnly(targetsOnly);
1825 if(event->modifiers() == Qt::ShiftModifier) {
1827 if (event->delta() > 0) {
1830 if (o_it->visible()) {
1844 if (o_it->visible()) {
1859 PrimitiveType _primitiveType,
1860 bool _deselection) {
1863 QList <QPair<unsigned int, unsigned int> > list;
1868 std::set<int> alreadySelectedObjects;
1870 for(
int i = 0; i < list.size(); ++i) {
1872 if(alreadySelectedObjects.count(list[i].first) != 0)
1880 for(
int j = 0; j < list.size(); ++j) {
1881 if(list[j].first == list[i].first) {
1883 elements.push_back(list[j].second);
1890 alreadySelectedObjects.insert(list[i].first);
1899 std::set<int> alreadySelectedObjects;
1901 for(
int i = 0; i < list.size(); ++i) {
1903 if(alreadySelectedObjects.count(list[i].first) != 0)
1911 for(
int j = 0; j < list.size(); ++j) {
1912 if(list[j].first == list[i].first) {
1914 elements.push_back(list[j].second);
1921 alreadySelectedObjects.insert(list[i].first);
1930 std::set<int> alreadySelectedObjects;
1932 for(
int i = 0; i < list.size(); ++i) {
1934 if(alreadySelectedObjects.count(list[i].first) != 0)
1942 for(
int j = 0; j < list.size(); ++j) {
1943 if(list[j].first == list[i].first) {
1945 elements.push_back(list[j].second);
1977 alreadySelectedObjects.insert(list[i].first);
1986 std::set<int> alreadySelectedObjects;
1988 for(
int i = 0; i < list.size(); ++i) {
1990 if(alreadySelectedObjects.count(list[i].first) != 0)
1998 for(
int j = 0; j < list.size(); ++j) {
1999 if(list[j].first == list[i].first) {
2001 elements.push_back(list[j].second);
2008 alreadySelectedObjects.insert(list[i].first);
2022 bool selected =
false;
2026 selected = plugin_->volumeSelection(m, object->
id(), state_, ®ion_, type_, deselection_);
2031 selected = plugin_->volumeSelection(m, object->
id(), state_, ®ion_, type_, deselection_);
2051 emit log(
LOGERR, tr(
"Unable to get object"));
2059 emit log(
LOGERR, tr(
"Unable to get mesh"));
2068 emit log(
LOGERR, tr(
"Unable to add empty object"));
2078 emit log(
LOGERR, tr(
"Unable to get mesh"));
2093 emit log(
LOGERR, tr(
"Unable to get mesh"));
2102 emit log(
LOGERR, tr(
"Unable to add empty object"));
2112 emit log(
LOGERR, tr(
"Unable to get mesh"));
2123 emit log(
LOGERR, tr(
"DataType not supported"));
2131 if (OpenFlipper::Options::gui())
2140 std::stringstream sstream;
2173 _widget =
new QWidget();
2174 QVBoxLayout* vLayout =
new QVBoxLayout();
2175 QHBoxLayout* hLayout =
new QHBoxLayout();
2177 hLayout->addWidget(
new QLabel(
"Select default colors for newly created objects. Does not affect already created objects."));
2178 vLayout->addLayout(hLayout);
2180 hLayout =
new QHBoxLayout();
2182 hLayout->addWidget(
new QLabel(
"Selection Color: "));
2184 vLayout->addLayout(hLayout);
2186 hLayout =
new QHBoxLayout();
2188 hLayout->addWidget(
new QLabel(
"Handle Color: "));
2190 vLayout->addLayout(hLayout);
2192 hLayout =
new QHBoxLayout();
2194 hLayout->addWidget(
new QLabel(
"Feature Color: "));
2196 vLayout->addLayout(hLayout);
2198 hLayout =
new QHBoxLayout();
2200 hLayout->addWidget(
new QLabel(
"Area Color: "));
2202 vLayout->addLayout(hLayout);
2204 hLayout =
new QHBoxLayout();
2205 QPushButton* restoreDefault =
new QPushButton();
2207 restoreDefault->setText(
"Restore Default");
2208 hLayout->addWidget(restoreDefault);
2209 hLayout->addStretch();
2210 vLayout->addLayout(hLayout);
2212 _widget->setLayout(vLayout);
2217 void MeshObjectSelectionPlugin::applyOptions()
2229 if (OpenFlipper::Options::nogui())
2255 #if QT_VERSION < 0x050000 void selectFaces(int objectId, IdList _facesList)
Select given faces.
void invertVertexSelection(int _objectId)
Invert the current vertex selection.
void setAllModelingVertices(int objectId)
Set all vertices to be part of the modeling area.
ACG::Vec4f areaColor_
Handle to selection environment.
void selectVertices(int objectId, IdList _vertexList)
select given vertices
bool scenegraphPick(ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mousePos, unsigned int &_nodeIdx, unsigned int &_targetIdx, ACG::Vec3d *_hitPointPtr=0)
Execute picking operation on scenegraph.
QStringList IteratorRestriction
Iterable object range.
void deleteFaceSelection(int _objectId)
Delete face that are currently selected.
bool updateGL() const
should GL matrices be updated after each matrix operation
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.
ACG::GLState & glState()
Get the glState of the Viewer.
void setColorForSelection(const int _objectId, const PrimitiveType _primitiveType)
Set color for selection.
VectorT< float, 4 > Vec4f
IdList getHandleVertices(int objectId)
Get a list of all handle vertices.
Type for a MeshObject containing a triangle mesh.
void slotLoadSelection(const INIFile &_file)
Load selection for specific objects in the scene.
void addedEmptyObject(int _id)
An empty object has been added.
~MeshObjectSelectionPlugin()
Default destructor.
void selectAllVertices(int _objectId)
Select all Vertices.
const UpdateType UPDATE_TOPOLOGY(UpdateTypeSet(1)<< 3)
Topology updated.
picks only visible front edges (may not be implemented for all nodes)
IdList convertHalfedgesToVertexPairs(int _id, const IdList &_halfedges)
Convert halfedge ids to vertex pairs.
bool getObject(int _identifier, BSplineCurveObject *&_object)
void clearHalfedgeSelection(int objectId)
Invert the current edge selection.
PolyMesh * polyMesh(BaseObjectData *_object)
Get a poly mesh from an object.
MeshObjectSelectionPlugin()
Default constructor.
void selectAllHalfedges(int objectId)
Select all Halfedges.
bool dataType(DataType _type) const
void invertFaceSelection(int objectId)
Invert the current face selection.
const QStringList TARGET_OBJECTS("target")
Iterable object range.
SelectionInterface::PrimitiveType edgeType_
Handle to selection environment.
ACG::Vec4f handleColor_
Handle to selection environment.
void invertEdgeSelection(int objectId)
Unselect all Edges.
ACG::SceneGraph::BaseNode * getRootNode()
Get the root node for data objects.
SelectionInterface::PrimitiveType halfedgeType_
Handle to selection environment.
void setHandleColor(const ACG::Vec4f &_color)
set color for handles
void selectAllEdges(int objectId)
Select all Edges.
void selectHandleVertices(int objectId, IdList _vertexList)
Set vertices to be part of the handle area.
void conversion(const QString &_from, const QString &_to, bool _deselect)
Convert the selection on all target objects.
Traverse the scenegraph and call the selection function for all mesh nodes.
ConversionDialog * conversionDialog_
Handle to selection environment.
QPolygon lasso_2Dpoints_
Used for lasso selection tool.
void loadFlipperModelingSelection(int _objectId, QString _filename)
Load a selection from an Flipper selection file for the given object.
const QStringList ALL_OBJECTS
Iterable object range.
void traceEdgePath(int objectId, double threshold)
Trace Edge Path.
bool getPickedObject(const unsigned int _node_idx, BaseObjectData *&_object)
Get the picked mesh.
void colorizeEdgeSelection(int objectId, int r, int g, int b, int a)
Colorize the edge selection.
virtual bool picked(uint _node_idx)
detect if the node has been picked
void createMeshFromSelection(MeshT &_mesh, MeshT &_newMesh, PrimitiveType _primitiveType)
Create a new mesh from the selection.
void closestBoundarySelection(MeshT *_mesh, int _vh, PrimitiveType _primitiveTypes, bool _deselection)
Select all entities that are incident to closest boundary.
PolyMeshObject * polyMeshObject(BaseObjectData *_object)
Cast an BaseObject to a PolyMeshObject if possible.
void selectEdges(int objectId, IdList _vertexList)
Select given Edges.
SelectionInterface::PrimitiveType allSupportedTypes_
Handle to selection environment.
void clearFaceSelection(int objectId)
Unselect all faces.
bool get_entry(QString &_val, const QString &_section, const QString &_key) const
Access to a string entry.
QtColorChooserButton * colorButtonSelection_
Options.
SelectionInterface::PrimitiveType faceType_
Handle to selection environment.
Kernel::FaceVertexIter FaceVertexIter
Circulator.
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) ...
void unselectHandleVertices(int objectId, IdList _vertexList)
Remove vertices from handle area.
void selectBoundaryHalfedges(int objectId)
Select boundary edges.
void growVertexSelection(int _objectId)
Grow the current vertex selection.
void slotFloodFillSelection(QMouseEvent *_event, double _maxAngle, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a flood fill selection.
void setValue(const QString &key, const QVariant &value)
Wrapper function which makes it possible to enable Debugging output with -DOPENFLIPPER_SETTINGS_DEBUG...
Functions for selection on a mesh.
void updateSlotDescriptions()
Set descriptions for local public slots.
void conversionRequested()
Show selection conversion dialog.
Viewer::ViewerProperties & viewerProperties(int _id)
Get the viewer properties Use this functions to get basic viewer properties such as backgroundcolor o...
void clearEdgeSelection(int objectId)
Invert the current edge selection.
void slotKeyShortcutEvent(int _key, Qt::KeyboardModifiers _modifiers)
One of the previously registered keys has been pressed.
QtColorChooserButton * colorButtonHandle_
Handle to selection environment.
void setFeatureColor(const ACG::Vec4f &_color)
set color for features
const DataType DATA_ALL(UINT_MAX)
Identifier for all available objects.
void shrinkFaceSelection(int objectId)
Shrink the current face selection.
void unselectVertices(int objectId, IdList _vertexList)
unselect given vertices
void slotVolumeLassoSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a volume lasso selection.
void selectModelingVertices(int objectId, IdList _vertexList)
Set vertices to be part of the modeling area.
bool section_exists(const QString &_section) const
Check if given section exists in the current INI file.
bool operator()(BaseNode *_node)
Traverse the scenegraph and call the selection function for all mesh nodes.
IdList convertEdgesToVertexPairs(int _id, const IdList &_edges)
Convert edge ids to vertex pairs.
const UpdateType UPDATE_GEOMETRY(UpdateTypeSet(1)<< 2)
Geometry updated.
QVariant value(const QString &key, const QVariant &defaultValue=QVariant()) const
void selectHalfedges(int objectId, IdList _vertexList)
Select given Halfedges.
bool connect(const QString &name, const bool create)
Connect INIFile object with given filename.
Class for the handling of simple configuration files.
IdList convertVertexPairsToEdges(int _id, const IdList &_vertices)
Inverse of function above.
void shrinkVertexSelection(int _objectId)
Shrink the current vertex selection.
QtColorChooserButton * colorButtonArea_
Handle to selection environment.
void updateColorValues()
Set descriptions for local public slots.
void traverse(BaseNode *_node, Action &_action)
void convertSelection(const int &_objectId, const QString &_from, const QString &_to, bool _deselect)
Convert the selection on one object.
QVector< QPoint > volumeLassoPoints_
Used for volume lasso tool.
IdList getVertexSelection(int _objectId)
Return a list of all selected vertices.
TriMeshObject * triMeshObject(BaseObjectData *_object)
Cast an BaseObject to a TriMeshObject if possible.
void clearVertexSelection(int _objectId)
Unselect all vertices.
Kernel::VertexHandle VertexHandle
Handle for referencing the corresponding item.
std::vector< int > IdList
Standard Type for id Lists used for scripting.
ACG::Vec4f featureColor_
Handle to selection environment.
void slotLassoSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a lasso selection.
SelectionInterface::PrimitiveType vertexType_
Primitive type handles:
void unselectEdges(int objectId, IdList _vertexList)
Unselect given Edges.
void slotSaveSelection(INIFile &_file)
Save selection for all objects in the scene.
IdList getHalfedgeSelection(int objectId)
Return a list of all selected edges.
picks only visible front verices (may not be implemented for all nodes)
bool initializeOptionsWidget(QWidget *&_widget)
Initialize the Options Widget.
void deleteVertexSelection(int _objectId)
Delete vertices and faces that are currently selected.
void slotSelectionOperation(QString _operation)
A specific operation is requested.
const UpdateType UPDATE_SELECTION(UpdateTypeSet(1)<< 4)
Selection updated.
void colorizeVertexSelection(int _objectId, int _r, int _g, int _b, int a)
Colorize the vertex selection.
void selectAllFaces(int objectId)
Select all faces.
void update_regions(MeshT *_mesh)
Update face selection to correspond to the vertex selection.
void selectBoundaryVertices(int _objectId)
Select all boundary vertices of the given object.
void invertHalfedgeSelection(int objectId)
Unselect all Halfedges.
void setAllHandleVertices(int objectId)
Set all vertices to be part of the handle area.
void slotMouseWheelEvent(QWheelEvent *event, std::string const &mode)
Wheel Event from main application.
void slotSphereSelection(QMouseEvent *_event, double _radius, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a sphere selection.
void unselectFaces(int objectId, IdList _facesList)
Unselect given faces.
ACG::Vec4f statusColor_
Handle to selection environment.
void slotComponentsSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a connected components selection.
IdList getModelingVertices(int objectId)
Get a list of all modeling vertices.
void clearHandleVertices(int objectId)
Clear handle Area.
Type for a Meshobject containing a poly mesh.
void slotClosestBoundarySelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a closest boundary selection.
void slotToggleSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a toggle selection.
void colorizeFaceSelection(int objectId, int r, int g, int b, int a)
Colorize the face selection.
bool scenegraphRegionPick(ACG::SceneGraph::PickTarget _pickTarget, const QRegion &_region, QList< QPair< unsigned int, unsigned int > > &_list, QVector< float > *_depths, QVector< ACG::Vec3d > *_points)
void toggleMeshSelection(int _objectId, MeshT *_mesh, uint _fh, ACG::Vec3d &_hit_point, PrimitiveType _primitiveType)
Toggle mesh selection.
void componentsMeshSelection(MeshT *_mesh, int _objectId, uint _fh, ACG::Vec3d &_hit_point, PrimitiveType _primitiveType)
Connected component mesh selection.
void unselectModelingVertices(int objectId, IdList _vertexList)
Remove vertices from modeling area.
void selectBoundaryEdges(int objectId)
select boundary edges
pick any of the prior targets (should be implemented for all nodes)
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.
void selectBoundaryFaces(int objectId)
Select all boundary faces of the given object.
void clearModelingVertices(int objectId)
Clear Modeling Area.
void colorizeHalfedgeSelection(int objectId, int r, int g, int b, int a)
Colorize the edge selection.
void growFaceSelection(int objectId)
Grow the current face selection.
IdList getEdgeSelection(int objectId)
Return a list of all selected edges.
void add_entry(const QString &_section, const QString &_key, const QString &_value)
Addition / modification of a string entry.
void setAreaColor(const ACG::Vec4f &_color)
set color for areas
QtColorChooserButton * colorButtonFeature_
Handle to selection environment.
#define DATA_TRIANGLE_MESH
picks faces (should be implemented for all nodes)
void lassoSelect(QRegion &_region, PrimitiveType _primitiveType, bool _deselection)
Lasso selection tool.
DLLEXPORT ObjectIterator objectsEnd()
Return Iterator to Object End.
void set_updateGL(bool _b)
should GL matrices be updated after each matrix operation
void setDefaultColorValues()
sets the default color values for selection/handle/region/feature nodes for all objects of this type ...
IdList getFaceSelection(int objectId)
Return a list of all selected faces.
TriMesh * triMesh(BaseObjectData *_object)
Get a triangle mesh from an object.
QString environmentHandle_
Handle to selection environment.
IdList convertVertexPairsToHalfedges(int _id, const IdList &_vertices)
Inverse of function above.
void deleteEdgeSelection(int _objectId)
Delete edges that are currently selected.
void setSelectionColor(const ACG::Vec4f &_color)
set color for selection