Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages | Examples

logical_point.h

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

Generated on Tue May 17 12:07:44 2005 for Autodesk DWF Whip 2D Toolkit by  doxygen 1.4.1