List functions that allows to check, enable and assert characteristics and the availability of components in the Elements of a Mesh.
More...
|
template<uint ELEM_ID, MeshConcept MeshType> |
bool | vcl::isElementContainerCompact (const MeshType &m) |
| Returns true if the given mesh has its Container of the given Element compact.
|
|
template<uint ELEM_ID, uint COMP_ID, MeshConcept MeshType> |
bool | vcl::isPerElementComponentAvailable (const MeshType &m) |
| Returns true if the given component is available in the given element of the input mesh m.
|
|
template<uint ELEM_ID, uint COMP_ID, MeshConcept MeshType> |
bool | vcl::enableIfPerElementComponentOptional (MeshType &m) |
| Makes available the given Component in the given Element of the input mesh m, and returns true if it succeeds.
|
|
template<uint ELEM_ID, MeshConcept MeshType> |
void | vcl::requireElementContainerCompactness (const MeshType &m) |
| This function asserts that a Mesh has the Container of the given Element ID compact (no elements flagged as deleted).
|
|
template<uint ELEM_ID, uint COMP_ID, MeshConcept MeshType> |
void | vcl::requirePerElementComponent (const MeshType &m) |
| This function asserts that a Mesh has the Container of the given Element ID, the Element has a Component of the given Component ID, and that Component is available at runtime.
|
|
template<MeshConcept MeshType> |
bool | vcl::isTriangleMesh (const MeshType &m) |
| Checks at run time if the mesh m is composed of triangles.
|
|
template<MeshConcept MeshType> |
bool | vcl::isQuadMesh (const MeshType &m) |
| Checks at run time if the mesh is composed of quads.
|
|
template<MeshConcept MeshType> |
bool | vcl::isCompact (const MeshType &m) |
| Checks if a Mesh is compact, that is if it does not contains deleted elements.
|
|
template<FaceMeshConcept MeshType> |
void | vcl::requireTriangleMesh (const MeshType &m) |
| Checks if the mesh is composed of triangles, and if not, throws an exception.
|
|
template<FaceMeshConcept MeshType> |
void | vcl::requireQuadMesh (const MeshType &m) |
| Checks if the mesh is composed of quads, and if not, throws an exception.
|
|
template<MeshConcept MeshType> |
void | vcl::requireCompactness (const MeshType &m) |
| Checks if a Mesh is compact, that is if it does not contains deleted elements, and if not, throws an exception.
|
|
List functions that allows to check, enable and assert characteristics and the availability of components in the Elements of a Mesh.
template<uint ELEM_ID, uint COMP_ID, MeshConcept MeshType>
bool vcl::enableIfPerElementComponentOptional |
( |
MeshType & |
m | ) |
|
Makes available the given Component in the given Element of the input mesh m, and returns true
if it succeeds.
If the input mesh has a Container of the given Element ID, and the Element has a Component of the given Component ID, this function enables the Component in the Element if the component needs to be enabled. Returns true
if, after the call of this function, the component will be available in the Element of the mesh.
- Template Parameters
-
ELEM_ID | the ID of the Element on which enable the component. |
COMP_ID | the ID of the Component to enable. |
MeshType | the type of the Mesh to check. |
- Parameters
-
[in] | m | the mesh on which enable the component in the Element. |
- Returns
true
if the Component is available in the Element after the call of this funciton.
template<uint ELEM_ID, uint COMP_ID, MeshConcept MeshType>
bool vcl::isPerElementComponentAvailable |
( |
const MeshType & |
m | ) |
|
Returns true if the given component is available in the given element of the input mesh m.
This function returns true
when the component can be used on the element, whether the component is horizontal, vertical or optional.
These are the following cases:
- if the Mesh does not have an ElementContainer of the given Element ID, the function returns
false
;
- if the Element does not have a Component of the given Component ID, the function returns
false
;
- if the Element has a non-optional Component of the given Component ID, the function returns
true
;
- if the Element has an optional Component of the given Component ID, the function returns
true
if the component is enabled, false otherwise (this check is the only one that is made at runtime);
- Template Parameters
-
ELEM_ID | the ID of the Element to check. |
COMP_ID | the ID of the Component to check. |
MeshType | the type of the Mesh to check. |
- Parameters
-
[in] | m | the mesh on which check the availability of the Component in the Element. |
- Returns
true
if the Component is available in the Element of the given Mesh.
template<MeshConcept MeshType>
Checks at run time if the mesh is composed of quads.
This function works both for quad and polygonal meshes composed of faces having 4 vertices. If the size of the Face Vertices is 4, this check is immediate. If it is not 4, the functions checks for each face if it has 4 vertices.
Complexity: O(n)
- Template Parameters
-
MeshType | the type of the mesh. It must satisfy the MeshConcept. |
- Parameters
-
[in] | m | the mesh on which check if each face has 4 vertices. |
- Returns
true
if every face of the mesh is composed of 4 vertices.
template<MeshConcept MeshType>
bool vcl::isTriangleMesh |
( |
const MeshType & |
m | ) |
|
Checks at run time if the mesh m is composed of triangles.
This function works both for triangle and polygonal meshes composed of faces having 3 vertices. If the size of the Face Vertices is static and 3, this check is immediate. If it is not 3, the functions checks for each face if it has 3 vertices.
Complexity: O(n)
- Template Parameters
-
MeshType | the type of the mesh. It must satisfy the MeshConcept. |
- Parameters
-
[in] | m | the mesh on which check if each face has 3 vertices. |
- Returns
true
if every face of the mesh is composed of 3 vertices.
template<uint ELEM_ID, uint COMP_ID, MeshConcept MeshType>
void vcl::requirePerElementComponent |
( |
const MeshType & |
m | ) |
|
This function asserts that a Mesh has the Container of the given Element ID, the Element has a Component of the given Component ID, and that Component is available at runtime.
If the Mesh does not satisfy one of these conditions, a vcl::MissingComponentException will be thrown:
- has not a Container of the given ElementEnumType;
- has the Container but the Element has not a Component of the given ComponentEnumType;
- has the Container, the Element has the Component, but the Component is not enabled.
- Template Parameters
-
ELEM_ID | the ID of the Element to check. |
COMP_ID | the ID of the Component to check. |
MeshType | the type of the Mesh to check. |
- Exceptions
-
- Parameters
-
[in] | m | the mesh on which check the availability of the Component in the Element. |
- Todo:
- fix this - add compile time requirements
template<FaceMeshConcept MeshType>
void vcl::requireQuadMesh |
( |
const MeshType & |
m | ) |
|
Checks if the mesh is composed of quads, and if not, throws an exception.
This function works both for quad and polygonal meshes composed of faces having 4 vertices. If the size of the Face Vertices is static and 3, this check is immediate. If it is not 4, the functions checks for each face if it has 4 vertices.
Complexity: O(n)
- Exceptions
-
- Template Parameters
-
MeshType | the type of the mesh. It must satisfy the FaceMeshConcept. |
- Parameters
-
[in] | m | the mesh on which check if each face has 4 vertices. |
template<FaceMeshConcept MeshType>
void vcl::requireTriangleMesh |
( |
const MeshType & |
m | ) |
|
Checks if the mesh is composed of triangles, and if not, throws an exception.
This function works both for triangle and polygonal meshes composed of faces having 3 vertices. If the size of the Face Vertices is static and 3, this check is immediate. If it is not 3, the functions checks for each face if it has 3 vertices.
Complexity: O(n)
- Exceptions
-
- Template Parameters
-
MeshType | the type of the mesh. It must satisfy the FaceMeshConcept. |
- Parameters
-
[in] | m | the mesh on which check if each face has 3 vertices. |