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 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::glTF::animation
28 
29 Description
30  glTF animation
31 
32 Note
33  Implements the glTF v2 specification
34 
35 SourceFiles
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 
49 namespace Foam
50 {
51 namespace glTF
52 {
53  class animation;
54 }
55 
56 Ostream& operator<<(Ostream& os, const glTF::animation& animation);
57 
58 namespace glTF
59 {
60 
61 /*---------------------------------------------------------------------------*\
62  Class glTF::animation Declaration
63 \*---------------------------------------------------------------------------*/
64 
65 
66 class animation
67 :
68  public base
69 {
70 protected:
71 
72  // Local Helpers
73 
74  // Sampler
75  struct glTFSampler
76  {
77  label input;
78  string interpolation;
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 
107 public:
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 // ************************************************************************* //
DynamicList< glTFSampler > samplers_
Samplers.
void write(Ostream &os) const
Write.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
Definition: DynamicList.H:51
A class for handling words, derived from Foam::string.
Definition: word.H:63
animation()
Default construct.
const word & name() const noexcept
Return const access to the name.
Definition: foamGltfBase.H:174
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
OBJstream os(runTime.globalPath()/outputName)
~animation()=default
Destructor.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:77
Base class for glTF entities.
Definition: foamGltfBase.H:116
void addTranslation(const label inputId, const label outputId, const label nodeId, const string &interpolation)
Add translation.
Abstract base class for volume field interpolation.
Namespace for OpenFOAM.
DynamicList< glTFChannel > channels_
Channels.