Structural deformable models
Public Member Functions | Protected Member Functions | List of all members
ZeroSensor Class Reference

#include <Sensor.h>

Inheritance diagram for ZeroSensor:
Inheritance graph
[legend]
Collaboration diagram for ZeroSensor:
Collaboration graph
[legend]

Public Member Functions

 ZeroSensor ()
 
void changeSource (sensor_cptr source)
 
int getDim1Size () const
 
int getDim2Size () const
 
int getDim3Size () const
 
int getNChannels () const
 
float getWeightedValue (int x, int y) const
 
Point2D getWeightedGradient (int x, int y) const
 
std::ostream & print (std::ostream &os) const
 
- Public Member Functions inherited from Sensor
virtual ~Sensor ()
 
sensor_cptr getSource ()
 
void replaceBy (sensor_ptr target)
 
bool assignRef (sensor_cptr rhs)
 
virtual Sensorassign (const Sensor &rhs)
 
virtual float getValue (int x, int y) const
 get value at discrete position More...
 
float getValue (const Point &p) const
 get value at position p using nearest neighbour interpolation More...
 
virtual std::vector< float > getMValue (int x, int y) const
 get multi-channel value More...
 
virtual Point2D getGradient (int x, int y) const
 get gradient at discrete position More...
 
Point2D getGradient (const Point2D &p) const
 get gradient at position p using nearest neighbor interpolation More...
 
float getMax () const
 
float getMin () const
 
float getMinMaxRange () const
 
float getWeightedValue (int x, int y) const
 get max normalized value at discrete position range [0,1] More...
 
Point2D getWeightedGradient (int x, int y) const
 get range weighted gradient at discrete position More...
 
void setCWeights (const std::vector< float > &weights)
 
const std::vector< float > & getCWeights () const
 
void setDirection (const Point &dir)
 
const PointgetDirection () const
 
void setScale (float _scale)
 
float getScale () const
 
bool isModified (dword mask=UPD_ALL) const
 
void setModified (dword mask=UPD_ALL)
 
void unsetModified (dword mask=UPD_ALL)
 
bool isUpdate (dword udMask) const
 
void enableUpdate (dword udMask)
 
void disableUpdate (dword udMask)
 
virtual bool performUpdate ()
 
virtual int getSkip () const
 
bool isValid (int x, int y) const
 
virtual Image< float > createSensorImage () const
 
const std::string & getID () const
 
void setID (const std::string &id)
 
virtual std::ostream & hprint (std::ostream &os, SensorCollection *sc) const
 
void refSuperSensor (sensor_ptr super)
 
void unrefSuperSensor (sensor_ptr super)
 
void invalidateSource ()
 
template<typename Derived >
std::shared_ptr< Derived > shared_from_base ()
 

Protected Member Functions

float calcValue (int x, int y) const
 Computes a zero. More...
 
Point calcGradient (int x, int y) const
 
- Protected Member Functions inherited from Sensor
 Sensor (dword updateMask)
 
 Sensor ()
 
virtual std::vector< float > calcMValue (int x, int y) const
 
virtual void calcMinMax ()
 

Additional Inherited Members

- Public Types inherited from Sensor
enum  UpdateParam {
  UPD_NOTHING =0, UPD_DATA =1, UPD_SCALE =2, UPD_CWEIGHTS =4,
  UPD_DIR =8, UPD_MINMAX =16, UPD_LAST =32, UPD_ALL =0xffffffff
}
 
- Static Public Member Functions inherited from Sensor
static dword getStringNumber (const char *sid)
 
static void getNumberString (char sid[5], dword id)
 
- Protected Attributes inherited from Sensor
sensor_cptr source
 
float scale
 
std::vector< float > cweights
 multi-channel weights ('color') More...
 
Point dir
 direction parameter More...
 
float maxval
 
float minval
 overall minimum and maximum More...
 
float mean
 
float stdev
 overall mean and stdev More...
 
dword toupdate
 bitflag for updates More...
 
dword updateMask
 bitflag to mask unimportant updates More...
 
std::string m_ID
 
int m_Skip
 
int m_AddSkip
 

Detailed Description

a sensor that does nothing except returning zeros

Definition at line 203 of file Sensor.h.

Constructor & Destructor Documentation

ZeroSensor::ZeroSensor ( )
inline

Definition at line 205 of file Sensor.h.

References Sensor::setID(), Sensor::unsetModified(), Sensor::UPD_NOTHING, and Sensor::updateMask.

205  : Sensor(0)
206  {
208  unsetModified();
209  setID("0");
210  }
Sensor()
Definition: Sensor.cpp:23
void setID(const std::string &id)
Definition: Sensor.h:129
dword updateMask
bitflag to mask unimportant updates
Definition: Sensor.h:180
void unsetModified(dword mask=UPD_ALL)
Definition: Sensor.h:111

Member Function Documentation

Point ZeroSensor::calcGradient ( int  x,
int  y 
) const
inlineprotectedvirtual

Calculates the gradient using central differencing.

Reimplemented from Sensor.

Definition at line 224 of file Sensor.h.

224 { return Point(0,0); }
Point2D Point
Definition: Point.h:251
float ZeroSensor::calcValue ( int  x,
int  y 
) const
inlineprotectedvirtual

Computes a zero.

Implements Sensor.

Definition at line 223 of file Sensor.h.

223 { return 0.0f; }
void ZeroSensor::changeSource ( sensor_cptr  source)
inlinevirtual

Reimplemented from Sensor.

Definition at line 211 of file Sensor.h.

211 {};
int ZeroSensor::getDim1Size ( ) const
inlinevirtual

the real dataset will override these

Reimplemented from Sensor.

Definition at line 212 of file Sensor.h.

212 { return 2; }
int ZeroSensor::getDim2Size ( ) const
inlinevirtual

Reimplemented from Sensor.

Definition at line 213 of file Sensor.h.

213 { return 2; }
int ZeroSensor::getDim3Size ( ) const
inlinevirtual

Reimplemented from Sensor.

Definition at line 214 of file Sensor.h.

214 { return 1; }
int ZeroSensor::getNChannels ( ) const
inlinevirtual

Reimplemented from Sensor.

Definition at line 215 of file Sensor.h.

215 { return 1; }
Point2D ZeroSensor::getWeightedGradient ( int  x,
int  y 
) const
inline

Definition at line 217 of file Sensor.h.

217 { return Point(); }
Point2D Point
Definition: Point.h:251
float ZeroSensor::getWeightedValue ( int  x,
int  y 
) const
inline

Definition at line 216 of file Sensor.h.

216 { return 0; }
std::ostream& ZeroSensor::print ( std::ostream &  os) const
inlinevirtual

Reimplemented from Sensor.

Definition at line 218 of file Sensor.h.

References Sensor::print().

219  { return Sensor::print(os)<<"o"; }
virtual std::ostream & print(std::ostream &os) const
Definition: Sensor.cpp:213

The documentation for this class was generated from the following file: