HOutputHandler

Functions

HOutputHandler

~HOutputHandler

char const *

GetOutputName

unsigned long

GetOutputOps

void

RegisterOutputHandlerTypes

HFileIOResult

FileOutputByKey

HFileIOResult

FileOutputByKey

HFileIOResult

FileOutputByKey

HFileIOResult

FileOutputFromImageKey

HFileIOResult

FileOutputFromImageKey

char const *

GetOutputTypesString

HOutputHandlerStyle

GetOutputStyle

char const *

GetOutputDefaultHSRA

char const *

GetOutputProgress

float

GetOutputPercentProgress

__wchar_t const *

GetOutputInformation

HIONoticeCallback *

SetOutputProgressNoticeCallback

HIOPercentNoticeCallback *

SetOutputPercentProgressNoticeCallback

HIONoticeCallback *

SetOutputInformationNoticeCallback

void

ReportOutputProgress

void

ReportOutputPercentProgress

void

ReportOutputInformation

void

SetModuleDirectory

void

SetModuleDirectory

Detailed Description

class HOutputHandler

HOutputHandler an abstract base class for model and image output.

HOutputHandler is an abstract base class that performs model, image, hardcopy and html file output. HIOManager::RegisterOutputHandler is used to register an output handler for a file extension type with the HIOManager. To make a new output handler, create a child class that inherits from this class and implements the abstract interfaces.

Subclassed by HIOUtilityCGM, HIOUtilityDwfExport, HIOUtilityExchange, HIOUtilityHMF, HIOUtilityHPGL2, HIOUtilityHTML, HIOUtilityHsf, HIOUtilityLeadTools, HIOUtilityMagick, HIOUtilityObj, HIOUtilityPDF, HIOUtilityPly, HIOUtilityPostscript, HIOUtilityPublish, HIOUtilityStl, HIOUtilityWhip2D

Public Functions

HOutputHandler()

For the constructor in any child class, note it must class must call SetOutputOps() with the subclassed HOutputHandler instance type.

For example, the following line of code can be used to specify a class supporting the image output:

virtual ~HOutputHandler()
virtual char const *GetOutputName() = 0
Returns

A character pointer denoting the name of the output handler.

inline unsigned long GetOutputOps()
Returns

The HOutputOp which specifies what kind of output this handlers works with. It can be HOutputOpNone, HOutputOpFileOutputByKey or HOutputOpFileOutputFromImageKey.

virtual void RegisterOutputHandlerTypes() = 0

This abstract function must register extension types to be handled by subclassed HOutputHandler instance.

For example, the following lines of code can be used to specify a class that will handle files with “tiff” and “tif” extensions:

virtual HFileIOResult FileOutputByKey(char const *filename, HC_KEY key, HOutputHandlerOptions *options)

This method writes model data from a given HOOPS key to a given output file. Note that this must be implemented in a subclassed HOutputHandler instance handling models.

Parameters
  • filename – The name of the file to output.

  • key – The HOOPS segment key to output model data from.

  • options – The options class containing any needed extra information for the operation.

Returns

The #HFileOutputResult result of the output operation.

virtual HFileIOResult FileOutputByKey(__wchar_t const *filename, HC_KEY key, HOutputHandlerOptions *options)
virtual HFileIOResult FileOutputByKey(unsigned short const *filename, HC_KEY key, HOutputHandlerOptions *options)

This method writes model data from a given HOOPS key to a given output file. Note that this must be implemented in a subclassed HOutputHandler instance handling models.

Parameters
  • filename – The wide character name of the file to output.

  • key – The HOOPS segment key to get output model data from.

  • options – The options class containing any needed extra information for the operation.

Returns

The #HFileOutputResult result of the output operation.

virtual HFileIOResult FileOutputFromImageKey(char const *filename, HC_KEY image_key, HOutputHandlerOptions *options)

This method writes image data from a given HOOPS key to a given output file. Note that this must be implemented in a subclassed HOutputHandler instance handling images. This must be implemented in a subclassed HOutputHandler instance handling images.

Parameters
  • filename – The name of the file to output.

  • image_key – The HOOPS image key to get output image data from.

  • options – The options class containing any needed extra information for the operation.

Returns

The #HFileOutputResult result of the output operation.

virtual HFileIOResult FileOutputFromImageKey(__wchar_t const *filename, HC_KEY image_key, HOutputHandlerOptions *options)
virtual char const *GetOutputTypesString() = 0

This must be implemented in a subclassed HOutputHandler For example: the following line of code can be use to specify the stl extension:

The following line of code can be used to specify that jpg, bmp and gif extension are handled:

Returns

The extension type or types that can be handled by this HOutputHandler.

virtual HOutputHandlerStyle GetOutputStyle() = 0

For example: the following code can be used for an HOutputHandler that outputs model:

Returns

The HOutputHandlerStyle that this instance will use. It can be HOutputHandlerStyleModel for geometry data, HOutputHandlerStyleImage for images, HOutputHandlerStyleHardcopy for hardcopy or HOutputHandlerStyleHTML for MVO style html page.

virtual char const *GetOutputDefaultHSRA()

For example: the following line of code might be used for an output handler needing painters:

Returns

A default HSRA for HOutputHandler instance if needed.

char const *GetOutputProgress()

If used this will return the last progress messages posted

Returns

The last progress posted and 0 if none is available.

float GetOutputPercentProgress()

If used this will return the last progress percent posted

Returns

The last progress posted or 0.0 if none is available.

__wchar_t const *GetOutputInformation()

If used this will return the oldest information messages posted

Returns

The oldest information posted and 0 if none is available.

HIONoticeCallback *SetOutputProgressNoticeCallback(HIONoticeCallback *notice_callback)

If used this will call the notice function when progress is posted It is the duty of the caller to delete the notice_callback object passing 0 to this function will unset the callback.

Returns

The last callback object set

HIOPercentNoticeCallback *SetOutputPercentProgressNoticeCallback(HIOPercentNoticeCallback *percent_notice_callback)

If used this will call the notice function when progress is posted It is the duty of the caller to delete the notice_callback object passing 0 to this function will unset the callback.

Returns

The last callback object set

HIONoticeCallback *SetOutputInformationNoticeCallback(HIONoticeCallback *notice_callback)

If used this will call the notice function when information is posted It is the duty of the caller to delete the notice_callback object passing 0 to this function will unset the callback.

Returns

The last callback object set

void ReportOutputProgress(char const *progress)

This posts the current progress message.

void ReportOutputPercentProgress(float percent_progress)

This posts the current percent progress message should be between 0.0 and 1.0.

void ReportOutputInformation(char const *information)

This posts information to the information queue.

void SetModuleDirectory(char const *module_directory)
void SetModuleDirectory(__wchar_t const *module_directory)