ArcGIS Procedural Runtime  3.2.10650
List of all members | Public Types | Public Member Functions
prt::Callbacks Class Referenceabstract

#include <Callbacks.h>

Inheritance diagram for prt::Callbacks:
[legend]

Public Types

enum  Continuation {
  CONTINUE,
  CANCEL_AND_FINISH,
  CANCEL_ASAP
}
 
enum  CoordSelector {
  PROJ_X,
  PROJ_Y,
  WGS84_LAT,
  WGS84_LON,
  WGS84_ALT_METER,
  LAYER_X,
  LAYER_Y,
  LAYER_Z
}
 

Public Member Functions

virtual Status assetError (size_t isIndex, CGAErrorLevel level, const wchar_t *key, const wchar_t *uri, const wchar_t *message)=0
 
virtual Status attrBool (size_t isIndex, int32_t shapeID, const wchar_t *key, bool value)=0
 
virtual Status attrBoolArray (size_t isIndex, int32_t shapeID, const wchar_t *key, const bool *ptr, size_t size, size_t nRows)=0
 
virtual Status attrFloat (size_t isIndex, int32_t shapeID, const wchar_t *key, double value)=0
 
virtual Status attrFloatArray (size_t isIndex, int32_t shapeID, const wchar_t *key, const double *ptr, size_t size, size_t nRows)=0
 
virtual Status attrString (size_t isIndex, int32_t shapeID, const wchar_t *key, const wchar_t *value)=0
 
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
 
virtual Status cgaError (size_t isIndex, int32_t shapeID, CGAErrorLevel level, int32_t methodId, int32_t pc, const wchar_t *message)=0
 
virtual double cgaGetCoord (size_t isIndex, CoordSelector sel, double x, double y, double z, Status *stat=0)
 
virtual Status cgaPrint (size_t isIndex, int32_t shapeID, const wchar_t *txt)=0
 
virtual Status cgaReportBool (size_t isIndex, int32_t shapeID, const wchar_t *key, bool value)=0
 
virtual Status cgaReportFloat (size_t isIndex, int32_t shapeID, const wchar_t *key, double value)=0
 
virtual Status cgaReportString (size_t isIndex, int32_t shapeID, const wchar_t *key, const wchar_t *value)=0
 
virtual Status generateError (size_t isIndex, Status status, const wchar_t *message)=0
 
virtual Continuation progress (float percentageCompleted)
 

Detailed Description

Callbacks are used to return data such as errors or reports during generation, to lookup coordinates dependent on the client's coordinate system and to report progress and query for cancelation.

A client must either use one of the provided implementations (FileOutputHandler, MemoryOutputHandler) or implement this interface in order to use the generate() functions.

An instance of a Callbacks subclass is instantiated & destroyed by the client. It usually lives for a number of sequential generate() calls. All member functions must be thread-safe (can be called simultaneously by a number of internal threads). One instance of a Callbacks must not be used by more than one concurrent generate() calls.

Member Enumeration Documentation

◆ Continuation

Continuation possibilities.

Enumerator
CONTINUE 

Go on.

CANCEL_AND_FINISH 

Cancel generation but finish encoding the already generated models.

CANCEL_ASAP 

Cancel generation and return as soon as possible, do not finalize encoding.

◆ CoordSelector

Geographical coordinates which might be looked up by cga.

Enumerator
PROJ_X 

The x coordinate of the projected coordinate system (i.e. cga's x axis).

PROJ_Y 

The y coordinate of the projected coordinate system (i.e. cga's z axis).

WGS84_LAT 

The WGS84 latitude coordinates.

WGS84_LON 

The WGS84 longitude coordinates.

WGS84_ALT_METER 

The WGS84 altitude in meters.

LAYER_X 

The layer x coordinate. Layer coordinates are not used internally by cga but some encoders might rely on this.

LAYER_Y 

The layer y coordinate.

LAYER_Z 

The layer z coordinate.

Member Function Documentation

◆ assetError()

virtual Status prt::Callbacks::assetError ( size_t  isIndex,
CGAErrorLevel  level,
const wchar_t *  key,
const wchar_t *  uri,
const wchar_t *  message 
)
pure virtual

Reports to the client that one of the assets used by the rule was erroneous. Called by com.esri.prt.core.CGAErrorEncoder (potentially by any encoder).

See also
generate(), InitialShape, ResolveMap
Parameters
isIndexInitial shape index (relative to the initialShapes array in the generate() call)
levelError/warning/info.
keyThe asset's key (symbolic name) into the initial shape's ResolveMap.
uriThe asset's URI from the initial shape's ResolveMap.
messageAn error message.
Returns
status.

◆ attrBool()

virtual Status prt::Callbacks::attrBool ( size_t  isIndex,
int32_t  shapeID,
const wchar_t *  key,
bool  value 
)
pure virtual

Reports the value of an evaluated attribute to the client. Called by com.esri.prt.core.AttributeEvalEncoder (potentially by any encoder).

Parameters
isIndexInitial shape index (relative to the initialShapes array in the generate() call)
shapeIDUnique shape id to identify the shape in the shape tree. See prtx::Shape.
keyThe key of the attribute.
valueThe evaluated value.
Returns
status.

◆ attrBoolArray()

virtual Status prt::Callbacks::attrBoolArray ( size_t  isIndex,
int32_t  shapeID,
const wchar_t *  key,
const bool *  ptr,
size_t  size,
size_t  nRows 
)
pure virtual

Reports the value of an evaluated attribute to the client. Called by com.esri.prt.core.AttributeEvalEncoder (potentially by any encoder).

Parameters
isIndexInitial shape index (relative to the initialShapes array in the generate() call)
shapeIDUnique shape id to identify the shape in the shape tree. See prtx::Shape.
keyThe key of the attribute.
ptrPointer to the array.
sizeSize of the array.
nRowsNumber of rows in the array. This is 1 for 1d arrays. CGA arrays can actually be 2d!
Returns
status.

◆ attrFloat()

virtual Status prt::Callbacks::attrFloat ( size_t  isIndex,
int32_t  shapeID,
const wchar_t *  key,
double  value 
)
pure virtual

Reports the value of an evaluated attribute to the client. Called by com.esri.prt.core.AttributeEvalEncoder (potentially by any encoder).

Parameters
isIndexInitial shape index (relative to the initialShapes array in the generate() call)
shapeIDUnique shape id to identify the shape in the shape tree. See prtx::Shape.
keyThe key of the attribute.
valueThe evaluated value.
Returns
status.

◆ attrFloatArray()

virtual Status prt::Callbacks::attrFloatArray ( size_t  isIndex,
int32_t  shapeID,
const wchar_t *  key,
const double *  ptr,
size_t  size,
size_t  nRows 
)
pure virtual

Reports the value of an evaluated attribute to the client. Called by com.esri.prt.core.AttributeEvalEncoder (potentially by any encoder).

Parameters
isIndexInitial shape index (relative to the initialShapes array in the generate() call)
shapeIDUnique shape id to identify the shape in the shape tree. See prtx::Shape.
keyThe key of the attribute.
ptrPointer to the array.
sizeSize of the array.
nRowsNumber of rows in the array. This is 1 for 1d arrays. CGA arrays can actually be 2d!
Returns
status.

◆ attrString()

virtual Status prt::Callbacks::attrString ( size_t  isIndex,
int32_t  shapeID,
const wchar_t *  key,
const wchar_t *  value 
)
pure virtual

Reports the value of an evaluated attribute to the client. Called by com.esri.prt.core.AttributeEvalEncoder (potentially by any encoder).

Parameters
isIndexInitial shape index (relative to the initialShapes array in the generate() call)
shapeIDUnique shape id to identify the shape in the shape tree. See prtx::Shape.
keyThe key of the attribute.
valueThe evaluated value.
Returns
status.

◆ attrStringArray()

virtual Status prt::Callbacks::attrStringArray ( size_t  isIndex,
int32_t  shapeID,
const wchar_t *  key,
const wchar_t *const *  ptr,
size_t  size,
size_t  nRows 
)
pure virtual

Reports the value of an evaluated attribute to the client. Called by com.esri.prt.core.AttributeEvalEncoder (potentially by any encoder).

Parameters
isIndexInitial shape index (relative to the initialShapes array in the generate() call)
shapeIDUnique shape id to identify the shape in the shape tree. See prtx::Shape.
keyThe key of the attribute.
ptrPointer to the array.
sizeSize of the array.
nRowsNumber of rows in the array. This is 1 for 1d arrays. CGA arrays can actually be 2d!
Returns
status.

◆ cgaError()

virtual Status prt::Callbacks::cgaError ( size_t  isIndex,
int32_t  shapeID,
CGAErrorLevel  level,
int32_t  methodId,
int32_t  pc,
const wchar_t *  message 
)
pure virtual

Reports to the client that a runtime cga error occuried during generation of a model. Called by com.esri.prt.core.CGAErrorEncoder (potentially by any encoder).

See also
generate()
Parameters
isIndexInitial shape index (relative to the initialShapes array in the generate() call)
shapeIDUnique shape id to identify the shape in the shape tree. See prtx::Shape.
levelError/warning/info.
methodIdCGB-internal method id in which the error occurred.
pcSPU-internal program counter at which the error occured.
messageAn error message.
Returns
status.

◆ cgaGetCoord()

virtual double prt::Callbacks::cgaGetCoord ( size_t  isIndex,
CoordSelector  sel,
double  x,
double  y,
double  z,
Status stat = 0 
)
virtual

Function to convert world coordinates from the cga coordinate system (right handed y-up, meters) to a Cartesian scene coordinate system, geographical WGS84 coordinates or client-dependent layer coordinates. Note: The conversion to WGS84 coordinates is only correct if the input is in Web Mercator coordinates.

Some cga functions (getGeoCord) rely on this. Additionally, some encoders use this functioanlity as well.

Parameters
isIndexInitial shape index (relative to the initialShapes array in the generate() call)
selSelector for the desired coordinate.
xX world coordinate in cga system.
yY world coordinate in cga system.
zZ world coordinate in cga system.
[out]statOptional pointer to return the status.
Returns
The desired coordinate.

◆ cgaPrint()

virtual Status prt::Callbacks::cgaPrint ( size_t  isIndex,
int32_t  shapeID,
const wchar_t *  txt 
)
pure virtual

Reports to the client that a cga print operation/function was called during generation of a model. Called by com.esri.prt.core.CGAPrintEncoder (potentially by any encoder).

See also
generate()
Parameters
isIndexInitial shape index (relative to the initialShapes array in the generate() call)
shapeIDUnique shape id to identify the shape in the shape tree. See prtx::Shape.
txtThe printed text.
Returns
status.

◆ cgaReportBool()

virtual Status prt::Callbacks::cgaReportBool ( size_t  isIndex,
int32_t  shapeID,
const wchar_t *  key,
bool  value 
)
pure virtual

Reports to the client that a cga report operation was called during generation of a model. Called by com.esri.prt.core.CGAReportEncoder (potentially by any encoder).

Parameters
isIndexInitial shape index (relative to the initialShapes array in the generate() call)
shapeIDUnique shape id to identify the shape in the shape tree. See prtx::Shape.
keyThe key in the report operation.
valueThe value in the report operation.
Returns
status.

◆ cgaReportFloat()

virtual Status prt::Callbacks::cgaReportFloat ( size_t  isIndex,
int32_t  shapeID,
const wchar_t *  key,
double  value 
)
pure virtual

Reports to the client that a cga report operation was called during generation of a model. Called by com.esri.prt.core.CGAReportEncoder (potentially by any encoder).

Parameters
isIndexInitial shape index (relative to the initialShapes array in the generate() call)
shapeIDUnique shape id to identify the shape in the shape tree. See prtx::Shape.
keyThe key in the report operation.
valueThe value in the report operation.
Returns
status.

◆ cgaReportString()

virtual Status prt::Callbacks::cgaReportString ( size_t  isIndex,
int32_t  shapeID,
const wchar_t *  key,
const wchar_t *  value 
)
pure virtual

Reports to the client that a cga report operation was called during generation of a model. Called by com.esri.prt.core.CGAReportEncoder (potentially by any encoder).

Parameters
isIndexInitial shape index (relative to the initialShapes array in the generate() call)
shapeIDUnique shape id to identify the shape in the shape tree. See prtx::Shape.
keyThe key in the report operation.
valueThe value in the report operation.
Returns
status.

◆ generateError()

virtual Status prt::Callbacks::generateError ( size_t  isIndex,
Status  status,
const wchar_t *  message 
)
pure virtual

Reports to the client that an application error occurred during generation of one of the initial shapes.

Parameters
isIndexInitial shape index (relative to the initialShapes array in the generate() call)
statusThe erroneous status encountered during generation / encoding of the initial shape.
messageAn error message.
Returns
client status (this value is currently ignored by PRT).

◆ progress()

virtual Continuation prt::Callbacks::progress ( float  percentageCompleted)
virtual

Called during the generation() call. Called at least once for every initial shape in the generate() call. Allows the client to abort the generate process.

Parameters
percentageCompletedA value in [0, 100]
Returns
The desired way to continue.

The documentation for this class was generated from the following file: