projection.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 PROJECTION_HEADER
00020 #define PROJECTION_HEADER
00021 
00025 
00026 #include "whiptk/whipcore.h"
00027 #include "whiptk/attribute.h"
00028 
00033 
00034 
00035 class WHIPTK_API WT_Projection : public WT_Attribute
00036 {
00037         friend class WT_Rendition;
00038         friend class WT_W2D_Class_Factory;
00039         friend class WT_Opcode;
00040 
00041 public:
00042 
00044     enum WT_Projection_Type
00045     {
00054         Normal = 0,
00058         Stretch = 1,
00062         Chop = 2
00063     };
00064 
00065 private:
00066     typedef WT_Result (*WT_String_Interpreter)( char const *, WT_Projection_Type& );
00067 
00068     WT_Projection_Type m_value;
00069 
00070     enum WT_Materialize_Stage
00071     {   Eating_Initial_Whitespace,
00072         Gathering_String,
00073         Eating_End_Whitespace
00074     } m_stage;
00075 
00076     WT_Result materialize( WT_Opcode const & opcode, WT_File& file, WT_String_Interpreter interpret);
00077 
00078 public:
00079 
00081 
00082     WT_Projection()
00083     : m_value(Normal)
00084     , m_stage(Eating_Initial_Whitespace)
00085     {}
00087     WT_Projection(
00088         const WT_Projection_Type projection_type 
00089         )
00090     : m_value(projection_type)
00091     , m_stage(Eating_Initial_Whitespace)
00092     {}
00093 
00095         WT_Projection(WT_Projection const& projection)
00096         {
00097                 *this = projection;
00098         }
00099 
00100         virtual ~WT_Projection()
00101         {}
00103 public:
00105 
00108     static WT_Result interpret_string(
00109         char const * string, 
00110         WT_Projection_Type & projection_type 
00111         );
00112 
00114 
00115     WT_Projection_Type   type() const { return m_value; }
00116         WT_Projection_Type&   type() { return m_value; }
00118 
00120     WT_ID            object_id() const;
00121     WT_Type          object_type() const;
00122     WT_Result        materialize(WT_Opcode const & opcode, WT_File & file) { return materialize (opcode, file, interpret_string); }
00123     WT_Result        process(WT_File & file);
00124     WT_Result        skip_operand(WT_Opcode const & opcode, WT_File & file);
00125     WT_Result        serialize (WT_File & file) const;
00126     WT_Result        sync (WT_File & file) const;
00127     WT_Boolean       operator== (WT_Attribute const & attrib) const;
00129 
00131 
00133     static WT_Result default_process(
00134         WT_Projection & item, 
00135         WT_File & file 
00136         );
00137 };
00138 
00140 
00141 #endif // PROJECTION_HEADER

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