linepat.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 #if !defined LINEPAT_HEADER
00019 #define LINEPAT_HEADER
00020 
00024 
00029 
00030 
00069 class WHIPTK_API WT_Line_Pattern
00070 : public WT_Attribute
00071 {
00072         friend class WT_Rendition;
00073         friend class WT_W2D_Class_Factory;
00074         friend class WT_Opcode;
00075 
00076 public:
00078     enum WT_Pattern_ID
00079     {
00080         Illegal,    
00081         Solid,      
00082         Dashed,
00083         Dotted,
00084         Dash_Dot,
00085         Short_Dash,
00086         Medium_Dash,
00087         Long_Dash,
00088         Short_Dash_X2,
00089         Medium_Dash_X2,
00090         Long_Dash_X2,
00091         Medium_Long_Dash, // not to be confused with Dashed
00092         Medium_Dash_Short_Dash_Short_Dash,
00093         Long_Dash_Short_Dash,
00094         Long_Dash_Dot_Dot,
00095         Long_Dash_Dot,
00096         Medium_Dash_Dot_Short_Dash_Dot,
00097         Sparse_Dot,
00098         ISO_Dash,
00099         ISO_Dash_Space,
00100         ISO_Long_Dash_Dot,
00101         ISO_Long_Dash_Double_Dot,
00102         ISO_Long_Dash_Triple_Dot,
00103         ISO_Dot,
00104         ISO_Long_Dash_Short_Dash,
00105         ISO_Long_Dash_Double_Short_Dash,
00106         ISO_Dash_Dot,
00107         ISO_Double_Dash_Dot,
00108         ISO_Dash_Double_Dot,
00109         ISO_Double_Dash_Double_Dot,
00110         ISO_Dash_Triple_Dot,
00111         ISO_Double_Dash_Triple_Dot,
00112         Decorated_Tracks,
00113         Decorated_Wide_Tracks,
00114         Decorated_Circle_Fence,
00115         Decorated_Square_Fence,
00116         Count,            
00117         Undefined = -1    
00118     };
00119 
00120 public:
00122 
00123     WT_Line_Pattern()
00124     : m_stage(Eating_Initial_Whitespace)
00125     , m_id(Solid)
00126     {}
00128     WT_Line_Pattern( WT_Pattern_ID id )
00129     : m_stage(Eating_Initial_Whitespace)
00130     , m_id(Solid)
00131     { set(id); }
00132 
00133         WT_Line_Pattern(WT_Line_Pattern const& pat)
00134         {
00135                 *this = pat;
00136         }
00137         virtual ~WT_Line_Pattern()
00138         {}
00140 public:
00142 
00143     inline WT_Pattern_ID pattern_id() const { return m_id; }
00145     inline void set( WT_Pattern_ID i ) { m_id = i; }
00147     inline operator WT_Pattern_ID ()  const { return m_id; }
00149     virtual inline WT_Line_Pattern& operator= ( WT_Pattern_ID i ) { set(i); return *this; }
00151 
00153     WT_ID            object_id() const { return Line_Pattern_ID; }
00154     WT_Result        materialize(WT_Opcode const & opcode, WT_File & file);
00155     WT_Result        process(WT_File & file);
00156     WT_Result        skip_operand(WT_Opcode const & opcode, WT_File & file);
00157     WT_Result        serialize (WT_File & file) const;
00158     WT_Result        sync (WT_File & file) const;
00159     WT_Boolean       operator== (WT_Attribute const & attrib) const;
00161     inline WT_Boolean operator == ( WT_Pattern_ID i ) const { return i == m_id; }
00163 
00165 
00167     static WT_Result default_process(
00168         WT_Line_Pattern & item, 
00169         WT_File & file 
00170         );
00171 
00172 
00173 private:
00174     static WT_Result interpret( char const * , WT_Pattern_ID& );
00175     WT_Result materialize_ascii( WT_Opcode const & , WT_File& );
00176     WT_Result materialize_single_byte( WT_Opcode const & , WT_File& );
00177 
00178     enum WT_Materialize_Stage
00179     {   Eating_Initial_Whitespace,
00180         Getting_Pattern_ID,
00181         Eating_End_Whitespace
00182     } m_stage;
00183 
00184     static const char* m_names[Count];
00185     static const char* m_alternate_names[Count];
00186     WT_Pattern_ID m_id;
00187 };
00188 
00190 
00191 #endif // LINEPAT_HEADER

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