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

transform.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 TRANSFORM_HEADER
00019 #define TRANSFORM_HEADER
00020 
00022 
00024 class WHIPTK_API WT_Transform
00025 {
00026 public:
00027     WT_Logical_Point    m_translate; 
00028     double              m_x_scale; 
00029     double              m_y_scale; 
00030     long                m_rotation; 
00032 
00033     WT_Transform()
00034         : m_translate(0,0)
00035         , m_x_scale(1.0)
00036         , m_y_scale(1.0)
00037         , m_rotation(0)
00038     { }
00039 
00041     WT_Transform (
00042         WT_Logical_Point trans, 
00043         double xval, 
00044         double yval, 
00045         double rotation = 0.0 
00046         )
00047         : m_translate(trans)
00048         , m_x_scale(xval)
00049         , m_y_scale(yval)
00050     {
00051         set_rotation(rotation);
00052     }
00053 
00055 
00057     void set_rotation(
00058         double rotation 
00059         )
00060     {
00061         switch ((long)rotation)
00062         {
00063             case 0:
00064             case 90:
00065             case 180:
00066             case 270:
00067                 m_rotation = (long)rotation;
00068                 break;
00069             default:
00070                 m_rotation = 0;
00071                 throw WT_Result::Toolkit_Usage_Error;
00072         }
00073     }
00074 
00076     long rotation() const
00077     {   return m_rotation;    }
00078 };
00079 
00080 #endif // TRANSFORM_HEADER

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