Changeset 20968
- Timestamp:
- 12/30/07 09:28:46 (8 months ago)
- Files:
-
- juggler/trunk/modules/gadgeteer/ChangeLog (modified) (1 diff)
- juggler/trunk/modules/gadgeteer/VERSION (modified) (1 diff)
- juggler/trunk/modules/gadgeteer/gadget/Devices/Sim/SimGloveGesture.cpp (modified) (1 diff)
- juggler/trunk/modules/gadgeteer/gadget/Devices/Sim/SimGloveGesture.h (modified) (1 diff)
- juggler/trunk/modules/gadgeteer/gadget/Type/AnalogProxy.h (modified) (1 diff)
- juggler/trunk/modules/gadgeteer/gadget/Type/Command.cpp (modified) (1 diff)
- juggler/trunk/modules/gadgeteer/gadget/Type/Command.h (modified) (2 diffs)
- juggler/trunk/modules/gadgeteer/gadget/Type/CommandProxy.h (modified) (2 diffs)
- juggler/trunk/modules/gadgeteer/gadget/Type/DeviceFactory.cpp (modified) (2 diffs)
- juggler/trunk/modules/gadgeteer/gadget/Type/DeviceFactory.h (modified) (2 diffs)
- juggler/trunk/modules/gadgeteer/gadget/Type/DeviceInterface.h (modified) (3 diffs)
- juggler/trunk/modules/gadgeteer/gadget/Type/DigitalProxy.h (modified) (2 diffs)
- juggler/trunk/modules/gadgeteer/gadget/Type/Gesture.h (modified) (3 diffs)
- juggler/trunk/modules/gadgeteer/gadget/Type/GestureProxy.h (modified) (4 diffs)
- juggler/trunk/modules/gadgeteer/gadget/Type/Glove.cpp (modified) (6 diffs)
- juggler/trunk/modules/gadgeteer/gadget/Type/Glove.h (modified) (4 diffs)
- juggler/trunk/modules/gadgeteer/gadget/Type/GloveData.h (modified) (2 diffs)
- juggler/trunk/modules/gadgeteer/gadget/Type/GloveGesture.cpp (modified) (2 diffs)
- juggler/trunk/modules/gadgeteer/gadget/Type/GloveGesture.h (modified) (2 diffs)
- juggler/trunk/modules/gadgeteer/gadget/Type/GloveProxy.h (modified) (6 diffs)
- juggler/trunk/modules/gadgeteer/gadget/Type/Input.h (modified) (2 diffs)
- juggler/trunk/modules/gadgeteer/gadget/Type/InputData.h (modified) (1 diff)
- juggler/trunk/modules/gadgeteer/gadget/Type/KeyboardMouse.cpp (modified) (3 diffs)
- juggler/trunk/modules/gadgeteer/gadget/Type/KeyboardMouse.h (modified) (4 diffs)
- juggler/trunk/modules/gadgeteer/gadget/Type/KeyboardMouseProxy.h (modified) (4 diffs)
- juggler/trunk/modules/gadgeteer/gadget/Type/LinearSigmoidPositionFilter.cpp (modified) (2 diffs)
- juggler/trunk/modules/gadgeteer/gadget/Type/LinearSigmoidPositionFilter.h (modified) (2 diffs)
- juggler/trunk/modules/gadgeteer/gadget/Type/Position.h (modified) (2 diffs)
- juggler/trunk/modules/gadgeteer/gadget/Type/PositionData.h (modified) (1 diff)
- juggler/trunk/modules/gadgeteer/gadget/Type/PositionProxy.cpp (modified) (1 diff)
- juggler/trunk/modules/gadgeteer/gadget/Type/PositionProxy.h (modified) (2 diffs)
- juggler/trunk/modules/gadgeteer/gadget/Type/Proxy.h (modified) (1 diff)
- juggler/trunk/modules/gadgeteer/gadget/Type/SampleBuffer.h (modified) (1 diff)
- juggler/trunk/modules/gadgeteer/gadget/Type/String.cpp (modified) (1 diff)
- juggler/trunk/modules/gadgeteer/gadget/Type/String.h (modified) (1 diff)
- juggler/trunk/modules/gadgeteer/gadget/Type/StringProxy.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
juggler/trunk/modules/gadgeteer/ChangeLog
r20934 r20968 1 1 DATE AUTHOR CHANGE 2 2 ----------- ----------- ------------------------------------------------------- 3 Dec-30-2007 patrick Improved const correctness for most input-related 4 classes. This should not break any existing code, but 5 some code could reduce data copying by using const 6 references to returned data. 7 NEW VERSION: 1.3.17 3 8 Nov-18-2007 patrick The X,Y position for mouse events is now reported 4 9 using a lower left-hand corner origin to match the juggler/trunk/modules/gadgeteer/VERSION
r20934 r20968 1 1.3.17-0 @12/30/2007 15:30:00 UTC@ 1 2 1.3.16-0 @11/18/2007 19:35:00 UTC@ 2 3 1.3.15-0 @11/18/2007 09:15:00 UTC@ juggler/trunk/modules/gadgeteer/gadget/Devices/Sim/SimGloveGesture.cpp
r19729 r20968 145 145 * @return id of current gesture 146 146 */ 147 int SimGloveGesture::getGesture() 147 int SimGloveGesture::getGesture() const 148 148 { return mCurGesture; } 149 149 juggler/trunk/modules/gadgeteer/gadget/Devices/Sim/SimGloveGesture.h
r20356 r20968 63 63 * @return id of current gesture. 64 64 */ 65 virtual int getGesture() ;65 virtual int getGesture() const; 66 66 67 67 virtual const DigitalData getDigitalData(int devNum = 0); juggler/trunk/modules/gadgeteer/gadget/Type/AnalogProxy.h
r20966 r20968 91 91 92 92 /** Returns a pointer to the gadget::Analog object that we are proxying. */ 93 AnalogPtr getAnalogPtr()93 const AnalogPtr getAnalogPtr() const 94 94 { 95 if (isStupefied() || NULL == mTypedDevice.get())95 if ( isStupefied() || NULL == mTypedDevice.get() ) 96 96 { 97 97 return AnalogPtr(); juggler/trunk/modules/gadgeteer/gadget/Type/Command.cpp
r20123 r20968 46 46 } 47 47 48 const CommandData Command::getCommandData( int devNum)48 const CommandData Command::getCommandData(const int devNum) const 49 49 { 50 SampleBuffer_t::buffer_t& stable_buffer = mCommandSamples.stableBuffer(); 50 const SampleBuffer_t::buffer_t& stable_buffer = 51 mCommandSamples.stableBuffer(); 51 52 52 53 if ( (!stable_buffer.empty()) && juggler/trunk/modules/gadgeteer/gadget/Type/Command.h
r20603 r20968 100 100 * an error to a log or console - but will not ASSERT. 101 101 */ 102 const CommandData getCommandData( int devNum = 0);102 const CommandData getCommandData(const int devNum = 0) const; 103 103 104 104 /** … … 135 135 * Returns the current stable sample buffers for this device. 136 136 */ 137 const SampleBuffer_t::buffer_t& getCommandDataBuffer() 137 const SampleBuffer_t::buffer_t& getCommandDataBuffer() const 138 138 { 139 139 return mCommandSamples.stableBuffer(); juggler/trunk/modules/gadgeteer/gadget/Type/CommandProxy.h
r20966 r20968 83 83 } 84 84 85 CommandData* getCommandData()85 const CommandData* getCommandData() const 86 86 { 87 87 return &mData; … … 91 91 * Returns a pointer to the gadget::Command object that we are proxying. 92 92 */ 93 CommandPtr getCommandPtr()93 const CommandPtr getCommandPtr() const 94 94 { 95 95 // If we're stupefied, return NULL. Otherwise, return mTypedDevice. juggler/trunk/modules/gadgeteer/gadget/Type/DeviceFactory.cpp
r20243 r20968 183 183 // Simply query all device constructors registered looking 184 184 // for one that knows how to load the device 185 bool DeviceFactory::recognizeDevice(jccl::ConfigElementPtr element) 185 bool DeviceFactory::recognizeDevice(jccl::ConfigElementPtr element) const 186 186 { 187 187 return ! (findConstructor(element) == -1); … … 209 209 } 210 210 211 int DeviceFactory::findConstructor(jccl::ConfigElementPtr element) 211 int DeviceFactory::findConstructor(jccl::ConfigElementPtr element) const 212 212 { 213 213 const std::string element_type(element->getID()); juggler/trunk/modules/gadgeteer/gadget/Type/DeviceFactory.h
r20243 r20968 76 76 * @return true if the factory knows how to create the device; false if not. 77 77 */ 78 bool recognizeDevice(jccl::ConfigElementPtr element) ;78 bool recognizeDevice(jccl::ConfigElementPtr element) const; 79 79 80 80 /** … … 93 93 * Otherwise, the index of the constructor is returned. 94 94 */ 95 int findConstructor(jccl::ConfigElementPtr element) ;95 int findConstructor(jccl::ConfigElementPtr element) const; 96 96 97 97 void debugDump(); juggler/trunk/modules/gadgeteer/gadget/Type/DeviceInterface.h
r20131 r20968 76 76 77 77 /** Returns the name of the proxy. */ 78 std::stringgetProxyName() const78 const std::string& getProxyName() const 79 79 { 80 80 return mProxyName; … … 161 161 * @see init() 162 162 */ 163 boost::shared_ptr<PROXY_TYPE> operator->()163 const boost::shared_ptr<PROXY_TYPE> operator->() const 164 164 { 165 165 return mTypeSpecificProxy; … … 180 180 181 181 /** Returns the underlying proxy to which we are connected. */ 182 boost::shared_ptr<PROXY_TYPE> getProxy()182 const boost::shared_ptr<PROXY_TYPE> getProxy() const 183 183 { 184 184 return mTypeSpecificProxy; juggler/trunk/modules/gadgeteer/gadget/Type/DigitalProxy.h
r20966 r20968 96 96 } 97 97 98 DigitalData* getDigitalData()98 const DigitalData* getDigitalData() const 99 99 { 100 100 return &mData; … … 102 102 103 103 /** Returns a pointer to the gadget::Digital object that we are proxying. */ 104 DigitalPtr getDigitalPtr()104 const DigitalPtr getDigitalPtr() const 105 105 { 106 106 // If we're stupefied, return NULL. Otherwise, return mTypedDevice. juggler/trunk/modules/gadgeteer/gadget/Type/Gesture.h
r20138 r20968 72 72 * @return -1 if the gesture name not found. 73 73 */ 74 virtual int getGestureIndex( std::string name)= 0;74 virtual int getGestureIndex(const std::string& name) const = 0; 75 75 76 76 /** … … 78 78 * If id is -1, then it returns the string name of the current gesture. 79 79 */ 80 virtual std::string getGestureString( int id)= 0;80 virtual std::string getGestureString(const int id) const = 0; 81 81 82 82 /** … … 84 84 * @return id of current gesture. 85 85 */ 86 virtual int getGesture() = 0;86 virtual int getGesture() const = 0; 87 87 88 88 juggler/trunk/modules/gadgeteer/gadget/Type/GestureProxy.h
r20966 r20968 71 71 * @return id of current gesture. 72 72 */ 73 int getGesture() 73 int getGesture() const 74 74 { 75 75 const int defaultGesture(-1); … … 90 90 * @return -1 if not found 91 91 */ 92 int getGestureIndex( std::string name)92 int getGestureIndex(const std::string& name) const 93 93 { 94 94 const int defaultGestureIndex(-1); … … 108 108 * @note if gestureId = -1, returns name of current gesture. 109 109 */ 110 std::string getGestureString(int gestureId = -1)110 const std::string getGestureString(const int gestureId = -1) 111 111 { 112 112 if(isStupefied()) … … 124 124 125 125 /** Returns a pointer to the device held by this proxy. */ 126 GesturePtr getGesturePtr()126 const GesturePtr getGesturePtr() const 127 127 { 128 128 if(isStupefied()) juggler/trunk/modules/gadgeteer/gadget/Type/Glove.cpp
r20123 r20968 206 206 * Use getJointTransform to get the transformation matrix. 207 207 */ 208 gmtl::Vec3f Glove::getTipVector(GloveData::GloveComponent component, int devNum) 208 const gmtl::Vec3f Glove:: 209 getTipVector(const GloveData::GloveComponent component, const int devNum) const 209 210 { 210 211 gmtl::Vec3f y_axis(0.0f, 1.0f, 0.0f); … … 219 220 * wTt = wTb bTj jTt 220 221 */ 221 gmtl::Matrix44f Glove::getTipTransform(GloveData::GloveComponent component,int devNum) 222 const gmtl::Matrix44f Glove:: 223 getTipTransform(const GloveData::GloveComponent component, const int devNum) 224 const 222 225 { 223 226 gmtl::Matrix44f worldTdij; … … 237 240 * wTj = wTb bTj 238 241 */ 239 gmtl::Matrix44f Glove::getJointTransform(GloveData::GloveComponent component, GloveData::GloveJoint joint,int devNum) 242 const gmtl::Matrix44f Glove:: 243 getJointTransform(const GloveData::GloveComponent component, 244 const GloveData::GloveJoint joint, int devNum) 245 const 240 246 { 241 247 gmtl::Matrix44f result; // The returned matrix. … … 264 270 265 271 // Compute return value: result = TIPw = wTb bTd dTt 266 if(devNum<(int)mGlovePositions.size()){ 272 if ( devNum < (int) mGlovePositions.size() ) 273 { 267 274 result=mGlovePositions[devNum]->getData(); // wTb 268 275 } … … 272 279 } 273 280 274 GloveData Glove::getGloveData(int devNum = 0) 275 { 276 SampleBuffer_t::buffer_t& stable_buffer = mGloveSamples.stableBuffer(); 281 const GloveData Glove::getGloveData(const int devNum) const 282 { 283 const SampleBuffer_t::buffer_t& stable_buffer = 284 mGloveSamples.stableBuffer(); 277 285 278 286 if ( (!stable_buffer.empty()) && (stable_buffer.back().size() > (unsigned)devNum) ) // If have entry && devNum in range … … 297 305 * Utility function to convert a 10 size vector of DigitalData to GloveData 298 306 */ 299 std::vector<GloveData> Glove::getGloveDataFromDigitalData(const std::vector<DigitalData> &digitalData) 307 const std::vector<GloveData> Glove:: 308 getGloveDataFromDigitalData(const std::vector<DigitalData> &digitalData) 309 const 300 310 { 301 311 assert(digitalData.size()>=10); juggler/trunk/modules/gadgeteer/gadget/Type/Glove.h
r20603 r20968 81 81 * Can be used for selection, etc. 82 82 */ 83 gmtl::Vec3f getTipVector(GloveData::GloveComponent component, int devNum); 83 const gmtl::Vec3f getTipVector(const GloveData::GloveComponent component, 84 const int devNum) 85 const; 84 86 85 87 /** … … 87 89 * component. 88 90 */ 89 gmtl::Matrix44f getTipTransform(GloveData::GloveComponent component, 90 int devNum); 91 const gmtl::Matrix44f 92 getTipTransform(const GloveData::GloveComponent component, 93 const int devNum) 94 const; 91 95 92 96 /** 93 97 * Returns the transform matrix of the specified joint in world space. 94 98 */ 95 gmtl::Matrix44f getJointTransform(GloveData::GloveComponent component, 96 GloveData::GloveJoint joint, int devNum); 99 const gmtl::Matrix44f 100 getJointTransform(const GloveData::GloveComponent component, 101 const GloveData::GloveJoint joint, const int devNum) 102 const; 97 103 98 104 /** Returns a copy of the glove data struct. */ 99 GloveData getGloveData(int devNum);105 const GloveData getGloveData(const int devNum) const; 100 106 //@} 101 107 … … 128 134 } 129 135 130 const SampleBuffer_t::buffer_t& getGloveDataBuffer() 136 const SampleBuffer_t::buffer_t& getGloveDataBuffer() const 131 137 { 132 138 return mGloveSamples.stableBuffer(); … … 159 165 160 166 /** Utility function to generate GloveData from DigitalData. */ 161 std::vector<GloveData> getGloveDataFromDigitalData(const std::vector<DigitalData>& digitalData); 167 const std::vector<GloveData> 168 getGloveDataFromDigitalData(const std::vector<DigitalData>& digitalData) 169 const; 162 170 163 171 protected: juggler/trunk/modules/gadgeteer/gadget/Type/GloveData.h
r19729 r20968 69 69 70 70 /** 71 * Calulates all the xform matrices 72 * This is calculated based upon the angles in the data structure 71 * Calulates all the transformation matrices. 72 * This is calculated based upon the angles in the data structure. 73 * 74 * @post mTransforms is updated to reflect the current transformations. 73 75 */ 74 76 int calcXforms(); … … 77 79 * Returns the transform matrix of the specified joint 78 80 */ 79 gmtl::Matrix44f getLocalTransformMatrix(GloveComponent component,GloveJoint joint) const 81 const gmtl::Matrix44f& 82 getLocalTransformMatrix(const GloveComponent component, 83 const GloveJoint joint) 84 const 80 85 { 81 86 return mTransforms[component][joint]; juggler/trunk/modules/gadgeteer/gadget/Type/GloveGesture.cpp
r19729 r20968 37 37 * @return (gesture not in range) - empty string 38 38 */ 39 std::string GloveGesture::getGestureString( int gestureId)39 std::string GloveGesture::getGestureString(const int gestureId) const 40 40 { 41 41 if(gestureId < 0) … … 134 134 135 135 /** Returns the gesture identifier of the gesture. */ 136 int GloveGesture::getGestureIndex( std::string gestureName)136 int GloveGesture::getGestureIndex(const std::string& gestureName) const 137 137 { 138 138 unsigned i = 0; juggler/trunk/modules/gadgeteer/gadget/Type/GloveGesture.h
r20061 r20968 63 63 * @note if gestureId = -1, returns name of current gesture. 64 64 */ 65 virtual std::string getGestureString( int gestureId = -1);65 virtual std::string getGestureString(const int gestureId) const; 66 66 67 67 /** … … 102 102 * @return -1 if not found. 103 103 */ 104 virtual int getGestureIndex( std::string gestureName);104 virtual int getGestureIndex(const std::string& gestureName) const; 105 105 106 106 /** Return the number of gestures in system. */ 107 virtual int getNumGestures() 108 { return mGestureNames.size(); } 107 virtual int getNumGestures() const 108 { 109 return mGestureNames.size(); 110 } 109 111 110 112 protected: juggler/trunk/modules/gadgeteer/gadget/Type/GloveProxy.h
r20966 r20968 70 70 virtual ~GloveProxy(); 71 71 72 gmtl::Vec3f getTipVector(GloveData::GloveComponent component) 72 const gmtl::Vec3f getTipVector(const GloveData::GloveComponent component) 73 const 73 74 { 74 75 if(isStupefied()) … … 82 83 } 83 84 84 gmtl::Matrix44f getTipTransform( GloveData::GloveComponent component) 85 const gmtl::Matrix44f 86 getTipTransform(const GloveData::GloveComponent component) const 85 87 { 86 88 if(isStupefied()) … … 94 96 } 95 97 96 gmtl::Matrix44f getJointTransform(GloveData::GloveComponent component, 97 GloveData::GloveJoint joint) 98 const gmtl::Matrix44f 99 getJointTransform(const GloveData::GloveComponent component, 100 const GloveData::GloveJoint joint) 101 const 98 102 { 99 103 if(isStupefied()) … … 107 111 } 108 112 109 GloveData getData()113 const GloveData getData() const 110 114 { 111 115 if(isStupefied()) … … 123 127 124 128 /** Returns a pointer to the device held by this proxy. */ 125 GlovePtr getGlovePtr()129 const GlovePtr getGlovePtr() const 126 130 { 127 131 if(isStupefied()) … … 136 140 137 141 /** Returns the subUnit number that this proxy points to. */ 138 int getUnit() 142 int getUnit() const 139 143 { 140 144 return mUnitNum; 141 145 } 142 146 143 bool isVisible() 147 bool isVisible() const 144 148 { 145 149 return mVisible; juggler/trunk/modules/gadgeteer/gadget/Type/Input.h
r20603 r20968 163 163 * "MyFlockOfBirds", "The Ibox", etc.). 164 164 */ 165 std::string getInstanceName()165 const std::string getInstanceName() const 166 166 { 167 167 if (mInstName.empty()) … … 207 207 208 208 /** Is this input device active? */ 209 bool isActive() 209 bool isActive() const 210 210 { 211 211 return mActive; juggler/trunk/modules/gadgeteer/gadget/Type/InputData.h
r19729 r20968 62 62 63 63 /** Return the last marked time using the vpr::Interval. */ 64 vpr::IntervalgetTime() const64 const vpr::Interval& getTime() const 65 65 { 66 66 return mTimeStamp; juggler/trunk/modules/gadgeteer/gadget/Type/KeyboardMouse.cpp
r20322 r20968 149 149 } 150 150 151 bool KeyboardMouse::modifierOnly(gadget::Keys modKey) 151 bool KeyboardMouse::modifierOnly(gadget::Keys modKey) const 152 152 { 153 153 switch (modKey) … … 167 167 } 168 168 169 std::string KeyboardMouse::getKeyName(gadget::Keys keyId) 169 const std::string KeyboardMouse::getKeyName(const gadget::Keys keyId) const 170 170 { 171 171 switch(keyId) … … 334 334 } 335 335 336 KeyboardMouse::EventQueue KeyboardMouse::getEventQueue()336 const KeyboardMouse::EventQueue KeyboardMouse::getEventQueue() 337 337 { 338 338 vpr::Guard<vpr::Mutex> guard(mCurEventQueueLock); juggler/trunk/modules/gadgeteer/gadget/Type/KeyboardMouse.h
r20603 r20968 116 116 * keyboard data across the cluster. 117 117 */ 118 vpr::Interval getSyncTime()118 const vpr::Interval& getSyncTime() const 119 119 { 120 120 return mSyncTime; … … 130 130 * @return The number of times the key was pressed since last update. 131 131 */ 132 int keyPressed( gadget::Keys keyId)132 int keyPressed(const gadget::Keys keyId) const 133 133 { 134 134 return mCurKeys[keyId]; … … 146 146 * @return true if the given modifier key is the only modifier key pressed. 147 147 */ 148 bool modifierOnly( gadget::Keys modKey);148 bool modifierOnly(const gadget::Keys modKey) const; 149 149 150 150 /** … … 156 156 * @return A string that is the symbolic name of the given key. 157 157 */ 158 std::string getKeyName(gadget::Keys keyId);159 160 /** 161 * Returns a copy of the current queue of events for this device.162 */ 163 EventQueue getEventQueue();158 const std::string getKeyName(const gadget::Keys keyId) const; 159 160 /** 161 * Returns a \em copy of the current queue of events for this device. 162 */ 163 const EventQueue getEventQueue(); 164 164 165 165 /** juggler/trunk/modules/gadgeteer/gadget/Type/KeyboardMouseProxy.h
r20966 r20968 69 69 * Returns a pointer to the gadget::KeyboardMouse object held by this proxy. 70 70 */ 71 KeyboardMousePtr getKeyboardMousePtr()71 const KeyboardMousePtr getKeyboardMousePtr() const 72 72 { 73 73 if(isStupefied()) … … 95 95 * @return true if the given modifier key is the only modifier key pressed. 96 96 */ 97 bool modifierOnly(gadget::Keys modKey) 97 bool modifierOnly(gadget::Keys modKey) const 98 98 { 99 99 if ( isStupefied() || (NULL == mTypedDevice.get()) ) … … 116 116 * @return The number of times the key was pressed since last update. 117 117 */ 118 int keyPressed(gadget::Keys keyId) 118 int keyPressed(gadget::Keys keyId) const 119 119 { 120 120 if ( isStupefied() || (NULL == mTypedDevice.get()) ) … … 131 131 * Returns a copy of the current queue of events for the proxied device. 132 132 */ 133 KeyboardMouse::EventQueue getEventQueue()133 const KeyboardMouse::EventQueue getEventQueue() const 134 134 { 135 135 if ( isStupefied() || (NULL == mTypedDevice.get()) ) juggler/trunk/modules/gadgeteer/gadget/Type/LinearSigmoidPositionFilter.cpp
r19729 r20968 59 59 // Else, perform a quaternion slerp on the rotation and linear calculation 60 60 // on position and return that matrix. 61 gmtl::Matrix44f LinearSigmoidPositionFilter::getPos(const gmtl::Matrix44f newPos) 61 const gmtl::Matrix44f LinearSigmoidPositionFilter:: 62 getPos(const gmtl::Matrix44f newPos) const 62 63 { 63 64 // If value is the same, then return immediately … … 135 136 } 136 137 137 float LinearSigmoidPositionFilter::getScaleFactor(const float distance) 138 float LinearSigmoidPositionFilter::getScaleFactor(const float distance) const 138 139 { 139 140 if(distance < mMinDist) juggler/trunk/modules/gadgeteer/gadget/Type/LinearSigmoidPositionFilter.h
r19729 r20968 54 54 * @param newPos The new postion this frame of the physical device. 55 55 */ 56 gmtl::Matrix44f getPos(const gmtl::Matrix44f newPos);56 const gmtl::Matrix44f getPos(const gmtl::Matrix44f& newPos) const; 57 57 58 58 /** … … 60 60 * maxDist values. 61 61 */ 62 float getScaleFactor(const float distance) ;62 float getScaleFactor(const float distance) const; 63 63 64 void setMinDist(float val) { mMinDist = val;} 65 float minDist() { return mMinDist;} 64 void setMinDist(const float val) 65 { 66 mMinDist = val; 67 } 66 68 67 void setMaxDist(float val) { mMaxDist = val;} 68 float maxDist() { return mMaxDist;} 69 float minDist() const 70 { 71 return mMinDist; 72 } 69 73 70 void setMaxThreshold(float val) { mMaxThreshold = val; } 71 float maxTheshold() { return mMaxThreshold; } 74 void setMaxDist(const float val) 75 { 76 mMaxDist = val; 77 } 78 79 float maxDist() const 80 { 81 return mMaxDist; 82 } 83 84 void setMaxThreshold(const float val) 85 { 86 mMaxThreshold = val; 87 } 88 89 float maxTheshold() const 90 { 91 return mMaxThreshold; 92 } 72 93 73 94 private: juggler/trunk/modules/gadgeteer/gadget/Type/Position.h
r20603 r20968 95 95 virtual bool config(jccl::ConfigElementPtr e); 96 96 97 98 97 /** Get positional data. */ 99 PositionData getPositionData(int devNum = 0)98 const PositionData& getPositionData(int devNum = 0) const 100 99 { 101 SampleBuffer_t::buffer_t& stable_buffer = mPosSamples.stableBuffer(); 100 const SampleBuffer_t::buffer_t& stable_buffer = 101 mPosSamples.stableBuffer(); 102 102 103 103 if ((!stable_buffer.empty()) && … … 175 175 * Returns the current stable sample buffers for this device. 176 176 */ 177 const SampleBuffer_t::buffer_t& getPositionDataBuffer() 177 const SampleBuffer_t::buffer_t& getPositionDataBuffer() const 178 178 { 179 179 return mPosSamples.stableBuffer(); juggler/trunk/modules/gadgeteer/gadget/Type/PositionData.h
r19729 r20968 50 50 } 51 51 52 gmtl::Matrix44fgetPosition() const52 const gmtl::Matrix44f& getPosition() const 53 53 { 54 54 return mPosData; 55 55 } 56 56 57 void setPosition( gmtl::Matrix44fposMatrix)57 void setPosition(const gmtl::Matrix44f& posMatrix) 58 58 { 59 59 mPosData = posMatrix; juggler/trunk/modules/gadgeteer/gadget/Type/PositionProxy.cpp
r20966 r20968 149 149 150 150 // Deprecated, don't use 151 gmtl::Matrix44f PositionProxy::getData(float scaleFactor) const151 const gmtl::Matrix44f PositionProxy::getData(const float scaleFactor) const 152 152 { 153 153 gmtl::Matrix44f ret_mat; juggler/trunk/modules/gadgeteer/gadget/Type/PositionProxy.h
r20966 r20968 100 100 * @return The position of the device as a matrix. 101 101 */ 102 gmtl::Matrix44f getData(float scaleFactor = gadget::PositionUnitConversion::ConvertToFeet ) const; 102 const gmtl::Matrix44f 103 getData(const float scaleFactor = PositionUnitConversion::ConvertToFeet) 104 const; 103 105 104 106 /** Gets the actual PositionData. */ 105 PositionData* getPositionData()107 const PositionData* getPositionData() const 106 108 { 107 109 return &mPositionData; … … 115 117 116 118 /// Returns a pointer to the gadget::Position object held by this proxy. 117 PositionPtr getPositionPtr()119 const PositionPtr getPositionPtr() const 118 120 { 119 121 if(mStupefied || NULL == mTypedDevice.get()) juggler/trunk/modules/gadgeteer/gadget/Type/Proxy.h
r20966 r20968 107 107 108 108 /** Gets the name of the proxy. */ 109 std::stringgetName() const109 const std::string& getName() const 110 110 { 111 111 return mName; juggler/trunk/modules/gadgeteer/gadget/Type/SampleBuffer.h
r20055 r20968 107 107 108 108 void lock() 109 { mLock.acquire(); } 109 { 110 mLock.acquire(); 111 } 110 112 111 113 void unlock() 112 { mLock.release(); } 114 { 115 mLock.release(); 116 } 113 117 114 118 buffer_t& stableBuffer() 115 { return mStableBuffer; } 119 { 120 return mStableBuffer; 121 } 122 123 const buffer_t& stableBuffer() const 124 { 125 return mStableBuffer; 126 } 116 127 117 128 protected: juggler/trunk/modules/gadgeteer/gadget/Type/String.cpp
