| Rev | Line | |
|---|
| [48b662] | 1 | /**
|
|---|
| 2 | * @file vector.cpp
|
|---|
| 3 | * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
|
|---|
| 4 | * @date Mon Apr 18 12:25:24 2011
|
|---|
| 5 | *
|
|---|
| 6 | * @brief VMG::Vector
|
|---|
| 7 | *
|
|---|
| 8 | */
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 | #ifdef HAVE_CONFIG_H
|
|---|
| 12 | #include <config.h>
|
|---|
| 13 | #endif
|
|---|
| 14 |
|
|---|
| 15 | #include "base/index.hpp"
|
|---|
| 16 | #include "base/vector.hpp"
|
|---|
| 17 |
|
|---|
| 18 | using namespace VMG;
|
|---|
| 19 |
|
|---|
| 20 | Vector::Vector(const Index& index)
|
|---|
| 21 | {
|
|---|
| 22 | i[0] = static_cast<vmg_float>(index.X());
|
|---|
| 23 | i[1] = static_cast<vmg_float>(index.Y());
|
|---|
| 24 | i[2] = static_cast<vmg_float>(index.Z());
|
|---|
| 25 | }
|
|---|
| 26 |
|
|---|
| 27 | Vector::Vector(vmg_float x, vmg_float y, vmg_float z)
|
|---|
| 28 | {
|
|---|
| 29 | i[0]=x;
|
|---|
| 30 | i[1]=y;
|
|---|
| 31 | i[2]=z;
|
|---|
| 32 | }
|
|---|
| 33 |
|
|---|
| 34 | Vector::Vector(vmg_float val)
|
|---|
| 35 | {
|
|---|
| 36 | i[0]=val;
|
|---|
| 37 | i[1]=val;
|
|---|
| 38 | i[2]=val;
|
|---|
| 39 | }
|
|---|
| 40 | Vector::Vector()
|
|---|
| 41 | {
|
|---|
| 42 | i[0]=0.0;
|
|---|
| 43 | i[1]=0.0;
|
|---|
| 44 | i[2]=0.0;
|
|---|
| 45 | }
|
|---|
| 46 |
|
|---|
| 47 | std::ostream& operator<<(std::ostream& out, const Vector& base)
|
|---|
| 48 | {
|
|---|
| 49 | return out << "{" << base.X() << " " << base.Y() << " " << base.Z() << "}";
|
|---|
| 50 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.