Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

point3d.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------
00002 //               The Motion Strategy Library (MSL)
00003 //----------------------------------------------------------------------
00004 //
00005 // Copyright (c) University of Illinois and Steven M. LaValle.     
00006 // All Rights Reserved.
00007 //
00008 // Permission to use, copy, and distribute this software and its
00009 // documentation is hereby granted free of charge, provided that
00010 // (1) it is not a component of a commercial product, and
00011 // (2) this notice appears in all copies of the software and
00012 //     related documentation.
00013 //
00014 // The University of Illinois and the author make no representations
00015 // about the suitability or fitness of this software for any purpose.
00016 // It is provided "as is" without express or implied warranty.
00017 //----------------------------------------------------------------------
00018 
00019 #ifndef MSL_POINT3D_H
00020 #define MSL_POINT3D_H
00021 
00022 #ifdef WIN32
00023   #include <iostream>
00024   #include <list>
00025   using namespace std;
00026 #else
00027   #include <iostream.h>
00028   #include <list.h>
00029 #endif
00030 
00031   #include "mslio.h"
00032 
00033 class MSLPoint3d
00034 {
00035   double xrep;
00036   double yrep;
00037   double zrep;
00038 
00039 public:
00040   
00041   MSLPoint3d();
00042   MSLPoint3d(double x, double y, double z);
00043   ~MSLPoint3d() {}
00044   double  xcoord()  const   { return xrep; }
00045   double  ycoord()  const   { return yrep; }
00046   double  zcoord()  const   { return zrep; }
00047   double  W()   const   { return 1; }
00048   double  WD()  const   { return 1; }
00049   int     dim() const { return 3; }
00050   double  sqr_dist(const MSLPoint3d& q) const;
00051   double xdist(const MSLPoint3d& q) const;
00052   double ydist(const MSLPoint3d& q) const;
00053   double zdist(const MSLPoint3d& q) const;
00054   double  distance(const MSLPoint3d& q) const;
00055   MSLPoint3d translate(double dx, double dy, double dz) const;
00056   MSLPoint3d reflect(const MSLPoint3d& q, const MSLPoint3d& r, 
00057                      const MSLPoint3d& s) const;
00058   MSLPoint3d reflect(const MSLPoint3d& q) const;
00059   bool operator==(const MSLPoint3d& q) const;
00060   bool operator!=(const MSLPoint3d& q)  const { return !operator==(q);}
00061   friend ostream& operator<<(ostream& O, const MSLPoint3d& p) ;
00062   friend istream& operator>>(istream& I, MSLPoint3d& p) ;
00063   //friend istream& operator>>(istream& is, list<MSLPoint3d> & vl);
00064   //friend ostream& operator<<(ostream& os, const list<MSLPoint3d> & vl);
00065 };
00066 
00067 ostream& operator<<(ostream& O, const MSLPoint3d& p) ;
00068 istream& operator>>(istream& I, MSLPoint3d& p) ;
00069 
00070 #endif
00071 
00072 
00073 
00074 
00075 
Motion Strategy Library


Web page maintained by Steve LaValle
Partial support provided by NSF CAREER Award IRI-970228 (LaValle), Honda Research.
Contributors: Anna Atramentov, Peng Cheng, James Kuffner, Steve LaValle, and Libo Yang.