foamGltfMesh.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2021 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::glTF::mesh
28
29Description
30 glTF mesh
31
32Note
33 Implements the glTF v2 specification
34
35SourceFiles
36 foamGltfMesh.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef foam_gltf_mesh_H
41#define foam_gltf_mesh_H
42
43#include "foamGltfBase.H"
44#include "DynamicList.H"
45#include "Tuple2.H"
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
51namespace glTF
52{
53 class mesh;
54}
55
56Ostream& operator<<(Ostream& os, const glTF::mesh& mesh);
57
58namespace glTF
59{
60
61/*---------------------------------------------------------------------------*\
62 Class glTF::mesh Declaration
63\*---------------------------------------------------------------------------*/
65class mesh
66:
67 public base
68{
69 // Private Data
70
71 //- List of fields (name, accessor ID)
73
74 //- List of colours (name, accessor ID)
76
77 //- Accessor ID
78 label accessorId_;
79
80
81public:
82
83 // Constructors
84
85 //- Default construct
86 mesh();
87
88 //- Construct from name
89 explicit mesh(const word& name);
90
91
92 //- Destructor
93 ~mesh() = default;
94
95
96 // Public Member Functions
97
98 //- Return the accessor ID
99 label& accessorId() noexcept;
100
101 //- Add a field to the mesh
102 void addField(const word& name, const label accessorId);
103
104 //- Add a colour to the mesh
105 void addColour(const label accessorId);
106
107 //- Write
108 void write(Ostream& os) const;
109};
110
111
112// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113
114} // End namespace glTF
115} // End namespace Foam
116
117// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118
119#endif
120
121// ************************************************************************* //
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition: DynamicList.H:72
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Base class for glTF entities.
Definition: foamGltfBase.H:122
const word & name() const noexcept
Return const access to the name.
Definition: foamGltfBase.H:165
~mesh()=default
Destructor.
void addColour(const label accessorId)
Add a colour to the mesh.
Definition: foamGltfMesh.C:64
label & accessorId() noexcept
Return the accessor ID.
Definition: foamGltfMesh.C:52
void addField(const word &name, const label accessorId)
Add a field to the mesh.
Definition: foamGltfMesh.C:58
mesh()
Default construct.
Definition: foamGltfMesh.C:32
A class for handling words, derived from Foam::string.
Definition: word.H:68
dynamicFvMesh & mesh
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
const direction noexcept
Definition: Scalar.H:223
runTime write()