1
/*=========================================================================
3
Program: Image Guided Surgery Software Toolkit
4
Module: $RCSfile: igstkWebcamWinVideoImagerTool.cxx,v $
6
Date: $Date: 2009-06-18 18:40:55 $
7
Version: $Revision: 1.1 $
9
Copyright (c) ISC Insight Software Consortium. All rights reserved.
10
See IGSTKCopyright.txt or http://www.igstk.org/copyright.htm for details.
12
This software is distributed WITHOUT ANY WARRANTY; without even
13
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14
PURPOSE. See the above copyright notices for more information.
16
=========================================================================*/
19
// Warning about: identifier was truncated to '255' characters
20
// in the debug information (MVC6.0 Debug)
21
#pragma warning( disable : 4786 )
24
#include "igstkWebcamWinVideoImagerTool.h"
25
#include "igstkWebcamWinVideoImager.h"
31
WebcamWinVideoImagerTool::WebcamWinVideoImagerTool():m_StateMachine(this)
33
m_VideoImagerToolConfigured = false;
36
igstkAddStateMacro( Idle );
37
igstkAddStateMacro( VideoImagerToolNameSpecified );
39
// Set the input descriptors
40
igstkAddInputMacro( ValidVideoImagerToolName );
41
igstkAddInputMacro( InValidVideoImagerToolName );
44
// Transitions from idle state
45
igstkAddTransitionMacro( Idle,
46
ValidVideoImagerToolName,
47
VideoImagerToolNameSpecified,
48
SetVideoImagerToolName );
50
igstkAddTransitionMacro( Idle,
51
InValidVideoImagerToolName,
53
ReportInvalidVideoImagerToolNameSpecified );
55
// Transitions from VideoImagerToolName specified
56
igstkAddTransitionMacro( VideoImagerToolNameSpecified,
57
ValidVideoImagerToolName,
58
VideoImagerToolNameSpecified,
59
ReportInvalidRequest );
60
igstkAddTransitionMacro( VideoImagerToolNameSpecified,
61
InValidVideoImagerToolName,
62
VideoImagerToolNameSpecified,
63
ReportInvalidRequest );
65
igstkSetInitialStateMacro( Idle );
67
m_StateMachine.SetReadyToRun();
71
WebcamWinVideoImagerTool::~WebcamWinVideoImagerTool()
75
/** Request set VideoImagerTool name */
76
void WebcamWinVideoImagerTool::RequestSetVideoImagerToolName(
77
const std::string& clientDeviceName )
79
igstkLogMacro( DEBUG, "igstk::WebcamWinVideoImagerTool::"
80
<< "RequestSetVideoImagerToolName called ...\n");
81
if ( clientDeviceName == "" )
83
m_StateMachine.PushInput( m_InValidVideoImagerToolNameInput );
84
m_StateMachine.ProcessInputs();
88
m_VideoImagerToolNameToBeSet = clientDeviceName;
89
m_StateMachine.PushInput( m_ValidVideoImagerToolNameInput );
90
m_StateMachine.ProcessInputs();
94
/** Set valid VideoImagerTool name */
95
void WebcamWinVideoImagerTool::SetVideoImagerToolNameProcessing( )
97
igstkLogMacro( DEBUG, "igstk::WebcamWinVideoImagerTool"
98
<< "::SetVideoImagerToolNameProcessing called ...\n");
100
this->m_VideoImagerToolName = m_VideoImagerToolNameToBeSet;
102
m_VideoImagerToolConfigured = true;
104
// VideoImagerTool name is used as a unique identifier
105
this->SetVideoImagerToolIdentifier( this->m_VideoImagerToolName );
108
/** Report Invalid VideoImagerTool name*/
109
void WebcamWinVideoImagerTool
110
::ReportInvalidVideoImagerToolNameSpecifiedProcessing( )
112
igstkLogMacro( DEBUG, "igstk::WebcamWinVideoImagerTool"
113
<< "::ReportInvalidVideoImagerToolNameSpecifiedProcessing called ...\n");
115
igstkLogMacro( CRITICAL, "Invalid VideoImagerTool name specified ");
118
void WebcamWinVideoImagerTool::ReportInvalidRequestProcessing()
120
igstkLogMacro( WARNING, "ReportInvalidRequestProcessing() called ...\n");
123
/** The "CheckIfVideoImagerToolIsConfigured" method returns true if the imager
124
* tool is configured */
126
WebcamWinVideoImagerTool::CheckIfVideoImagerToolIsConfigured( ) const
128
igstkLogMacro( DEBUG, "igstk::WebcamWinVideoImagerTool"
129
<< "::CheckIfVideoImagerToolIsConfigured called...\n");
130
return m_VideoImagerToolConfigured;
133
/** Print Self function */
134
void WebcamWinVideoImagerTool::PrintSelf(
135
std::ostream& os, itk::Indent indent ) const
137
Superclass::PrintSelf(os, indent);
139
os << indent << "VideoImagerTool name : "
140
<< m_VideoImagerToolName << std::endl;
141
os << indent << "VideoImagerToolConfigured:"
142
<< m_VideoImagerToolConfigured << std::endl;