viewport.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 VIEWPORT_HEADER
00020 #define VIEWPORT_HEADER
00021 
00025 
00026 #include "whiptk/attribute.h"
00027 #include "whiptk/pointset.h"
00028 #include "whiptk/viewport_options.h"
00029 
00030 class WT_Contour_Set;
00031 class WT_File;
00032 
00037 
00038 
00041 class WHIPTK_API WT_Viewport   : public WT_Attribute
00042 {
00043         friend class WT_Rendition;
00044         friend class WT_W2D_Class_Factory;
00045         friend class WT_Opcode;
00046 
00047 protected:
00048 
00049     enum WT_Materialize_Stage
00050     {
00051         Eating_Initial_Whitespace,
00052         Checking_For_Attribute_End,
00053         Getting_Viewport_Name,
00054         Getting_Viewport_Polygon,
00055         Materialize_Contour_Set,
00056         Getting_Viewport_Optioncode,
00057         Materializing_Viewport_Option,
00058         Eating_End_Whitespace
00059     } m_stage;
00060 
00061     WT_Contour_Set *        m_contour_set;
00062     WT_Point_Set *          m_temp_point_set;
00063     WT_Opcode *             m_temp_opcode;
00064     WT_Unsigned_Integer16   m_fields_defined;
00065     WT_Viewport_Optioncode  m_optioncode;
00066     WT_String               m_name;
00067     int                     m_incarnation;
00068 
00069     WT_Viewport_Option_Viewport_Units  m_viewport_units;
00070 
00071     enum WT_Viewport_Options
00072     {
00073         VIEWPORT_UNITS_BIT = 0x0001
00074     };
00075 
00076 public:
00077 
00079 
00080     WT_Viewport()
00081         : m_stage(Eating_Initial_Whitespace)
00082         , m_contour_set(WD_Null)
00083         , m_temp_point_set(WD_Null)
00084         , m_temp_opcode(WD_Null)
00085         , m_fields_defined(0)
00086         , m_incarnation(-1)
00087     {}
00089     WT_Viewport( WT_Viewport const & vport) throw(WT_Result);
00091     WT_Viewport(
00092         WT_File &                   file, 
00093         char const *                name, 
00094         int                         num_points, 
00095         WT_Logical_Point const *    points, 
00096         WT_Boolean                  copy = WD_True 
00097         ) throw(WT_Result);
00099     WT_Viewport(
00100         WT_File &                   file, 
00101         WT_Unsigned_Integer16 const * name, 
00102         int                         num_points, 
00103         WT_Logical_Point const *    points, 
00104         WT_Boolean                  copy = WD_True 
00105         ) throw(WT_Result);
00107     WT_Viewport(
00108         WT_File &                   file, 
00109         WT_String const &           name, 
00110         WT_Contour_Set const &      boundary, 
00111         WT_Boolean                  copy = WD_True 
00112         ) throw(WT_Result);
00114     virtual ~WT_Viewport();
00115 
00117 public:
00119 
00120     WT_Contour_Set const * contour() const {   return m_contour_set;   }
00122     WT_String const & name() const {   return m_name;   }
00124     WT_Result set(
00125         WT_Viewport const & vport, 
00126         WT_Boolean copy = WD_True 
00127         );
00128 
00130     void set(
00131         WT_String const & name 
00132         );
00133 
00135     WT_Result set(
00136         WT_Contour_Set const * boundary, 
00137         WT_Boolean copy = WD_True 
00138         );
00139 
00141     WT_Viewport_Option_Viewport_Units const &    viewport_units()    const { return m_viewport_units; }
00143     WT_Viewport_Option_Viewport_Units &          viewport_units() { m_fields_defined |= VIEWPORT_UNITS_BIT; return m_viewport_units; }
00145     virtual WT_Viewport &  operator=(WT_Viewport const & vport);
00147 
00149     WT_ID              object_id() const;
00150     virtual WT_Result  materialize(WT_Opcode const & opcode, WT_File & file);
00151     virtual WT_Result  process(WT_File & file);
00152     virtual WT_Result  skip_operand(WT_Opcode const & opcode, WT_File & file);
00153     virtual WT_Result  serialize (WT_File & file) const;
00154     virtual WT_Result  sync (WT_File & file) const;
00155     virtual WT_Boolean operator== (WT_Attribute const & attrib) const;
00157 
00159 
00161     static WT_Result default_process(
00162         WT_Viewport & item, 
00163         WT_File & file 
00164         );
00165 
00166 };
00167 
00169 
00170 #endif // VIEWPORT_HEADER

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