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
static Sign side(const GenericOrientedLine< float > &a, const GenericOrientedLine< float > &b)
Picker(const Camera *cam)
Constructor.
Definition picker.cpp:39
OpenGL Shader Compilation.
Definition shader_program.h:75
A halfedge data structure for polygonal meshes of 2-manifold.
Definition surface_mesh.h:51
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(const Camera *cam)
Constructor.
Definition picker_surface_mesh.cpp:41
~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
Vec< 3, float > vec3
A 3D point/vector of float type.
Definition types.h:44
GenericOrientedLine< float > OrientedLine3
A 3D oriented line of float type.
Definition types.h:95
GenericPolygon< float > Polygon2
A 2D polygon of float type.
Definition types.h:116
GenericRect< float > Rect
A 2D axis-aligned rectangle of float type.
Definition types.h:111
Sign sign(T x)
returns the sign of a value.
Definition oriented_line.h:28
GenericPlane< float > Plane3
A 3D plane of float type.
Definition types.h:103
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