An array of mesh faces of arbitrary size. More...
#include <imesh_face.h>
Public Member Functions | |
imesh_face_array () | |
Default Constructor. | |
imesh_face_array (unsigned int size) | |
Constructor. | |
imesh_face_array (const vcl_vector< vcl_vector< unsigned int > > &faces) | |
Constructor (from a vector). | |
imesh_face_array (const imesh_face_array &other) | |
Copy Constructor. | |
imesh_face_array (const imesh_face_array_base &fb) | |
Construct from base class. | |
virtual unsigned int | regularity () const |
returns the number of vertices per face if the same for all faces, zero otherwise. | |
virtual unsigned int | size () const |
returns the number of faces. | |
virtual unsigned int | num_verts (unsigned int f) const |
returns the number of vertices in face | |
virtual unsigned int | operator() (unsigned int f, unsigned int i) const |
Access a vertex index by face index and within-face index. | |
virtual void | flip_orientation (unsigned int f) |
Flip a face over, inverting its orientation. | |
virtual imesh_face_array_base * | clone () const |
Produce a clone of this object (dynamic copy). | |
virtual void | append (const imesh_face_array_base &other, unsigned int ind_shift=0) |
Append this array of faces. | |
void | push_back (const vcl_vector< unsigned int > &f) |
Add a face to the array. | |
template<unsigned int s> | |
void | push_back (const imesh_regular_face< s > &f) |
Add a face to the array. | |
vcl_vector< unsigned int > & | operator[] (unsigned int f) |
Access face. | |
const vcl_vector< unsigned int > & | operator[] (unsigned int f) const |
bool | has_normals () const |
Return true if the faces have normals. | |
void | set_normals (const vcl_vector< vgl_vector_3d< double > > &n) |
Set the face normals. | |
vgl_vector_3d< double > & | normal (unsigned int f) |
Access a face normal. | |
const vgl_vector_3d< double > & | normal (unsigned int f) const |
const vcl_vector < vgl_vector_3d< double > > & | normals () const |
Access the entire vector of normals. | |
bool | has_groups () const |
Returns true if the faces have named groups. | |
vcl_string | group_name (unsigned int f) const |
Return the group name for a given face index. | |
unsigned int | make_group (const vcl_string &name) |
Assign a group name to all faces currently unnamed. | |
vcl_set< unsigned int > | group_face_set (const vcl_string &name) const |
Return a set of all faces in a group. | |
const vcl_vector< vcl_pair < vcl_string, unsigned int > > & | groups () const |
Access the groups. | |
Protected Attributes | |
vcl_vector< vcl_pair < vcl_string, unsigned int > > | groups_ |
named groups of adjacent faces (a partition of the face array). | |
vcl_vector< vgl_vector_3d < double > > | normals_ |
vectors that are normal to each face. | |
Private Attributes | |
vcl_vector< vcl_vector < unsigned int > > | faces_ |
An array of mesh faces of arbitrary size.
Definition at line 157 of file imesh_face.h.
imesh_face_array::imesh_face_array | ( | ) | [inline] |
Default Constructor.
Definition at line 163 of file imesh_face.h.
imesh_face_array::imesh_face_array | ( | unsigned int | size | ) | [inline] |
Constructor.
Definition at line 166 of file imesh_face.h.
imesh_face_array::imesh_face_array | ( | const vcl_vector< vcl_vector< unsigned int > > & | faces | ) | [inline] |
Constructor (from a vector).
Definition at line 169 of file imesh_face.h.
imesh_face_array::imesh_face_array | ( | const imesh_face_array & | other | ) | [inline] |
Copy Constructor.
Definition at line 173 of file imesh_face.h.
imesh_face_array::imesh_face_array | ( | const imesh_face_array_base & | fb | ) | [inline, explicit] |
Construct from base class.
Definition at line 177 of file imesh_face.h.
void imesh_face_array::append | ( | const imesh_face_array_base & | other, |
unsigned int | ind_shift = 0 |
||
) | [virtual] |
Append this array of faces.
Optionally shift the indices in
other | by |
ind_shift |
Reimplemented from imesh_face_array_base.
Definition at line 81 of file imesh_face.cxx.
virtual imesh_face_array_base* imesh_face_array::clone | ( | ) | const [inline, virtual] |
Produce a clone of this object (dynamic copy).
Implements imesh_face_array_base.
Definition at line 205 of file imesh_face.h.
virtual void imesh_face_array::flip_orientation | ( | unsigned int | f | ) | [inline, virtual] |
Flip a face over, inverting its orientation.
Reimplemented from imesh_face_array_base.
Definition at line 198 of file imesh_face.h.
vcl_set< unsigned int > imesh_face_array_base::group_face_set | ( | const vcl_string & | name | ) | const [inherited] |
Return a set of all faces in a group.
Definition at line 26 of file imesh_face.cxx.
vcl_string imesh_face_array_base::group_name | ( | unsigned int | f | ) | const [inherited] |
Return the group name for a given face index.
Definition at line 8 of file imesh_face.cxx.
const vcl_vector<vcl_pair<vcl_string,unsigned int> >& imesh_face_array_base::groups | ( | ) | const [inline, inherited] |
Access the groups.
Definition at line 144 of file imesh_face.h.
bool imesh_face_array_base::has_groups | ( | ) | const [inline, inherited] |
Returns true if the faces have named groups.
Definition at line 131 of file imesh_face.h.
bool imesh_face_array_base::has_normals | ( | ) | const [inline, inherited] |
Return true if the faces have normals.
Definition at line 117 of file imesh_face.h.
unsigned int imesh_face_array_base::make_group | ( | const vcl_string & | name | ) | [inherited] |
Assign a group name to all faces currently unnamed.
Return the number of faces in the new group
Definition at line 44 of file imesh_face.cxx.
vgl_vector_3d<double>& imesh_face_array_base::normal | ( | unsigned int | f | ) | [inline, inherited] |
Access a face normal.
Definition at line 124 of file imesh_face.h.
const vgl_vector_3d<double>& imesh_face_array_base::normal | ( | unsigned int | f | ) | const [inline, inherited] |
Definition at line 125 of file imesh_face.h.
const vcl_vector<vgl_vector_3d<double> >& imesh_face_array_base::normals | ( | ) | const [inline, inherited] |
Access the entire vector of normals.
Definition at line 128 of file imesh_face.h.
virtual unsigned int imesh_face_array::num_verts | ( | unsigned int | f | ) | const [inline, virtual] |
returns the number of vertices in face
f. |
Implements imesh_face_array_base.
Definition at line 192 of file imesh_face.h.
virtual unsigned int imesh_face_array::operator() | ( | unsigned int | f, |
unsigned int | i | ||
) | const [inline, virtual] |
Access a vertex index by face index and within-face index.
Implements imesh_face_array_base.
Definition at line 195 of file imesh_face.h.
vcl_vector<unsigned int>& imesh_face_array::operator[] | ( | unsigned int | f | ) | [inline] |
const vcl_vector<unsigned int>& imesh_face_array::operator[] | ( | unsigned int | f | ) | const [inline] |
Definition at line 230 of file imesh_face.h.
void imesh_face_array::push_back | ( | const vcl_vector< unsigned int > & | f | ) | [inline] |
Add a face to the array.
Definition at line 216 of file imesh_face.h.
void imesh_face_array::push_back | ( | const imesh_regular_face< s > & | f | ) | [inline] |
Add a face to the array.
Definition at line 220 of file imesh_face.h.
virtual unsigned int imesh_face_array::regularity | ( | ) | const [inline, virtual] |
returns the number of vertices per face if the same for all faces, zero otherwise.
Implements imesh_face_array_base.
Definition at line 186 of file imesh_face.h.
void imesh_face_array_base::set_normals | ( | const vcl_vector< vgl_vector_3d< double > > & | n | ) | [inline, inherited] |
Set the face normals.
Definition at line 120 of file imesh_face.h.
virtual unsigned int imesh_face_array::size | ( | ) | const [inline, virtual] |
returns the number of faces.
Implements imesh_face_array_base.
Definition at line 189 of file imesh_face.h.
vcl_vector<vcl_vector<unsigned int> > imesh_face_array::faces_ [private] |
Definition at line 159 of file imesh_face.h.
vcl_vector<vcl_pair<vcl_string,unsigned int> > imesh_face_array_base::groups_ [protected, inherited] |
named groups of adjacent faces (a partition of the face array).
Integers mark the group's ending vertex + 1
Definition at line 149 of file imesh_face.h.
vcl_vector<vgl_vector_3d<double> > imesh_face_array_base::normals_ [protected, inherited] |
vectors that are normal to each face.
Definition at line 152 of file imesh_face.h.