opensurgsim
MockInputOutput.h
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2013, SimQuest Solutions Inc.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 
16 #ifndef SURGSIM_TESTING_MOCKINPUTOUTPUT_H
17 #define SURGSIM_TESTING_MOCKINPUTOUTPUT_H
18 
19 #include "SurgSim/DataStructures/DataGroup.h"
20 #include "SurgSim/DataStructures/OptionalValue.h"
21 #include "SurgSim/Input/InputConsumerInterface.h"
22 #include "SurgSim/Input/OutputProducerInterface.h"
23 
24 namespace SurgSim
25 {
26 namespace Testing
27 {
28 
30 {
31 public:
33 
34  virtual void initializeInput(const std::string& device, const SurgSim::DataStructures::DataGroup& inputData);
35  virtual void handleInput(const std::string& device, const SurgSim::DataStructures::DataGroup& inputData);
36  virtual bool requestOutput(const std::string& device, SurgSim::DataStructures::DataGroup* outputData);
37 
38  int m_numTimesInitializedInput;
39  int m_numTimesReceivedInput;
40  int m_numTimesRequestedOutput;
41  SurgSim::DataStructures::DataGroup m_lastReceivedInput;
43 };
44 
45 };
46 };
47 #endif // SURGSIM_TESTING_MOCKINPUTOUTPUT_H
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
virtual void handleInput(const std::string &device, const SurgSim::DataStructures::DataGroup &inputData)
Notifies the consumer that the application input coming from the device has been updated.
Definition: MockInputOutput.cpp:44
Interface for a producer that generates device output updates (forces, status LED state...
Definition: OutputProducerInterface.h:33
virtual bool requestOutput(const std::string &device, SurgSim::DataStructures::DataGroup *outputData)
Asks the producer to provide output state to the device.
Definition: MockInputOutput.cpp:32
Definition: MockInputOutput.h:29
Interface for a consumer that monitors device and signal state updates (pose, buttons, etc).
Definition: InputConsumerInterface.h:33
A collection of NamedData objects.
Definition: DataGroup.h:68
virtual void initializeInput(const std::string &device, const SurgSim::DataStructures::DataGroup &inputData)
Set the initial input data group.
Definition: MockInputOutput.cpp:50