Point2D.h

Go to the documentation of this file.
00001 /* $Id: Point2D.h,v 1.3 2002/11/05 14:31:15 anonymous Exp $ */
00002 
00003 #ifndef __POINT_2D_H
00004 #define __POINT_2D_H
00005 
00006 #include <esg/geometry/Point3D.h>
00007 
00008 namespace esg {
00009 
00015 class OGSCENE_EXPORT Point2D : public Point3D {
00016 protected:
00017         virtual void _rotateX   (float) {}
00018         virtual void _rotateY   (float) {}
00019         virtual void _translate (float x, float y, float z = 0) {
00020             _position.add(Vector3(x,y,z));
00021         }
00022     
00023 public:
00027         Point2D() : Point3D() {}
00028 
00034         Point2D (const Vector2& v) : Point3D(v.x,v.y,0) {}
00035 
00042         Point2D (float x, float  y) : Point3D(x,y,0) {}
00043 
00050         Point2D (double x, double y) : Point3D(x,y,0) {}
00051         
00052         virtual Geometry* clone(const Matrix4* pTrMat) const {
00053             Point2D* pRet = new Point2D();
00054             pRet->_duplicate_attributes(*this);
00055             if (pTrMat) pRet->_transform(*pTrMat);
00056             return pRet;
00057         }
00058 
00062         void setPosition(const Vector2& p) {
00063             Point3D::setPosition(p.x, p.y, 0.0);
00064         }
00065 
00070         void setPosition(float x, float y) {
00071             Point3D::setPosition(x, y, 0.0);
00072         }
00073 };
00074 
00075 }; // namespace
00076 
00077 #endif // __POINT_2D_H

Generated on Wed Jun 28 12:24:28 2006 for esg by  doxygen 1.4.6