DATAKIT SDK  V2026.4
testcreatemesh.hpp
Go to the documentation of this file.
1 // TestCreateMesh.hpp
2 // Sample mesh creation helpers.
3 // Demonstrates creation of triangle meshes, wireframe meshes, point meshes, per-face/per-vertex colors, UV texture mapping, and render infos.
4 
5 namespace sampleWriter
6 {
7 
8  //! \image html SampleOneMesh.png
9  //! \brief Creates a unit cube triangulated mesh (12 triangles, 24 vertices with normals).
11  //! \brief Applies distinct per-face colors to an existing cube mesh (modifies the mesh in place).
12  void FillFacesColors( Dtk_MeshPtr &inoutCubeMesh );
13  //! \image html SampleOneMeshRender.png
14  //! \brief Creates a unit cube mesh with UV texture coordinates, referencing an image from the given directory.
15  Dtk_MeshPtr CreateTexturedMeshCube( const Dtk_string& inImageDirectory );
16  //! \brief Creates a cuboid (axis-aligned box) mesh from two opposite corner points.
17  Dtk_MeshPtr CreateMeshCuboid( const Dtk_pnt & inPnt1, const Dtk_pnt &inPnt2 );
18  //! \image html CubeVertexColor.png
19  //! \brief Creates a unit cube mesh with per-vertex color data.
21  //! \image html MeshCylinder.png
22  //! \brief Creates a cylinder mesh with circular caps and lateral surface, tessellated with the given number of circle points.
23  Dtk_MeshPtr CreateMeshCylinder( int nbpoints );
24  //! \image html MeshWire.png
25  //! \brief Creates a wireframe (polyline) mesh.
27  //! \image html MeshPoints.png
28  //! \brief Creates a point cloud mesh.
30 
31  //! \brief Creates a Dtk_RenderInfos object with material and color information for a cube.
33 }
sampleWriter::CreateMeshCube
Dtk_MeshPtr CreateMeshCube()
Mesh Cube sample.
Definition: testcreatemesh.cpp:207
sampleWriter::CreateMeshCubeVertexColor
Dtk_MeshPtr CreateMeshCubeVertexColor()
Creates a unit cube mesh with per-vertex color data (red, green, blue, white cycling per face).
Definition: testcreatemesh.cpp:300
sampleWriter::CreateMeshPoints
Dtk_MeshPtr CreateMeshPoints()
Points mesh sample.
Definition: testcreatemesh.cpp:440
Dtk_string
This is a high level string class.
Definition: dtk_string.hpp:53
sampleWriter::FillFacesColors
void FillFacesColors(Dtk_MeshPtr &inoutCubeMesh)
Filling mesh faces with colors.
Definition: testcreatemesh.cpp:244
sampleWriter::CreateMeshWire
Dtk_MeshPtr CreateMeshWire()
Wire mesh sample.
Definition: testcreatemesh.cpp:389
sampleWriter::CreateTexturedMeshCube
Dtk_MeshPtr CreateTexturedMeshCube(const Dtk_string &inImageDirectory)
Textured Mesh Cube sample.
Definition: testcreatemesh.cpp:272
sampleWriter
Definition: testcreatecube.cpp:15
sampleWriter::CreateCubeRenderInfos
Dtk_RenderInfosPtr CreateCubeRenderInfos()
Creates a Dtk_RenderInfos object with ambient, diffuse, and specular lighting and a texture for use o...
Definition: testcreatemesh.cpp:501
Dtk_SmartPtr
Definition: util_ptr_dtk.hpp:37
sampleWriter::CreateMeshCylinder
Dtk_MeshPtr CreateMeshCylinder(int nbpoints)
Mesh Cylinder sample.
Definition: testcreatemesh.cpp:338
Dtk_pnt
This is a mathematical point class.
Definition: dtk_pnt.hpp:20
sampleWriter::CreateMeshCuboid
Dtk_MeshPtr CreateMeshCuboid(const Dtk_pnt &inFirstPoint, const Dtk_pnt &inSecondPoint)
Creates an axis-aligned cuboid mesh from two opposite corner points.
Definition: testcreatemesh.cpp:460