/** * @file vector.cpp * @author Julian Iseringhausen * @date Mon Apr 18 12:25:24 2011 * * @brief VMG::Vector * */ #ifdef HAVE_CONFIG_H #include #endif #include "base/index.hpp" #include "base/vector.hpp" using namespace VMG; Vector::Vector(const Index& index) { i[0] = static_cast(index.X()); i[1] = static_cast(index.Y()); i[2] = static_cast(index.Z()); } Vector::Vector(vmg_float x, vmg_float y, vmg_float z) { i[0]=x; i[1]=y; i[2]=z; } Vector::Vector(vmg_float val) { i[0]=val; i[1]=val; i[2]=val; } Vector::Vector() { i[0]=0.0; i[1]=0.0; i[2]=0.0; } std::ostream& operator<<(std::ostream& out, const Vector& base) { return out << "{" << base.X() << " " << base.Y() << " " << base.Z() << "}"; }