~ubuntu-branches/ubuntu/maverick/freecad/maverick

« back to all changes in this revision

Viewing changes to src/Base/Placement.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Adam C. Powell, IV
  • Date: 2010-01-11 08:48:33 UTC
  • mfrom: (3.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20100111084833-4g9vgdqbkw8u34zb
Tags: 0.9.2646.5-1
* New upstream version (closes: #561696).
* Added swig to Build-Depends (closes: #563523, #563772).
* Removed python-opencv from Build-Depends and Recommends (closes: #560768).

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
    this->_rot = that._rot;
43
43
}
44
44
 
 
45
Placement::Placement(const Vector3d& Pos, const Rotation &Rot)
 
46
{
 
47
    this->_pos = Pos;
 
48
    this->_rot = Rot;
 
49
}
 
50
 
 
51
Placement::Placement(const Vector3d& Pos, const Rotation &Rot, const Vector3d& Cnt)
 
52
{
 
53
    Vector3d RotC = Cnt;
 
54
    Rot.multVec(RotC, RotC);
 
55
    this->_pos = Pos + Cnt - RotC;
 
56
    this->_rot = Rot;
 
57
}
 
58
 
45
59
Base::Matrix4D Placement::toMatrix(void) const
46
60
{
47
61
    Base::Matrix4D matrix;
74
88
    return p;
75
89
}
76
90
 
 
91
void Placement::move(const Vector3d& MovVec)
 
92
{
 
93
    _pos += MovVec;
 
94
}
 
95
 
77
96
bool Placement::operator == (const Placement& that) const
78
97
{
79
98
    return (this->_pos == that._pos) && (this->_rot == that._rot);
100
119
    return plm;
101
120
}
102
121
 
 
122
Placement& Placement::operator = (const Placement& New)
 
123
{
 
124
    this->_pos = New._pos;
 
125
    this->_rot = New._rot;
 
126
    return *this;
 
127
}
 
128
 
103
129
void Placement::multVec(const Vector3d & src, Vector3d & dst) const
104
130
{
105
131
    this->_rot.multVec(src, dst);