LunaSysMgr
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
frictiontransform.h
Go to the documentation of this file.
1 /* @@@LICENSE
2 *
3 * Copyright (c) 2010-2012 Hewlett-Packard Development Company, L.P.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 * LICENSE@@@ */
18 
19 
20 
21 
22 #ifndef FRICTIONTRANSFORM_H_
23 #define FRICTIONTRANSFORM_H_
24 
25 #include "linearmotiontransform.h"
26 
28 {
29  Q_OBJECT
30 public:
32  virtual ~FrictionTransform();
33 
34  virtual void restart(const qreal newStartTime=0.0);
35 
36  qreal setInitialForce(const qreal force); //can specify by either force or accel+mass
37  qreal setInitialAcceleration(const qreal accel);
38  qreal setObjectMass(const qreal mass);
39  qreal setInitialMomentTime(const qreal time);
40  qreal setCoeffKineticFriction(const qreal coeffKinFriction);
41  qreal coeffKineticFriction() const;
42  qreal initialForce() const;
43  qreal initialAcceleration() const;
44  qreal objectMass() const;
45  qreal initialMomentTime() const;
46 
47  virtual qreal displacement(const qreal time);
48  virtual qreal velocity(const qreal time);
49  virtual qreal acceleration(const qreal time);
50 
51  virtual void vec(const qreal time,qreal& d,qreal& v, qreal& a);
52  virtual QVector<qreal> vec(const qreal time);
53 
54  virtual qreal haltTime() const;
55 
56  virtual void setReverse();
57  virtual void setForward();
58 
59 public Q_SLOTS:
60 
61  virtual void slotTimetic(const qreal absTime=0); //absolute time coordinate (increasing)
62 
63 protected:
64 
65  virtual void parametersChanged();
66 
67  //PARAMETERS
69  qreal m_objectMass;
71  qreal m_reverse; //-1.0 to let the displacement go in reverse
72 
74 
75  //INVARIANTS
78 
84 };
85 
86 #endif /* FRICTIONTRANSFORM_H_ */