ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkWasmMeshIO.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18#ifndef itkWasmMeshIO_h
19#define itkWasmMeshIO_h
20#include "WebAssemblyInterfaceExport.h"
21
22#include "itkMeshIOBase.h"
23#include <fstream>
24
25#include "itkMeshJSON.h"
26#include "itkPointSetJSON.h"
27#include "cbor.h"
28
29namespace itk
30{
44class WebAssemblyInterface_EXPORT WasmMeshIO : public MeshIOBase
45{
46public:
51
53 itkNewMacro(Self);
54
56 itkOverrideGetNameOfClassMacro(WasmMeshIO);
57
58 bool
59 CanReadFile(const char *) override;
60
63 void
65
67 void
68 ReadPoints(void * buffer) override;
69
70 void
71 ReadCells(void * buffer) override;
72
73 void
74 ReadPointData(void * buffer) override;
75
76 void
77 ReadCellData(void * buffer) override;
78
80 void
81 SetJSON(const MeshJSON & json);
82
84 void
85 SetJSON(const PointSetJSON & json);
86
87 /*-------- This part of the interfaces deals with writing data ----- */
88
91 bool
92 CanWriteFile(const char *) override;
93
94 void
96
97 void
98 WritePoints(void * buffer) override;
99
100 void
101 WriteCells(void * buffer) override;
102
103 void
104 WritePointData(void * buffer) override;
105
106 void
107 WriteCellData(void * buffer) override;
108
109 void
110 Write() override;
111
112#if !defined(ITK_WRAPPING_PARSER)
114 auto
116
118 auto
120#endif
121
122protected:
124 ~WasmMeshIO() override;
125 void
126 PrintSelf(std::ostream & os, Indent indent) const override;
127
129 void
130 ReadCBOR(void * buffer = nullptr, unsigned char * cborBuffer = nullptr, size_t cborBufferLength = 0);
132 void
134
135 cbor_item_t * m_CBORRoot{ nullptr };
136
137private:
138 ITK_DISALLOW_COPY_AND_MOVE(WasmMeshIO);
139};
140} // end namespace itk
141
142#endif // itkWasmMeshIO_h
Control indentation during Print() invocation.
Definition itkIndent.h:53
Implements transparent reference counting.
Read and write the an itk::Mesh in a format for interfacing in WebAssembly (Wasm).
MeshIOBase Superclass
SmartPointer< Self > Pointer
auto GetPointSetJSON() -> PointSetJSON
void ReadCellData(void *buffer) override
auto GetJSON() -> MeshJSON
cbor_item_t * m_CBORRoot
void ReadPoints(void *buffer) override
void WritePoints(void *buffer) override
WasmMeshIO Self
void WriteCellData(void *buffer) override
void PrintSelf(std::ostream &os, Indent indent) const override
void ReadCBOR(void *buffer=nullptr, unsigned char *cborBuffer=nullptr, vcl_size_t cborBufferLength=0)
void SetJSON(const PointSetJSON &json)
void SetJSON(const MeshJSON &json)
bool CanReadFile(const char *) override
~WasmMeshIO() override
void ReadCells(void *buffer) override
void WriteCells(void *buffer) override
void WriteMeshInformation() override
bool CanWriteFile(const char *) override
void ReadPointData(void *buffer) override
void ReadMeshInformation() override
void Write() override
void WritePointData(void *buffer) override
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Mesh JSON representation data structure.
Definition itkMeshJSON.h:62
PointSet JSON representation data structure.