User Manual, Developers Guide and API Documentation

Point.hpp

Go to the documentation of this file.
00001 /*******************************************************************************
00002  * This file is part of openWNS (open Wireless Network Simulator)
00003  * _____________________________________________________________________________
00004  *
00005  * Copyright (C) 2004-2007
00006  * Chair of Communication Networks (ComNets)
00007  * Kopernikusstr. 5, D-52074 Aachen, Germany
00008  * phone: ++49-241-80-27910,
00009  * fax: ++49-241-80-22242
00010  * email: info@openwns.org
00011  * www: http://www.openwns.org
00012  * _____________________________________________________________________________
00013  *
00014  * openWNS is free software; you can redistribute it and/or modify it under the
00015  * terms of the GNU Lesser General Public License version 2 as published by the
00016  * Free Software Foundation;
00017  *
00018  * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY
00019  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
00020  * A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00021  * details.
00022  *
00023  * You should have received a copy of the GNU Lesser General Public License
00024  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00025  *
00026  ******************************************************************************/
00027 
00028 #ifndef WNS_GEOMETRY_POINT_HPP
00029 #define WNS_GEOMETRY_POINT_HPP
00030 
00031 #include <WNS/pyconfig/View.hpp>
00032 
00033 #include <ostream>
00034 #include <valarray>
00035 
00036 namespace wns { namespace geometry {
00037     class Vector;
00038 
00042     class Point {
00043     public:
00044         // con-/destructors
00045         Point();
00046 
00047         Point(double x, double y, double z);
00048 
00049         explicit
00050         Point(const std::valarray<double>& other);
00051 
00052         explicit
00053         Point(const wns::pyconfig::View& view);
00054 
00055         virtual
00056         ~Point();
00057 
00058         // getter
00059         double
00060         getX() const;
00061 
00062         double
00063         getY() const;
00064 
00065         double
00066         getZ() const;
00067 
00068         const std::valarray<double>&
00069         get() const;
00070 
00071         // setter
00072         void
00073         setX(double x);
00074 
00075         void
00076         setY(double y);
00077 
00078         void
00079         setZ(double z);
00080 
00081         void
00082         set(double x, double y, double z);
00083 
00084         void
00085         set(const std::valarray<double>& other);
00086 
00087         void
00088         setPolar(double r, double phi, double theta);
00089 
00090         // operator
00091         Point
00092         operator+(const Vector& v) const;
00093 
00094         void
00095         operator+=(const Vector& v);
00096 
00097         Vector
00098         operator-(const Point& other) const;
00099 
00100         void
00101         operator=(const Point& other);
00102 
00103         bool
00104         operator==(const Point& other) const;
00105 
00106         bool
00107         operator!=(const Point& other) const;
00108         
00109         bool operator<(const Point& other) const;
00110 
00111         friend std::ostream&
00112         operator<<(std::ostream& str, const Point& point)
00113         {
00114             str << "x: " << point.getX()
00115                 << ", y: " << point.getY()
00116                 << ", z: " << point.getZ();
00117             return str;
00118         }
00119 
00120     private:
00121         std::valarray<double> point;
00122     };
00123 } // geometry
00124 } // wns
00125 #endif // WNS_GEOMETRY_POINT_HPP
00126 
00127 

Generated on Fri May 25 03:31:39 2012 for openWNS by  doxygen 1.5.5