GSModeler Engine Version: 9.0

ProcessControl class



Description Process control object. Details...
Module Rendering API
Base classes -
Derived classes -
Header ProcessControl.hpp


Public methods

    Constructors
    Copy constructor
    operator=

Process feedback

    SetProcessName
    SetProcessValue
    WriteReport
    WriteError

Interrupt handling

    Canceled

Detailed description

This object can be used to communicate with ArchiCAD's process control system. The MakePicture method of the renderer gets an instance of this class as a parameter. The add-on can set the process state (process name, progress bar), write report string and get information about the cancel button via this parameter.
Here is an example how to use this parameter in the rendering process:


// processControl: The process control object.
// model:          The model.

char renderingStr [256];

GSResModule actResModule = RSSetActiveModule (GSModeler::GetAddOnResourceModule ());           // Set the add-on as active resource modul.
RSGetIndString (renderingStr, resourceTableID, stringIndex);                                   // Get the process string.
RSSetActiveModule (actResModule);                                                              // Restore the original resource module.
processControl.SetProcessName (renderingStr);                                                  // Set the process name in the process window.

for (long iElement = 1; iElement <= model.GetElementNum (); iElement++) {
    // Element processing.
    processControl.SetProcessValue (static_cast<double> (iElement) / model.GetElementNum ());  // Set the process value.
    if (processControl.Canceled ()) break;                                                     // Exit if the user cancelled the rendering.
}




See Also

RendererImp

Copyright © 2004 - Graphisoft R&D Software Development Rt. All rights reserved worldwide.