Commit dcceda3b authored by Mike Kremer's avatar Mike Kremer

Added plugin function to take viewer snapshot.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10792 383ad7c9-94d9-4d36-a494-682f7c89f535
parent dc38fca2
......@@ -1028,6 +1028,20 @@ void flyTo (const ACG::Vec3d &_center, bool _move_back, double _time) {
}
/// Take a snapshot of a viewer
void viewerSnapshot(int _viewer, QImage& _image, int _width, int _height, bool _alpha,
bool _hideCoordsys, int _samples) {
if ( _viewer == ACTIVE_VIEWER ) {
examiner_widgets_[activeExaminer_]->snapshot(_image, _width, _height, _alpha, _hideCoordsys, _samples);
} else if ( _viewer == ALL_VIEWERS )
std::cerr << "Please select viewer to get snapshot!" << std::endl;
else if ( ( _viewer >= 0 ) && _viewer < (int)examiner_widgets_.size() )
examiner_widgets_[_viewer]->snapshot(_image, _width, _height, _alpha, _hideCoordsys, _samples);
else
std::cerr << "Requested illegal viewer for snapshot!!" << std::endl;
}
// ===============================================================================
......
......@@ -404,6 +404,27 @@ DLLEXPORT
void flyTo (const ACG::Vec3d &_center, bool _move_back = true, double _time=1000.0);
/** @} */
//=======================================
// Provide snapshot functions
/** @name Snapshots
* @{ */
//=======================================
/** Fly to point and keep viewing direction (animated).
* @param _viewer Viewer id
* @param _image An image to store pixel data in
* @param _width Image width
* @param _height Image height
* @param _alpha Make background transparent
* @param _hideCoordsys Hide coordsys node
* @param _samples Number of samples (multisampling)
*/
DLLEXPORT
void viewerSnapshot(int _viewer, QImage& _image, int _width = 0, int _height = 0,
bool _alpha = false, bool _hideCoordsys = false, int _samples = 1);
/** @} */
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment