Chapter 6. Other New Heidi Tools

This chapter discusses the implementation of some of the other important tools now available in Heidi. These functions are brought to your attention here so that you can explore their capability in advance of more detailed information:


    The AppKit
    The Heidi AppKit is a group of convenient functions for writing Heidi programs. It is a set of utility functions and classes designed to simplify operations which are commonly performed in Heidi applications. In the most common cases, a Heidi application simply wants to stack the software Z-buffer renderer on top of the GDI driver and then draw to the top of the renderer stack all of the time ¾ that is, to the software Z buffer. In cases like this, AppKit serves as a set of convenient functions that reduce the number of Heidi calls you need to make and save some programming effort.

    These operations currently include the following functions:

    The set of functions which implement these operations are described in the following examples from heidi_tools.h located in \heidi\source\utilities\appkit.
      HeidiBeginPicture()
        Usage
        HeidiBeginPicture (HT_Renderer & renderers)
        Purpose
        This function performs a begin_picture on each renderer of a linear stack, from the device to the target renderer.
      HeidiConnect()
        Usage
        HeidiConnect (
            HT_Renderer &       renderers,
            HWND                wnd,
            HDC                 hdc)
        Purpose
        This attaches a stack to a GDI window handle/device context. The window id, context id, window size, and palette (for mapped devices) is set on the device.

        The caller is responsible for performing the HeidiEstablish call.

        Parameters

        renderers       Identifies the renderer stack to connect.
        hwnd            Identifies a GDI window handle.
        hdc             Identifies a GDI device context.
      HeidiCreateOptionsPage()
        Usage
        CPropertryPage * 
           HeidiCreateOptionsPage ( 
                    HT_Renderer        *     renderers,
                    HT_Renderer        *     target,
                    HT_Device          *     device)
        Purpose
        This function creates a property page of configurable Heidi options based upon the supplied renderer stack, target and device. This is currently used to dynamically configure the renderer stack.
        Parameters
        renderers       Pointer to the full renderer stack of interest.
        
        target          Pointer to the current rendering target.
        
        device          Pointer to the current device.
        Results
        Returns a pointer to a property page. This pointer must be freed using HeidiDestroyOptionsPage(). The incoming renderers are updated to reflect any configuration changes.
      HeidiDefaultStack()
        Usage
        HT_Renderer
            HeidiDefaultStack (const char * inipath = null)
        Purpose
        This function creates a default renderer stack. The stack is constructed based upon the contents of either an application specific INI file, or from a generic heidi.ini file. The stack is specified in the INI file in the following form:
         
        [RENDERER OPTIONS] 
        DEVICE=device.hdi 
        RENDERER1=renderer.hdi 
        RENDERER2=renderer.hdi 
        RENDERERN=....
        If no stack is specified, the default stack is simply the SZB renderer connected to the GDI device.
        Parameters
        inipath         Identifies the fullpathname of a user-supplied or null to use the Heidi INI file.
        Results
        Returns an HT_Renderer representing the stack.
      HeidiDestroyOptionsPage()
        Usage
        HeidiDestroyOptionsPage  (CPropertyPage * page)
        Purpose
        This function destroys a property page created by the HeidiCreateOptionsPage function.

        Parameters
        page Pointer to an AppKit created property page.

      HeidiEndPicture()
        Usage
        HeidiEndPicture (HT_Renderer & renderers)
        Purpose
        This function performs an end_picture on each renderer of a linear stack, from the target renderer to the base device.
      HeidiEstablish()
        Usage
        HeidiEstablish (HT_Renderer & renderers)
        Purpose
        This function performs an establish upon each renderer of a linear stack, from the device to the target renderer.
      HeidiUpdate()
        Usage
        HeidiUpdate (HT_Renderer & renderers)
        Purpose
        This function performs an update upon each renderer of a linear stack, from the target renderer to the base device.


      HeidiUpdate()

        Usage
        HeidiUpdate ( 
           HT_Renderer               & renderers,
           HT_Int_Rectangle const   & bounds)
        Purpose
        This function performs an update by bounds upon each renderer of a linear stack, from the target renderer to the base device.

        Parameters

        bounds       Identifies the desired update region.
    Frequently Asked Questions and Answers
    A "Questions and Answers" page is posted to the Heidi web page. It contains technical and marketing questions from Heidi developers and driver writers. Just press the "Questions and Answers" button at the Heidi web page  http://www.autodesk.com/heidi .

    The page provides answers to questions such as these: