Vector3D.cpp
Go to the documentation of this file.
00001 /*******************************************************************************
00002  *  Vector3D.cpp
00003  *
00004  *  (C) 2007 AG Aktives Sehen <agas@uni-koblenz.de>
00005  *           Universitaet Koblenz-Landau
00006  *
00007  *  Additional information:
00008  *  $Id: $
00009  *******************************************************************************/
00010 
00011 #include "Vector3D.h"
00012 
00013 #define THIS Vector3D
00014 
00015 using namespace std;
00016 
00017 std::string THIS::toString( int precision, std::string name )
00018 {
00019   std::ostringstream s;
00020 
00021   s.precision( precision );
00022   s.setf(ios::fixed,ios::floatfield);
00023 
00024   for ( unsigned row=0; row<3; row++ )
00025   {
00026     if ( name != "" )
00027     {
00028       if ( row==1 )
00029       {
00030         s << name << " = ";
00031       }
00032       else
00033       {
00034         s.width( name.length()+3 );
00035         s << "";
00036       }
00037     }
00038 
00039     s << "( ";
00040     s.width( precision+4 );
00041     switch ( row )
00042     {
00043       case 0:
00044         s << m_X << " ";
00045         break;
00046       case 1:
00047         s << m_Y << " ";
00048         break;
00049       case 2:
00050         s << m_Z << " ";
00051         break;
00052     }
00053     s << ")" << endl;
00054   }
00055   return s.str();
00056 }
00057 
00058 #undef THIS


robbie_architecture
Author(s): Viktor Seib
autogenerated on Mon Oct 6 2014 02:53:09