OSDLPoint2D.h

Go to the documentation of this file.
00001 #ifndef OSDL_POINT_2D_H_
00002 #define OSDL_POINT_2D_H_
00003 
00004 
00005 #include "OSDLVideoTypes.h"    // for Coordinate
00006 #include "OSDLPoint.h"         // for inheritance
00007 
00008 #include "OSDLTypes.h"
00009 
00010 #include "Ceylan.h"            // for MatrixIndex, TextDisplayable
00011 
00012 #include <string>
00013 #include <list>
00014 
00015 
00016 
00017 namespace OSDL
00018 {
00019 
00020     
00021     namespace Video
00022     {
00023     
00024     
00025         namespace TwoDimensional
00026         {
00027         
00028 
00029         
00038             class OSDL_DLL Point2D : public Point
00039             {
00040 
00041 
00042                 public:
00043     
00044         
00045         
00051                     explicit Point2D( Coordinate x = 0, Coordinate y = 0 )
00052                         throw() ;
00053 
00054 
00063                     Point2D( const Point2D & source ) throw() ;
00064                     
00065                     
00074                     explicit Point2D( 
00075                             const Ceylan::Maths::Linear::Bipoint & source )
00076                         throw() ;
00077                     
00078                     
00087                     explicit Point2D( 
00088                             const Ceylan::Maths::Linear::Vector2 & source )
00089                         throw() ;
00090                     
00091                      
00092                      
00113                     static Point2D & CreateFrom( FloatingPointCoordinate x = 0, 
00114                         FloatingPointCoordinate y = 0 ) throw() ;
00115 
00116 
00118                     virtual ~Point2D() throw() ;
00119     
00120     
00126                     virtual void setTo( Coordinate x, Coordinate y ) throw() ;
00127                     
00128                     
00137                     virtual void setTo( FloatingPointCoordinate x, 
00138                         FloatingPointCoordinate y ) throw() ;
00139 
00140 
00146                     virtual void setFrom( const Point2D & source ) throw() ;
00147                     
00148 
00157                     virtual void setFrom( 
00158                             const Ceylan::Maths::Linear::Vector2 & source )
00159                         throw() ;
00160 
00161                     
00163                     inline Coordinate getX() const throw() ;
00164                     
00166                     inline void setX( Coordinate newX ) throw() ;
00167     
00168     
00170                     inline Coordinate getY() const throw();
00171                     
00173                     inline void setY( Coordinate newY ) throw() ;
00174 
00175 
00181                     void translate( Offset x, Offset y ) throw() ;
00182                     
00183                     
00185                     virtual void flip() throw() ;
00186                     
00187                     
00189                     virtual void flipX() throw() ;
00190                     
00192                     virtual void flipY() throw() ;
00193                     
00194                     
00207                     virtual const std::string toString( 
00208                             Ceylan::VerbosityLevels level = Ceylan::high ) 
00209                         const throw() ;
00210                         
00211 
00212 
00213                     // Static section.
00214                     
00215                     
00217                     static const Point2D Origin ;
00218                     
00219                     
00220                     
00227                     static void Translate( std::list<Point2D *> & pointList,
00228                         Offset x, Offset y ) throw() ;
00229                     
00230 
00236                     static const Ceylan::Maths::Linear::MatrixIndex Dimensions 
00237                         = 2 ;
00238                     
00239                     
00240                     
00241                 protected:
00242     
00243     
00249                     Coordinate _coord[ Dimensions ] ;
00250                     
00251 
00252             } ;
00253     
00254     
00255     
00256     
00257             // Inline section.
00258             
00259     
00260             Coordinate Point2D::getX() const throw()
00261             {
00262             
00263                 return _coord[0] ;
00264                 
00265             }
00266     
00267     
00268             void Point2D::setX( Coordinate newX ) throw()
00269             {
00270             
00271                 _coord[0] = newX ;
00272                 
00273             }
00274     
00275     
00276             Coordinate Point2D::getY() const throw()
00277             {
00278             
00279                 return _coord[1] ;
00280                 
00281             }
00282     
00283     
00284             void Point2D::setY( Coordinate newY ) throw()
00285             {
00286             
00287                 _coord[1] = newY ;
00288                 
00289             }
00290             
00291         }
00292 
00293     }
00294     
00295 }
00296 
00297 
00299 OSDL_DLL std::ostream & operator << ( std::ostream & os, 
00300     const OSDL::Video::TwoDimensional::Point2D & p ) ;
00301 
00302 
00303 #endif // OSDL_POINT_2D_H_
00304 

Generated on Fri Mar 30 14:46:59 2007 for OSDL by  doxygen 1.5.1