Changeset dfed1c for src/base/index.cpp
- Timestamp:
- Nov 22, 2011, 9:22:10 PM (14 years ago)
- Children:
- facba0
- Parents:
- 66f24d
- File:
-
- 1 edited
-
src/base/index.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/base/index.cpp
r66f24d rdfed1c 14 14 #include "base/vector.hpp" 15 15 16 using namespace VMG; 16 using VMG::Index; 17 using VMG::Vector; 18 19 Index::Index(const Index& rhs) 20 { 21 std::memcpy(this->i, rhs.i, 3*sizeof(int)); 22 } 17 23 18 24 Index::Index(const Vector& vec) … … 23 29 } 24 30 25 Index::Index(const Stencil::iterator& iter) 26 { 27 i[0] = iter->m; 28 i[1] = iter->n; 29 i[2] = iter->o; 30 } 31 32 const Vector Index::operator+(const Vector& rhs) const 31 Vector Index::operator+(const Vector& rhs) const 33 32 { 34 33 return Vector(*this) += rhs; 35 34 } 36 35 37 constVector Index::operator-(const Vector& rhs) const36 Vector Index::operator-(const Vector& rhs) const 38 37 { 39 38 return Vector(*this) -= rhs; 40 39 } 41 40 42 constVector Index::operator*(const Vector& rhs) const41 Vector Index::operator*(const Vector& rhs) const 43 42 { 44 43 return Vector(*this) *= rhs; 45 44 } 46 45 47 constVector Index::operator/(const Vector& rhs) const46 Vector Index::operator/(const Vector& rhs) const 48 47 { 49 48 return Vector(*this) /= rhs; 50 49 } 51 50 52 constVector Index::operator+(const vmg_float& rhs) const51 Vector Index::operator+(const vmg_float& rhs) const 53 52 { 54 53 return Vector(*this) += rhs; 55 54 } 56 55 57 constVector Index::operator-(const vmg_float& rhs) const56 Vector Index::operator-(const vmg_float& rhs) const 58 57 { 59 58 return Vector(*this) -= rhs; 60 59 } 61 60 62 constVector Index::operator*(const vmg_float& rhs) const61 Vector Index::operator*(const vmg_float& rhs) const 63 62 { 64 63 return Vector(*this) *= rhs; 65 64 } 66 65 67 constVector Index::operator/(const vmg_float& rhs) const66 Vector Index::operator/(const vmg_float& rhs) const 68 67 { 69 68 return Vector(*this) /= rhs; … … 93 92 } 94 93 95 std::ostream& operator<<(std::ostream& out, const Index& base)94 std::ostream& VMG::operator<<(std::ostream& out, const Index& index) 96 95 { 97 return out << "{" << base.X() << " " << base.Y() << " " << base.Z() << "}"; 96 out << "{" << index.X() << " " << index.Y() << " " << index.Z() << "}"; 97 98 return out; 98 99 }
Note:
See TracChangeset
for help on using the changeset viewer.
