28#ifndef EASY3D_GUI_PICKER_SURFACE_MESH_H
29#define EASY3D_GUI_PICKER_SURFACE_MESH_H
31#include <easy3d/gui/picker.h>
32#include <easy3d/core/surface_mesh.h>
63 unsigned int resolution()
const {
return hit_resolution_; }
195 Sign face_sign = ZERO;
197 auto s = model->source(h);
198 auto t = model->target(h);
199 const OrientedLine3 edge_line(model->position(t), model->position(s));
202 if (face_sign != ZERO &&
sign != face_sign)
211 unsigned int hit_resolution_;
212 SurfaceMesh::Face picked_face_;
A perspective or orthographic camera.
Definition camera.h:113
OrientedLine implements plucker coordinates, which enables oriented lines to be compared.
Definition oriented_line.h:43
static Sign side(const GenericOrientedLine< FT > &a, const GenericOrientedLine< FT > &b)
Definition oriented_line.h:97
A 2D polygon representation.
Definition polygon.h:43
The GenericRect class defines a rectangle in the 2D space, where the origin of the coordinate system ...
Definition rect.h:45
Base class for picking mechanism.
Definition picker.h:43
OpenGL Shader Compilation.
Definition shader_program.h:75
A halfedge data structure for polygonal meshes of 2-manifold.
Definition surface_mesh.h:51
Implementation of picking elements (i.e, vertices, faces, edges) from a surface mesh.
Definition picker_surface_mesh.h:44
SurfaceMesh::Face picked_face() const
Query the previously picked face.
Definition picker_surface_mesh.cpp:172
unsigned int resolution() const
Returns the picker resolution (in pixels).
Definition picker_surface_mesh.h:63
vec3 picked_point(SurfaceMesh *model, SurfaceMesh::Face picked_face, int x, int y) const
Query the coordinate of the previously picked position, which is the intersection between the picking...
Definition picker_surface_mesh.cpp:180
SurfaceMesh::Halfedge pick_edge(SurfaceMesh *model, int x, int y)
Pick an edge from a surface mesh given the cursor position.
Definition picker_surface_mesh.cpp:159
SurfaceMesh::Face pick_face(SurfaceMesh *model, int x, int y)
Pick a face from a surface mesh given the cursor position.
Definition picker_surface_mesh.cpp:49
~SurfaceMeshPicker() override=default
Destructor.
std::vector< SurfaceMesh::Face > pick_faces(SurfaceMesh *model, const Rect &rect)
Pick faces of a surface mesh by a rectangle.
Definition picker_surface_mesh.cpp:355
SurfaceMesh::Vertex pick_vertex(SurfaceMesh *model, int x, int y)
Pick a vertex from a surface mesh given the cursor position.
Definition picker_surface_mesh.cpp:109
void set_resolution(unsigned int r)
Sets the picker resolution (in pixels).
Definition picker_surface_mesh.h:69
Definition collider.cpp:182
Sign sign(T x)
returns the sign of a value.
Definition oriented_line.h:28
Sign
The sign.
Definition oriented_line.h:20
Definition surface_mesh.h:191
This type represents a halfedge (internally it is basically an index).
Definition surface_mesh.h:155
This type represents a vertex (internally it is basically an index).
Definition surface_mesh.h:135