plotinfo.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 PLOTINFO_HEADER
00024 #define PLOTINFO_HEADER
00025 
00031 
00032 
00038 class WHIPTK_API WT_Plot_Info
00039 : public WT_Object
00040 {
00041 public:
00043     enum WT_Paper_Units
00044     {
00045         Millimeters,
00046         Inches,
00047 
00048         // Not units
00049         Count, 
00050         Undefined = -1 
00051     };
00052 
00053 protected:
00054     double          m_height;
00055     double          m_width;
00056     WT_Point2D      m_ll;   // lower left
00057     WT_Point2D      m_ur;   // upper right
00058     WT_Matrix2D m_dwf2paper;
00059     WT_Paper_Units  m_units;
00060     WT_Boolean      m_show;
00061     WT_String       m_temp_string;
00062     long            m_rotation;
00063 
00064     enum WT_Materialize_Stage
00065     {   Eating_Initial_Whitespace,
00066         Getting_Show_Boolean,
00067         Getting_Landscape_To_Portrait_Flip,
00068         Getting_Units_String,
00069         Getting_Paper_Width,
00070         Getting_Paper_Height,
00071         Getting_Plot_Area_Left,
00072         Getting_Plot_Area_Bottom,
00073         Getting_Plot_Area_Right,
00074         Getting_Plot_Area_Top,
00075         Getting_To_Paper_Transform,
00076         Eating_End_Whitespace
00077     } m_stage;
00078 
00079 public:
00080 
00082 
00083     WT_Plot_Info()
00084     : m_height(11.0)
00085     , m_width(8.5)
00086     , m_ll(0.25,0.25)
00087     , m_ur(8.25,10.75)
00088     , m_units(Inches)
00089     , m_show(WD_False)
00090     , m_rotation(0)
00091     , m_stage(Eating_Initial_Whitespace)
00092     {}
00094 
00095     virtual ~WT_Plot_Info()
00096     {}
00097 
00099 
00100     inline WT_Boolean&           for_display()     { return m_show; }
00102     inline const WT_Boolean&     for_display()     const { return m_show; }
00104     inline WT_Point2D&           lower_left()      { return m_ll; }
00106     inline const WT_Point2D&     lower_left()      const { return m_ll; }
00108     inline double&               paper_height()        { return m_height; }
00110     inline const double&         paper_height()        const { return m_height; }
00112     inline WT_Paper_Units&       paper_units() { return m_units; }
00114     inline const WT_Paper_Units& paper_units() const { return m_units; }
00116     inline double&               paper_width()         { return m_width; }
00118     inline const double&         paper_width()         const { return m_width; }
00120     inline const long&           rotation()              const { return m_rotation; }
00122     inline long&                 rotation()        { return m_rotation; }
00124     inline WT_Matrix2D&          to_paper()       { return m_dwf2paper; }
00126     inline const WT_Matrix2D&    to_paper()       const { return m_dwf2paper; }
00128     inline WT_Point2D&           upper_right()     { return m_ur; }
00130     inline const WT_Point2D&     upper_right()     const { return m_ur; }    //@}
00131 
00133     WT_Result materialize( const WT_Opcode& opcode, WT_File& file);
00134     WT_ID     object_id()   const { return WT_Object::Plot_Info_ID; }
00135     WT_Type   object_type() const { return WT_Object::Definition; }
00136     WT_Result process( WT_File& file);
00137     virtual WT_Result serialize( WT_File& file ) const;
00139 
00141 
00143     static WT_Result default_process(
00144         WT_Plot_Info  & item, 
00145         WT_File & file 
00146         );
00147 };
00148 
00150 
00151 #endif // PLOTINFO_HEADER

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