Easy3D 2.5.3
|
Implementation of picking elements (i.e, vertices, faces, edges) from a surface mesh. More...
#include <easy3d/gui/picker_surface_mesh.h>
Public Member Functions | |
SurfaceMeshPicker (const Camera *cam) | |
unsigned int | resolution () const |
Returns the picker resolution (in pixels). More... | |
void | set_resolution (unsigned int r) |
Sets the picker resolution (in pixels). More... | |
SurfaceMesh::Face | pick_face (SurfaceMesh *model, int x, int y) |
SurfaceMesh::Vertex | pick_vertex (SurfaceMesh *model, int x, int y) |
Pick a vertex from a surface mesh given the cursor position. More... | |
SurfaceMesh::Halfedge | pick_edge (SurfaceMesh *model, int x, int y) |
Pick an edge from a surface mesh given the cursor position. More... | |
SurfaceMesh::Vertex | pick_vertex (SurfaceMesh *model, SurfaceMesh::Face picked_face, int x, int y) |
Pick a vertex from a surface mesh given the cursor position and a known picked face. More... | |
SurfaceMesh::Halfedge | pick_edge (SurfaceMesh *model, SurfaceMesh::Face picked_face, int x, int y) |
Pick an edge from a surface mesh given the cursor position and a known picked face. More... | |
SurfaceMesh::Face | picked_face () const |
Query the previously picked face. More... | |
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 line and the picked face. More... | |
std::vector< SurfaceMesh::Face > | pick_faces (SurfaceMesh *model, const Rect &rect) |
Pick faces of a surface mesh by a rectangle. More... | |
std::vector< SurfaceMesh::Face > | pick_faces (SurfaceMesh *model, const Polygon2 &plg) |
Pick faces of a surface mesh by a polygon/lasso. More... | |
Public Member Functions inherited from Picker | |
Picker (const Camera *cam) | |
const Camera * | camera () const |
Returns the pointer of the camera. | |
Line3 | picking_line (int x, int y) const |
Construct a picking line. More... | |
vec3 | picking_dir (int x, int y) const |
The picking direction, pointing inside the screen. More... | |
vec3 | project (const vec3 &p) const |
Project a 3D point in the world coordinate system onto the 2D screen coordinate system. More... | |
vec3 | unproject (int x, int y, float depth) const |
Compute the world coordinates of a point defined in the screen coordinate system. More... | |
void | screen_to_opengl (int x, int y, int &gl_x, int &gl_y, int width, int height) const |
Convert a point expressed in the screen coordinate system (with an origin in the upper left corner) into the OpenGL coordinate system (with an origin in the lower left corner). The high DPI scaling is also taken into consideration, so the result always corresponds to its image pixel. More... | |
Implementation of picking elements (i.e, vertices, faces, edges) from a surface mesh.
SurfaceMesh::Halfedge pick_edge | ( | SurfaceMesh * | model, |
int | x, | ||
int | y | ||
) |
Pick an edge from a surface mesh given the cursor position.
x | The cursor x-coordinate, relative to the left edge of the content area. |
y | The cursor y-coordinate, relative to the top edge of the content area. |
SurfaceMesh::Halfedge pick_edge | ( | SurfaceMesh * | model, |
SurfaceMesh::Face | picked_face, | ||
int | x, | ||
int | y | ||
) |
Pick an edge from a surface mesh given the cursor position and a known picked face.
x | The cursor x-coordinate, relative to the left edge of the content area. |
y | The cursor y-coordinate, relative to the top edge of the content area. |
picked_face | The picked face. |
SurfaceMesh::Face pick_face | ( | SurfaceMesh * | model, |
int | x, | ||
int | y | ||
) |
Pick a face from a surface mesh given the cursor position.
x | The cursor x-coordinate, relative to the left edge of the content area. |
y | The cursor y-coordinate, relative to the top edge of the content area. |
std::vector< SurfaceMesh::Face > pick_faces | ( | SurfaceMesh * | model, |
const Polygon2 & | plg | ||
) |
Pick faces of a surface mesh by a polygon/lasso.
plg | The polygon region. |
std::vector< SurfaceMesh::Face > pick_faces | ( | SurfaceMesh * | model, |
const Rect & | rect | ||
) |
Pick faces of a surface mesh by a rectangle.
rect | The rectangle region. |
SurfaceMesh::Vertex pick_vertex | ( | SurfaceMesh * | model, |
int | x, | ||
int | y | ||
) |
Pick a vertex from a surface mesh given the cursor position.
x | The cursor x-coordinate, relative to the left edge of the content area. |
y | The cursor y-coordinate, relative to the top edge of the content area. |
SurfaceMesh::Vertex pick_vertex | ( | SurfaceMesh * | model, |
SurfaceMesh::Face | picked_face, | ||
int | x, | ||
int | y | ||
) |
Pick a vertex from a surface mesh given the cursor position and a known picked face.
x | The cursor x-coordinate, relative to the left edge of the content area. |
y | The cursor y-coordinate, relative to the top edge of the content area. |
picked_face | The picked face. |
SurfaceMesh::Face picked_face | ( | ) | const |
Query the previously picked face.
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 line and the picked face.
x | The cursor x-coordinate, relative to the left edge of the content area. |
y | The cursor y-coordinate, relative to the top edge of the content area. |
picked_face | The picked face. |
|
inline |
Returns the picker resolution (in pixels).
The picker resolution indicates the sensitivity for picking a vertex or an edge.
|
inline |
Sets the picker resolution (in pixels).
The picker resolution indicates the sensitivity for picking a vertex or an edge.