Visual Computing Library
Loading...
Searching...
No Matches
Mesh Requirements

List functions that allows to check, enable and assert characteristics and the availability of components in the Elements of a Mesh. More...

Collaboration diagram for Mesh Requirements:

Modules

 Edge Requirements
 List functions that allows to check, enable and assert the availability of components in the Edge Elements of a Mesh.
 
 Face Requirements
 List functions that allows to check, enable and assert the availability of components in the Face Elements of a Mesh.
 
 Vertex Requirements
 List functions that allows to check, enable and assert the availability of components in the Vertex Elements of a Mesh.
 

Functions

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.
 

Detailed Description

List functions that allows to check, enable and assert characteristics and the availability of components in the Elements of a Mesh.

Function Documentation

◆ enableIfPerElementComponentOptional()

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_IDthe ID of the Element on which enable the component.
COMP_IDthe ID of the Component to enable.
MeshTypethe type of the Mesh to check.
Parameters
[in]mthe 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.

◆ isCompact()

template<MeshConcept MeshType>
bool vcl::isCompact ( const MeshType &  m)

Checks if a Mesh is compact, that is if it does not contains deleted elements.

It is equivalent to call m.isCompact().

Returns
true if m is compact, false otherwise.

◆ isElementContainerCompact()

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 Parameters
ELEM_IDthe Element ID of the ElementContainer to check.
MeshTypethe type of the Mesh to check. It must satisfy the MeshConcept.
Parameters
[in]mthe mesh on which check the compactness of the Container of the given Element.
Returns
true if the Container of the given Element is compact.

◆ isPerElementComponentAvailable()

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_IDthe ID of the Element to check.
COMP_IDthe ID of the Component to check.
MeshTypethe type of the Mesh to check.
Parameters
[in]mthe 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.

◆ isQuadMesh()

template<MeshConcept MeshType>
bool vcl::isQuadMesh ( const MeshType &  m)

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
MeshTypethe type of the mesh. It must satisfy the MeshConcept.
Parameters
[in]mthe mesh on which check if each face has 4 vertices.
Returns
true if every face of the mesh is composed of 4 vertices.

◆ isTriangleMesh()

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
MeshTypethe type of the mesh. It must satisfy the MeshConcept.
Parameters
[in]mthe mesh on which check if each face has 3 vertices.
Returns
true if every face of the mesh is composed of 3 vertices.

◆ requireCompactness()

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.

Exceptions
vcl::MissingCompactnessExceptionif the mesh is not compact.
Template Parameters
MeshTypethe type of the mesh. It must satisfy the MeshConcept.
Parameters
[in]mthe mesh on which check if is compact.

◆ requireElementContainerCompactness()

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

If the Container of the given Element ID is not compact, a vcl::MissingCompactnessException will be thrown. If the mesh has not a Container of the given Element ID, a build error will be raised.

Template Parameters
ELEM_IDthe Element ID of the ElementContainer to check.
MeshTypethe type of the Mesh to check.
Exceptions
vcl::MissingCompactnessExceptionif the Container of the given ElementEnumType is not compact.
Parameters
[in]mthe mesh on which check the compactness of the Container of the given Element.

◆ requirePerElementComponent()

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_IDthe ID of the Element to check.
COMP_IDthe ID of the Component to check.
MeshTypethe type of the Mesh to check.
Exceptions
vcl::MissingComponentExceptionif the Component is not enabled or available in the Element Container of the Mesh.
Parameters
[in]mthe mesh on which check the availability of the Component in the Element.
Todo:
fix this - add compile time requirements

◆ requireQuadMesh()

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
vcl::MissingQuadRequirementExceptionif the mesh is not composed of quads.
Template Parameters
MeshTypethe type of the mesh. It must satisfy the FaceMeshConcept.
Parameters
[in]mthe mesh on which check if each face has 4 vertices.

◆ requireTriangleMesh()

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
vcl::MissingTriangularRequirementExceptionif the mesh is not composed of triangles.
Template Parameters
MeshTypethe type of the mesh. It must satisfy the FaceMeshConcept.
Parameters
[in]mthe mesh on which check if each face has 3 vertices.