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

linepat.h

00001 //  Copyright (c) 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 LINEPAT_HEADER
00019 #define LINEPAT_HEADER
00020 
00025 
00026 
00065 class WHIPTK_API WT_Line_Pattern
00066 : public WT_Attribute
00067 {
00068 public:
00070     enum WT_Pattern_ID
00071     {
00072         Illegal,    
00073         Solid,      
00074         Dashed,
00075         Dotted,
00076         Dash_Dot,
00077         Short_Dash,
00078         Medium_Dash,
00079         Long_Dash,
00080         Short_Dash_X2,
00081         Medium_Dash_X2,
00082         Long_Dash_X2,
00083         Medium_Long_Dash, // not to be confused with Dashed
00084         Medium_Dash_Short_Dash_Short_Dash,
00085         Long_Dash_Short_Dash,
00086         Long_Dash_Dot_Dot,
00087         Long_Dash_Dot,
00088         Medium_Dash_Dot_Short_Dash_Dot,
00089         Sparse_Dot,
00090         ISO_Dash,
00091         ISO_Dash_Space,
00092         ISO_Long_Dash_Dot,
00093         ISO_Long_Dash_Double_Dot,
00094         ISO_Long_Dash_Triple_Dot,
00095         ISO_Dot,
00096         ISO_Long_Dash_Short_Dash,
00097         ISO_Long_Dash_Double_Short_Dash,
00098         ISO_Dash_Dot,
00099         ISO_Double_Dash_Dot,
00100         ISO_Dash_Double_Dot,
00101         ISO_Double_Dash_Double_Dot,
00102         ISO_Dash_Triple_Dot,
00103         ISO_Double_Dash_Triple_Dot,
00104         Count,            
00105         Undefined = -1    
00106     };
00107 
00108 
00110 
00111     WT_Line_Pattern()
00112     : m_stage(Eating_Initial_Whitespace)
00113     , m_id(Solid)
00114     {}
00116     WT_Line_Pattern( WT_Pattern_ID id )
00117     : m_stage(Eating_Initial_Whitespace)
00118     , m_id(Solid)
00119     { set(id); }
00121 
00123 
00124     inline WT_Pattern_ID pattern_id() const { return m_id; }
00126     inline void set( WT_Pattern_ID i ) { m_id = i; }
00128     inline operator WT_Pattern_ID ()  const { return m_id; }
00130     inline WT_Line_Pattern& operator= ( WT_Pattern_ID i ) { set(i); return *this; }
00132 
00134     WT_ID            object_id() const { return Line_Pattern_ID; }
00135     WT_Result        materialize(WT_Opcode const & opcode, WT_File & file);
00136     WT_Result        process(WT_File & file);
00137     WT_Result        skip_operand(WT_Opcode const & opcode, WT_File & file);
00138     WT_Result        serialize (WT_File & file) const;
00139     WT_Result        sync (WT_File & file) const;
00140     WT_Boolean       operator== (WT_Attribute const & attrib) const;
00142     inline WT_Boolean operator == ( WT_Pattern_ID i ) const { return i == m_id; }
00144 
00146 
00148     static WT_Result default_process(
00149         WT_Line_Pattern & item, 
00150         WT_File & file 
00151         );
00152 
00153 
00154 private:
00155     static WT_Result interpret( char const * , WT_Pattern_ID& );
00156     WT_Result materialize_ascii( WT_Opcode const & , WT_File& );
00157     WT_Result materialize_single_byte( WT_Opcode const & , WT_File& );
00158 
00159     enum WT_Materialize_Stage
00160     {   Eating_Initial_Whitespace,
00161         Getting_Pattern_ID,
00162         Eating_End_Whitespace
00163     } m_stage;
00164 
00165     static const char* m_names[Count];
00166     static const char* m_alternate_names[Count];
00167     WT_Pattern_ID m_id;
00168 };
00169 
00170 #endif // LINEPAT_HEADER

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