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>
54 unsigned int resolution()
const {
return hit_resolution_; }
175 Sign face_sign = ZERO;
177 auto s = model->
source(h);
178 auto t = model->
target(h);
182 if (face_sign != ZERO &&
sign != face_sign)
191 unsigned int hit_resolution_;
192 SurfaceMesh::Face picked_face_;
A perspective or orthographic camera.
Definition: camera.h:116
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:41
The GenericRect class defines a rectangle in the 2D space.
Definition: rect.h:42
Base class for picking mechanism.
Definition: picker.h:43
OpenGL Shader Compilation.
Definition: shader_program.h:78
A halfedge data structure for polygonal meshes of 2-manifold.
Definition: surface_mesh.h:52
const vec3 & position(Vertex v) const
position of a vertex (read only)
Definition: surface_mesh.h:1928
Vertex source(Halfedge h) const
returns the vertex the halfedge h emanates from
Definition: surface_mesh.h:1217
Vertex target(Halfedge h) const
returns the vertex the halfedge h points to
Definition: surface_mesh.h:1211
HalfedgeContainer halfedges() const
returns halfedge container for C++11 range-based for-loops
Definition: surface_mesh.h:1649
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:54
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)
Definition: picker_surface_mesh.cpp:49
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:57
Definition: collider.cpp:182
Sign
The sign.
Definition: oriented_line.h:20
Sign sign(T x)
returns the sign of a value.
Definition: oriented_line.h:28
Definition: surface_mesh.h:134
Definition: surface_mesh.h:114
Definition: surface_mesh.h:104