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 typename MeshT::FaceIter f_it, f_end(_mesh->faces_end());
562 for (f_it=_mesh->faces_begin(); f_it!=f_end; ++f_it)
563 _mesh->status(*f_it).set_tagged(
false);
565 std::vector<typename MeshT::FaceHandle> face_handles;
568 typename MeshT::FaceHandle hitFace =
typename MeshT::FaceHandle(_fh);
569 face_handles.reserve(50);
570 face_handles.push_back(hitFace);
571 _mesh->status(hitFace).set_tagged(
true);
573 typename MeshT::Point n1 = _mesh->normal(hitFace);
575 double maxAngle = OpenMesh::deg_to_rad(_maxAngle);
577 while (!face_handles.empty()) {
578 typename MeshT::FaceHandle fh = face_handles.back();
579 face_handles.pop_back();
581 for (
typename MeshT::FaceFaceIter ff_it(*_mesh,fh) ; ff_it.is_valid() ; ++ff_it) {
584 if (_mesh->status(*ff_it).tagged())
587 typename MeshT::Point n2 = _mesh->normal(*ff_it);
589 double angle = acos(n1 | n2);
591 if (angle <= maxAngle) {
592 _mesh->status(*ff_it).set_tagged(
true);
593 face_handles.push_back(*ff_it);
599 for (f_it=_mesh->faces_begin(); f_it!=f_end; ++f_it) {
600 if (_mesh->status(*f_it).tagged()) {
603 for (
typename MeshT::FaceVertexIter fv_it(*_mesh,*f_it) ; fv_it.is_valid(); ++fv_it)
604 _mesh->status(*fv_it).set_selected(!_deselection);
608 for (
typename MeshT::FaceEdgeIter fe_it(*_mesh,*f_it) ; fe_it.is_valid(); ++fe_it)
609 _mesh->status(*fe_it).set_selected(!_deselection);
613 for (
typename MeshT::FaceHalfedgeIter fhe_it(*_mesh,*f_it) ; fhe_it.is_valid(); ++fhe_it)
614 _mesh->status(*fhe_it).set_selected(!_deselection);
618 _mesh->status(*f_it).set_selected(!_deselection);
644 template<
class MeshT>
646 MeshT* _mesh,
int _objectId, uint _fh,
ACG::Vec3d& _hit_point,
647 PrimitiveType _primitiveType) {
649 typename MeshT::FaceHandle fh = _mesh->face_handle(_fh);
658 _mesh->add_property(visited);
660 typename MeshT::VertexIter v_it;
661 typename MeshT::VertexIter v_end = _mesh->vertices_end();
664 for (v_it = _mesh->vertices_begin(); v_it != v_end; ++v_it)
665 _mesh->property(visited, *v_it) =
false;
668 typename MeshT::VertexHandle current = *(_mesh->fv_iter(fh));
669 if(!current.is_valid())
672 std::set<typename MeshT::VertexHandle> unprocessed;
673 unprocessed.insert(current);
675 while( !unprocessed.empty() ) {
678 current = *unprocessed.begin();
679 _mesh->status(current).set_selected(!(_mesh->status(current)).selected());
680 _mesh->property(visited, current) =
true;
681 unprocessed.erase(current);
684 for(
typename MeshT::VertexVertexIter vv_it = _mesh->vv_iter(current); vv_it.is_valid(); ++vv_it) {
685 if(_mesh->property(visited, *vv_it) ==
true)
continue;
686 unprocessed.insert(*vv_it);
691 _mesh->remove_property(visited);
698 _mesh->add_property(visited);
700 typename MeshT::FaceIter f_it;
701 typename MeshT::FaceIter f_end = _mesh->faces_end();
704 for (f_it = _mesh->faces_begin(); f_it != f_end; ++f_it)
705 _mesh->property(visited, *f_it) =
false;
708 typename MeshT::FaceHandle current = fh;
710 std::set<typename MeshT::FaceHandle> unprocessed;
711 unprocessed.insert(current);
713 typename MeshT::EdgeHandle firstEdge = *(_mesh->fe_iter(fh));
714 if(!firstEdge.is_valid())
return;
715 bool selected = _mesh->status(firstEdge).selected();
717 while( !unprocessed.empty() ) {
720 current = *unprocessed.begin();
721 for(
typename MeshT::FaceHalfedgeIter fh_it = _mesh->fh_iter(current); fh_it.is_valid(); ++fh_it) {
722 if(_primitiveType & halfedgeType_) {
723 _mesh->status(*fh_it).set_selected(!(_mesh->status(*fh_it)).selected());
725 if(_primitiveType & edgeType_) {
726 _mesh->status(_mesh->edge_handle(*fh_it)).set_selected(!selected);
730 _mesh->property(visited, current) =
true;
731 unprocessed.erase(current);
734 for(
typename MeshT::FaceFaceIter ff_it = _mesh->ff_iter(current); ff_it.is_valid(); ++ff_it) {
735 if(_mesh->property(visited, *ff_it) ==
true)
continue;
736 unprocessed.insert(*ff_it);
741 _mesh->remove_property(visited);
748 _mesh->add_property(visited);
750 typename MeshT::FaceIter f_it;
751 typename MeshT::FaceIter f_end = _mesh->faces_end();
754 for (f_it = _mesh->faces_begin(); f_it != f_end; ++f_it)
755 _mesh->property(visited, *f_it) =
false;
758 typename MeshT::FaceHandle current = fh;
760 std::set<typename MeshT::FaceHandle> unprocessed;
761 unprocessed.insert(current);
763 while( !unprocessed.empty() ) {
766 current = *unprocessed.begin();
767 _mesh->status(current).set_selected(!(_mesh->status(current)).selected());
768 _mesh->property(visited, current) =
true;
769 unprocessed.erase(current);
772 for(
typename MeshT::FaceFaceIter ff_it = _mesh->ff_iter(current); ff_it.is_valid(); ++ff_it) {
773 if(_mesh->property(visited, *ff_it) ==
true)
continue;
774 unprocessed.insert(*ff_it);
779 _mesh->remove_property(visited);
781 if(_primitiveType & vertexType_)
783 if(_primitiveType & edgeType_)
785 if(_primitiveType & halfedgeType_)
787 if(_primitiveType & faceType_)
802 template<
typename MeshT >
804 PrimitiveType _primitiveTypes,
818 typename MeshT::VertexIter v_it, v_end=_mesh->vertices_end();
821 if ( !_mesh->has_vertex_colors() )
822 _mesh->request_vertex_colors();
824 for (v_it=_mesh->vertices_begin(); v_it!=v_end; ++v_it)
825 if ( _mesh->status(*v_it).selected() )
826 _mesh->set_color(*v_it, color);
830 typename MeshT::FaceIter f_it, f_end( _mesh->faces_end() );
833 if ( !_mesh->has_face_colors() )
834 _mesh->request_face_colors();
836 for (f_it=_mesh->faces_begin(); f_it!=f_end; ++f_it)
837 if ( _mesh->status(*f_it).selected() )
838 _mesh->set_color(*f_it, color);
842 typename MeshT::EdgeIter e_it, e_end( _mesh->edges_end() );
845 if ( !_mesh->has_edge_colors() )
846 _mesh->request_edge_colors();
848 for (e_it=_mesh->edges_begin(); e_it!=e_end; ++e_it)
849 if ( _mesh->status(*e_it).selected() )
850 _mesh->set_color(*e_it, color);
854 typename MeshT::HalfedgeIter h_it, h_end( _mesh->halfedges_end() );
857 if ( !_mesh->has_halfedge_colors() )
858 _mesh->request_halfedge_colors();
860 for (h_it=_mesh->halfedges_begin(); h_it!=h_end; ++h_it)
861 if ( _mesh->status(*h_it).selected() )
862 _mesh->set_color(*h_it, color);
876 template<
class MeshT>
882 _mesh.add_property(copyHandle,
"copyHandle Property");
885 typename MeshT::VertexIter v_it, v_end = _mesh.vertices_end();
886 for (v_it = _mesh.vertices_begin(); v_it != v_end; ++v_it) {
892 copy = _mesh.status(*v_it).selected();
895 for (
typename MeshT::VertexOHalfedgeIter voh_it(_mesh, *v_it); voh_it.is_valid(); ++voh_it)
896 if (_mesh.status(_mesh.edge_handle(*voh_it)).selected()) {
902 for (
typename MeshT::VertexFaceIter vf_it(_mesh, *v_it); vf_it.is_valid(); ++vf_it)
903 if (_mesh.status(*vf_it).selected()) {
911 _mesh.property(copyHandle, *v_it) = _newMesh.add_vertex(_mesh.point(*v_it));
913 _mesh.property(copyHandle, *v_it) =
typename MeshT::VertexHandle(-1);
919 typename MeshT::FaceIter f_it, f_end = _mesh.faces_end();
920 for (f_it = _mesh.faces_begin(); f_it != f_end; ++f_it) {
922 std::vector<typename MeshT::VertexHandle> v;
926 for (
typename MeshT::FaceVertexIter fv_it(_mesh, *f_it); fv_it.is_valid(); ++fv_it)
927 if (_mesh.property(copyHandle, *fv_it).is_valid())
928 v.push_back(_mesh.property(copyHandle, *fv_it));
935 _newMesh.add_face(v);
938 _newMesh.update_normals();
940 _mesh.remove_property(copyHandle);
944 template<
class MeshT>
949 typename MeshT::VertexIter v_it, v_end = _mesh->vertices_end();
950 for (v_it = _mesh->vertices_begin(); v_it != v_end; ++v_it) {
951 const typename MeshT::Point p = _mesh->point(*v_it);
955 if (_component.contains(
"x",Qt::CaseInsensitive) ) {
956 select = (p[0] > _value);
957 }
else if (_component.contains(
"y",Qt::CaseInsensitive) ) {
958 select = (p[1] > _value);
959 }
else if (_component.contains(
"z",Qt::CaseInsensitive) ) {
960 select = (p[2] > _value);
962 emit log(
LOGERR,tr(
"selectVerticesByValue, undefined component ") + _component );
971 if ( ! _mesh->status(*v_it).selected() )
972 _mesh->status(*v_it).set_selected(select);
978 template <
typename HandleT>
981 if (!_handle.is_valid())
986 emit log(
LOGERR,tr(
"selectElement: unable to get object"));
991 elementList.push_back(_handle.idx());
995 bool handle_valid =
false;
1004 emit log(
LOGERR,tr(
"selectElement: Unsupported object Type"));
1008 if (handle_valid && _fly_to_element)
1011 return handle_valid;
1014 template <
typename MeshObjectT,
typename HandleT>
1020 _mesh_object.boundingBox(bbMin, bbMax);
1022 auto& mesh = *_mesh_object.mesh();
1024 if (_handle.is_valid() &&
static_cast<size_t>(_handle.idx()) < mesh.template n_elements<HandleT>())
1027 normal = 0.5 * (bbMax-bbMin).length() * mesh.
calc_normal(_handle);
1028 handle_valid =
true;
1032 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.
const UpdateType UPDATE_SELECTION_VERTICES(UpdateTypeSet(1)<< 5)
Vertex selection has changed.
const UpdateType UPDATE_SELECTION_HALFEDGES(UpdateTypeSet(1)<< 7)
Halfedge selection has changed.
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
void update_dihedral_angle_threshold_from_ui()
set dihedral angle threshold for edge selection
VectorT< unsigned char, 4 > Vec4uc
const UpdateType UPDATE_SELECTION_FACES(UpdateTypeSet(1)<< 8)
Face selection has changed.
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.
const UpdateType UPDATE_SELECTION_EDGES(UpdateTypeSet(1)<< 6)
Edge selection has changed.
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
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.
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
void flyTo(const ACG::Vec3d &_position, const ACG::Vec3d &_center, double _time)
Fly to point and viewing direction (animated).