Assimp v5.2.2 (January 2022)
The Asset-Importer-Lib API documentation.
Assimp::ProgressHandler Class Referenceabstract

CPP-API: Abstract interface for custom progress report receivers. More...

#include <ProgressHandler.hpp>

Inherits Intern::AllocateFromAssimpHeap.

Public Member Functions

virtual bool Update (float percentage=-1.f)=0
 Progress callback. More...
 
virtual void UpdateFileRead (int currentStep, int numberOfSteps)
 Progress callback for file loading steps. More...
 
virtual void UpdateFileWrite (int currentStep, int numberOfSteps)
 Progress callback for export steps. More...
 
virtual void UpdatePostProcess (int currentStep, int numberOfSteps)
 Progress callback for post-processing steps. More...
 
virtual ~ProgressHandler ()
 Virtual destructor. More...
 

Protected Member Functions

 ProgressHandler () AI_NO_EXCEPT
 Default constructor. More...
 

Detailed Description

CPP-API: Abstract interface for custom progress report receivers.

Each #Importer instance maintains its own ProgressHandler. The default implementation provided by Assimp doesn't do anything at all.

Constructor & Destructor Documentation

◆ ProgressHandler()

Assimp::ProgressHandler::ProgressHandler ( )
inlineprotected

Default constructor.

◆ ~ProgressHandler()

virtual Assimp::ProgressHandler::~ProgressHandler ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

◆ Update()

virtual bool Assimp::ProgressHandler::Update ( float  percentage = -1.f)
pure virtual

Progress callback.

Parameters
percentageAn estimate of the current loading progress, in percent. Or -1.f if such an estimate is not available.

There are restriction on what you may do from within your implementation of this method: no exceptions may be thrown and no non-const #Importer methods may be called. It is not generally possible to predict the number of callbacks fired during a single import.

Returns
Return false to abort loading at the next possible occasion (loaders and Assimp are generally allowed to perform all needed cleanup tasks prior to returning control to the caller). If the loading is aborted, #Importer::ReadFile() returns always nullptr.

◆ UpdateFileRead()

virtual void Assimp::ProgressHandler::UpdateFileRead ( int  currentStep,
int  numberOfSteps 
)
inlinevirtual

Progress callback for file loading steps.

Parameters
numberOfStepsThe number of total post-processing steps
currentStepThe index of the current post-processing step that will run, or equal to numberOfSteps if all of them has finished. This number is always strictly monotone increasing, although not necessarily linearly.
Note
This is currently only used at the start and the end of the file parsing.

◆ UpdateFileWrite()

virtual void Assimp::ProgressHandler::UpdateFileWrite ( int  currentStep,
int  numberOfSteps 
)
inlinevirtual

Progress callback for export steps.

Parameters
numberOfStepsThe number of total processing steps
currentStepThe index of the current post-processing step that will run, or equal to numberOfSteps if all of them has finished. This number is always strictly monotone increasing, although not necessarily linearly.

◆ UpdatePostProcess()

virtual void Assimp::ProgressHandler::UpdatePostProcess ( int  currentStep,
int  numberOfSteps 
)
inlinevirtual

Progress callback for post-processing steps.

Parameters
numberOfStepsThe number of total post-processing steps
currentStepThe index of the current post-processing step that will run, or equal to numberOfSteps if all of them has finished. This number is always strictly monotone increasing, although not necessarily linearly.

The documentation for this class was generated from the following file: