HOutputHandler an abstract base class for model and image output. More...

#include <HIOManager.h>

Public Member Functions

virtual HFileOutputResult FileOutputByKey (const char *filename, HC_KEY key, HOutputHandlerOptions *options)
 
virtual HFileOutputResult FileOutputByKey (const __wchar_t *filename, HC_KEY key, HOutputHandlerOptions *options)
 
virtual HFileOutputResult FileOutputByKey (const unsigned short *filename, HC_KEY key, HOutputHandlerOptions *options)
 
virtual HFileOutputResult FileOutputFromImageKey (const char *filename, HC_KEY image_key, HOutputHandlerOptions *options)
 
virtual HFileOutputResult FileOutputFromImageKey (const __wchar_t *filename, HC_KEY image_key, HOutputHandlerOptions *options)
 
virtual const char * GetOutputDefaultHSRA ()
 
const __wchar_t * GetOutputInformation ()
 
virtual const char * GetOutputName ()=0
 
unsigned long GetOutputOps ()
 
float GetOutputPercentProgress ()
 
const char * GetOutputProgress ()
 
virtual HOutputHandlerStyle GetOutputStyle ()=0
 
virtual const char * GetOutputTypesString ()=0
 
 HOutputHandler ()
 
virtual void RegisterOutputHandlerTypes ()=0
 
void ReportOutputInformation (const char *information)
 This posts information to the information queue.
 
void ReportOutputPercentProgress (float percent_progress)
 This posts the current percent progress message should be between 0.0 and 1.0.
 
void ReportOutputProgress (const char *progress)
 This posts the current progress message.
 
void SetModuleDirectory (const char *module_directory)
 
void SetModuleDirectory (const __wchar_t *module_directory)
 
HIONoticeCallbackSetOutputInformationNoticeCallback (HIONoticeCallback *notice_callback)
 
HIOPercentNoticeCallbackSetOutputPercentProgressNoticeCallback (HIOPercentNoticeCallback *percent_notice_callback)
 
HIONoticeCallbackSetOutputProgressNoticeCallback (HIONoticeCallback *notice_callback)
 

Protected Member Functions

void SetFinishedOutput ()
 
void SetOutputOps (unsigned long ops)
 This sets the HOutputOp.
 
void SetStartingOutput ()
 

Protected Attributes

char * m_module_directory
 
unsigned long m_OutputOps
 This is the HOutputOp set for a subclassed instance.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ HOutputHandler()

HOutputHandler::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:

Member Function Documentation

◆ FileOutputByKey() [1/2]

virtual HFileOutputResult HOutputHandler::FileOutputByKey ( const char *  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
filenameThe name of the file to output.
keyThe HOOPS segment key to output model data from.
optionsThe options class containing any needed extra information for the operation.
Returns
The #HFileOutputResult result of the output operation.

Reimplemented in HIOUtilityPublish, HIOUtilityCGM, HIOUtilityHPGL2, HIOUtilityPostscript, HIOUtilityHTML, HIOUtilityPly, HIOUtilityObj, HIOUtilityPDF, HIOUtilityStl, HIOUtilityHMF, HIOUtilityHsf, and HIOUtilityExchange.

◆ FileOutputByKey() [2/2]

virtual HFileOutputResult HOutputHandler::FileOutputByKey ( const unsigned short *  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
filenameThe wide character name of the file to output.
keyThe HOOPS segment key to get output model data from.
optionsThe options class containing any needed extra information for the operation.
Returns
The #HFileOutputResult result of the output operation.

Reimplemented in HIOUtilityPublish, HIOUtilityCGM, HIOUtilityHPGL2, HIOUtilityPostscript, HIOUtilityHTML, HIOUtilityPly, HIOUtilityObj, HIOUtilityWhip2D, HIOUtilityStl, HIOUtilityHMF, HIOUtilityHsf, HIOUtilityExchange, and HIOUtilityDwfExport.

◆ FileOutputFromImageKey()

virtual HFileOutputResult HOutputHandler::FileOutputFromImageKey ( const char *  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
filenameThe name of the file to output.
image_keyThe HOOPS image key to get output image data from.
optionsThe options class containing any needed extra information for the operation.
Returns
The #HFileOutputResult result of the output operation.

Reimplemented in HIOUtilityLeadTools, and HIOUtilityMagick.

◆ GetOutputDefaultHSRA()

virtual const char* HOutputHandler::GetOutputDefaultHSRA ( )
virtual
Returns
A default HSRA for HOutputHandler instance if needed.

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

{return "painters";};

Reimplemented in HIOUtilityCGM, HIOUtilityHPGL2, HIOUtilityPostscript, HIOUtilityWhip2D, and HIOUtilityPDF.

◆ GetOutputInformation()

const __wchar_t* HOutputHandler::GetOutputInformation ( )

If used this will return the oldest information messages posted

Returns
The oldest information posted and 0 if none is available.

◆ GetOutputName()

virtual const char* HOutputHandler::GetOutputName ( )
pure virtual

◆ GetOutputOps()

unsigned long HOutputHandler::GetOutputOps ( )
inline
Returns
The HOutputOp which specifies what kind of output this handlers works with. It can be HOutputOpNone, HOutputOpFileOutputByKey or HOutputOpFileOutputFromImageKey.

◆ GetOutputPercentProgress()

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.

◆ GetOutputProgress()

const char* HOutputHandler::GetOutputProgress ( )

If used this will return the last progress messages posted

Returns
The last progress posted and 0 if none is available.

◆ GetOutputStyle()

virtual HOutputHandlerStyle HOutputHandler::GetOutputStyle ( )
pure virtual
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.

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

{return HOutputHandlerStyleModel;}

Implemented in HIOUtilityPublish, HIOUtilityCGM, HIOUtilityHPGL2, HIOUtilityPostscript, HIOUtilityHTML, HIOUtilityLeadTools, HIOUtilityObj, HIOUtilityExchange, HIOUtilityPly, HIOUtilityWhip2D, HIOUtilityPDF, HIOUtilityHMF, HIOUtilityHsf, HIOUtilityMagick, HIOUtilityStl, and HIOUtilityDwfExport.

◆ GetOutputTypesString()

virtual const char* HOutputHandler::GetOutputTypesString ( )
pure virtual

This must be implemented in a subclassed HOutputHandler

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

For example: the following line of code can be use to specify the stl extension:

{return "stl";};

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

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

Implemented in HIOUtilityPublish, HIOUtilityCGM, HIOUtilityHPGL2, HIOUtilityPostscript, HIOUtilityLeadTools, HIOUtilityHTML, HIOUtilityObj, HIOUtilityExchange, HIOUtilityPly, HIOUtilityWhip2D, HIOUtilityPDF, HIOUtilityHMF, HIOUtilityHsf, HIOUtilityMagick, HIOUtilityStl, and HIOUtilityDwfExport.

◆ RegisterOutputHandlerTypes()

virtual void HOutputHandler::RegisterOutputHandlerTypes ( )
pure virtual

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:

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

Implemented in HIOUtilityPublish, HIOUtilityCGM, HIOUtilityHPGL2, HIOUtilityPostscript, HIOUtilityHTML, HIOUtilityObj, HIOUtilityLeadTools, HIOUtilityExchange, HIOUtilityPly, HIOUtilityWhip2D, HIOUtilityHMF, HIOUtilityPDF, HIOUtilityHsf, HIOUtilityMagick, HIOUtilityStl, and HIOUtilityDwfExport.

◆ SetFinishedOutput()

void HOutputHandler::SetFinishedOutput ( )
protected

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

◆ SetOutputInformationNoticeCallback()

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

◆ SetOutputPercentProgressNoticeCallback()

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

◆ SetOutputProgressNoticeCallback()

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

◆ SetStartingOutput()

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"


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