VTK  9.4.20241226
OMFElement.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
3#ifndef OMFElement_h
4#define OMFElement_h
5
6#include "vtkSmartPointer.h"
7
8#include "vtk_jsoncpp_fwd.h"
9
10#include <memory>
11#include <string>
12
13VTK_ABI_NAMESPACE_BEGIN
16class vtkTexture;
17VTK_ABI_NAMESPACE_END
18
19namespace omf
20{
21VTK_ABI_NAMESPACE_BEGIN
22
23struct OMFFile;
24
26{
27public:
28 ProjectElement(const std::string& uid, double globalOrigin[3]);
29 virtual ~ProjectElement() = default;
30
31 virtual void ProcessJSON(std::shared_ptr<OMFFile>& file, const Json::Value& element,
32 vtkPartitionedDataSet* output, bool writeOutTextures, bool columnMajorOrdering);
33
34protected:
35 std::string UID;
36 double GlobalOrigin[3] = { 0, 0, 0 };
37
38 virtual void ProcessGeometry(std::shared_ptr<OMFFile>& file, const std::string& geometryUID,
39 vtkPartitionedDataSet* output) = 0;
40 virtual void ProcessDataFields(
41 std::shared_ptr<OMFFile>& file, const Json::Value& dataJSON, vtkPartitionedDataSet* output);
42 virtual void ProcessColumnOrdering(std::shared_ptr<OMFFile>& /*file*/,
43 const Json::Value& /*dataJSON*/, vtkPartitionedDataSet* /*output*/){};
44 virtual void ProcessTextures(std::shared_ptr<OMFFile>& file, const Json::Value& textureJSON,
45 vtkPartitionedDataSet* output, const std::string& elementName);
46};
47
49{
50public:
51 PointSetElement(const std::string& uid, double globalOrigin[3])
52 : ProjectElement(uid, globalOrigin)
53 {
54 }
55
56protected:
57 void ProcessGeometry(std::shared_ptr<OMFFile>& file, const std::string& geometryUID,
58 vtkPartitionedDataSet* output) override;
59};
60
62{
63public:
64 LineSetElement(const std::string& uid, double globalOrigin[3])
65 : ProjectElement(uid, globalOrigin)
66 {
67 }
68
69protected:
70 void ProcessGeometry(std::shared_ptr<OMFFile>& file, const std::string& geometryUID,
71 vtkPartitionedDataSet* output) override;
72};
73
75{
76public:
77 SurfaceElement(const std::string& uid, double globalOrigin[3])
78 : ProjectElement(uid, globalOrigin)
79 {
80 }
81
82protected:
83 void ProcessGeometry(std::shared_ptr<OMFFile>& file, const std::string& geometryUID,
84 vtkPartitionedDataSet* output) override;
85};
86
88{
89public:
90 VolumeElement(const std::string& uid, double globalOrigin[3])
91 : ProjectElement(uid, globalOrigin)
92 {
93 }
94
95protected:
96 void ProcessGeometry(std::shared_ptr<OMFFile>& file, const std::string& geometryUID,
97 vtkPartitionedDataSet* output) override;
98 void ProcessColumnOrdering(std::shared_ptr<OMFFile>& file, const Json::Value& dataJSON,
99 vtkPartitionedDataSet* output) override;
100 size_t Dimensions[3];
101};
102
103VTK_ABI_NAMESPACE_END
104} // end namespace omf
105
106#endif // OMFElement_h
void ProcessGeometry(std::shared_ptr< OMFFile > &file, const std::string &geometryUID, vtkPartitionedDataSet *output) override
LineSetElement(const std::string &uid, double globalOrigin[3])
Definition OMFElement.h:64
void ProcessGeometry(std::shared_ptr< OMFFile > &file, const std::string &geometryUID, vtkPartitionedDataSet *output) override
PointSetElement(const std::string &uid, double globalOrigin[3])
Definition OMFElement.h:51
virtual void ProcessDataFields(std::shared_ptr< OMFFile > &file, const Json::Value &dataJSON, vtkPartitionedDataSet *output)
virtual void ProcessColumnOrdering(std::shared_ptr< OMFFile > &, const Json::Value &, vtkPartitionedDataSet *)
Definition OMFElement.h:42
std::string UID
Definition OMFElement.h:35
virtual ~ProjectElement()=default
virtual void ProcessTextures(std::shared_ptr< OMFFile > &file, const Json::Value &textureJSON, vtkPartitionedDataSet *output, const std::string &elementName)
virtual void ProcessGeometry(std::shared_ptr< OMFFile > &file, const std::string &geometryUID, vtkPartitionedDataSet *output)=0
double GlobalOrigin[3]
Definition OMFElement.h:36
virtual void ProcessJSON(std::shared_ptr< OMFFile > &file, const Json::Value &element, vtkPartitionedDataSet *output, bool writeOutTextures, bool columnMajorOrdering)
ProjectElement(const std::string &uid, double globalOrigin[3])
SurfaceElement(const std::string &uid, double globalOrigin[3])
Definition OMFElement.h:77
void ProcessGeometry(std::shared_ptr< OMFFile > &file, const std::string &geometryUID, vtkPartitionedDataSet *output) override
void ProcessGeometry(std::shared_ptr< OMFFile > &file, const std::string &geometryUID, vtkPartitionedDataSet *output) override
VolumeElement(const std::string &uid, double globalOrigin[3])
Definition OMFElement.h:90
void ProcessColumnOrdering(std::shared_ptr< OMFFile > &file, const Json::Value &dataJSON, vtkPartitionedDataSet *output) override
size_t Dimensions[3]
Definition OMFElement.h:100
Composite dataset that groups datasets as a collection.
composite dataset to encapsulates a dataset consisting of partitions.
handles properties associated with a texture map
Definition vtkTexture.h:168