cgv
Loading...
Searching...
No Matches
cgv::media::mesh::convex_polyhedron_base Class Referenceabstract
Inheritance diagram for cgv::media::mesh::convex_polyhedron_base:
cgv::media::mesh::convex_polyhedron< T, TCDim >

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_typeshell_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_typeshell (int si) const
 
shell_typeshell (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_typeface (int fi, int si=0) const
 
face_typeface (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_typeshells
 vector of shells
 

Detailed Description

Definition at line 15 of file convex_polyhedron.h.

Member Typedef Documentation

◆ face_type

a face is an oriented list of vertex indices

Definition at line 53 of file convex_polyhedron.h.

◆ shell_type

a shell is simply a list of faces

Definition at line 56 of file convex_polyhedron.h.

Member Enumeration Documentation

◆ FacePlaneLocation

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.

◆ VertexPlaneLocation

enumeration of different vertex locations with respect to plane

Definition at line 19 of file convex_polyhedron.h.

Member Function Documentation

◆ add_face()

virtual int cgv::media::mesh::convex_polyhedron_base::add_face ( int  si = 0)
inlinevirtual

Definition at line 102 of file convex_polyhedron.h.

◆ add_shell()

virtual int cgv::media::mesh::convex_polyhedron_base::add_shell ( )
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().

◆ box_get_face_vertex_index()

int cgv::media::mesh::convex_polyhedron_base::box_get_face_vertex_index ( int  fi,
int  ci 
)
static

function implementing the connectivity of an axis aligned box

Definition at line 8 of file convex_polyhedron.cxx.

◆ change_orientation()

void cgv::media::mesh::convex_polyhedron_base::change_orientation ( face_type face)
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.

◆ copy_shell()

virtual void cgv::media::mesh::convex_polyhedron_base::copy_shell ( int  si_source,
int  si_target 
)
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().

◆ del_face()

virtual void cgv::media::mesh::convex_polyhedron_base::del_face ( int  fi,
int  si = 0 
)
inlinevirtual

Definition at line 104 of file convex_polyhedron.h.

◆ del_shell()

virtual void cgv::media::mesh::convex_polyhedron_base::del_shell ( int  si)
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().

◆ del_vertex()

virtual void cgv::media::mesh::convex_polyhedron_base::del_vertex ( int  vi)
pure virtual

virtual method to be implemented in derived class

Implemented in cgv::media::mesh::convex_polyhedron< T, TCDim >.

Referenced by remove_redundant_vertices().

◆ extract_touching_halfedge()

std::pair< int, int > cgv::media::mesh::convex_polyhedron_base::extract_touching_halfedge ( const face_type face,
const std::vector< VertexPlaneLocation > &  vertex_locations 
)
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.

◆ face() [1/2]

face_type & cgv::media::mesh::convex_polyhedron_base::face ( int  fi,
int  si = 0 
)
inline

Definition at line 108 of file convex_polyhedron.h.

◆ face() [2/2]

const face_type & cgv::media::mesh::convex_polyhedron_base::face ( int  fi,
int  si = 0 
) const
inline

Definition at line 106 of file convex_polyhedron.h.

◆ get_face_plane_location()

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().

◆ get_nr_faces()

size_t cgv::media::mesh::convex_polyhedron_base::get_nr_faces ( int  si = 0) const
inline

Definition at line 100 of file convex_polyhedron.h.

◆ get_nr_shells()

size_t cgv::media::mesh::convex_polyhedron_base::get_nr_shells ( ) const
inline

return the current number of shells

Definition at line 86 of file convex_polyhedron.h.

◆ get_nr_vertices()

virtual size_t cgv::media::mesh::convex_polyhedron_base::get_nr_vertices ( ) const
pure virtual

return current number of vertices

Implemented in cgv::media::mesh::convex_polyhedron< T, TCDim >.

Referenced by remove_redundant_vertices().

◆ is_face_location_on_one_side()

static bool cgv::media::mesh::convex_polyhedron_base::is_face_location_on_one_side ( FacePlaneLocation  face_location)
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.

◆ is_face_location_split()

static bool cgv::media::mesh::convex_polyhedron_base::is_face_location_split ( FacePlaneLocation  face_location)
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.

◆ is_valid_face_location()

static bool cgv::media::mesh::convex_polyhedron_base::is_valid_face_location ( FacePlaneLocation  face_location)
inlinestatic

check if a face location corresponds to a valid configuration assuming planar convex faces

Definition at line 69 of file convex_polyhedron.h.

◆ remove_redundant_vertices()

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.

◆ shell() [1/2]

shell_type & cgv::media::mesh::convex_polyhedron_base::shell ( int  si)
inline

Definition at line 90 of file convex_polyhedron.h.

◆ shell() [2/2]

const shell_type & cgv::media::mesh::convex_polyhedron_base::shell ( int  si) const
inline

Definition at line 88 of file convex_polyhedron.h.

◆ shell_location_side()

convex_polyhedron_base::VertexPlaneLocation cgv::media::mesh::convex_polyhedron_base::shell_location_side ( const std::vector< FacePlaneLocation > &  face_locations)
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.

◆ swap_shells()

virtual void cgv::media::mesh::convex_polyhedron_base::swap_shells ( int  si0,
int  si1 
)
inlinevirtual

◆ to_index()

static int cgv::media::mesh::convex_polyhedron_base::to_index ( VertexPlaneLocation  vertex_location)
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().

◆ vertex_location_side()

convex_polyhedron_base::VertexPlaneLocation cgv::media::mesh::convex_polyhedron_base::vertex_location_side ( const std::vector< VertexPlaneLocation > &  vertex_locations)
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().

Member Data Documentation

◆ shells

std::vector<shell_type> cgv::media::mesh::convex_polyhedron_base::shells
protected

vector of shells

Definition at line 60 of file convex_polyhedron.h.

Referenced by remove_redundant_vertices().


The documentation for this class was generated from the following files: