penpat.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 
00022 
00023 #if !defined PENPAT_HEADER
00024 #define PENPAT_HEADER
00025 
00026 #include "whiptk/whipcore.h"
00027 #include "whiptk/file.h"
00028 #include "whiptk/attribute.h"
00029 
00034 
00035 
00048 class WHIPTK_API WT_Pen_Pattern : public WT_Attribute
00049 {
00050         friend class WT_Rendition;
00051         friend class WT_W2D_Class_Factory;
00052         friend class WT_Opcode;
00053 
00054 public:
00056     enum WT_Pattern_ID
00057     {
00058         Illegal,    
00060         //Individual Screening Percentage Patterns
00061         Screening_Black,      
00062         Screening_Alternate,  
00063         Screening_Block,      
00064         Screening_Dots,       
00065         Screening_Big_Dots,   
00067         //Non-Individual Screening Patterns (Face Patterns)
00068         Dots_Big,
00069         Dots_Medium,
00070         Dots_Small,
00071         Slant_Left_32x32,
00072         Slant_Right_32x32,
00073         Screen_15,
00074         Screen_25,
00075         Screen_20,
00076         Screen_75,
00077         Screen_50,
00078         Screen_Thin_50,
00079         Screen_Hatched_50,
00080         Trellis,
00081         ZigZag,
00082         Diagonal,
00083         Triangle,
00084         Triangle_More,
00085         Bricks,
00086         Bricks_Big,
00087         Squares,
00088         Squares_3D,
00089         Diamond_Plaid,
00090         Ziggurat,
00091         Diagonal_Thatch,
00092         Zipper,
00093         Slants,
00094         Slants_More,
00095         Diags,
00096         Diags_More,
00097         Marks,
00098         Marks_More,
00099         Diamonds_Thick,
00100         Diamonds_Thin,
00101 
00102         Screening_Black_0,
00103         Screening_Black_10,
00104         Screening_Black_15,
00105         Screening_Black_20,
00106         Screening_Black_35,
00107         Screening_Black_40,
00108         Screening_Black_45,
00109         Screening_Black_50,
00110         Screening_Black_55,
00111         Screening_Black_60,
00112         Screening_Black_65,
00113         Screening_Black_70,
00114         Screening_Black_75,
00115         Screening_Black_80,
00116         Screening_Black_85,
00117         Screening_Black_90,
00118         Screening_Black_100,
00119 
00120         Screening_Alternate_5,
00121         Screening_Alternate_10,
00122         Screening_Alternate_15,
00123         Screening_Alternate_20,
00124         Screening_Alternate_25,
00125         Screening_Alternate_35,
00126         Screening_Alternate_40,
00127         Screening_Alternate_45,
00128         Screening_Alternate_50,
00129         Screening_Alternate_65,
00130         Screening_Alternate_70,
00131         Screening_Alternate_80,
00132         Screening_Alternate_85,
00133         Screening_Alternate_90,
00134         Screening_Alternate_95,
00135 
00136         Screening_Block_10,
00137         Screening_Block_20,
00138         Screening_Block_25,
00139         Screening_Block_30,
00140         Screening_Block_40,
00141         Screening_Block_50,
00142         Screening_Block_60,
00143         Screening_Block_65,
00144         Screening_Block_70,
00145         Screening_Block_75,
00146         Screening_Block_80,
00147         Screening_Block_85,
00148         Screening_Block_90,
00149         Screening_Block_95,
00150 
00151         Screening_Dots_5,
00152         Screening_Dots_10,
00153         Screening_Dots_15,
00154         Screening_Dots_20,
00155         Screening_Dots_25,
00156         Screening_Dots_30,
00157         Screening_Dots_40,
00158         Screening_Dots_50,
00159         Screening_Dots_60,
00160         Screening_Dots_70,
00161         Screening_Dots_75,
00162         Screening_Dots_85,
00163         Screening_Dots_90,
00164         Screening_Dots_95,
00165 
00166         Screening_Big_Dots_5,
00167         Screening_Big_Dots_10,
00168         Screening_Big_Dots_20,
00169         Screening_Big_Dots_30,
00170         Screening_Big_Dots_40,
00171         Screening_Big_Dots_50,
00172         Screening_Big_Dots_60,
00173         Screening_Big_Dots_65,
00174         Screening_Big_Dots_70,
00175         Screening_Big_Dots_75,
00176         Screening_Big_Dots_80,
00177         Screening_Big_Dots_85,
00178         Screening_Big_Dots_90,
00179         Screening_Big_Dots_95,
00180 
00181         Count,            
00182         Undefined = -1    
00183     };
00184 
00185 protected:
00186 
00187     WT_Pattern_ID           m_id;
00188     WT_Unsigned_Integer32   m_screening_percentage;
00189     WT_Color_Map *          m_color_map;
00190     WT_Boolean              m_local_color_map_copy;
00191 
00192     enum
00193     {
00194         Starting,
00195         Getting_Pattern_Id,
00196         Getting_Screening_Percentage,
00197         Getting_Transparency_ColorMap_Flag,
00198         Getting_Color_Map_Opcode,
00199         Getting_Color_Map,
00200         Getting_Pre_Data_Size_Whitespace,
00201         Getting_Pre_Data_Size_Open_Paren,
00202         Getting_Close
00203     }                       m_stage;
00204 
00205     WT_Opcode               m_colormap_opcode;
00206     
00207 public:
00208 
00210 
00211     WT_Pen_Pattern ()
00212                 : m_id(Screening_Black)
00213                 , m_screening_percentage(0)
00214                 , m_color_map(WD_Null)
00215                 , m_local_color_map_copy(WD_False)
00216                 , m_stage(Starting)
00217             { }
00219     WT_Pen_Pattern (WT_Pattern_ID pattern_id)
00220                 : m_id(pattern_id)
00221                 , m_screening_percentage(0)
00222                 , m_color_map(WD_Null)
00223                 , m_local_color_map_copy(WD_False)
00224                 , m_stage(Starting)
00225             { }
00227     WT_Pen_Pattern(
00228             WT_Pattern_ID                pattern_id, 
00229             WT_Unsigned_Integer32        screening_percentage, 
00230             WT_Boolean                   colormap_flag, 
00231             WT_Color_Map const *         color_map, 
00232             WT_Boolean                   copy) throw(WT_Result);
00234     WT_Pen_Pattern(WT_Pen_Pattern const & pattern) throw(WT_Result);
00235 
00237     virtual ~WT_Pen_Pattern()
00238     {
00239         if (m_local_color_map_copy && m_color_map!=NULL)
00240             delete [] m_color_map;
00241     }
00243 public:
00245     WT_Boolean              is_local_color_map_copy() const {   return m_local_color_map_copy;  }
00246 
00248     WT_Color_Map const *    color_map() const {   return m_color_map;     }
00250     WT_Pattern_ID           pen_pattern() const {   return m_id;  }
00252     WT_Unsigned_Integer32   screening_percentage() const {   return m_screening_percentage;  }
00254     void                    set_pen_pattern(WT_Pattern_ID pattern_id) {   m_id = pattern_id;  }
00256     void                    set_screening_percentage (const WT_Unsigned_Integer32 screening_percentage) {   m_screening_percentage = screening_percentage;  }
00258     virtual inline WT_Pen_Pattern&  operator= ( WT_Pattern_ID const & id )  {  m_id = id;  return *this;  }
00260     virtual WT_Pen_Pattern&         operator= ( const WT_Pen_Pattern& pen_pattern ) throw(WT_Result);
00262     WT_Boolean              operator!= ( WT_Pen_Pattern const & pattern ) const;
00264     inline WT_Boolean       operator == ( WT_Pattern_ID const & id ) const { return id == m_id; }
00266 
00268     WT_ID            object_id() const;
00269     WT_Result        materialize(WT_Opcode const & opcode, WT_File & file);
00270     WT_Result        process(WT_File & file);
00271     WT_Result        skip_operand(WT_Opcode const & opcode, WT_File & file);
00272     WT_Result        serialize (WT_File & file) const;
00273     WT_Result        sync (WT_File & file) const;
00274     WT_Boolean       operator== (WT_Attribute const & attrib) const;
00276 
00278 
00280     static WT_Result default_process(
00281         WT_Pen_Pattern & item, 
00282         WT_File & file 
00283         );
00284 };
00285 
00287 
00288 #endif // PENPAT_HEADER

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