Graphite
Version 3
An experimental 3D geometry processing program
|
A Mesh with reference counting and bounding box. More...
#include <geogram/mesh/mesh_CSG.h>
Public Member Functions | |
const Box3d & | bbox () const |
Gets the bounding box. More... | |
bool | bbox_initialized () const |
Tests whether the bounding box was initialized. More... | |
void | update_bbox () |
Computes the bounding box. More... | |
void | append_mesh (const CSGMesh *other, index_t operand=index_t(-1)) |
Appends a mesh to this mesh. More... | |
bool | may_have_intersections_with (const CSGMesh *other) const |
Tests whether this mesh may have an intersection with another mesh. More... | |
Public Member Functions inherited from GEO::Mesh | |
Mesh (index_t dimension=3, bool single_precision=false) | |
Mesh constructor. More... | |
virtual | ~Mesh () |
Mesh destructor. | |
void | clear (bool keep_attributes=true, bool keep_memory=false) |
Removes all the elements and attributes of this mesh. More... | |
void | show_stats (const std::string &tag="Mesh") const |
Displays number of vertices, facets and borders. | |
void | assert_is_valid () |
Does some validity checks. More... | |
void | copy (const Mesh &rhs, bool copy_attributes=true, MeshElementsFlags what=MESH_ALL_ELEMENTS) |
Copies a mesh onto this one. More... | |
std::string | get_attributes () const |
Gets the list of all attributes. More... | |
std::string | get_scalar_attributes () const |
Gets the list of all scalar attributes. More... | |
std::string | get_vector_attributes (index_t max_dim=0) const |
Gets the list of all vector attributes. More... | |
index_t | nb_subelements_types () const |
Gets the number of subelements types. More... | |
MeshSubElementsStore & | get_subelements_by_index (index_t i) |
Gets a MeshSubElementsStore by index. More... | |
const MeshSubElementsStore & | get_subelements_by_index (index_t i) const |
Gets a MeshSubElementsStore by index. More... | |
MeshSubElementsStore & | get_subelements_by_type (MeshElementsFlags what) |
Gets a MeshSubElementsStore by subelements type. More... | |
const MeshSubElementsStore & | get_subelements_by_type (MeshElementsFlags what) const |
Gets a MeshSubElementsStore by subelements type. More... | |
Public Member Functions inherited from GEO::Counted | |
void | ref () const |
Increments the reference count. More... | |
void | unref () const |
Decrements the reference count. More... | |
bool | is_shared () const |
Check if the object is shared. More... | |
int | nb_refs () const |
Gets the number of references that point to this object. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from GEO::Mesh | |
static std::string | subelements_type_to_name (MeshElementsFlags what) |
Gets a subelement name by subelement type. More... | |
static MeshElementsFlags | name_to_subelements_type (const std::string &name) |
Gets a subelement type by subelement name. More... | |
static bool | parse_attribute_name (const std::string &full_attribute_name, MeshElementsFlags &where, std::string &attribute_name, index_t &component) |
Extracts localisation, name and optional component from an attribute name. More... | |
Static Public Member Functions inherited from GEO::Counted | |
static void | ref (const Counted *counted) |
Increments the reference count. More... | |
static void | unref (const Counted *counted) |
Decrements the reference count. More... | |
Public Attributes inherited from GEO::Mesh | |
MeshVertices | vertices |
MeshEdges | edges |
MeshFacets | facets |
MeshFacetCornersStore | facet_corners |
MeshCells | cells |
MeshCellCornersStore | cell_corners |
MeshCellFacetsStore | cell_facets |
Protected Member Functions inherited from GEO::Mesh | |
void | display_attributes (const std::string &tag, const std::string &subelement_name, const MeshSubElementsStore &subelements) const |
Displays the list of attributes to the Logger. More... | |
Protected Member Functions inherited from GEO::Counted | |
Counted () | |
Creates a reference counted object. More... | |
virtual | ~Counted () |
Destroys a reference counted object. More... | |
Related Functions inherited from GEO::Mesh | |
enum | MeshElementsFlags |
Indicates the mesh elements (vertices, facets or cells) present in a mesh. More... | |
A Mesh with reference counting and bounding box.
Definition at line 61 of file mesh_CSG.h.
Appends a mesh to this mesh.
[in] | other | a const pointer to the mesh to be appended |
[in] | operand | an optional operand id, or index_t(-1) if not setting operand_bit attribute |
Copies all the vertices and the facets of other
|
inline |
Gets the bounding box.
Definition at line 70 of file mesh_CSG.h.
bool GEO::CSGMesh::bbox_initialized | ( | ) | const |
Tests whether the bounding box was initialized.
Used for debugging purposes, for instance, to detect that the bounding box of a mesh was not properly updated
true | if the bounding box was not changed since construction |
false | otherwise |
|
inline |
Tests whether this mesh may have an intersection with another mesh.
Tests the bounding boxes for intersection. To be used as a filter before calling the (costly) intersection algorithm.
[in] | other | a const pointer to the other mesh to be tested |
false | if there is no intersection with other |
true | if there is possibly an intersection, but there may be false positives |
Definition at line 110 of file mesh_CSG.h.
void GEO::CSGMesh::update_bbox | ( | ) |
Computes the bounding box.
This function needs to be called each time the mesh is modified