Alphabetical Class Index  Class Hierarchy   File Members   Compound Members   File List  

HOutputHandler Class Reference

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

#include <HIOManager.h>

List of all members.

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.

HInputHandler 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 ( )

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

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 implimented 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, HIOUtilityObj, HIOUtilityPly, HIOUtilityPDF, HIOUtilityU3D, HIOUtilityStl, HIOUtilityHMF, HIOUtilityHsf, HIOUtilityExchange, and HIOUtilityHTML.

Referenced by HIOUtilityDwfExport::FileOutputByKey(), HIOUtilityHTML::FileOutputByKey(), HIOUtilityExchange::FileOutputByKey(), HIOUtilityHsf::FileOutputByKey(), HIOUtilityHMF::FileOutputByKey(), HIOUtilityStl::FileOutputByKey(), HIOUtilityWhip2D::FileOutputByKey(), HIOUtilityU3D::FileOutputByKey(), HIOUtilityPDF::FileOutputByKey(), HIOUtilityObj::FileOutputByKey(), HIOUtilityPly::FileOutputByKey(), HIOUtilityPostscript::FileOutputByKey(), HIOUtilityHPGL2::FileOutputByKey(), HIOUtilityCGM::FileOutputByKey(), and HIOUtilityPublish::FileOutputByKey().

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 implimented 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, HIOUtilityObj, HIOUtilityPly, HIOUtilityU3D, HIOUtilityWhip2D, HIOUtilityStl, HIOUtilityHMF, HIOUtilityHsf, HIOUtilityExchange, HIOUtilityHTML, and HIOUtilityDwfExport.

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 implimented 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.

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, HIOUtilityPDF, and HIOUtilityWhip2D.

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.
virtual const char* HOutputHandler::GetOutputName ( ) [pure virtual]
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.
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.
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.
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, HIOUtilityLeadTools, HIOUtilityObj, HIOUtilityExchange, HIOUtilityPly, HIOUtilityU3D, HIOUtilityWhip2D, HIOUtilityPDF, HIOUtilityHMF, HIOUtilityHsf, HIOUtilityMagick, HIOUtilityStl, HIOUtilityHTML, and HIOUtilityDwfExport.

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

 
 {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, HIOUtilityObj, HIOUtilityExchange, HIOUtilityU3D, HIOUtilityPly, HIOUtilityWhip2D, HIOUtilityPDF, HIOUtilityHMF, HIOUtilityHsf, HIOUtilityMagick, HIOUtilityStl, HIOUtilityHTML, and HIOUtilityDwfExport.

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, HIOUtilityObj, HIOUtilityLeadTools, HIOUtilityExchange, HIOUtilityU3D, HIOUtilityPly, HIOUtilityHMF, HIOUtilityWhip2D, HIOUtilityPDF, HIOUtilityHsf, HIOUtilityMagick, HIOUtilityStl, HIOUtilityHTML, and HIOUtilityDwfExport.

void HOutputHandler::SetFinishedOutput ( ) [protected]

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

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