foamGltfAnimation.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::animation
28
29Description
30 glTF animation
31
32Note
33 Implements the glTF v2 specification
34
35SourceFiles
36 foamGltfAnimation.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef foam_gltf_animation_H
41#define foam_gltf_animation_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 animation;
54}
55
56Ostream& operator<<(Ostream& os, const glTF::animation& animation);
57
58namespace glTF
59{
60
61/*---------------------------------------------------------------------------*\
62 Class glTF::animation Declaration
63\*---------------------------------------------------------------------------*/
64
66class animation
67:
68 public base
69{
70protected:
71
72 // Local Helpers
73
74 // Sampler
75 struct glTFSampler
76 {
77 label input;
79 label output;
80 };
81
82 // Channel target
83 struct glTFTarget
84 {
85 label node;
86 string path;
87 };
88
89 // Channel
90 struct glTFChannel
91 {
92 label samplerId;
94 };
95
96
97
98 // Protected Member Data
99
100 //- Samplers
102
103 //- Channels
105
106
107public:
108
109 // Constructors
110
111 //- Default construct
112 animation();
113
114 //- Construct with name
115 explicit animation(const word& name);
116
117
118 //- Destructor
119 ~animation() = default;
120
121
122 // Public Member Functions
123
124 //- Add translation
125 void addTranslation
126 (
127 const label inputId,
128 const label outputId,
129 const label nodeId,
130 const string& interpolation
131 );
132
133 //- Write
134 void write(Ostream& os) const;
135};
136
137
138// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139
140} // End namespace glTF
141} // End namespace Foam
142
143// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144
145#endif
146
147// ************************************************************************* //
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
~animation()=default
Destructor.
DynamicList< glTFChannel > channels_
Channels.
DynamicList< glTFSampler > samplers_
Samplers.
animation()
Default construct.
void addTranslation(const label inputId, const label outputId, const label nodeId, const string &interpolation)
Add translation.
Base class for glTF entities.
Definition: foamGltfBase.H:122
const word & name() const noexcept
Return const access to the name.
Definition: foamGltfBase.H:165
Abstract base class for volume field interpolation.
Definition: interpolation.H:60
A class for handling words, derived from Foam::string.
Definition: word.H:68
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
runTime write()