iMSTK
Interactive Medical Simulation Toolkit
imstkScreenCaptureUtility.cpp
1 /*
2 ** This file is part of the Interactive Medical Simulation Toolkit (iMSTK)
3 ** iMSTK is distributed under the Apache License, Version 2.0.
4 ** See accompanying NOTICE for details.
5 */
6 
7 #include "imstkScreenCaptureUtility.h"
8 
9 namespace imstk
10 {
12  m_screenShotNumber(0),
13  m_screenShotPrefix(prefix)
14 {
15 }
16 
17 std::string
19 {
20  std::string captureName = m_screenShotPrefix + std::to_string(m_screenShotNumber);
22  return saveScreenShot(captureName);
23 }
24 
25 unsigned int
27 {
28  return m_screenShotNumber;
29 }
30 
31 void
32 ScreenCaptureUtility::setScreenShotPrefix(const std::string& newPrefix)
33 {
34  if (m_screenShotPrefix.compare(newPrefix) != 0)
35  {
36  m_screenShotPrefix = newPrefix;
38  }
39 }
40 
41 void
43 {
45 }
46 } // namespace imstk
ScreenCaptureUtility(std::string prefix="Screenshot-")
Constructor.
void resetScreenShotNumber()
reset the screenshot number
Compound Geometry.
unsigned int m_screenShotNumber
screen shot number is added to the file prefix, and incremented everytime a screen shot is taken ...
std::string saveScreenShot()
Saves a screenshot with a name of <prefix><screenshotNumber>.<implementationImageType> the <Implement...
unsigned int getScreenShotNumber() const
Returns the number of the next screenshot.
std::string m_screenShotPrefix
the prefix for the screenshots to be saved
void setScreenShotPrefix(const std::string &newPrefix)
set/reset the prefix and the count numbers