43 #include "MeshObjectSelectionPlugin.hh" 47 #include <OpenMesh/Core/Geometry/MathDefs.hh> 57 template<
typename MeshT>
63 typename MeshT::VertexIter v_it, v_end=_mesh->vertices_end();
65 for(v_it=_mesh->vertices_begin(); v_it!=v_end; ++v_it) {
66 if(_mesh->status(*v_it).selected()) {
67 _mesh->delete_vertex(*v_it);
74 typename MeshT::EdgeIter e_it, e_end(_mesh->edges_end());
76 for(e_it=_mesh->edges_begin(); e_it!=e_end; ++e_it) {
77 if(_mesh->status(*e_it).selected()) {
78 _mesh->delete_edge(*e_it);
85 typename MeshT::FaceIter f_it, f_end(_mesh->faces_end());
87 for(f_it=_mesh->faces_begin(); f_it!=f_end; ++f_it) {
88 if(_mesh->status(*f_it).selected()) {
89 _mesh->delete_face(*f_it);
95 _mesh->garbage_collection();
106 template<
typename MeshType>
110 typename MeshType::FaceIter f_it, f_end=_mesh->faces_end();
111 typename MeshType::FaceVertexIter fv_it;
112 typename MeshType::VertexHandle v0, v1, v2;
114 for(f_it=_mesh->faces_begin(); f_it!=f_end; ++f_it) {
115 fv_it = _mesh->fv_iter(*f_it);
120 const bool a =(_mesh->status(v0).is_bit_set(AREA)|| _mesh->status(v1).is_bit_set(AREA)|| _mesh->status(v2).is_bit_set(AREA));
121 bool h =(_mesh->status(v0).is_bit_set(HANDLEAREA)&&
122 _mesh->status(v1).is_bit_set(HANDLEAREA)&&
123 _mesh->status(v2).is_bit_set(HANDLEAREA));
126 if(_mesh->status(v0).is_bit_set(HANDLEAREA)||
127 _mesh->status(v1).is_bit_set(HANDLEAREA)||
128 _mesh->status(v2).is_bit_set(HANDLEAREA))
131 _mesh->status(*f_it).change_bit(AREA , a);
132 _mesh->status(*f_it).change_bit(HANDLEAREA, h);
146 template<
class MeshT>
149 typename MeshT::FaceHandle fh = _mesh->face_handle(_fh);
157 typename MeshT::FaceVertexIter fv_it(*_mesh, fh);
158 typename MeshT::VertexHandle closest = *fv_it;
159 typename MeshT::Scalar shortest_distance =(_mesh->point(closest)- _hit_point).sqrnorm();
162 if((_mesh->point(*fv_it)- _hit_point).sqrnorm()<shortest_distance) {
163 shortest_distance =(_mesh->point(*fv_it)- _hit_point).sqrnorm();
169 }
while( fv_it.is_valid() );
171 _mesh->status(closest).set_selected(!_mesh->status(closest).selected());
173 if(_mesh->status(closest).selected())
174 emit scriptInfo(
"selectVertices(ObjectId(" + QString::number(_objectId) +
") , [" + QString::number(closest.idx())+
"])");
176 emit scriptInfo(
"unselectVertices(ObjectId(" + QString::number(_objectId) +
") , [" + QString::number(closest.idx())+
"])");
183 typename MeshT::FaceHalfedgeIter fhe_it(*_mesh, fh);
185 typename MeshT::HalfedgeHandle closest(-1);
186 typename MeshT::Scalar closest_dist(-1);
188 typename MeshT::Point pp =(
typename MeshT::Point)_hit_point;
190 for(; fhe_it.is_valid(); ++fhe_it) {
195 typename MeshT::Point lp0 = _mesh->point(_mesh->to_vertex_handle (*fhe_it));
196 typename MeshT::Point lp1 = _mesh->point(_mesh->from_vertex_handle(*fhe_it));
200 if(dist_new <closest_dist || closest_dist == -1) {
203 closest_dist = dist_new;
208 typename MeshT::EdgeHandle closest_eh = _mesh->edge_handle(closest);
210 if(_primitiveType & edgeType_) {
212 _mesh->status(closest_eh).set_selected(!_mesh->status(closest_eh).selected());
214 if(_mesh->status(closest_eh).selected())
215 emit scriptInfo(
"selectEdges(ObjectId(" + QString::number(_objectId) +
") , [" + QString::number(closest_eh.idx())+
"])");
217 emit scriptInfo(
"unselectEdges(ObjectId(" + QString::number(_objectId) +
") , [" + QString::number(closest_eh.idx())+
"])");
220 _mesh->status(closest).set_selected(!_mesh->status(closest).selected());
222 if(_mesh->status(closest).selected())
223 emit scriptInfo(
"selectHalfedges(ObjectId(" + QString::number(_objectId) +
") , [" + QString::number(closest.idx())+
"])");
225 emit scriptInfo(
"unselectHalfedges(ObjectId(" + QString::number(_objectId) +
") , [" + QString::number(closest.idx())+
"])");
232 _mesh->status(fh).set_selected(!_mesh->status(fh).selected());
234 if(_mesh->status(fh).selected())
235 emit scriptInfo(
"selectFaces(ObjectId(" + QString::number(_objectId) +
") , [" + QString::number(fh.idx())+
"])");
237 emit scriptInfo(
"unselectFaces(ObjectId(" + QString::number(_objectId) +
") , [" + QString::number(fh.idx())+
"])");
254 template <
class MeshT>
258 typename MeshT::Point _hitpoint,
260 PrimitiveType _primitiveType,
264 const float sqr_radius = _radius * _radius;
267 const bool sel = !_deselection;
270 std::set< typename MeshT::FaceHandle > visited;
272 typename MeshT::FaceHandle hitface = _mesh->face_handle(_target_idx);
274 if(!hitface.is_valid())
277 visited.insert(hitface);
280 std::vector<typename MeshT::FaceHandle> face_handles;
281 face_handles.reserve(50);
282 face_handles.push_back(hitface);
286 while(!face_handles.empty()) {
287 typename MeshT::FaceHandle fh = face_handles.back();
289 face_handles.pop_back();
293 unsigned int fVertices = 0;
296 std::vector<typename MeshT::EdgeHandle> edge_handles;
298 for(
typename MeshT::FaceHalfedgeIter fh_it(*_mesh,fh); fh_it.is_valid(); ++fh_it) {
300 const typename MeshT::VertexHandle vh = _mesh->from_vertex_handle(*fh_it);
302 if((_mesh->point(vh) - _hitpoint).sqrnorm() <= sqr_radius) {
306 _mesh->status(vh).set_selected(sel);
309 if((_mesh->point(_mesh->to_vertex_handle(*fh_it))- _hitpoint).sqrnorm()<= sqr_radius)
310 edge_handles.push_back(_mesh->edge_handle(*fh_it));
321 for(
size_t i=0; i < edge_handles.size(); i++) {
323 if(!_mesh->has_face_normals() || std::abs(_mesh->calc_dihedral_angle_fast(edge_handles[i])) >=
dihedral_angle_threshold_)
325 _mesh->status( _mesh->halfedge_handle(edge_handles[i],0) ).set_selected(sel) ;
326 _mesh->status( _mesh->halfedge_handle(edge_handles[i],1) ).set_selected(sel) ;
329 if (_primitiveType & edgeType_)
330 if(!_mesh->has_face_normals() || std::abs(_mesh->calc_dihedral_angle_fast(edge_handles[i])) >=
dihedral_angle_threshold_)
331 _mesh->status(edge_handles[i]).set_selected(sel);
339 if( _mesh->valence(fh ) == fVertices) {
340 _mesh->status(fh).set_selected(sel);
348 for(
typename MeshT::FaceFaceIter ff_it(*_mesh,fh); ff_it.is_valid(); ++ff_it) {
349 if ( visited.count(*ff_it) == 0 )
350 face_handles.push_back(*ff_it);
374 emit updatedObject(_objectId, update);
390 template<
class MeshT>
392 PrimitiveType _primitiveType,
bool _deselection) {
397 typename MeshT::VertexIter v_it, v_end(_mesh->vertices_end());
398 for(v_it=_mesh->vertices_begin(); v_it!=v_end; ++v_it)
399 _mesh->status(*v_it).set_tagged(
false);
402 for(v_it=_mesh->vertices_begin(); v_it!=v_end; ++v_it) {
404 proj = _state.
project(_mesh->point(*v_it));
406 if(_region->contains(QPoint((
int)proj[0], _state.
context_height()- (int)proj[1]))) {
408 _mesh->status(*v_it).set_tagged(
true);
411 _mesh->status(*v_it).set_selected(!_deselection);
418 typename MeshT::EdgeIter e_it, e_end(_mesh->edges_end());
419 for(e_it=_mesh->edges_begin(); e_it!=e_end; ++e_it) {
421 if(_mesh->status(_mesh->to_vertex_handle(_mesh->halfedge_handle(*e_it, 0))).tagged()||
422 _mesh->status(_mesh->to_vertex_handle(_mesh->halfedge_handle(*e_it, 1))).tagged()) {
424 if(_primitiveType & edgeType_)
426 _mesh->status(*e_it).set_selected(!_deselection);
428 if(_primitiveType & halfedgeType_)
431 _mesh->status(_mesh->halfedge_handle(*e_it,0)).set_selected(!_deselection);
432 _mesh->status(_mesh->halfedge_handle(*e_it,1)).set_selected(!_deselection);
439 typename MeshT::FaceIter f_it, f_end(_mesh->faces_end());
440 for(f_it=_mesh->faces_begin(); f_it!=f_end; ++f_it) {
443 for(
typename MeshT::FaceVertexIter fv_it(*_mesh,*f_it); fv_it.is_valid(); ++fv_it)
444 if(_mesh->status(*fv_it).tagged())
448 _mesh->status(*f_it).set_selected(!_deselection);
454 if(_primitiveType & edgeType_)
456 if(_primitiveType & halfedgeType_)
458 if(_primitiveType & faceType_)
473 template<
class MeshT>
476 typename MeshT::VertexHandle vh = _mesh->vertex_handle(_vh);
480 typename MeshT::VertexHandle vhBound = MeshNavigation::findClosestBoundary(_mesh , vh);
481 if(vhBound.is_valid()) {
485 if(!_mesh->get_property_handle(visited,
"Visited Vertices"))
486 _mesh->add_property(visited,
"Visited Vertices");
488 typename MeshT::VertexIter v_it, v_end = _mesh->vertices_end();
489 for(v_it = _mesh->vertices_begin(); v_it != v_end; ++v_it)
490 _mesh->property(visited, *v_it)=
false;
492 std::stack<typename MeshT::VertexHandle> stack;
495 while(!stack.empty()) {
497 typename MeshT::VertexHandle vh = stack.top();
500 if(_mesh->property(visited,vh))
504 for(
typename MeshT::VertexOHalfedgeIter voh_it(*_mesh,vh); voh_it.is_valid(); ++voh_it) {
506 if(_mesh->is_boundary(_mesh->edge_handle(*voh_it))) {
508 stack.push(_mesh->to_vertex_handle(*voh_it));
511 _mesh->status(_mesh->edge_handle(*voh_it)).set_selected(!_deselection);
514 typename MeshT::HalfedgeHandle heh = *voh_it;
515 if(!_mesh->is_boundary(heh))heh = _mesh->opposite_halfedge_handle(heh);
516 _mesh->status(heh).set_selected(!_deselection);
521 typename MeshT::FaceHandle f1 = _mesh->face_handle(*voh_it);
522 typename MeshT::FaceHandle f2 = _mesh->face_handle(_mesh->opposite_halfedge_handle(*voh_it));
523 if(f1.is_valid())_mesh->status(f1).set_selected(!_deselection);
524 if(f2.is_valid())_mesh->status(f2).set_selected(!_deselection);
528 _mesh->property(visited,vh)=
true;
531 _mesh->status(vh).set_selected(!_deselection);
533 _mesh->remove_property(visited);
537 emit log(
LOGERR, tr(
"Unable to find boundary."));
540 emit log(
LOGERR, tr(
"Invalid vertex handle."));
555 template<
class MeshT>
557 MeshT* _mesh,
int _objectId, uint _fh,
double _maxAngle,
558 PrimitiveType _primitiveTypes,
bool _deselection) {
561 for (
auto face : _mesh->faces() )
562 _mesh->status(face).set_tagged(
false);
564 std::vector<typename MeshT::FaceHandle> face_handles;
567 typename MeshT::FaceHandle hitFace =
typename MeshT::FaceHandle(_fh);
568 face_handles.reserve(50);
569 face_handles.push_back(hitFace);
570 _mesh->status(hitFace).set_tagged(
true);
572 typename MeshT::Point n1 = _mesh->normal(hitFace);
574 double maxAngle = OpenMesh::deg_to_rad(_maxAngle);
576 while (!face_handles.empty()) {
577 typename MeshT::FaceHandle fh = face_handles.back();
578 face_handles.pop_back();
580 for (
auto ff_it : _mesh->ff_range(fh)) {
583 if (_mesh->status(ff_it).tagged())
586 typename MeshT::Point n2 = _mesh->normal(ff_it);
588 double angle = acos(n1 | n2);
590 if (angle <= maxAngle) {
591 _mesh->status(ff_it).set_tagged(
true);
592 face_handles.push_back(ff_it);
598 for (
auto face : _mesh->faces() ) {
599 if (_mesh->status(face).tagged()) {
602 for (
typename MeshT::FaceVertexIter fv_it(*_mesh,face) ; fv_it.is_valid(); ++fv_it)
603 _mesh->status(*fv_it).set_selected(!_deselection);
607 for (
typename MeshT::FaceEdgeIter fe_it(*_mesh,face) ; fe_it.is_valid(); ++fe_it)
608 _mesh->status(*fe_it).set_selected(!_deselection);
612 for (
typename MeshT::FaceHalfedgeIter fhe_it(*_mesh,face) ; fhe_it.is_valid(); ++fhe_it)
613 _mesh->status(*fhe_it).set_selected(!_deselection);
617 _mesh->status(face).set_selected(!_deselection);
643 template<
class MeshT>
645 MeshT* _mesh,
int _objectId, uint _fh,
ACG::Vec3d& _hit_point,
646 PrimitiveType _primitiveType) {
648 typename MeshT::FaceHandle fh = _mesh->face_handle(_fh);
657 _mesh->add_property(visited);
659 typename MeshT::VertexIter v_it;
660 typename MeshT::VertexIter v_end = _mesh->vertices_end();
663 for (v_it = _mesh->vertices_begin(); v_it != v_end; ++v_it)
664 _mesh->property(visited, *v_it) =
false;
667 typename MeshT::VertexHandle current = *(_mesh->fv_iter(fh));
668 if(!current.is_valid())
671 std::set<typename MeshT::VertexHandle> unprocessed;
672 unprocessed.insert(current);
674 while( !unprocessed.empty() ) {
677 current = *unprocessed.begin();
678 _mesh->status(current).set_selected(!(_mesh->status(current)).selected());
679 _mesh->property(visited, current) =
true;
680 unprocessed.erase(current);
683 for(
typename MeshT::VertexVertexIter vv_it = _mesh->vv_iter(current); vv_it.is_valid(); ++vv_it) {
684 if(_mesh->property(visited, *vv_it) ==
true)
continue;
685 unprocessed.insert(*vv_it);
690 _mesh->remove_property(visited);
697 _mesh->add_property(visited);
699 typename MeshT::FaceIter f_it;
700 typename MeshT::FaceIter f_end = _mesh->faces_end();
703 for (f_it = _mesh->faces_begin(); f_it != f_end; ++f_it)
704 _mesh->property(visited, *f_it) =
false;
707 typename MeshT::FaceHandle current = fh;
709 std::set<typename MeshT::FaceHandle> unprocessed;
710 unprocessed.insert(current);
712 typename MeshT::EdgeHandle firstEdge = *(_mesh->fe_iter(fh));
713 if(!firstEdge.is_valid())
return;
714 bool selected = _mesh->status(firstEdge).selected();
716 while( !unprocessed.empty() ) {
719 current = *unprocessed.begin();
720 for(
typename MeshT::FaceHalfedgeIter fh_it = _mesh->fh_iter(current); fh_it.is_valid(); ++fh_it) {
721 if(_primitiveType & halfedgeType_) {
722 _mesh->status(*fh_it).set_selected(!(_mesh->status(*fh_it)).selected());
724 if(_primitiveType & edgeType_) {
725 _mesh->status(_mesh->edge_handle(*fh_it)).set_selected(!selected);
729 _mesh->property(visited, current) =
true;
730 unprocessed.erase(current);
733 for(
typename MeshT::FaceFaceIter ff_it = _mesh->ff_iter(current); ff_it.is_valid(); ++ff_it) {
734 if(_mesh->property(visited, *ff_it) ==
true)
continue;
735 unprocessed.insert(*ff_it);
740 _mesh->remove_property(visited);
747 _mesh->add_property(visited);
749 typename MeshT::FaceIter f_it;
750 typename MeshT::FaceIter f_end = _mesh->faces_end();
753 for (f_it = _mesh->faces_begin(); f_it != f_end; ++f_it)
754 _mesh->property(visited, *f_it) =
false;
757 typename MeshT::FaceHandle current = fh;
759 std::set<typename MeshT::FaceHandle> unprocessed;
760 unprocessed.insert(current);
762 while( !unprocessed.empty() ) {
765 current = *unprocessed.begin();
766 _mesh->status(current).set_selected(!(_mesh->status(current)).selected());
767 _mesh->property(visited, current) =
true;
768 unprocessed.erase(current);
771 for(
typename MeshT::FaceFaceIter ff_it = _mesh->ff_iter(current); ff_it.is_valid(); ++ff_it) {
772 if(_mesh->property(visited, *ff_it) ==
true)
continue;
773 unprocessed.insert(*ff_it);
778 _mesh->remove_property(visited);
780 if(_primitiveType & vertexType_)
782 if(_primitiveType & edgeType_)
784 if(_primitiveType & halfedgeType_)
786 if(_primitiveType & faceType_)
801 template<
typename MeshT >
803 PrimitiveType _primitiveTypes,
817 typename MeshT::VertexIter v_it, v_end=_mesh->vertices_end();
820 if ( !_mesh->has_vertex_colors() )
821 _mesh->request_vertex_colors();
823 for (v_it=_mesh->vertices_begin(); v_it!=v_end; ++v_it)
824 if ( _mesh->status(*v_it).selected() )
825 _mesh->set_color(*v_it, color);
829 typename MeshT::FaceIter f_it, f_end( _mesh->faces_end() );
832 if ( !_mesh->has_face_colors() )
833 _mesh->request_face_colors();
835 for (f_it=_mesh->faces_begin(); f_it!=f_end; ++f_it)
836 if ( _mesh->status(*f_it).selected() )
837 _mesh->set_color(*f_it, color);
841 typename MeshT::EdgeIter e_it, e_end( _mesh->edges_end() );
844 if ( !_mesh->has_edge_colors() )
845 _mesh->request_edge_colors();
847 for (e_it=_mesh->edges_begin(); e_it!=e_end; ++e_it)
848 if ( _mesh->status(*e_it).selected() )
849 _mesh->set_color(*e_it, color);
853 typename MeshT::HalfedgeIter h_it, h_end( _mesh->halfedges_end() );
856 if ( !_mesh->has_halfedge_colors() )
857 _mesh->request_halfedge_colors();
859 for (h_it=_mesh->halfedges_begin(); h_it!=h_end; ++h_it)
860 if ( _mesh->status(*h_it).selected() )
861 _mesh->set_color(*h_it, color);
875 template<
class MeshT>
881 _mesh.add_property(copyHandle,
"copyHandle Property");
884 typename MeshT::VertexIter v_it, v_end = _mesh.vertices_end();
885 for (v_it = _mesh.vertices_begin(); v_it != v_end; ++v_it) {
891 copy = _mesh.status(*v_it).selected();
894 for (
typename MeshT::VertexOHalfedgeIter voh_it(_mesh, *v_it); voh_it.is_valid(); ++voh_it)
895 if (_mesh.status(_mesh.edge_handle(*voh_it)).selected()) {
901 for (
typename MeshT::VertexFaceIter vf_it(_mesh, *v_it); vf_it.is_valid(); ++vf_it)
902 if (_mesh.status(*vf_it).selected()) {
910 _mesh.property(copyHandle, *v_it) = _newMesh.add_vertex(_mesh.point(*v_it));
912 _mesh.property(copyHandle, *v_it) =
typename MeshT::VertexHandle(-1);
918 typename MeshT::FaceIter f_it, f_end = _mesh.faces_end();
919 for (f_it = _mesh.faces_begin(); f_it != f_end; ++f_it) {
921 std::vector<typename MeshT::VertexHandle> v;
925 for (
typename MeshT::FaceVertexIter fv_it(_mesh, *f_it); fv_it.is_valid(); ++fv_it)
926 if (_mesh.property(copyHandle, *fv_it).is_valid())
927 v.push_back(_mesh.property(copyHandle, *fv_it));
934 _newMesh.add_face(v);
937 _newMesh.update_normals();
939 _mesh.remove_property(copyHandle);
943 template<
class MeshT>
948 typename MeshT::VertexIter v_it, v_end = _mesh->vertices_end();
949 for (v_it = _mesh->vertices_begin(); v_it != v_end; ++v_it) {
950 const typename MeshT::Point p = _mesh->point(*v_it);
954 if (_component.contains(
"x",Qt::CaseInsensitive) ) {
955 select = (p[0] > _value);
956 }
else if (_component.contains(
"y",Qt::CaseInsensitive) ) {
957 select = (p[1] > _value);
958 }
else if (_component.contains(
"z",Qt::CaseInsensitive) ) {
959 select = (p[2] > _value);
961 emit log(
LOGERR,tr(
"selectVerticesByValue, undefined component ") + _component );
970 if ( ! _mesh->status(*v_it).selected() )
971 _mesh->status(*v_it).set_selected(select);
977 template <
typename HandleT>
980 if (!_handle.is_valid())
985 emit log(
LOGERR,tr(
"selectElement: unable to get object"));
990 elementList.push_back(_handle.idx());
994 bool handle_valid =
false;
1003 emit log(
LOGERR,tr(
"selectElement: Unsupported object Type"));
1007 if (handle_valid && _fly_to_element)
1010 return handle_valid;
1013 template <
typename MeshObjectT,
typename HandleT>
1019 _mesh_object.boundingBox(bbMin, bbMax);
1021 auto& mesh = *_mesh_object.mesh();
1023 if (_handle.is_valid() &&
static_cast<size_t>(_handle.idx()) < mesh.template n_elements<HandleT>())
1026 normal = 0.5 * (bbMax-bbMin).length() * mesh.
calc_normal(_handle);
1027 handle_valid =
true;
1031 handle_valid =
false;
Vec::value_type distPointLineSquared(const Vec &_p, const Vec &_v0, const Vec &_v1, Vec *_min_v)
squared distance from point _p to line segment (_v0,_v1)
#define DATA_TRIANGLE_MESH
void selectVerticesByValue(int _objectId, QString _component, bool _greater, double _value)
Select vertices by their value.
Functions for getting information about a mesh.
PolyMesh * polyMesh(BaseObjectData *_object)
Get a poly mesh from an object.
double dihedral_angle_threshold_
Handle to selection environment.
Vec3d project(const Vec3d &_point) const
project point in world coordinates to window coordinates
bool getObject(const int _identifier, BaseObject *&_object)
Get the object which has the given identifier.
TriMesh * triMesh(BaseObjectData *_object)
Get a triangle mesh from an object.
bool deleteSelection(MeshT *_mesh, PrimitiveType _primitiveType)
Delete all selected elements of a mesh.
SelectionInterface::PrimitiveType faceType_
Handle to selection environment.
bool dataType(DataType _type) const
std::vector< int > IdList
Standard Type for id Lists used for scripting.
SelectionInterface::PrimitiveType vertexType_
Primitive type handles:
Add colors to mesh item (vertices/faces/edges)
void getFlightData(MeshObjectT &_mesh_object, HandleT _handle, OpenMesh::Vec3d ¢er, OpenMesh::Vec3d &normal, bool &handle_valid)
set dihedral angle threshold for edge selection
const UpdateType UPDATE_SELECTION_HALFEDGES(UpdateTypeSet(128))
Halfedge selection has changed.
void update_dihedral_angle_threshold_from_ui()
set dihedral angle threshold for edge selection
VectorT< unsigned char, 4 > Vec4uc
PolyMeshObject * polyMeshObject(BaseObjectData *_object)
Cast an BaseObject to a PolyMeshObject if possible.
Functions for selection on a mesh.
TriMeshObject * triMeshObject(BaseObjectData *_object)
Cast an BaseObject to a TriMeshObject if possible.
SelectionInterface::PrimitiveType edgeType_
Handle to selection environment.
void createMeshFromSelection(MeshT &_mesh, MeshT &_newMesh, PrimitiveType _primitiveType)
Create a new mesh from the selection.
void colorizeSelection(MeshT *_mesh, PrimitiveType _primitiveTypes, int _red, int _green, int _blue, int _alpha)
Colorize the selection.
void componentsMeshSelection(MeshT *_mesh, int _objectId, uint _fh, ACG::Vec3d &_hit_point, PrimitiveType _primitiveType)
Connected component mesh selection.
bool selectElement(int _objectId, HandleT _handle, bool _fly_to_element)
set dihedral angle threshold for edge selection
SelectionInterface::PrimitiveType halfedgeType_
Handle to selection environment.
VectorT< float, 4 > Vec4f
const UpdateType UPDATE_SELECTION_EDGES(UpdateTypeSet(64))
Edge selection has changed.
void closestBoundarySelection(MeshT *_mesh, int _vh, PrimitiveType _primitiveTypes, bool _deselection)
Select all entities that are incident to closest boundary.
Point calc_centroid(FaceHandle _fh) const
Computes and returns the average of the vertices defining _fh (same as calc_face_centroid) ...
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.
const UpdateType UPDATE_SELECTION_FACES(UpdateTypeSet(256))
Face selection has changed.
bool volumeSelection(MeshT *_mesh, int _objectId, ACG::GLState &_state, QRegion *_region, PrimitiveType _primitiveTypes, bool _deselection)
Surface volume selection tool.
int context_height() const
get gl context height
void toggleMeshSelection(int _objectId, MeshT *_mesh, uint _fh, ACG::Vec3d &_hit_point, PrimitiveType _primitiveType)
Toggle mesh selection.
const UpdateType UPDATE_NONE(UpdateTypeSet(0))
Empty update for empty initialization of update type.
void update_regions(MeshT *_mesh)
Update face selection to correspond to the vertex selection.
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) ...
Normal calc_normal(FaceHandle _fh) const
same as calc_face_normal
const UpdateType UPDATE_SELECTION_VERTICES(UpdateTypeSet(32))
Vertex selection has changed.
void flyTo(const ACG::Vec3d &_position, const ACG::Vec3d &_center, double _time)
Fly to point and viewing direction (animated).