VTK  9.1.0
OMFElement.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: OMFElement.h
5 Language: C++
6
7 Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
8 All rights reserved.
9 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
10
11 This software is distributed WITHOUT ANY WARRANTY; without even
12 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13 PURPOSE. See the above copyright notice for more information.
14
15=========================================================================*/
16#ifndef OMFElement_h
17#define OMFElement_h
18
19#include "vtkSmartPointer.h"
20
21#include "vtk_jsoncpp_fwd.h"
22
23#include <memory>
24#include <string>
25
28class vtkTexture;
29
30namespace omf
31{
32
33struct OMFFile;
34
36{
37public:
38 ProjectElement(const std::string& uid, double globalOrigin[3]);
39 virtual ~ProjectElement() = default;
40
41 virtual void ProcessJSON(std::shared_ptr<OMFFile>& file, const Json::Value& element,
42 vtkPartitionedDataSet* output, bool writeOutTextures, bool columnMajorOrdering);
43
44protected:
46 double GlobalOrigin[3] = { 0, 0, 0 };
47
48 virtual void ProcessGeometry(std::shared_ptr<OMFFile>& file, const std::string& geometryUID,
49 vtkPartitionedDataSet* output) = 0;
50 virtual void ProcessDataFields(
51 std::shared_ptr<OMFFile>& file, const Json::Value& dataJSON, vtkPartitionedDataSet* output);
52 virtual void ProcessColumnOrdering(std::shared_ptr<OMFFile>& /*file*/,
53 const Json::Value& /*dataJSON*/, vtkPartitionedDataSet* /*output*/){};
54 virtual void ProcessTextures(std::shared_ptr<OMFFile>& file, const Json::Value& textureJSON,
55 vtkPartitionedDataSet* output, const std::string& elementName);
56};
57
59{
60public:
61 PointSetElement(const std::string& uid, double globalOrigin[3])
62 : ProjectElement(uid, globalOrigin)
63 {
64 }
65
66protected:
67 void ProcessGeometry(std::shared_ptr<OMFFile>& file, const std::string& geometryUID,
68 vtkPartitionedDataSet* output) override;
69};
70
72{
73public:
74 LineSetElement(const std::string& uid, double globalOrigin[3])
75 : ProjectElement(uid, globalOrigin)
76 {
77 }
78
79protected:
80 void ProcessGeometry(std::shared_ptr<OMFFile>& file, const std::string& geometryUID,
81 vtkPartitionedDataSet* output) override;
82};
83
85{
86public:
87 SurfaceElement(const std::string& uid, double globalOrigin[3])
88 : ProjectElement(uid, globalOrigin)
89 {
90 }
91
92protected:
93 void ProcessGeometry(std::shared_ptr<OMFFile>& file, const std::string& geometryUID,
94 vtkPartitionedDataSet* output) override;
95};
96
98{
99public:
100 VolumeElement(const std::string& uid, double globalOrigin[3])
101 : ProjectElement(uid, globalOrigin)
102 {
103 }
104
105protected:
106 void ProcessGeometry(std::shared_ptr<OMFFile>& file, const std::string& geometryUID,
107 vtkPartitionedDataSet* output) override;
108 void ProcessColumnOrdering(std::shared_ptr<OMFFile>& file, const Json::Value& dataJSON,
109 vtkPartitionedDataSet* output) override;
110 size_t Dimensions[3];
111};
112
113} // end namespace omf
114
115#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:74
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:61
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:52
std::string UID
Definition: OMFElement.h:45
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:46
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:87
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:100
void ProcessColumnOrdering(std::shared_ptr< OMFFile > &file, const Json::Value &dataJSON, vtkPartitionedDataSet *output) override
size_t Dimensions[3]
Definition: OMFElement.h:110
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:175
Definition: OMFElement.h:31
@ string
Definition: vtkX3D.h:496