logical_point.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (c) 1996-2006 by Autodesk, Inc.
00003 //
00004 //  By using this code, you are agreeing to the terms and conditions of
00005 //  the License Agreement included in the documentation for this code.
00006 //
00007 //  AUTODESK MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AS TO THE CORRECTNESS
00008 //  OF THIS CODE OR ANY DERIVATIVE WORKS WHICH INCORPORATE IT. AUTODESK
00009 //  PROVIDES THE CODE ON AN "AS-IS" BASIS AND EXPLICITLY DISCLAIMS ANY
00010 //  LIABILITY, INCLUDING CONSEQUENTIAL AND INCIDENTAL DAMAGES FOR ERRORS,
00011 //  OMISSIONS, AND OTHER PROBLEMS IN THE CODE.
00012 //
00013 //  Use, duplication, or disclosure by the U.S. Government is subject to
00014 //  restrictions set forth in FAR 52.227-19 (Commercial Computer Software
00015 //  Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) (Rights in Technical
00016 //  Data and Computer Software), as applicable.
00017 //
00018 
00022 
00023 #if !defined LOGICAL_POINT_HEADER
00024 #define LOGICAL_POINT_HEADER
00025 
00026 class WT_Logical_Point_16;
00027 class WT_Transform;
00028 
00030 class WHIPTK_API WT_Logical_Point
00031 {
00032         
00033 public:
00034     WT_Integer32    m_x; 
00035     WT_Integer32    m_y; 
00037 
00038     WT_Logical_Point() : m_x(0), m_y(0) {}
00039 
00041     WT_Logical_Point(WT_Integer32 x, WT_Integer32 y)
00042         : m_x (x)
00043         , m_y (y)
00044     { }
00045 
00047     ~WT_Logical_Point() {}
00048 
00050     WT_Boolean    operator== (WT_Logical_Point const & lp) const
00051     {
00052         if (m_x == lp.m_x && m_y == lp.m_y)
00053             return WD_True;
00054         else
00055             return WD_False;
00056     }
00057 
00058     WT_Boolean    operator!= (WT_Logical_Point const & lp) const
00059     {
00060         if (operator==(lp))
00061             return WD_False;
00062         else
00063             return WD_True;
00064     }
00065 
00066 
00068     WT_Boolean  operator== (WT_Logical_Point_16 const & lp) const;
00069 
00071     WT_Logical_Point const & operator= (WT_Logical_Point_16 const & in);
00073     WT_Logical_Point const   operator* (WT_Transform const & trans) const;
00075     WT_Logical_Point const   operator*= (WT_Transform const & trans);
00076 };
00077 
00079 class WT_Logical_Point_16
00080 {       
00081 public:
00082     WT_Integer16    m_x; 
00083     WT_Integer16    m_y; 
00086     // Constructors, Destructors
00087 
00089     WT_Logical_Point_16() : m_x(0), m_y(0) {}
00090 
00092 
00095     WT_Logical_Point_16(WT_Integer32 x, WT_Integer32 y)
00096     {
00097         m_x = (WT_Integer16)x;
00098         m_y = (WT_Integer16)y;
00099         WD_Assert(m_x == x);
00100         WD_Assert(m_y == y);
00101     }
00102 
00104     WT_Logical_Point_16(WT_Integer16 x, WT_Integer16 y)
00105         : m_x (x)
00106         , m_y (y)
00107     { }
00108 
00110     ~WT_Logical_Point_16() {}
00111     
00113     WT_Boolean    operator== (WT_Logical_Point const & lp) const
00114     {
00115         if ((WT_Integer32)m_x == lp.m_x &&
00116             (WT_Integer32)m_y == lp.m_y)
00117             return WD_True;
00118         else
00119             return WD_False;
00120     }
00121 
00123 
00126     WT_Logical_Point_16 const & operator= (WT_Logical_Point const & in)
00127     {
00128         m_x = (WT_Integer16) in.m_x;
00129         m_y = (WT_Integer16) in.m_y;
00130         WD_Assert (m_x == in.m_x); // Make sure that we don't truncate data
00131         WD_Assert (m_y == in.m_y);
00132         return *this;
00133     }
00134 };
00135 
00136 #endif // LOGICAL_POINT_HEADER

Generated on Tue Jan 6 22:41:13 2009 for Autodesk DWF Whip 2D Toolkit by  doxygen 1.4.5