Go to the documentation of this file.
16 #ifndef SURGSIM_DEVICES_DEVICEFILTERS_BOOLTOSCALAR_H
17 #define SURGSIM_DEVICES_DEVICEFILTERS_BOOLTOSCALAR_H
24 namespace DataStructures
26 class DataGroupCopier;
32 SURGSIM_STATIC_REGISTRATION(BoolToScalar);
62 void setRange(
const std::pair<double, double>& val);
65 std::pair<double, double>
getRange()
const;
118 std::shared_ptr<DataStructures::DataGroupCopier>
m_copier;
void setDecreaseField(const std::string &val)
Set the field this is read to decrease the scalar value, needs to be a bool.
Definition: BoolToScalar.cpp:175
void initializeInput(const std::string &device, const DataStructures::DataGroup &inputData) override
Set the initial input data group.
Definition: BoolToScalar.cpp:58
void setRange(const std::pair< double, double > &val)
Set the range of values that should be produced by this.
Definition: BoolToScalar.cpp:130
std::string getTargetField() const
Definition: BoolToScalar.cpp:195
void setScale(double val)
Sets the value that gets used, the actual value to be added is scale * dt per call to filterInput.
Definition: BoolToScalar.cpp:154
void setScalar(double val)
Set the value of the mapped field, can also be used to set a starting value for the field.
Definition: BoolToScalar.cpp:185
Timer class, measures execution times.
Definition: Timer.h:30
double getScalar() const
Definition: BoolToScalar.cpp:180
A device filter can be connected between a device and the InputConsumerInterface (e....
Definition: DeviceFilter.h:37
std::pair< double, double > m_range
Definition: BoolToScalar.h:110
~BoolToScalar()
Destructor.
Definition: BoolToScalar.cpp:54
std::string getDecreaseField() const
Definition: BoolToScalar.cpp:170
Definition: CompoundShapeToGraphics.cpp:29
A collection of NamedData objects.
Definition: DataGroup.h:68
double m_value
Definition: BoolToScalar.h:106
Framework::Timer m_timer
Definition: BoolToScalar.h:116
bool isClamping()
Definition: BoolToScalar.cpp:149
void setTargetField(const std::string &val)
Set the name of the target field that carries the scalar value, will be created in the datagroup if i...
Definition: BoolToScalar.cpp:200
std::string getIncreaseField() const
Definition: BoolToScalar.cpp:159
void setIncreaseField(const std::string &val)
Set the field that is read to increase the scalar value, needs to be a bool.
Definition: BoolToScalar.cpp:165
Maps the on and off state of two boolean values to the increase and decrease of a scalar field,...
Definition: BoolToScalar.h:37
void setClamping(bool val)
Enables or disables clamping on the output value (default true)
Definition: BoolToScalar.cpp:144
BoolToScalar(const std::string &name)
Constructor.
Definition: BoolToScalar.cpp:29
std::shared_ptr< DataStructures::DataGroupCopier > m_copier
Definition: BoolToScalar.h:118
SURGSIM_CLASSNAME(SurgSim::Devices::BoolToScalar)
std::string m_targetField
Definition: BoolToScalar.h:114
void filterInput(const std::string &device, const DataStructures::DataGroup &dataToFilter, DataStructures::DataGroup *result) override
Filter the input data.
Definition: BoolToScalar.cpp:90
double m_scale
Definition: BoolToScalar.h:108
std::pair< double, double > getRange() const
Definition: BoolToScalar.cpp:139
bool m_isClamping
Definition: BoolToScalar.h:104
double getScale() const
Definition: BoolToScalar.cpp:125
std::string m_increaseField
Definition: BoolToScalar.h:112
std::string m_decreaseField
Definition: BoolToScalar.h:113