HOutputHandler

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.

Methods

HOutputHandler::HOutputHandler()

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

{SetOutputOps(HOutputOpFileOutputFromImageKey);};

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

virtual HOutputHandler::~HOutputHandler()

virtual

virtual char const *HOutputHandler::GetOutputName() = 0

virtual

Returns

A character pointer denoting the name of the output handler.
unsigned long HOutputHandler::GetOutputOps()

Returns

The HOutputOp which specifies what kind of output this handlers works with. It can be HOutputOpNone, HOutputOpFileOutputByKey or HOutputOpFileOutputFromImageKey.
virtual void HOutputHandler::RegisterOutputHandlerTypes() = 0

virtual

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

{HIORegisterOutputType("tif",this);
HIORegisterOutputType("tiff",this);};

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

virtual HFileOutputResult HOutputHandler::FileOutputByKey(char const *filename, HC_KEY key, HOutputHandlerOptions *options)

virtual

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 HFileOutputResult HOutputHandler::FileOutputByKey(__wchar_t const *filename, HC_KEY key, HOutputHandlerOptions *options)

virtual

virtual HFileOutputResult HOutputHandler::FileOutputByKey(unsigned short const *filename, HC_KEY key, HOutputHandlerOptions *options)

virtual

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 HFileOutputResult HOutputHandler::FileOutputFromImageKey(char const *filename, HC_KEY image_key, HOutputHandlerOptions *options)

virtual

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 HFileOutputResult HOutputHandler::FileOutputFromImageKey(__wchar_t const *filename, HC_KEY image_key, HOutputHandlerOptions *options)

virtual

virtual char const *HOutputHandler::GetOutputTypesString() = 0

virtual

{return "stl";};

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

{return "jpg;bmp;gif";};

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 HOutputHandler::GetOutputStyle() = 0

virtual

{return HOutputHandlerStyleModel;}

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 *HOutputHandler::GetOutputDefaultHSRA()

virtual

{return "painters";};

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 *HOutputHandler::GetOutputProgress()

If used this will return the last progress messages posted

Returns

The last progress posted and 0 if none is available.
float HOutputHandler::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 *HOutputHandler::GetOutputInformation()

If used this will return the oldest information messages posted

Returns

The oldest information posted and 0 if none is available.
HIONoticeCallback *HOutputHandler::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 *HOutputHandler::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 *HOutputHandler::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 HOutputHandler::ReportOutputProgress(char const *progress)

This posts the current progress message.

void HOutputHandler::ReportOutputPercentProgress(float percent_progress)

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

void HOutputHandler::ReportOutputInformation(char const *information)

This posts information to the information queue.

void HOutputHandler::SetModuleDirectory(char const *module_directory)
void HOutputHandler::SetModuleDirectory(__wchar_t const *module_directory)
void HOutputHandler::SetStartingOutput()

protected

The three FileOutput methods must call this before loading data It restarts the information logging and sets the progress to “starting”

void HOutputHandler::SetFinishedOutput()

protected

The three FileOutput methods must call this after loading data if they work It sets the progress to “finished”

void HOutputHandler::SetOutputOps(unsigned long ops)

protected

This sets the HOutputOp.

Variables

unsigned long HOutputHandler::m_OutputOps

protected

unsigned long

This is the HOutputOp set for a subclassed instance.

char *HOutputHandler::m_module_directory

protected

char
char *HOutputHandler::m_progress

private

char
float HOutputHandler::m_percent_progress1

private

float
float HOutputHandler::m_percent_progress2

private

float
__wchar_t *HOutputHandler::m_information

private

__wchar_t
struct vlist_s *HOutputHandler::m_information_list

private

struct vlist_s
HIONoticeCallback *HOutputHandler::m_progress_callback

private

HIOPercentNoticeCallback *HOutputHandler::m_percent_progress_callback

private

HIONoticeCallback *HOutputHandler::m_information_callback

private