ENH: signals: refactored to make static methods

The signal handling can now be set and unset. This latter is important
for external libraries (e.g. VTK/OpenGL) that do not work with it.
This commit is contained in:
mattijs
2015-11-27 12:14:14 +00:00
parent 6cd4387b9f
commit 99bdd2c1d7
11 changed files with 211 additions and 130 deletions

View File

@ -31,6 +31,7 @@ License
#include "surface.H"
#include "text.H"
#include "Time.H"
#include "sigFpe.H"
// VTK includes
#include "vtkPolyDataMapper.h"
@ -143,6 +144,10 @@ void Foam::runTimePostProcessing::write()
Info<< type() << " " << name_ << " output:" << nl
<< " Constructing scene" << endl;
// Unset any floating point trapping (some low-level rendering functionality
// does not like it)
sigFpe::unset(false);
// Initialise render window
vtkSmartPointer<vtkRenderWindow> renderWindow =
vtkSmartPointer<vtkRenderWindow>::New();
@ -204,6 +209,9 @@ void Foam::runTimePostProcessing::write()
surfaces_[i].updateActors(position);
}
}
// Reset any floating point trapping
sigFpe::set(false);
}