cgv
|
Public Types | |
enum | VertexPlaneLocation { VPL_INSIDE = -1 , VPL_TOUCH = 0 , VPL_OUTSIDE = 1 } |
enumeration of different vertex locations with respect to plane More... | |
enum | FacePlaneLocation { FPL_OUTSIDE = 0 , FPL_INSIDE = 3 , FPL_TOUCH_NOTHING = 0 , FPL_TOUCH_VERTEX = 1 , FPL_TOUCH_EDGE = 2 , FPL_TOUCH_FACE = 6 , FPL_SPLIT_TWO_VERTICES , FPL_SPLIT_VERTEX_EDGE , FPL_SPLIT_TWO_EDGES , FPL_TWO_NON_ADJACENT_VERTICES_TOUCH , FPL_INCOMLETE_TOUCH_FACE , FPL_TOUCH_AND_SPLIT , FPL_MULTI_SPLIT , FPL_ODD_TRANSITION_NUMBER , FPL_UNCONSIDERED_CASE , FPL_FIRST_INVALID_CASE = FPL_TWO_NON_ADJACENT_VERTICES_TOUCH } |
enumeration of 11 valid and 5 invalid cases that a face can be located with respect to a plane after locating vertices into outside, inside or touching More... | |
typedef std::vector< int > | face_type |
a face is an oriented list of vertex indices | |
typedef std::vector< face_type > | shell_type |
a shell is simply a list of faces | |
Public Member Functions | |
FacePlaneLocation | get_face_plane_location (const face_type &face, const std::vector< VertexPlaneLocation > &vertex_locations) const |
given a face as a list of vertex indices and a vector of vertex locations, determine the face location with respect to the current clip plane | |
handling of shells and faces | |
size_t | get_nr_shells () const |
return the current number of shells | |
const shell_type & | shell (int si) const |
shell_type & | shell (int si) |
virtual int | add_shell () |
add a new shell and return shell index | |
virtual void | del_shell (int si) |
remove the shell of the given index, be careful as shell indices large si get implizitely decreased | |
virtual void | copy_shell (int si_source, int si_target) |
copy a shell onto another one | |
virtual void | swap_shells (int si0, int si1) |
swap two shells | |
size_t | get_nr_faces (int si=0) const |
virtual int | add_face (int si=0) |
virtual void | del_face (int fi, int si=0) |
const face_type & | face (int fi, int si=0) const |
face_type & | face (int fi, int si=0) |
handling of vertices | |
virtual size_t | get_nr_vertices () const =0 |
return current number of vertices | |
virtual void | del_vertex (int vi)=0 |
virtual method to be implemented in derived class | |
void | remove_redundant_vertices () |
remove redundant vertices from mesh | |
Static Public Member Functions | |
static int | to_index (VertexPlaneLocation vertex_location) |
convert VertexPlaneLocation to an index in the range {0 .. 2} | |
static bool | is_face_location_on_one_side (FacePlaneLocation face_location) |
check if a face location is on one side of the plane only with potential touch events | |
static bool | is_face_location_split (FacePlaneLocation face_location) |
check if a face location corresponds to a split into parts (two for convex faces) | |
static bool | is_valid_face_location (FacePlaneLocation face_location) |
check if a face location corresponds to a valid configuration assuming planar convex faces | |
static int | box_get_face_vertex_index (int fi, int ci) |
function implementing the connectivity of an axis aligned box | |
static void | change_orientation (face_type &face) |
revert the orientation of a face in place, where the face is given by a list of vertex indices | |
static VertexPlaneLocation | vertex_location_side (const std::vector< VertexPlaneLocation > &vertex_locations) |
check whether all vertices lay on one side of the plane or on it, but not on the other; return side or VPL_TOUCH if vertices lay on both sides | |
static VertexPlaneLocation | shell_location_side (const std::vector< FacePlaneLocation > &face_locations) |
check whether all faces of a shell lay on one side of the plane or touch it, but not on the other side; return side or VPL_TOUCH if shell is intersected by plane | |
static std::pair< int, int > | extract_touching_halfedge (const face_type &face, const std::vector< VertexPlaneLocation > &vertex_locations) |
given a face as a list of vertex indices and a vector of vertex locations, find a halfedge that touches the current clip plane | |
Protected Attributes | |
std::vector< shell_type > | shells |
vector of shells | |
Definition at line 15 of file convex_polyhedron.h.
typedef std::vector<int> cgv::media::mesh::convex_polyhedron_base::face_type |
a face is an oriented list of vertex indices
Definition at line 53 of file convex_polyhedron.h.
typedef std::vector<face_type> cgv::media::mesh::convex_polyhedron_base::shell_type |
a shell is simply a list of faces
Definition at line 56 of file convex_polyhedron.h.
enumeration of 11 valid and 5 invalid cases that a face can be located with respect to a plane after locating vertices into outside, inside or touching
Definition at line 25 of file convex_polyhedron.h.
enumeration of different vertex locations with respect to plane
Definition at line 19 of file convex_polyhedron.h.
|
inlinevirtual |
Definition at line 102 of file convex_polyhedron.h.
|
inlinevirtual |
add a new shell and return shell index
Reimplemented in cgv::media::mesh::convex_polyhedron< T, TCDim >.
Definition at line 92 of file convex_polyhedron.h.
Referenced by cgv::media::mesh::convex_polyhedron< T, TCDim >::add_shell().
|
static |
function implementing the connectivity of an axis aligned box
Definition at line 8 of file convex_polyhedron.cxx.
|
static |
revert the orientation of a face in place, where the face is given by a list of vertex indices
Definition at line 30 of file convex_polyhedron.cxx.
|
inlinevirtual |
copy a shell onto another one
Reimplemented in cgv::media::mesh::convex_polyhedron< T, TCDim >.
Definition at line 96 of file convex_polyhedron.h.
Referenced by cgv::media::mesh::convex_polyhedron< T, TCDim >::copy_shell().
|
inlinevirtual |
Definition at line 104 of file convex_polyhedron.h.
|
inlinevirtual |
remove the shell of the given index, be careful as shell indices large si get implizitely decreased
Reimplemented in cgv::media::mesh::convex_polyhedron< T, TCDim >.
Definition at line 94 of file convex_polyhedron.h.
Referenced by cgv::media::mesh::convex_polyhedron< T, TCDim >::del_shell().
|
pure virtual |
virtual method to be implemented in derived class
Implemented in cgv::media::mesh::convex_polyhedron< T, TCDim >.
Referenced by remove_redundant_vertices().
|
static |
given a face as a list of vertex indices and a vector of vertex locations, find a halfedge that touches the current clip plane
find a halfedge that touches the current clip plane
Definition at line 94 of file convex_polyhedron.cxx.
|
inline |
Definition at line 108 of file convex_polyhedron.h.
|
inline |
Definition at line 106 of file convex_polyhedron.h.
convex_polyhedron_base::FacePlaneLocation cgv::media::mesh::convex_polyhedron_base::get_face_plane_location | ( | const face_type & | face, |
const std::vector< VertexPlaneLocation > & | vertex_locations | ||
) | const |
given a face as a list of vertex indices and a vector of vertex locations, determine the face location with respect to the current clip plane
Definition at line 111 of file convex_polyhedron.cxx.
References to_index().
|
inline |
Definition at line 100 of file convex_polyhedron.h.
|
inline |
return the current number of shells
Definition at line 86 of file convex_polyhedron.h.
|
pure virtual |
return current number of vertices
Implemented in cgv::media::mesh::convex_polyhedron< T, TCDim >.
Referenced by remove_redundant_vertices().
|
inlinestatic |
check if a face location is on one side of the plane only with potential touch events
Definition at line 65 of file convex_polyhedron.h.
|
inlinestatic |
check if a face location corresponds to a split into parts (two for convex faces)
Definition at line 67 of file convex_polyhedron.h.
|
inlinestatic |
check if a face location corresponds to a valid configuration assuming planar convex faces
Definition at line 69 of file convex_polyhedron.h.
void cgv::media::mesh::convex_polyhedron_base::remove_redundant_vertices | ( | ) |
remove redundant vertices from mesh
Definition at line 206 of file convex_polyhedron.cxx.
References del_vertex(), get_nr_vertices(), and shells.
|
inline |
Definition at line 90 of file convex_polyhedron.h.
|
inline |
Definition at line 88 of file convex_polyhedron.h.
|
static |
check whether all faces of a shell lay on one side of the plane or touch it, but not on the other side; return side or VPL_TOUCH if shell is intersected by plane
Definition at line 51 of file convex_polyhedron.cxx.
|
inlinevirtual |
swap two shells
Reimplemented in cgv::media::mesh::convex_polyhedron< T, TCDim >.
Definition at line 98 of file convex_polyhedron.h.
Referenced by cgv::media::mesh::convex_polyhedron< T, TCDim >::swap_shells().
|
inlinestatic |
convert VertexPlaneLocation
to an index in the range {0 .. 2}
Definition at line 63 of file convex_polyhedron.h.
Referenced by get_face_plane_location(), and vertex_location_side().
|
static |
check whether all vertices lay on one side of the plane or on it, but not on the other; return side or VPL_TOUCH if vertices lay on both sides
Definition at line 37 of file convex_polyhedron.cxx.
References to_index().
|
protected |
vector of shells
Definition at line 60 of file convex_polyhedron.h.
Referenced by remove_redundant_vertices().