# HInputHandler

## Functions

| `HInputHandler`
| `~HInputHandler`
unsigned long | `GetInputOps`
const char * | `GetInputName`
void | `RegisterInputHandlerTypes`
`HInputHandlerStyle` | `GetInputStyle`
HFileIOResult | `FileInputByKey`
HFileIOResult | `FileInputByKey`
HFileIOResult | `FileInputByKey`
HFileIOResult | `FileInputToImageKey`
HFileIOResult | `FileInputToImageKey`
HFileIOResult | `FileInputToImageKey`
const char * | `GetInputTypesString`
const __wchar_t * | `GetInputProgress`
float | `GetInputPercentProgress`
const __wchar_t * | `GetInputInformation`
HIONoticeCallback * | `SetInputProgressNoticeCallback`
HIOPercentNoticeCallback * | `SetInputPercentProgressNoticeCallback`
HIONoticeCallback * | `SetInputInformationNoticeCallback`
void | `ReportInputProgress`
void | `ReportInputProgress`
void | `ReportInputPercentProgress`
void | `ReportInputInformation`
void | `ReportInputInformation`
void | `SetModuleDirectory`
void | `SetModuleDirectory`

## Detailed Description

class HInputHandler

  HInputHandler an abstract base class for model and image input.

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

  Subclassed by HIOUtilityDGN, HIOUtilityExchange, HIOUtilitySKP

  Public Functions

  HInputHandler()

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

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

  virtual ~HInputHandler()
  inline unsigned long GetInputOps()
    Returns

      The HInputOp which can be one of the following: HInputOpNone, HInputOpFileInputByKey or HInputOpFileInputToImageKey.

  virtual const char *GetInputName() = 0
    Returns

      A character pointer denoting the name of the input handler.

  virtual void RegisterInputHandlerTypes() = 0

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

    For example, the following line of code can be used to specify a class that will handle files with “stl” extensions:

  virtual HInputHandlerStyle GetInputStyle() = 0

    This abstract method returns the HInputHandlerStyle the HInputHandler.

    For example, the following line of code can be used for an HInputHandler that handles models:

  virtual HFileIOResult FileInputByKey(const char *filename, HC_KEY key, HInputHandlerOptions *options)

    This method loads model data from a given file to a given HOOPS segment key. Note that this must be implemented in a subclassed HInputHandler instance handling models.

    Parameters

      - filename – The name of the file to load.

      - key – The HOOPS segment key to load model data into.

      - options – An options class containing any needed extra information for the operation.

    Returns

      The #HFileInputResult result of the input operation.

  virtual HFileIOResult FileInputByKey(const __wchar_t *filename, HC_KEY key, HInputHandlerOptions *options)
  virtual HFileIOResult FileInputByKey(const unsigned short *filename, HC_KEY key, HInputHandlerOptions *options)

    This method loads model data from a given file to a given HOOPS segment key. Note that this must be implemented in a subclassed HInputHandler instance handling models.

    Parameters

      - filename – The UNICODE name of the file to load.

      - key – The HOOPS segment key to load model data into.

      - options – An options class containing any needed extra information for the operation.

    Returns

      The #HFileInputResult result of the input operation.

  virtual HFileIOResult FileInputToImageKey(const char *filename, HC_KEY *image_key, HC_KEY segment_key, HInputHandlerOptions *options)

    This method loads image data from a given file to a given HOOPS image key. Note that this must be implemented in a sub-classed HInputHandler instance handling Images.

    Parameters

      - filename – The name of the file to load.

      - image_key – The pointer to a HOOPS key that will be filled in with a HOOPS image key.

      - segment_key – The HOOPS segment key to create the image_key in ie. the working segment.

      - options – An options class containing any needed extra information for operation.

    Returns

      The HFileInputResult result of the input operation.

  virtual HFileIOResult FileInputToImageKey(const __wchar_t *filename, HC_KEY *image_key, HC_KEY segment_key, HInputHandlerOptions *options)
  virtual HFileIOResult FileInputToImageKey(const unsigned short *filename, HC_KEY *image_key, HC_KEY segment_key, HInputHandlerOptions *options)

    This method loads image data from a given file to a given HOOPS image key. Note that this must be implemented in a sub-classed HInputHandler instance handling Images.

    Parameters

      - filename – The UNICODE name of the file to load.

      - image_key – The pointer to a HOOPS key that will be filled in with a HOOPS image key.

      - segment_key – The HOOPS segment key to create the image_key in &#8212; i.e., the working segment.

      - options – An options class containing any needed extra information for operation.

    Returns

      The HFileInputResult result of the input operation.

  virtual const char *GetInputTypesString() = 0

    This method must be implemented in a subclassed HInputHandler

    .

    Examples:

    The following line of code can be used to specify the stl extension:

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

    Returns

      The extension type or types that are handled by this HInputHandler.

  const __wchar_t *GetInputProgress()

    If used this will return the last progress messages posted

    Returns

      The last progress posted and 0 if none is available.

  float GetInputPercentProgress()

    If used this will return the last progress percent posted

    Returns

      The last progress posted or 0.0 if none is available.

  const __wchar_t *GetInputInformation()

    If used this will return the oldest information messages posted

    Returns

      The oldest information posted and 0 if none is available.

  HIONoticeCallback *SetInputProgressNoticeCallback(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 *SetInputPercentProgressNoticeCallback(HIOPercentNoticeCallback *percent_notice_callback)

    If used this will call the notice function when percent 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 *SetInputInformationNoticeCallback(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 ReportInputProgress(const char *progress)

    This posts the current progress message.

  void ReportInputProgress(const __wchar_t *progress)
  void ReportInputPercentProgress(float percent_progress)

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

  void ReportInputInformation(const char *information)

    This posts information to the information queue.

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