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

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

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