Select Git revision
VistaFrameSeriesCapture.cpp
VistaFrameSeriesCapture.cpp 13.06 KiB
/*============================================================================*/
/* ViSTA VR toolkit */
/* Copyright (c) 1997-2016 RWTH Aachen University */
/*============================================================================*/
/* License */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Lesser General Public License as published */
/* by the Free Software Foundation, either version 3 of the License, or */
/* (at your option) any later version. */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/*============================================================================*/
/* Contributors */
/* */
/*============================================================================*/
#include "VistaFrameSeriesCapture.h"
#include <VistaBase/VistaTimeUtils.h>
#include <VistaKernel/VistaSystem.h>
#include <VistaKernel/EventManager/VistaSystemEvent.h>
#include <VistaKernel/EventManager/VistaEventManager.h>
#include <VistaKernel/DisplayManager/VistaDisplayManager.h>
#include <VistaKernel/Cluster/VistaClusterMode.h>
#include <VistaKernel/VistaFrameLoop.h>
#include <VistaTools/VistaFileSystemDirectory.h>
#if defined(WIN32)
#include <windows.h>
#include <time.h>
#else
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
#endif
/*============================================================================*/
/* MACROS AND DEFINES */
/*============================================================================*/
/*============================================================================*/
/* IMPLEMENTATION */
/*============================================================================*/
VistaFrameSeriesCapture::VistaFrameSeriesCapture( VistaSystem* pSystem,
VistaWindow* pWindow,
const bool bAutoRegisterUnregisterAsEventHandler )
: m_pSystem( pSystem )
, m_pWindow( pWindow )
, m_bAutoRegisterUnregisterAsEventHandler( bAutoRegisterUnregisterAsEventHandler )
, m_bIsRegistered( false )
, m_nScreenshotCount( 0 )
, m_nPeriod( 0 )
, m_nFrameCylce( 0 )
, m_eCaptureMode( CM_INVALID )
, m_nLastCaptureFrameIndex( 0 )
, m_nLastCaptureTime( 0 )
{
if( m_pWindow == NULL )
{