foamGltfBufferView.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::bufferView
28
29Description
30 glTF buffer view - provides a view/slice of the glTF buffer
31
32Note
33 Implements the glTF v2 specification
34
35SourceFiles
36 foamGltfBufferView.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef foam_gltf_bufferview_H
41#define foam_gltf_bufferview_H
42
43#include "foamGltfBase.H"
44#include "Ostream.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50namespace glTF
51{
52 class bufferView;
53}
54
55Ostream& operator<<(Ostream&, const glTF::bufferView& bv);
56
57namespace glTF
58{
59
60/*---------------------------------------------------------------------------*\
61 Class glTF::bufferView Declaration
62\*---------------------------------------------------------------------------*/
64class bufferView
65:
66 public base
67{
68protected:
69
70 // Protected Data
71
72 //- Buffer index
73 label buffer_;
74
75 //- Byte offset
76 label byteOffset_;
77
78 //- Byte length
79 label byteLength_;
80
81 //- Target
82 label target_;
83
84
85public:
86
87 // Constructors
88
89 //- Default construct
90 bufferView();
91
92 //- Construct with name
93 explicit bufferView(const word& name);
94
95
96 //- Destructor
97 ~bufferView() = default;
98
99
100 // Public Member Functions
101
102 //- Return the buffer index
103 label& buffer() noexcept;
104
105 //- Return the byte offset
106 label& byteOffset() noexcept;
107
108 //- Return the byte length
109 label& byteLength() noexcept;
110
111 //- Return the target
112 label& target() noexcept;
113
114 //- Write
115 void write(Ostream& os) const;
116
117
118 // Member Operators
119
120 void operator=(const bufferView& bv);
121};
122
123
124// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125
126} // End namespace glTF
127} // End namespace Foam
128
129// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130
131#endif
132
133// ************************************************************************* //
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
glTF buffer view - provides a view/slice of the glTF buffer
label & byteLength() noexcept
Return the byte length.
label & buffer() noexcept
Return the buffer index.
label buffer_
Buffer index.
label byteLength_
Byte length.
~bufferView()=default
Destructor.
label & byteOffset() noexcept
Return the byte offset.
bufferView()
Default construct.
label & target() noexcept
Return the target.
label byteOffset_
Byte offset.
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
const direction noexcept
Definition: Scalar.H:223
runTime write()