ArcGIS Procedural Runtime  3.2.10650
Callbacks.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 PRT_CALLBACKS_H_
19 #define PRT_CALLBACKS_H_
20 
21 #include "prt/prt.h"
22 #include "prt/Status.h"
23 #include "prt/ContentType.h"
24 #include "prt/CGAErrorLevel.h"
25 
26 #include <cstddef>
27 #include <cstdint>
28 
29 
30 namespace prt {
31  class AttributeMap;
32 
33 
45 class PRT_EXPORTS_API Callbacks {
46 public:
55  virtual Status generateError(size_t isIndex, Status status, const wchar_t* message) = 0;
69  virtual Status assetError(size_t isIndex, CGAErrorLevel level, const wchar_t* key, const wchar_t* uri, const wchar_t* message) = 0;
84  virtual Status cgaError(size_t isIndex, int32_t shapeID, CGAErrorLevel level, int32_t methodId, int32_t pc, const wchar_t* message) = 0;
96  virtual Status cgaPrint(size_t isIndex, int32_t shapeID, const wchar_t* txt) = 0;
107  virtual Status cgaReportBool(size_t isIndex, int32_t shapeID, const wchar_t* key, bool value) = 0;
118  virtual Status cgaReportFloat(size_t isIndex, int32_t shapeID, const wchar_t* key, double value) = 0;
129  virtual Status cgaReportString(size_t isIndex, int32_t shapeID, const wchar_t* key, const wchar_t* value) = 0;
130 
141  virtual Status attrBool(size_t isIndex, int32_t shapeID, const wchar_t* key, bool value) = 0;
152  virtual Status attrFloat(size_t isIndex, int32_t shapeID, const wchar_t* key, double value) = 0;
163  virtual Status attrString(size_t isIndex, int32_t shapeID, const wchar_t* key, const wchar_t* value) = 0;
164 
165 
178  virtual Status attrBoolArray(size_t isIndex, int32_t shapeID, const wchar_t* key, const bool* ptr, size_t size, size_t nRows) = 0;
191  virtual Status attrFloatArray(size_t isIndex, int32_t shapeID, const wchar_t* key, const double* ptr, size_t size, size_t nRows) = 0;
204  virtual Status attrStringArray(size_t isIndex, int32_t shapeID, const wchar_t* key, const wchar_t* const* ptr, size_t size, size_t nRows) = 0;
205 
217  LAYER_Z
218  };
219 
235  virtual double cgaGetCoord(size_t isIndex, CoordSelector sel, double x, double y, double z, Status* stat = 0);
236 
243  CANCEL_ASAP
244  };
245 
253  virtual Continuation progress(float percentageCompleted);
254 
255 
256 protected:
257  Callbacks();
258  virtual ~Callbacks();
259 };
260 
261 
270 class PRT_EXPORTS_API SimpleOutputCallbacks : public Callbacks {
271 public:
278  SE_UTF16
279  };
283  enum OpenMode {
285  OPENMODE_IF_NOT_EXISTING
286  };
290  enum SeekOrigin {
293  SO_END
294  };
295 
299  virtual bool canSeek() const = 0;
311  virtual uint64_t open(const wchar_t* encoderId, const ContentType contentType, const wchar_t* name, StringEncoding enc = SE_NATIVE, OpenMode mode = OPENMODE_ALWAYS, prt::Status* stat = 0) = 0;
319  virtual Status write(uint64_t handle, const wchar_t* string) = 0;
328  virtual Status write(uint64_t handle, const uint8_t* buffer, size_t size) = 0;
338  virtual Status seek(uint64_t handle, int64_t offset, SeekOrigin origin) = 0;
347  virtual uint64_t tell(uint64_t handle, Status* stat = 0) = 0;
360  virtual Status logStats(uint64_t handle, const size_t* isIndices, size_t isCount, ContentType contentType, const prt::AttributeMap* stats);
370  virtual Status close(uint64_t handle, const size_t* isIndices, size_t isCount) = 0;
371 
378  virtual Status openCGAError(const wchar_t* name) = 0;
385  virtual Status openCGAPrint(const wchar_t* name) = 0;
392  virtual Status openCGAReport(const wchar_t* name) = 0;
393 
394  virtual Status closeCGAError() = 0;
395  virtual Status closeCGAPrint() = 0;
396  virtual Status closeCGAReport() = 0;
397 
398 protected:
400  virtual ~SimpleOutputCallbacks();
401 };
402 
403 
404 } // namespace prt
405 
406 
407 #endif /* PRT_CALLBACKS_H_ */
The y coordinate of the projected coordinate system (i.e. cga&#39;s z axis).
Definition: Callbacks.h:211
Always open.
Definition: Callbacks.h:284
StringEncoding
Definition: Callbacks.h:275
Seek at current position.
Definition: Callbacks.h:292
Native encoding.
Definition: Callbacks.h:276
Definition: Callbacks.h:270
ContentType
Definition: ContentType.h:28
The layer x coordinate. Layer coordinates are not used internally by cga but some encoders might rely...
Definition: Callbacks.h:215
Definition: AttributeMap.h:32
Status
Definition: Status.h:31
The WGS84 altitude in meters.
Definition: Callbacks.h:214
The WGS84 longitude coordinates.
Definition: Callbacks.h:213
Go on.
Definition: Callbacks.h:241
CoordSelector
Definition: Callbacks.h:209
SeekOrigin
Definition: Callbacks.h:290
OpenMode
Definition: Callbacks.h:283
Seek at beginning.
Definition: Callbacks.h:291
UTF8 encoding.
Definition: Callbacks.h:277
Cancel generation but finish encoding the already generated models.
Definition: Callbacks.h:242
The WGS84 latitude coordinates.
Definition: Callbacks.h:212
Definition: Callbacks.h:45
The Procedural Runtime API namespace. The prt namespace contains the top level entry points into the ...
Definition: Annotation.h:24
CGAErrorLevel
Definition: CGAErrorLevel.h:27
The layer y coordinate.
Definition: Callbacks.h:216
The x coordinate of the projected coordinate system (i.e. cga&#39;s x axis).
Definition: Callbacks.h:210
Continuation
Definition: Callbacks.h:240