ArcGIS Procedural Runtime  3.2.10650
Decoder.h
1 /*
2  COPYRIGHT (c) 2012-2024 Esri R&D Center Zurich
3  TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
4  Unpublished material - all rights reserved under the
5  Copyright Laws of the United States and applicable international
6  laws, treaties, and conventions.
7 
8  For additional information, contact:
9  Environmental Systems Research Institute, Inc.
10  Attn: Contracts and Legal Services Department
11  380 New York Street
12  Redlands, California, 92373
13  USA
14 
15  email: contracts@esri.com
16 */
17 
18 #ifndef PRTX_DECODER_H_
19 #define PRTX_DECODER_H_
20 
21 #include "prtx/prtx.h"
22 #include "prtx/Extension.h"
23 
24 #include "prt/ContentType.h"
25 
26 #include <iosfwd>
27 #include <memory>
28 #include <vector>
29 
30 namespace prt {
31 class Cache;
32 }
33 
34 namespace prtx {
35 
36 class ResolveMap;
37 
38 class Content;
39 using ContentPtr = std::shared_ptr<Content>;
40 using ContentPtrVector = std::vector<ContentPtr>;
41 
42 class Decoder;
43 using DecoderPtr = std::shared_ptr<Decoder>;
44 
52 class PRTX_EXPORTS_API Decoder : public Extension {
53 protected:
54  Decoder() = default;
55 
56 public:
57  virtual ~Decoder() = default;
58 
67  virtual void decode(
68  ContentPtrVector& results,
69  std::istream& stream,
70  prt::Cache* cache,
71  const std::wstring& key,
72  prtx::ResolveMap const* resolveMap,
73  std::wstring& warnings
74  ) = 0;
76 
82  virtual ExtensionType getExtensionType() const final override {
83  return Extension::ET_DECODER;
84  }
85 };
86 
87 
95 class PRTX_EXPORTS_API GeometryDecoder : public Decoder {
96 protected:
97  GeometryDecoder() = default;
98 
99 public:
100  virtual ~GeometryDecoder() = default;
101 
107  virtual prt::ContentType getContentType() const final override { return prt::CT_GEOMETRY; }
108 };
109 
110 
117 class PRTX_EXPORTS_API MaterialDecoder : public Decoder {
118 protected:
119  MaterialDecoder() = default;
120 
121 public:
122  virtual ~MaterialDecoder() = default;
123 
129  virtual prt::ContentType getContentType() const final override { return prt::CT_MATERIAL; }
130 };
131 
132 
138 class PRTX_EXPORTS_API TextureDecoder : public Decoder {
139 protected:
140  TextureDecoder() = default;
141 
142 public:
143  virtual ~TextureDecoder() = default;
144 
150  virtual prt::ContentType getContentType() const final override { return prt::CT_TEXTURE; }
151 };
152 
153 
159 class PRTX_EXPORTS_API CGBDecoder : public Decoder {
160 protected:
161  CGBDecoder() = default;
162 
163 public:
164  virtual ~CGBDecoder() = default;
165 
171  virtual prt::ContentType getContentType() const final override { return prt::CT_CGB; }
172 };
173 
178 class PRTX_EXPORTS_API StringDecoder : public Decoder {
179 protected:
180  StringDecoder() = default;
181 
182 public:
183  virtual ~StringDecoder() = default;
184 
190  virtual prt::ContentType getContentType() const final override { return prt::CT_STRING; }
191 };
192 
193 
198 class PRTX_EXPORTS_API TableDecoder : public Decoder {
199 protected:
200  TableDecoder() = default;
201 
202 public:
203  virtual ~TableDecoder() = default;
204 
210  virtual prt::ContentType getContentType() const final override { return prt::CT_TABLE; }
211 };
212 
213 } // namespace prtx
214 
215 
216 #endif /* PRTX_DECODER_H_ */
Extension can handle tables.
Definition: ContentType.h:42
Extension can handle textures.
Definition: ContentType.h:32
Definition: Decoder.h:178
Extension can handle strings.
Definition: ContentType.h:41
Extension can handle materials (and potentially also textures).
Definition: ContentType.h:31
ExtensionType
Definition: Extension.h:46
Definition: Decoder.h:52
virtual prt::ContentType getContentType() const final override
Definition: Decoder.h:129
virtual prt::ContentType getContentType() const final override
Definition: Decoder.h:210
Definition: Decoder.h:159
Extension can handle CGB resources.
Definition: ContentType.h:34
Definition: Decoder.h:198
virtual prt::ContentType getContentType() const final override
Definition: Decoder.h:107
virtual prt::ContentType getContentType() const final override
Definition: Decoder.h:171
Definition: Extension.h:41
The Procedural Runtime eXtension namespace. The prtx namespace contains the tools to extend the Proce...
Definition: AnnotationBuilder.h:35
Definition: Decoder.h:95
ContentType
Definition: ContentType.h:28
Definition: Cache.h:53
Definition: Decoder.h:117
Definition: /ResolveMap.h:40
virtual ExtensionType getExtensionType() const final override
Definition: Decoder.h:82
Extension sub-class is a decoder.
Definition: Extension.h:51
virtual prt::ContentType getContentType() const final override
Definition: Decoder.h:190
virtual prt::ContentType getContentType() const final override
Definition: Decoder.h:150
Definition: Decoder.h:138
Extension can handle geometries (and potentially also materials and textures).
Definition: ContentType.h:30
The Procedural Runtime API namespace. The prt namespace contains the top level entry points into the ...
Definition: Annotation.h:24