The SequencerLauncher class is provided for convenience. More...
#include <Sequencer.h>
Public Member Functions | |
bool | next (bool canAbort=false) |
size_t | numberOfSteps () const |
SequencerLauncher (const char *pszStr, size_t steps) | |
void | setProgress (size_t) |
void | setText (const char *pszTxt) |
bool | wasCanceled () const |
~SequencerLauncher () | |
The SequencerLauncher class is provided for convenience.
It allows you to run an instance of the sequencer by instantiating an object of this class – most suitable on the stack. So this mechanism can be used for try-catch-blocks to destroy the object automatically if the C++ exception mechanism cleans up the stack.
This class has been introduced to simplify the use with the sequencer. In the FreeCAD Gui layer there is a subclass of SequencerBase called ProgressBar that grabs the keyboard and filters most of the incoming events. If the programmer uses the API of SequencerBase directly to start an instance without due diligence with exceptions then a not handled exception could block the whole application – the user has to kill the application then.
Below is an example of a not correctly used sequencer.
To avoid such problems the SequencerLauncher class can be used as follows:
SequencerLauncher::SequencerLauncher | ( | const char * | pszStr, |
size_t | steps | ||
) |
SequencerLauncher::~SequencerLauncher | ( | ) |
References Base::SequencerBase::Instance(), Base::SequencerP::mutex, and Base::SequencerBase::next().
Referenced by CmdTestProgress1::activated(), CmdTestProgress2::activated(), CmdTestProgress3::activated(), CmdTestProgress4::activated(), PartGui::CrossSections::apply(), Reen::BSplineParameterCorrection::CalcFirstSmoothMatrix(), Reen::BSplineParameterCorrection::CalcSecondSmoothMatrix(), Reen::BSplineParameterCorrection::CalcThirdSmoothMatrix(), MeshCore::MeshAlgorithm::CheckFacets(), MeshCore::MeshTrimming::CheckFacets(), MeshCore::MeshCurvature::ComputePerFace(), Reen::BSplineParameterCorrection::DoParameterCorrection(), MeshCore::MeshEvalTopology::Evaluate(), MeshCore::MeshEvalSelfIntersection::Evaluate(), MeshCore::MeshEvalNeighbourhood::Evaluate(), Inspection::Feature::execute(), Robot::Edge2TracObject::execute(), MeshCore::MeshAlgorithm::GetFacetsFromToolMesh(), MeshCore::MeshEvalNeighbourhood::GetIndices(), MeshCore::MeshIntersection::getIntersection(), MeshCore::MeshEvalSelfIntersection::GetIntersections(), Part::ImportIgesParts(), Points::PointsAlgos::LoadAscii(), MeshCore::MeshInput::LoadInventor(), MeshPart::CurveProjectorWithToolMesh::makeToolMesh(), App::Application::openDocuments(), MeshPart::CurveProjectorSimple::projectCurve(), MeshPart::MeshProjection::projectEdgeToEdge(), MeshPart::MeshProjection::projectOnMesh(), MeshPart::MeshProjection::projectParallelToMesh(), MeshPart::MeshProjection::projectToMesh(), Base::XMLReader::readFiles(), BarThread::run(), Sandbox::WorkerThread::run(), MeshCore::MeshOutput::SaveAsciiSTL(), MeshCore::MeshOutput::SaveBinarySTL(), MeshCore::MeshOutput::SaveInventor(), MeshCore::MeshOutput::SaveNastran(), MeshCore::MeshOutput::SaveOBJ(), MeshCore::MeshOutput::SaveOFF(), MeshCore::MeshOutput::SaveSMF(), MeshCore::MeshOutput::SaveVRML(), MeshCore::MeshTrimming::TrimFacets(), Raytracing::LuxTools::writeShape(), Raytracing::PovTools::writeShape(), and Raytracing::PovTools::writeShapeCSV().
size_t SequencerLauncher::numberOfSteps | ( | ) | const |
void SequencerLauncher::setProgress | ( | size_t | pos | ) |
void SequencerLauncher::setText | ( | const char * | pszTxt | ) |
bool SequencerLauncher::wasCanceled | ( | ) | const |
References Base::SequencerBase::Instance(), and Base::SequencerBase::wasCanceled().