osgEarth 2.1.1
Public Member Functions

osgEarth::ConsoleProgressCallback Class Reference

Inheritance diagram for osgEarth::ConsoleProgressCallback:
Collaboration diagram for osgEarth::ConsoleProgressCallback:

List of all members.

Public Member Functions

 ConsoleProgressCallback ()
virtual ~ConsoleProgressCallback ()
virtual bool reportProgress (double current, double total, const std::string &msg=std::string())

Detailed Description

ConsoleProgressCallback is a simple ProgressCallback that reports progress to the console

Definition at line 81 of file Progress.


Constructor & Destructor Documentation

ConsoleProgressCallback::ConsoleProgressCallback ( )

Creates a new ConsoleProgressCallback

Definition at line 40 of file Progress.cpp.

                                                 :
ProgressCallback()
{
    //NOP
}
virtual osgEarth::ConsoleProgressCallback::~ConsoleProgressCallback ( ) [inline, virtual]

Definition at line 88 of file Progress.

{ }

Member Function Documentation

bool ConsoleProgressCallback::reportProgress ( double  current,
double  total,
const std::string &  msg = std::string() 
) [virtual]

Callback function that will be called.

Parameters:
currentThe current amount of work to be done.
totalThe total amount of work to be done.
returnsReturns true if the current task should be cancelled, false otherwise.

Reimplemented from osgEarth::ProgressCallback.

Definition at line 47 of file Progress.cpp.

{
    if (total > 0)
    {
        double percentComplete = (current / total) * 100.0;
        OE_NOTICE << "Completed " << percentComplete << "% " << current << " of " << total << std::endl;
    }
    else
    {
        OE_NOTICE << msg << std::endl;
    }
    return false;
}

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines