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

viewport.h

00001 //  Copyright (c) 1996-2001 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 VIEWPORT_HEADER
00019 #define VIEWPORT_HEADER
00020 
00021 #include "whiptk/attribute.h"
00022 #include "whiptk/pointset.h"
00023 #include "whiptk/viewport_options.h"
00024 
00025 class WT_Contour_Set;
00026 class WT_File;
00027 
00032 
00033 
00036 class WHIPTK_API WT_Viewport   : public WT_Attribute
00037 {
00038 private:
00039 
00040     enum WT_Materialize_Stage
00041     {
00042         Eating_Initial_Whitespace,
00043         Checking_For_Attribute_End,
00044         Getting_Viewport_Name,
00045         Getting_Viewport_Polygon,
00046         Materialize_Contour_Set,
00047         Getting_Viewport_Optioncode,
00048         Materializing_Viewport_Option,
00049         Eating_End_Whitespace
00050     } m_stage;
00051 
00052     WT_Contour_Set *        m_contour_set;
00053     WT_Point_Set *          m_temp_point_set;
00054     WT_Opcode *             m_temp_opcode;
00055     WT_Unsigned_Integer16   m_fields_defined;
00056     WT_Viewport_Optioncode  m_optioncode;
00057     WT_String               m_name;
00058     int                     m_incarnation;
00059 
00060     WT_Viewport_Option_Viewport_Units  m_viewport_units;
00061 
00062     enum WT_Viewport_Options
00063     {
00064         VIEWPORT_UNITS_BIT = 0x0001
00065     };
00066 
00067 public:
00068 
00070 
00071     WT_Viewport()
00072         : m_stage(Eating_Initial_Whitespace)
00073         , m_contour_set(WD_Null)
00074         , m_temp_point_set(WD_Null)
00075         , m_temp_opcode(WD_Null)
00076         , m_fields_defined(0)
00077         , m_incarnation(-1)
00078     {}
00080     WT_Viewport( WT_Viewport const & vport);
00082     WT_Viewport(
00083         WT_File &                   file, 
00084         char const *                name, 
00085         int                         num_points, 
00086         WT_Logical_Point const *    points, 
00087         WT_Boolean                  copy = WD_True 
00088         );
00090     WT_Viewport(
00091         WT_File &                   file, 
00092         WT_Unsigned_Integer16 const * name, 
00093         int                         num_points, 
00094         WT_Logical_Point const *    points, 
00095         WT_Boolean                  copy = WD_True 
00096         );
00098     WT_Viewport(
00099         WT_File &                   file, 
00100         WT_String const &           name, 
00101         WT_Contour_Set const &      boundary, 
00102         WT_Boolean                  copy = WD_True 
00103         );
00105     ~WT_Viewport();
00107 
00109 
00110     WT_Contour_Set const * contour() const {   return m_contour_set;   }
00112     WT_String const & name() const {   return m_name;   }
00114     void set(
00115         WT_Viewport const & vport, 
00116         WT_Boolean copy = WD_True 
00117         );
00119     WT_Viewport_Option_Viewport_Units const &    viewport_units()    const { return m_viewport_units; }
00121     WT_Viewport_Option_Viewport_Units &          viewport_units() { m_fields_defined |= VIEWPORT_UNITS_BIT; return m_viewport_units; }
00123     WT_Viewport &  operator=(WT_Viewport const & vport);
00125 
00127     WT_ID            object_id() const;
00128     WT_Result        materialize(WT_Opcode const & opcode, WT_File & file);
00129     WT_Result        process(WT_File & file);
00130     WT_Result        skip_operand(WT_Opcode const & opcode, WT_File & file);
00131     WT_Result        serialize (WT_File & file) const;
00132     WT_Result        sync (WT_File & file) const;
00133     WT_Boolean       operator== (WT_Attribute const & attrib) const;
00135 
00137 
00139     static WT_Result default_process(
00140         WT_Viewport & item, 
00141         WT_File & file 
00142         );
00143 
00144 };
00145 
00146 #endif // VIEWPORT_HEADER

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