VTK  9.2.6
vtkGLTFWriterUtils.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkGLTFWriterUtils.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
15
26#ifndef vtkGLTFWriterUtils_h
27#define vtkGLTFWriterUtils_h
28
29#include "vtkIOGeometryModule.h" // For export macro
30#include "vtkWrappingHints.h"
31
32#include <vtk_nlohmannjson.h>
33#include VTK_NLOHMANN_JSON(json.hpp)
34#include <ostream>
35
37class vtkCellArray;
38class vtkDataArray;
39
40class VTKIOGEOMETRY_EXPORT vtkGLTFWriterUtils
41{
42public:
43 VTK_WRAPEXCLUDE static void WriteValues(vtkDataArray* ca, std::ostream& myFile);
45 VTK_WRAPEXCLUDE static void WriteBufferAndView(vtkDataArray* inda, const char* fileName,
46 bool inlineData, nlohmann::json& buffers, nlohmann::json& bufferViews);
47 VTK_WRAPEXCLUDE static void WriteCellBufferAndView(vtkCellArray* ca, const char* fileName,
48 bool inlineData, nlohmann::json& buffers, nlohmann::json& bufferViews);
49};
50
51// gltf uses hard coded numbers to represent data types
52// they match the definitions from gl.h but for your convenience
53// some of the common values we use are listed below to make
54// the code more readable without including gl.h
55
56#define GL_BYTE 0x1400
57#define GL_UNSIGNED_BYTE 0x1401
58#define GL_SHORT 0x1402
59#define GL_UNSIGNED_SHORT 0x1403
60#define GL_INT 0x1404
61#define GL_UNSIGNED_INT 0x1405
62#define GL_FLOAT 0x1406
63
64#define GL_CLAMP_TO_EDGE 0x812F
65#define GL_REPEAT 0x2901
66
67#define GL_NEAREST 0x2600
68#define GL_LINEAR 0x2601
69
70#define ARRAY_BUFFER 34962
71#define ELEMENT_ARRAY_BUFFER 34963
72
73#endif
74
75// VTK-HeaderTest-Exclude: vtkGLTFWriterUtils.h
Writes base64-encoded output to a stream.
object to represent cell connectivity
Definition: vtkCellArray.h:187
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:56
static VTK_WRAPEXCLUDE void WriteBufferAndView(vtkDataArray *inda, const char *fileName, bool inlineData, nlohmann::json &buffers, nlohmann::json &bufferViews)
static VTK_WRAPEXCLUDE void WriteValues(vtkDataArray *ca, std::ostream &myFile)
static VTK_WRAPEXCLUDE void WriteValues(vtkDataArray *ca, vtkBase64OutputStream *ostr)
static VTK_WRAPEXCLUDE void WriteCellBufferAndView(vtkCellArray *ca, const char *fileName, bool inlineData, nlohmann::json &buffers, nlohmann::json &bufferViews)
#define VTK_WRAPEXCLUDE