transform.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 
00019 #if !defined TRANSFORM_HEADER
00020 #define TRANSFORM_HEADER
00021 
00025 
00027 
00029 class WHIPTK_API WT_Transform
00030 {
00031 public:
00032     WT_Logical_Point    m_translate; 
00033     double              m_x_scale; 
00034     double              m_y_scale; 
00035     long                m_rotation; 
00037 
00038     WT_Transform()
00039         : m_translate(0,0)
00040         , m_x_scale(1.0)
00041         , m_y_scale(1.0)
00042         , m_rotation(0)
00043     { }
00044 
00046     WT_Transform (
00047         WT_Logical_Point trans, 
00048         double xval, 
00049         double yval, 
00050         double rotation = 0.0 
00051         )
00052         : m_translate(trans)
00053         , m_x_scale(xval)
00054         , m_y_scale(yval)
00055     {
00056         set_rotation(rotation);
00057     }
00058 
00059         virtual ~WT_Transform()
00060         {}
00061 
00063 
00065     void set_rotation(
00066         double rotation 
00067         )
00068     {
00069         switch ((long)rotation)
00070         {
00071             case 0:
00072             case 90:
00073             case 180:
00074             case 270:
00075                 m_rotation = (long)rotation;
00076                 break;
00077             default:
00078                 m_rotation = 0;
00079                 throw WT_Result::Toolkit_Usage_Error;
00080         }
00081     }
00082 
00084     long rotation() const
00085     {   return m_rotation;    }
00086 };
00087 
00088 #endif // TRANSFORM_HEADER

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