1 // Project MULTIPR, IOLS WP1.2.1 - EDF/CS
2 // Partitioning/decimation module for the SALOME v3.2 platform
5 * \file MULTIPR_ProgressCallback.hxx
7 * \brief Class MULTIPR_ProgressCallback
9 * \author Olivier LE ROUX - CS, Virtual Reality Dpt
14 #ifndef MULTIPR_PROGRESS_CALLBACK_HXX
15 #define MULTIPR_PROGRESS_CALLBACK_HXX
17 //*****************************************************************************
19 //*****************************************************************************
22 //*****************************************************************************
23 // Class MULTIPR_ProgressCallback
24 // Used to provide feedback on the progress of a slow operation.
25 //*****************************************************************************
27 class MULTIPR_ProgressCallback
32 * Builds a new MULTIPR_ProgressCallback (default constructor).
34 MULTIPR_ProgressCallback() { init(100); }
37 * Destructor. Removes everything.
39 ~MULTIPR_ProgressCallback() { /* do nothing */ }
42 * Starts to provide feedback on the progress of a slow operation.
43 * \param pTaskTitle name of the task to be monitored.
44 * \param pNumSteps number of steps in the task.
46 virtual void start(const char* pTaskTitle, int pNumSteps) = 0;
49 * Moves on the current amount of progress made.
51 void moveOn() { mCurrentStep++; float percent = float(mCurrentStep)/float(mTotalSteps)*100.0f; progress(percent); }
54 * Termines to provide feedback.
56 virtual void done() = 0;
61 * Resets this progress callback.
62 * \param pNumSteps number of steps in the task to be monitored.
64 void init(int pNumSteps) { mCurrentStep = 0; mTotalSteps = pNumSteps; }
67 * Callback. Called on each progress.
68 * \param pPercent percent accomplished.
70 virtual void progress(float pPercent) = 0;
77 }; // class MULTIPR_ProgressCallback
80 //*****************************************************************************
81 // Class MULTIPR_EmptyMeshCallback
82 // Used to provide feedback when an empty mesh is produced.
83 //*****************************************************************************
85 class MULTIPR_EmptyMeshCallback
90 * Builds a new MULTIPR_EmptyMeshCallback (default constructor).
92 MULTIPR_EmptyMeshCallback() { /* do nothing */ }
95 * Destructor. Removes everything.
97 ~MULTIPR_EmptyMeshCallback() { /* do nothing */ }
100 * Callback. Called each time an empty mesh is produced.
101 * \param pInfo information related to the empty mesh.
103 virtual void reportEmptyMesh(std::string pInfo) = 0;
105 }; // class MULTIPR_EmptyMeshCallback
108 #endif // MULTIPR_PROGRESS_CALLBACK_HXX