Class CWFGM Grid. More...
#include <CWFGM_Grid.h>
Public Member Functions | |
HRESULT | IPersistStreamInit_Save (LPSTREAM pStm, BOOL fClearDirty, const ATL_PROPMAP_ENTRY *pMap) |
HRESULT | IPersistStreamInit_Load (LPSTREAM pStm, const ATL_PROPMAP_ENTRY *pMap) |
STDMETHOD() | GetAttribute (USHORT option, VARIANT *value) |
STDMETHOD() | SetAttribute (USHORT option, VARIANT value) |
STDMETHOD() | ExportGrid (const BSTR grid_file_name) |
STDMETHOD() | ImportElevation (const BSTR prj_file_name, const BSTR grid_file_name) |
STDMETHOD() | ImportGrid (const BSTR prj_file_name, const BSTR grid_file_name, long *fail_index) |
STDMETHOD() | Clone (ICWFGM_Grid **newGrid) |
STDMETHOD() | get_FuelMap (ICWFGM_FuelMap **pVal) |
STDMETHOD() | put_FuelMap (ICWFGM_FuelMap *newVal) |
STDMETHOD() | IsFuelUsed (ICWFGM_Fuel *fuel) |
STDMETHOD() | MT_Lock (__int64 layerThread, USHORT exclusive, USHORT obtain) |
STDMETHOD() | Valid (__int64 layerThread, ULONGLONG start_time, LONGLONG duration, ULONG option, SAFEARRAY **application_count) |
STDMETHOD() | GetAttribute (__int64 layerThread, USHORT option, VARIANT *value) |
STDMETHOD() | GetDimensions (__int64 layerThread, USHORT *x_dim, USHORT *y_dim) |
STDMETHOD() | GetFuelData (__int64 layerThread, USHORT _x, USHORT _y, ULONGLONG time, ICWFGM_Fuel **fuel) |
STDMETHOD() | GetFuelIndexData (__int64 layerThread, USHORT x, USHORT y, ULONGLONG time, UCHAR *fuel_index) |
STDMETHOD() | GetElevationData (__int64 layerThread, USHORT x, USHORT y, SHORT allow_defaults_returned, double *elevation, double *slope_factor, double *slope_azimuth) |
STDMETHOD() | GetWeatherData (__int64 layerThread, USHORT x, USHORT y, ULONGLONG time, ULONG interpolate_method, IWXData *wx, IFWIData *ifwi, DFWIData *dfwi) |
STDMETHOD() | GetAttributeData (__int64 layerThread, USHORT _x, USHORT _y, ULONGLONG time, USHORT option, VARIANT *attribute) |
STDMETHOD() | GetFuelDataArray (__int64 layerThread, USHORT _x_min, USHORT _y_min, USHORT _x_max, USHORT _y_max, ULONGLONG time, SAFEARRAY **fuel) |
STDMETHOD() | GetFuelIndexDataArray (__int64 layerThread, USHORT _x_min, USHORT _y_min, USHORT _x_max, USHORT _y_max, ULONGLONG time, SAFEARRAY **fuel) |
STDMETHOD() | GetElevationDataArray (__int64 layerThread, USHORT x_min, USHORT y_min, USHORT x_max, USHORT y_max, SHORT allow_defaults_returned, SAFEARRAY **elevation, SAFEARRAY **slope_factor, SAFEARRAY **slope_azimuth) |
STDMETHOD() | GetWeatherDataArray (__int64 layerThread, USHORT x_min, USHORT y_min, USHORT x_max, USHORT y_max, ULONGLONG time, ULONG interpolate_method, SAFEARRAY **wx, SAFEARRAY **ifwi, SAFEARRAY **dfwi) |
STDMETHOD() | GetAttributeDataArray (__int64 layerThread, USHORT _x_min, USHORT _y_min, USHORT _x_max, USHORT _y_max, ULONGLONG time, USHORT option, SAFEARRAY **attribute) |
STDMETHOD() | GetEventTime (__int64 layerThread, ULONG flags, ULONGLONG from_time, ULONGLONG *next_event) |
STDMETHOD() | PreCalculationEvent (__int64 layerThread, ULONGLONG time, ULONG mode) |
STDMETHOD() | PostCalculationEvent (__int64 layerThread, ULONGLONG time, ULONG mode) |
STDMETHOD() | GetGridEngine (__int64 layerThread, ICWFGM_GridEngine **pVal) |
STDMETHOD() | PutGridEngine (__int64 layerThread, ICWFGM_GridEngine *newVal) |
STDMETHOD() | get_LayerManager (ICWFGM_LayerManager **pVal) |
STDMETHOD() | put_LayerManager (ICWFGM_LayerManager *newVal) |
STDMETHOD() | get_UserData (VARIANT *pVal) |
STDMETHOD() | put_UserData (VARIANT newVal) |
STDMETHOD() | CreateGrid (USHORT xsize, USHORT ysize, double xllcorner, double yllcorner, double resolution, UCHAR BasicFuel) |
STDMETHOD() | CreateSlopeElevationGrid (SHORT elevation, USHORT slope, USHORT aspect) |
STDMETHOD() | WriteProjection (const BSTR szPath) |
STDMETHOD() | ExportElevation (const BSTR grid_file_name) |
STDMETHOD() | ExportSlope (const BSTR grid_file_name) |
STDMETHOD() | ExportAspect (const BSTR grid_file_name) |
Public Member Functions inherited from ICWFGM_Grid | |
HRESULT | Clone ([out]ICWFGM_Grid **newGrid) |
HRESULT | ImportGrid ([in] const BSTR prj_file_name, [in]const BSTR grid_file_name, [out]long *fail_index) |
HRESULT | ImportElevation ([in] const BSTR prj_file_name, [in] const BSTR grid_file_name) |
HRESULT | ExportGrid ([in]const BSTR grid_file_name) |
HRESULT | IsFuelUsed ([in]ICWFGM_Fuel *fuel) |
HRESULT | GetAttribute ([in]unsigned short option, [out, retval]VARIANT *value) |
HRESULT | SetAttribute ([in]unsigned short option, [in]VARIANT value) |
HRESULT | WriteProjection ([in]const BSTR szPath) |
HRESULT | CreateGrid ([in]unsigned short xsize, [in]unsigned short ysize, [in]double xllcorner, [in]double yllcorner, [in]double resolution, [in]unsigned char BasicFuel) |
HRESULT | CreateSlopeElevationGrid ([in]short elevation, [in]unsigned short slope, [in]unsigned short aspect) |
HRESULT | ExportElevation ([in]const BSTR grid_file_name) |
HRESULT | ExportSlope ([in]const BSTR grid_file_name) |
HRESULT | ExportAspect ([in]const BSTR grid_file_name) |
Public Member Functions inherited from ICWFGM_GridEngine | |
HRESULT | MT_Lock ([in] __int64 layerThread, [in] unsigned short exclusive, [in] unsigned short obtain) |
HRESULT | Valid ([in] __int64 layerThread, [in] unsigned __int64 start_time, [in] __int64 duration, [in] unsigned long option, [in, out] SAFEARRAY(unsigned short)*application_count) |
HRESULT | GetAttribute ([in] __int64 layerThread, [in] unsigned short option, [out, retval]VARIANT *value) |
HRESULT | GetDimensions ([in] __int64 layerThread, [out] unsigned short *x_dim, [out]unsigned short *y_dim) |
HRESULT | GetFuelData ([in] __int64 layerThread, [in] unsigned short _x, [in] unsigned short _y, [in] unsigned __int64 time, [out, retval]ICWFGM_Fuel **fuel) |
HRESULT | GetFuelIndexData ([in] __int64 layerThread, [in] unsigned short x, [in] unsigned short y, [in] unsigned __int64 time, [out, retval]unsigned char *fuel_index) |
HRESULT | GetElevationData ([in] __int64 layerThread, [in] unsigned short x, [in] unsigned short y, [in] short allow_defaults_returned, [out]double *elevation, [out] double *slope_factor, [out] double *slope_azimuth) |
HRESULT | GetAttributeData ([in] __int64 layerThread, [in] unsigned short x, [in] unsigned short y, [in] unsigned __int64 time, [in] unsigned short option, [out, retval] VARIANT *attribute) |
HRESULT | GetWeatherData ([in] __int64 layerThread, [in] unsigned short x, [in] unsigned short y, [in] unsigned __int64 time, [in]unsigned long interpolate_method, [out]IWXData *wx, [out]IFWIData *ifwi, [out]DFWIData *dfwi) |
HRESULT | GetFuelDataArray ([in] __int64 layerThread, [in] unsigned short _x_min, [in] unsigned short _y_min, [in] unsigned short _x_max, [in]unsigned short _y_max,[in]unsigned __int64 time, [in, out] SAFEARRAY(ICWFGM_Fuel *)*fuel) |
HRESULT | GetFuelIndexDataArray ([in] __int64 layerThread, [in]unsigned short _x_min, [in]unsigned short _y_min, [in]unsigned short _x_max, [in]unsigned short _y_max, [in]unsigned __int64 time, [in, out] SAFEARRAY(unsigned char)*fuel_index) |
HRESULT | GetElevationDataArray ([in] __int64 layerThread, [in]unsigned short x_min, [in]unsigned short y_min, [in]unsigned short x_max, [in]unsigned short y_max, [in]short allow_defaults_returned, [in, out] SAFEARRAY(double)*elevation, [in, out] SAFEARRAY(double)*slope_factor, [in, out] SAFEARRAY(double)*slope_azimuth) |
HRESULT | GetWeatherDataArray ([in] __int64 layerThread, [in]unsigned short x_min, [in]unsigned short y_min, [in]unsigned short x_max, [in] unsigned short y_max, [in]unsigned __int64 time, [in]unsigned long interpolate_method, [in, out] SAFEARRAY(IWXData)*wx, [in, out] SAFEARRAY(IFWIData)*ifwi, [in, out] SAFEARRAY(DFWIData)*dfwi) |
HRESULT | GetAttributeDataArray ([in] __int64 layerThread, [in]unsigned short x_min, [in]unsigned short y_min, [in]unsigned short x_max, [in]unsigned short y_max, [in] unsigned __int64 time, [in] unsigned short option, [in, out] SAFEARRAY(VARIANT)*attribute) |
HRESULT | GetEventTime ([in] __int64 layerThread, [in] unsigned long flags, [in] unsigned __int64 from_time, [out, retval] unsigned __int64 *next_event) |
HRESULT | PreCalculationEvent ([in] __int64 layerThread, [in] unsigned __int64 time, [in] unsigned long mode) |
HRESULT | PostCalculationEvent ([in] __int64 layerThread, [in] unsigned __int64 time, [in] unsigned long mode) |
HRESULT | GetGridEngine ([in] __int64 layerThread, [out, retval] ICWFGM_GridEngine **pVal) |
HRESULT | PutGridEngine ([in] __int64 layerThread, [in] ICWFGM_GridEngine *newVal) |
Additional Inherited Members | |
Properties inherited from ICWFGM_Grid | |
ICWFGM_FuelMap | FuelMap [get, set] |
Properties inherited from ICWFGM_GridEngine | |
ICWFGM_LayerManager | LayerManager [get, set] |
VARIANT | UserData [get, set] |
Class CWFGM Grid.
A CWFGM Grid is a representation of an area and supports two interfaces: one interface to perform basic assignment, modification, and import operations (ICWFGM_Grid), and a second interface for retrieval of data for purposes of simulations, etc. (ICWFGM_GridEngine). The second interface is a requirement for the simulation engine but is also used elsewhere to extract grid values for the display. These methods are separated into two interfaces to simplify building another grid object for use with the simulation engine.
STDMETHODIMP CCWFGM_Grid::Clone | ( | ICWFGM_Grid ** | newGrid | ) |
Creates a new grid object with all the same properties of the object being called, returns a handle to the new object in 'newGrid'. No data is shared between these two objects, an exact copy is created. The FuelMap property should be set on the copied object immediately after successful completion of this call.
newGrid | The grid object. |
E_POINTER | The address provided for newGrid is invalid. |
S_OK | Successful. |
E_NOINTERFACE | 'newGrid' is not a successfully created CWFGM Grid object. |
E_OUTOFMEMORY | Insufficient memory. |
ERROR_SEVERITY_WARNING | Unspecified failure. |
STDMETHODIMP CCWFGM_Grid::CreateGrid | ( | USHORT | xsize, |
USHORT | ysize, | ||
double | xllcorner, | ||
double | yllcorner, | ||
double | resolution, | ||
UCHAR | BasicFuel | ||
) |
Rather than importing an FBP fuel grid, this function will allow the client application to manually create the grid. This grid has a location and is set to a single fuel type.
xsize | East-west dimension size. |
ysize | North-south dimension size. |
xllcorner | Location. |
yllcorner | Location. |
resolution | Resolution of each grid cell. |
BasicFuel | The initial fuel to assign the entire grid to. |
S_OK | Successful. |
E_INVALIDARG | If any of the parameters are invalid. |
ERROR_GRID_UNINITIALIZED | Grid objects are not correctly initialized. |
ERROR_FUELS_FUEL_UNKNOWN | The index provide is unknown by the fuel map. |
E_OUTOFMEMORY | Insufficient memory to create the grid. |
ERROR_SCENARIO_SIMULATION_RUNNING | Value cannot be changed as it is being used by a currently running scenario. |
STDMETHODIMP CCWFGM_Grid::CreateSlopeElevationGrid | ( | SHORT | elevation, |
USHORT | slope, | ||
USHORT | aspect | ||
) |
Used primarily for testing purposes. Sets elevation, slope, aspect to constant values. Note that elevations are NOT calculated to match slope, aspect data.
elevation | Elevation for the entire grid. |
slope | Slope for the entire grid. |
aspect | Aspect of the slope for the entire grid. |
S_OK | Successful. |
ERROR_GRID_INITIALIZED | Data had already been loaded/initialized and so cannot be reset. |
E_OUTOFMEMORY | Insufficient memory to create the grid. |
ERROR_SCENARIO_SIMULATION_RUNNING | Value cannot be changed as it is being used by a currently running scenario. |
STDMETHODIMP CCWFGM_Grid::ExportAspect | ( | const BSTR | grid_file_name | ) |
This method export Aspect data from the grid to a file
grid_file_name | File name where the data should be exported. |
S_OK | Successful. |
E_POINTER | Bad pointer. |
ERROR_GRID_UNINITIALIZED | Grid not initialized. |
E_INVALIDARG | Invalid argument(s). |
STDMETHODIMP CCWFGM_Grid::ExportElevation | ( | const BSTR | grid_file_name | ) |
This method exports elevation data from the grid to a file
grid_file_name | File name where the data should be exported. |
S_OK | Successful. |
E_POINTER | Bad pointer. |
ERROR_GRID_UNINITIALIZED | Grid not initialized. |
E_INVALIDARG | Invalid argument(s). |
STDMETHODIMP CCWFGM_Grid::ExportGrid | ( | const BSTR | grid_file_name | ) |
This method exports grid FBP data to files.
grid_file_name | Grid file name. |
E_POINTER | Invalid pointer. |
E_INVALIDARG | Invalid arguments. |
ERROR_ACCESS_DENIED | Access denied. |
ERROR_INVALID_HANDLE | Generic file I/O error. |
ERROR_FILE_EXISTS | The file already exists. |
ERROR_INVALID_PARAMETER | The parameters are invalid. |
ERROR_TOO_MANY_OPEN_FILES | Too many files are open. |
ERROR_FILE_NOT_FOUND | The file cannot be found. |
E_OUTOFMEMORY | Insufficient memory. |
ERROR_HANDLE_DISK_FULL | Disk full |
ERROR_SEVERITY_WARNING | Unsure of reason for failure. |
ERROR_FUELS_FUEL_UNKNOWN | Fueltype is unknown. |
S_OK | Successful. |
STDMETHODIMP CCWFGM_Grid::ExportSlope | ( | const BSTR | grid_file_name | ) |
This method exports Slope data from the grid to a file
grid_file_name | File name where the data should be exported. |
S_OK | Successful. |
E_POINTER | Bad pointer. |
ERROR_GRID_UNINITIALIZED | Grid not initialized. |
E_INVALIDARG | Invalid argument(s). |
STDMETHODIMP CCWFGM_Grid::get_FuelMap | ( | ICWFGM_FuelMap ** | pVal | ) |
The CWFGM Grid needs an object supporting the ICWFGM_FuelMap interface; the creator of the Grid should assign this property to a valid value before using the grid object. This property is write-once-read-many because of its high dependency on internal indexes assigned by the fuel map. The COM reference count for the fuel map is incremented on assignment and decremented when this object is destroyed.
pVal | The fuel map. |
E_POINTER | The address provided for index is invalid. |
S_OK | Successful. |
E_NOINTERFACE | On assignment if not passed CWFGM FuelMap object. |
ERROR_GRID_INITIALIZED | If the assignment is tried more than once. |
ERROR_GRID_UNINITIALIZED | When reading the value before it has been set. |
ERROR_SCENARIO_SIMULATION_RUNNING | Value cannot be changed as it is being used in a currently running scenario. |
STDMETHODIMP CCWFGM_Grid::get_LayerManager | ( | ICWFGM_LayerManager ** | pVal | ) |
This property is must be set before any calls to GetGridEngine or PutGridEngine. Additionally, this property should be considered write-once. This value should be set to the ICWFGM_LayerManager object which any layerThread assigned to this object will have been allocated from.
pVal | value of LayerManager |
STDMETHODIMP CCWFGM_Grid::get_UserData | ( | VARIANT * | pVal | ) |
This property is unused by this object, and is available for exclusive use by the client code. It is a VARIANT value to ensure that the client code can store a pointer value (if it chooses) for use in manual subclassing this object. This value is not loaded or saved during serialization operations, and it is the responsibility of the client code to manage any value or object stored here. Access to this property is not thread-safe.
pVal | Value of UserData |
E_POINTER | The address provided for pVal is invalid |
S_OK | Successful |
STDMETHODIMP CCWFGM_Grid::GetAttribute | ( | USHORT | option, |
VARIANT * | value | ||
) |
Polymorphic. This routine retrieves an attribute/option value given the attribute/option index.
option | Returns the attribute of interest. Valid attributes are:
|
value | Location for the retrieved value to be placed. |
E_POINTER | The address provided for value is invalid. |
S_OK | Successful. |
ERROR_SEVERITY_WARNING | If asking for default elevation where the default elevation is not set. |
S_FALSE | If asking for values where the appropriate array has not been initialized. |
ERROR_GRID_UNINITIALIZED | No FBP grid data has been loaded. |
E_OUTOFMEMORY | Insufficient memory (can occur when retrieving slope data which hasn't been loaded so must be calculated). |
E_INVALIDARG | The attribute/option index was invalid/unknown for this object. |
STDMETHODIMP CCWFGM_Grid::GetAttribute | ( | __int64 | layerThread, |
USHORT | option, | ||
VARIANT * | value | ||
) |
Polymorphic. This method returns a specified attribute/option value. \param layerThread Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. \param option The attribute of interest. Valid option values are as follows, defined in "GridCom_Ext.h".
CWFGM_GRID_ATTRIBUTE_XLLCORNER
64-bit floating point. UTM value for the X coordinate of the lower-left corner of the grid extent. CWFGM_GRID_ATTRIBUTE_YLLCORNER
64-bit floating point. UTM value for the Y coordinate of the lower-left corner of the grid extent. CWFGM_GRID_ATTRIBUTE_PLOTRESOLUTION
64-bit floating point, metres. Resolution of the underlying grid data. CWFGM_GRID_ATTRIBUTE_LATITUDE
64-bit floating point, radians. CWFGM_GRID_ATTRIBUTE_LONGITUDE
64-bit floating point, radians. CWFGM_GRID_ATTRIBUTE_DEFAULT_ELEVATION
64-bit floating point, metres. User specified elevation to use when there is no grid elevation available for at a requested grid location. CWFGM_GRID_ATTRIBUTE_MIN_ELEVATION
64-bit floating point, metres. CWFGM_GRID_ATTRIBUTE_MAX_ELEVATION
64-bit floating point, metres. CWFGM_GRID_ATTRIBUTE_MEDIAN_ELEVATION
64-bit floating point, metres. CWFGM_GRID_ATTRIBUTE_MIN_SLOPE
64-bit floating point. Percentage ground slope specified as a decimal value (0 - 1) CWFGM_GRID_ATTRIBUTE_MAX_SLOPE
64-bit floating point. Percentage ground slope specified as a decimal value (0 - 1) CWFGM_GRID_ATTRIBUTE_MIN_AZIMUTH
64-bit floating point. Direction of up-slope, Cartesian radians. CWFGM_GRID_ATTRIBUTE_MAX_AZIMUTH
64-bit floating point. Direction of up-slope, Cartesian radians. CWFGM_GRID_ATTRIBUTE_TIMEZONE
64-bit signed integer. Units are in seconds, relative to GMT. For example, MST (Mountain Standard Time) would be -6 * 60 * 60 seconds. Valid values are from -12 hours to +12 hours. CWFGM_GRID_ATTRIBUTE_DAYLIGHT_SAVINGS
64-bit signed integer. Units are in seconds. Amount of correction to apply for daylight savings time. CWFGM_GRID_ATTRIBUTE_DST_START
64-bit unsigned integer. Units are in seconds. Julian date determining when daylight savings starts within the calendar year. CWFGM_GRID_ATTRIBUTE_DST_END
64-bit unsigned integer. Units are in seconds. Julian date determining when daylight savings ends within the calendar year. CWFGM_GRID_ATTRIBUTE_FUELS_PRESENT
Boolean. TRUE if a valid fuel grid has been successfully loaded. CWFGM_GRID_ATTRIBUTE_DEM_PRESENT
Boolean. TRUE if an elevation grid has been successfully loaded. CWFGM_ATTRIBUTE_LOAD_WARNING
BSTR. Any warnings generated by the COM object when deserializating. CWFGM_GRID_ATTRIBUTE_SPATIALREFERENCE
BSTR. GDAL WKT format string defining the spatial reference of the grid. value | Location for the retrieved value to be placed. |
E_POINTER | The address provided for value is invalid. |
S_OK | Successful. |
ERROR_SEVERITY_WARNING | If asking for default elevation where the default elevation is not set. |
S_FALSE | If asking for values where the appropriate array has not been initialized. |
ERROR_GRID_UNINITIALIZED | No FBP grid data has been loaded. |
E_OUTOFMEMORY | Insufficient memory (can occur when retrieving slope data which hasn't been loaded so must be calculated). |
E_INVALIDARG | The attribute/option index was invalid/unknown for this object. |
STDMETHODIMP CCWFGM_Grid::GetAttributeData | ( | __int64 | layerThread, |
USHORT | _x, | ||
USHORT | _y, | ||
ULONGLONG | time, | ||
USHORT | option, | ||
VARIANT * | attribute | ||
) |
Polymorphic. This object does not implement any functionality regarding specific polymorphic gridded attributes.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
_x | Value on x-axis. |
_y | Value on y-axis. |
time | A GMT time provided as seconds since January 1st, 1600. |
option | Data array option. |
attribute | Data array attribute. |
E_NOTIMPL | Method not implemented |
STDMETHODIMP CCWFGM_Grid::GetAttributeDataArray | ( | __int64 | layerThread, |
USHORT | _x_min, | ||
USHORT | _y_min, | ||
USHORT | _x_max, | ||
USHORT | _y_max, | ||
ULONGLONG | time, | ||
USHORT | option, | ||
SAFEARRAY ** | attribute | ||
) |
Polymorphic. This object does not implement any functionality regarding specific polymorphic gridded attributes.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
_x_min | Minimum value (inclusive) on x-axis. |
_y_min | Minimum value (inclusive) on y-axis. |
_x_max | Maximum value (inclusive) on x-axis. |
_y_max | Maximum value (inclusive) on y-axis. |
time | A GMT time provided as seconds since January 1st, 1600. |
option | Data array option. |
attribute | Data array attribute. |
E_NOTIMPL | Method not implemented |
STDMETHODIMP CCWFGM_Grid::GetDimensions | ( | __int64 | layerThread, |
USHORT * | x_dim, | ||
USHORT * | y_dim | ||
) |
This method provides information regarding grid dimenions
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
x_dim | X dimension of the grid |
y_dim | Y dimension of the grid |
E_POINTER | The address provided for value is invalid. |
S_OK | Successful. |
ERROR_SEVERITY_WARNING | If asking for default elevation where the default elevation is not set. |
S_FALSE | If asking for values where the appropriate array has not been initialized. |
ERROR_GRID_UNINITIALIZED | No FBP grid data has been loaded. |
E_OUTOFMEMORY | Insufficient memory (can occur when retrieving slope data which hasn't been loaded so must be calculated). |
E_INVALIDARG | The attribute/option index was invalid/unknown for this object. |
STDMETHODIMP CCWFGM_Grid::GetElevationData | ( | __int64 | layerThread, |
USHORT | x, | ||
USHORT | y, | ||
SHORT | allow_defaults_returned, | ||
double * | elevation, | ||
double * | slope_factor, | ||
double * | slope_azimuth | ||
) |
Get the elevation data at a given grid location.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
x | The x-component of the grid cell location. |
y | The y-component of the grid cell location. |
allow_defaults_returned | Flag for allowing defaults to be returned |
elevation | Elevation (m) of the requested location. |
slope_factor | Percentage ground slope specified as a decimal value (0 - 1) |
slope_azimuth | Direction of up-slope, Cartesian radians. |
E_POINTER | One or more of elevation, slope_factor, slope_azimuth is NULL |
ERROR_GRID_UNINITIALIZED | Object hasn't been initialized; no gridded data has been loaded |
ERROR_GRID_LOCATION_OUT_OF_RANGE | x and/or y is invalid |
SUCCESS_RETURNING_DEFAULTS | Default return values are provided, indicates no data available (at requested location) |
S_OK | success |
STDMETHODIMP CCWFGM_Grid::GetElevationDataArray | ( | __int64 | layerThread, |
USHORT | x_min, | ||
USHORT | y_min, | ||
USHORT | x_max, | ||
USHORT | y_max, | ||
SHORT | allow_defaults_returned, | ||
SAFEARRAY ** | elevation, | ||
SAFEARRAY ** | slope_factor, | ||
SAFEARRAY ** | slope_azimuth | ||
) |
Get the elevation data for all grid cells inside a specified rectangle.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
x_min | The minimum x-component of the bounding rectangle. |
y_min | The minimum y-component of the bounding rectangle. |
x_max | The maximum x-component (inclusive) of the bounding rectangle. |
y_max | THe maximum y-component (inclusive) of the bounding rectangle. |
allow_defaults_returned | Flag for allowing defaults to be returned |
elevation | An array of elevation data for the given bounding rectangle. |
slope_factor | An array of slope factor data for the given bounding rectangle. |
slope_azimuth | An array of slope azimuth data for the given bounding rectangle. |
E_POINTER | One or more of elevation, slope_factor, slope_azimuth is NULL |
E_INVALIDARG | The array is not 2D, or is insufficient in size to contain the requested data |
ERROR_GRID_UNINITIALIZED | Object hasn't been initialized; no gridded data has been loaded |
ERROR_GRID_LOCATION_OUT_OF_RANGE | x and/or y is invalid |
SUCCESS_RETURNING_DEFAULTS | Default return values are provided, indicates no data available (at requested location) |
S_OK | success |
STDMETHODIMP CCWFGM_Grid::GetEventTime | ( | __int64 | layerThread, |
ULONG | flags, | ||
ULONGLONG | from_time, | ||
ULONGLONG * | next_event | ||
) |
This filter object simply returns since it does not introduce any events to a simulation.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
flags | Calculation flags. |
from_time | A GMT time provided as seconds since January 1st, 1600. |
next_event | A GMT time provided as seconds since January 1st, 1600, representing the time for the next event, based on 'flags'. |
ERROR_SEVERITY_WARNING | Grid is not initialized. |
S_OK | This object does not introduce any simulation events. |
STDMETHODIMP CCWFGM_Grid::GetFuelData | ( | __int64 | layerThread, |
USHORT | _x, | ||
USHORT | _y, | ||
ULONGLONG | time, | ||
ICWFGM_Fuel ** | fuel | ||
) |
Returns fuel data from the imported fuel grid map.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
_x | Value on x-axis. |
_y | Value on y-axis. |
time | A GMT time provided as seconds since January 1st, 1600. |
fuel | Fuel Information. |
ERROR_GRID_UNINITIALIZED | No grid data has been loaded |
ERROR_GRID_LOCATION_OUT_OF_RANGE | Requested location (in grid units) is outside the grid's bounds. |
E_POINTER | fuel is invalid |
ERROR_FUELS_FUEL_UNKNOWN | The location requested contains NODATA |
STDMETHODIMP CCWFGM_Grid::GetFuelDataArray | ( | __int64 | layerThread, |
USHORT | _x_min, | ||
USHORT | _y_min, | ||
USHORT | _x_max, | ||
USHORT | _y_max, | ||
ULONGLONG | time, | ||
SAFEARRAY ** | fuel | ||
) |
Fills in the provided array of fuel data from the imported fuel grid map.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
_x_min | Minimum value (inclusive) on x-axis. |
_y_min | Minimum value (inclusive) on y-axis. |
_x_max | Maximum value (inclusive) on x-axis. |
_y_max | Maximum value (inclusive) on y-axis. |
time | A GMT time provided as seconds since January 1st, 1600. |
fuel | Data array attribute. |
E_INVALIDARG | The array is not 2D, or is insufficient in size to contain the requested data |
ERROR_GRID_UNINITIALIZED | No grid data has been loaded |
ERROR_GRID_LOCATION_OUT_OF_RANGE | Requested location (in grid units) is outside the grid's bounds. |
E_POINTER | fuel is invalid |
ERROR_FUELS_FUEL_UNKNOWN | The location requested contains NODATA |
STDMETHODIMP CCWFGM_Grid::GetFuelIndexData | ( | __int64 | layerThread, |
USHORT | x, | ||
USHORT | y, | ||
ULONGLONG | time, | ||
UCHAR * | fuel_index | ||
) |
Returns fuel index data from the imported fuel grid map.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
x | Value on x-axis. |
y | Value on y-axis. |
time | A GMT time provided as seconds since January 1st, 1600. |
fuel_index | Fuel Index Information. |
ERROR_GRID_UNINITIALIZED | No grid data has been loaded |
ERROR_GRID_LOCATION_OUT_OF_RANGE | Requested location (in grid units) is outside the grid's bounds. |
E_POINTER | fuel is invalid |
ERROR_FUELS_FUEL_UNKNOWN | The location requested contains NODATA |
STDMETHODIMP CCWFGM_Grid::GetFuelIndexDataArray | ( | __int64 | layerThread, |
USHORT | _x_min, | ||
USHORT | _y_min, | ||
USHORT | _x_max, | ||
USHORT | _y_max, | ||
ULONGLONG | time, | ||
SAFEARRAY ** | fuel | ||
) |
Fills in the provided array of fuel index data from the imported fuel grid map.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
_x_min | Minimum value (inclusive) on x-axis. |
_y_min | Minimum value (inclusive) on y-axis. |
_x_max | Maximum value (inclusive) on x-axis. |
_y_max | Maximum value (inclusive) on y-axis. |
time | A GMT time provided as seconds since January 1st, 1600. |
fuel | Data array attribute. |
E_INVALIDARG | The array is not 2D, or is insufficient in size to contain the requested data |
ERROR_GRID_UNINITIALIZED | No grid data has been loaded |
ERROR_GRID_LOCATION_OUT_OF_RANGE | Requested location (in grid units) is outside the grid's bounds. |
E_POINTER | fuel is invalid |
ERROR_FUELS_FUEL_UNKNOWN | The location requested contains NODATA |
STDMETHODIMP CCWFGM_Grid::GetGridEngine | ( | __int64 | layerThread, |
ICWFGM_GridEngine ** | pVal | ||
) |
This method is not implemented by this object, since it is intended to always be at the base of a thread of filter objects.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
pVal | Pointer to grid engine. |
E_NOTIMPL | Method not implemented |
STDMETHODIMP CCWFGM_Grid::GetWeatherData | ( | __int64 | layerThread, |
USHORT | x, | ||
USHORT | y, | ||
ULONGLONG | time, | ||
ULONG | interpolate_method, | ||
IWXData * | wx, | ||
IFWIData * | ifwi, | ||
DFWIData * | dfwi | ||
) |
This object does not implement any functionality regarding weather.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
x | Value on x-axis. |
y | Value on y-axis. |
time | A GMT time provided as seconds since January 1st, 1600. |
interpolate_method | Interpolation method identifier. |
wx | Weather information. |
ifwi | IFWI Information. |
dfwi | DFWI Information. |
E_NOTIMPL | Method not implemented |
STDMETHODIMP CCWFGM_Grid::GetWeatherDataArray | ( | __int64 | layerThread, |
USHORT | x_min, | ||
USHORT | y_min, | ||
USHORT | x_max, | ||
USHORT | y_max, | ||
ULONGLONG | time, | ||
ULONG | interpolate_method, | ||
SAFEARRAY ** | wx, | ||
SAFEARRAY ** | ifwi, | ||
SAFEARRAY ** | dfwi | ||
) |
This object does not implement any functionality regarding weather.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
x_min | Minimum value (inclusive) on x-axis. |
y_min | Minimum value (inclusive) on y-axis. |
x_max | Maximum value (inclusive) on x-axis. |
y_max | Maximum value (inclusive) on y-axis. |
time | A GMT time provided as seconds since January 1st, 1600. |
interpolate_method | Interpolation method identifier. |
wx | Array of Weather information. |
ifwi | Array of Instantaneous FWI codes. |
dfwi | Array of Daily FWI codes. |
ERROR_GRID_UNINITIALIZED | No object in the grid layering to forward the request to. |
STDMETHODIMP CCWFGM_Grid::ImportElevation | ( | const BSTR | prj_file_name, |
const BSTR | grid_file_name | ||
) |
This method will import the elevation data. The elevation's grid file name is necessary. The projection file name is optional and if provided, must have matching values to the fuel map already imported.
prj_file_name | Projection file name. |
grid_file_name | Grid file name. |
E_POINTER | If any of the parameters cannot be read. |
ERROR_SCENARIO_SIMULATION_RUNNING | Value cannot be changed as it is being used in a currently running scenario. |
S_OK | Successful. |
ERROR_FILE_NOT_FOUND | If either file cannot be found in the file system. |
ERROR_ACCESS_DENIED | If either file cannot be opened. |
ERROR_READ_FAULT | | ERROR_SEVERITY_WARNING The file format is unrecognized, or if there is an error in the file format. |
ERROR_GRID_LOCATION_OUT_OF_RANGE | The import files do not appear to match data that has already been imported. |
ERROR_GRID_SIZE_INCORRECT | The dimensions and/or resolution of the file do not match data that has already been imported. |
E_OUTOFMEMORY | Insufficient memory. |
SUCCESS_GRID_IMPORT_CONTAINED_NODATA | Successful operation, but the elevation grid contained NODATA entries. |
SUCCESS_GRID_DATA_UPDATED | The original elevation grid map has been successfully replaced. |
ERROR_TOO_MANY_OPEN_FILES | System error; current application has too many files open. |
E_FAIL | A valid geographic projection transformation could not be created. |
S_OK | Successful. |
ERROR_INVALID_HANDLE | Generic file I/O error. |
ERROR_FILE_EXISTS | File already exists. |
ERROR_INVALID_PARAMETER | Parameter is not valid. |
ERROR_HANDLE_DISK_FULL | Disk full |
STDMETHODIMP CCWFGM_Grid::ImportGrid | ( | const BSTR | prj_file_name, |
const BSTR | grid_file_name, | ||
long * | fail_index | ||
) |
This method will (re)import the FBP grid layer. Both the PRJ (projection) and the Grid files are needed to complete this operation. 'fail_index' may be NULL.
prj_file_name | Projection file name. |
grid_file_name | Grid file name. |
fail_index | Fuel import index that was unrecognized, which caused the operation to fail (if it did). |
E_POINTER | 'prj_file_name', 'grid_file_name', or 'fail_index' cannot be read or written to. |
S_OK | Successful. |
ERROR_SCENARIO_SIMULATION_RUNNING | Value cannot be changed as it is being used in a currently running scenario. |
E_FAIL | A valid geographic projection transformation could not be created. |
ERROR_READ_FAULT | | ERROR_SEVERITY_WARNING The file format is unrecognized, or if there is an error in the file format. |
ERROR_GRID_UNINITIALIZED | The FuelMap property has not be set. |
ERROR_FILE_NOT_FOUND | If either file cannot be found. |
ERROR_ACCESS_DENIED | If either file cannot be opened. |
ERROR_FUELS_FUEL_UNKNOWN | The grid file contains a fuel index that is not defined in the FuelMap object. If 'fail_index' is not NULL, then the index found in the file that is not defined in FuelMap is placed here. |
ERROR_GRID_LOCATION_OUT_OF_RANGE | The import files do not appear to match data that has already been imported. |
E_OUTOFMEMORY | Insufficient memory. |
ERROR_TOO_MANY_OPEN_FILES | System error; current application has too many files open. |
SUCCESS_GRID_DATA_UPDATED | The original fuel grid map has been successfully replaced. |
S_OK | Successful. |
ERROR_INVALID_HANDLE | Generic file I/O error. |
ERROR_FILE_EXISTS | File already exists. |
ERROR_INVALID_PARAMETER | Parameter is not valid. |
ERROR_HANDLE_DISK_FULL | Disk full |
STDMETHODIMP CCWFGM_Grid::IsFuelUsed | ( | ICWFGM_Fuel * | fuel | ) |
This method reports whether a fuel is assigned to any point in the grid.
fuel | Fuel in question. |
E_POINTER | Invalid pointer to a fuel. |
S_OK | If the fuel is used. |
ERROR_SEVERITY_WARNING | If the fuel is not used. |
ERROR_FUELS_FUEL_UNKNOWN | 'fuel' is not in any associations. |
ERROR_GRID_UNINITIALIZED | Grid not initialized yet. |
STDMETHODIMP CCWFGM_Grid::MT_Lock | ( | __int64 | layerThread, |
USHORT | exclusive, | ||
USHORT | obtain | ||
) |
Changes the state of the object with respect to access rights. When the object is used by an active simulation, it must not be modified. When the object is somehow modified, it must be done so in an atomic action to prevent concerns with arising from multithreading. Note that these locks are primarily needed to ensure that data contributing during a simulation is not modified while the simulation is executing.
All routines in the ICWFGM_GridEngine interface are necessarily NOT multithreading safe (for performance) but other interfaces for a given COM object implementing this interface must be by specification. Locking request is forwarded to the attached ICWFGM_FuelMap object.
In the event of an error, then locking is undone to reflect an error state.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
exclusive | TRUE if the requester wants a write lock, false for read/shared access |
obtain | TRUE to obtain the lock, FALSE to release the lock. If this is FALSE, then the 'exclusive' parameter must match the initial call used to obtain the lock. |
SUCCESS_STATE_OBJECT_UNLOCKED | Lock was released. |
SUCCESS_STATE_OBJECT_LOCKED_WRITE | Exclusive/write lock obtained. |
SUCCESS_STATE_OBJECT_LOCKED_SCENARIO | A scenario successfully required a lock for purposes of simulating. |
SUCCESS_STATE_OBJECT_LOCKED_READ | Shared/read lock obtained. |
S_OK | Successful |
ERROR_GRID_UNINITIALIZED | No path via layerThread can be determined to further determine successful locks. |
STDMETHODIMP CCWFGM_Grid::PostCalculationEvent | ( | __int64 | layerThread, |
ULONGLONG | time, | ||
ULONG | mode | ||
) |
This object requires no work to be performed in this call.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
time | A GMT time provided as seconds since January 1st, 1600. |
mode | Calculation mode. |
S_OK | Always successful |
STDMETHODIMP CCWFGM_Grid::PreCalculationEvent | ( | __int64 | layerThread, |
ULONGLONG | time, | ||
ULONG | mode | ||
) |
This object requires no work to be performed in this call.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
time | A GMT time provided as seconds since January 1st, 1600. |
mode | Calculation mode. |
S_OK | Always successful. |
STDMETHODIMP CCWFGM_Grid::put_FuelMap | ( | ICWFGM_FuelMap * | newVal | ) |
The CWFGM Grid needs an object supporting the ICWFGM_FuelMap interface; the creator of the Grid should assign this property to a valid value before using the grid object. This property is write-once-read-many because of its high dependency on internal indexes assigned by the fuel map. The COM reference count for the fuel map is incremented on assignment and decremented when this object is destroyed.
newVal | The fuel map. |
E_POINTER | The address provided for index is invalid. |
S_OK | Successful. |
E_NOINTERFACE | On assignment if not passed CWFGM FuelMap object. |
ERROR_GRID_INITIALIZED | If the assignment is tried more than once. |
ERROR_GRID_UNINITIALIZED | When reading the value before it has been set. |
ERROR_SCENARIO_SIMULATION_RUNNING | Value cannot be changed as it is being used in a currently running scenario. |
STDMETHODIMP CCWFGM_Grid::put_LayerManager | ( | ICWFGM_LayerManager * | newVal | ) |
This property is must be set before any calls to GetGridEngine or PutGridEngine. Additionally, this property should be considered write-once. This value should be set to the ICWFGM_LayerManager object which any layerThread assigned to this object will have been allocated from.
newVal | value for LayerManager |
STDMETHODIMP CCWFGM_Grid::put_UserData | ( | VARIANT | newVal | ) |
This property is unused by this object, and is available for exclusive use by the client code. It is a VARIANT value to ensure that the client code can store a pointer value (if it chooses) for use in manual subclassing this object. This value is not loaded or saved during serialization operations, and it is the responsibility of the client code to manage any value or object stored here. Access to this property is not thread-safe.
newVal | Replacement value for UserData |
S_OK | Successful |
STDMETHODIMP CCWFGM_Grid::PutGridEngine | ( | __int64 | layerThread, |
ICWFGM_GridEngine * | newVal | ||
) |
This method is not implemented by this object, since it is intended to always be at the base of a thread of filter objects.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
newVal | Pointer to new grid engine. |
E_NOTIMPL | Method not implemented |
STDMETHODIMP CCWFGM_Grid::SetAttribute | ( | USHORT | option, |
VARIANT | value | ||
) |
Sets the value for the attribute denoted by "option".
option | The attribute to change. Valid option values are:
|
value | The value to set the attribute to. |
S_OK | Successful. |
E_INVALIDARG | On assignment if the value is out of range. |
ERROR_SCENARIO_SIMULATION_RUNNING | Value cannot be changed as it is being used in a currently running scenario. |
E_FAIL | The provided value (variant) was of the wrong type that could not be converted to the correct type. |
STDMETHODIMP CCWFGM_Grid::Valid | ( | __int64 | layerThread, |
ULONGLONG | start_time, | ||
LONGLONG | duration, | ||
ULONG | option, | ||
SAFEARRAY ** | diurnal_application_count | ||
) |
This method determines whether this object is valid for any simulating.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
start_time | Ignored. |
duration | Ignored. |
option | Determines type of Valid request. |
diurnal_application_count | Optional (dependent on option). Array of counts for how often a particular type of grid occurs in the set of ICWFGM_GridEngine objects associated with a scenario. |
S_OK | Successful. |
ERROR_SEVERITY_WARNING | Grid is not initialized. |
ERROR_GRID_WEATHER_NOT_IMPLEMENTED | Grid is valid but does not provide any weather data. |
STDMETHODIMP CCWFGM_Grid::WriteProjection | ( | const BSTR | szPath | ) |
Writes a projection file. All imported grids share the same dimensions and projection information.
szPath | The path/file to write the projection to. |
E_POINTER | Path is invalid. |
E_INVALIDARG | Path is invalid. |
S_OK | Successful. |
S_INVALIDARG | Invalid arguments. |
ERROR_ACCESS_DENIED | Access denied. |
ERROR_INVALID_HANDLE | Generic file I/O error. |
ERROR_FILE_EXISTS | The file already exists. |
ERROR_INVALID_PARAMETER | The parameters are invalid. |
ERROR_TOO_MANY_OPEN_FILES | Too many files are open. |
ERROR_FILE_NOT_FOUND | The file cannot be found. |
E_OUTOFMEMORY | Insufficient memory. |
ERROR_HANDLE_DISK_FULL | Disk full |
ERROR_SEVERITY_WARNING | Unsure of reason for failure. |