Description
Drawing function to draw a ChFieldElementHexahedron_8 finite element, for the 3D visualization of the finite element in real time rendering, postprocessing, etc.
Each of the 8 faces is made with 2 triangles.
#include <ChDrawer.h>


Public Member Functions | |
| virtual void | IncrementBufferSizes (ChFieldElement &melement, size_t &num_vertexes, size_t &num_triangles, size_t &num_normals) const |
| This method takes a ChFieldElement and increments the counters of total used number of triangle vertexes, number of triangles, number of normals, used in a triangle mesh that shows the shape of the finite element. More... | |
| virtual void | UpdateBuffers (ChFieldElement &melement, ChTriangleMeshConnected &mmesh, size_t &vert_offset, size_t &tri_offset, size_t &norm_offset) const |
| This method takes a ChFieldElement and, given a ChTriangleMeshConnected& mmesh, does this: 1) per each triangle from tri_offset sets the indexes in mmesh.GetIndicesVertexes() to 3 triangle vertexes; 2) per each triangle from tri_offset sets the indexes in mmesh.GetIndicesNormals() to 3 triangle normals; 3) per each normal from norm_offset sets its value in mmesh.GetCoordsNormals() (can be automated via ChDrawer::AutoComputeNormals()); Assumes there is no need to update the position of vertexes in mmesh.GetCoordsVertices() because already update by the caller, that sets the first N triangle vertices as the N finite element nodes - and same for N colors in mmesh.GetCoordsColors(), and N scalars/vectors/etc in myproperty.data of all properties in mmesh.GetPropertiesPerVertex(). More... | |
Additional Inherited Members | |
Protected Member Functions inherited from chrono::fea::ChDrawer | |
| void | AutoComputeNormals (ChTriangleMeshConnected &mmesh, const size_t tri_offset, const size_t norm_offset, const size_t num_triangles, const size_t num_normals) const |
| This is a helper function that can be called at the end of each element's UpdateBuffers(), to avoid setting all normals with ad-hoc formulas. More... | |
Member Function Documentation
◆ IncrementBufferSizes()
|
inlinevirtual |
This method takes a ChFieldElement and increments the counters of total used number of triangle vertexes, number of triangles, number of normals, used in a triangle mesh that shows the shape of the finite element.
This function is called on all finite elements, to get the total amount of vertexes, triangles etc. in a ChTriangleMeshConnected that will be used to show finite elements on the screen.
Implements chrono::fea::ChDrawer.
◆ UpdateBuffers()
|
inlinevirtual |
This method takes a ChFieldElement and, given a ChTriangleMeshConnected& mmesh, does this: 1) per each triangle from tri_offset sets the indexes in mmesh.GetIndicesVertexes() to 3 triangle vertexes; 2) per each triangle from tri_offset sets the indexes in mmesh.GetIndicesNormals() to 3 triangle normals; 3) per each normal from norm_offset sets its value in mmesh.GetCoordsNormals() (can be automated via ChDrawer::AutoComputeNormals()); Assumes there is no need to update the position of vertexes in mmesh.GetCoordsVertices() because already update by the caller, that sets the first N triangle vertices as the N finite element nodes - and same for N colors in mmesh.GetCoordsColors(), and N scalars/vectors/etc in myproperty.data of all properties in mmesh.GetPropertiesPerVertex().
However, if one has more triangle vertexes than N element nodes, there could be an additional task: 4) (optional) per each vertex beyond the N element nodes, interpolate position/color/properties by looking at values already updated in the position/color/properties of the first N vertexes of the mmesh, starting from vert_offset.
Implements chrono::fea::ChDrawer.
The documentation for this class was generated from the following file:
- /builds/uwsbel/chrono/src/chrono/fea/ChDrawer.h
Protected Member Functions inherited from