XamlUserHatchPattern.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (c) 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 
00020 #if !defined XAML_USER_HATCH_PATTERN_HEADER
00021 #define XAML_USER_HATCH_PATTERN_HEADER
00022 
00023 #include "dwfcore/DWFXMLSerializer.h"
00027 
00028 #include "XAML/XamlCore.h"
00029 
00030 #include "whiptk/usrhatchpat.h"
00031 #include "XAML/XamlDrawableAttributes.h"
00032 #include "XAML/XamlXML.h"
00033 
00035 class XAMLTK_API WT_XAML_User_Hatch_Pattern :
00036     public WT_User_Hatch_Pattern,
00037     public XamlDrawableAttributes::PathAttributeProvider,
00038     public XamlDrawableAttributes::Fill::Provider
00039 {
00040         friend class WT_XAML_Class_Factory;
00041         friend class WT_XAML_Rendition;
00042 
00043 private:
00044 
00045     WT_XAML_File *_pSerializeFile;                          // serialized file, !=0
00046     unsigned int _pattern_index;                            // current pattern number
00047 
00048 protected :
00049 
00051 
00052     WT_XAML_User_Hatch_Pattern()
00053         : WT_User_Hatch_Pattern()
00054         , _pSerializeFile( NULL )
00055         , _pattern_index(0)  // important: -1 means "does not exist", which is the default state
00056     {}
00060     WT_XAML_User_Hatch_Pattern(WT_Integer16 hashpatnum)
00061         : WT_User_Hatch_Pattern(hashpatnum)
00062         , _pSerializeFile( NULL )
00063         , _pattern_index(0)
00064     {}  
00070     WT_XAML_User_Hatch_Pattern(WT_Integer16 hashpatnum,
00071                          WT_Unsigned_Integer16 xsize,
00072                          WT_Unsigned_Integer16 ysize)
00073         : WT_User_Hatch_Pattern(hashpatnum,xsize,ysize)
00074         , _pSerializeFile( NULL )
00075         , _pattern_index(0)
00076     {}  
00077 
00079     WT_XAML_User_Hatch_Pattern(WT_User_Hatch_Pattern const & pattern)
00080                 : WT_User_Hatch_Pattern(static_cast<WT_User_Hatch_Pattern const &>(pattern))
00081         , _pSerializeFile( NULL )
00082         , _pattern_index(0)
00083         {}    
00084    
00085     virtual ~WT_XAML_User_Hatch_Pattern()
00086         {}    
00088 
00089 public:
00091         WT_XAML_User_Hatch_Pattern const & operator= (WT_User_Hatch_Pattern const & pattern)
00092         {
00093                 WT_User_Hatch_Pattern::operator = (pattern);
00094                 return *this;
00095         }
00096 
00097     //
00098     // sets the pattern definition # to use while rendering to XAML
00099     //
00100     // this should be used by hatchable WT_XAML_xxx drawables to serialize
00101     // multiple <Path> since multi-hatching has to be rendered by compositing
00102     // together all individual patterns
00103     //
00104     // returns WT_Success is the number is valid, Internal_Error otherwise
00105     //
00106     WT_Result set_pattern_number(
00107         unsigned int);                              // pattern number
00108 
00109     //
00110     // from XamlDrawableAttributes::PathAttributeProvider
00111     //
00112     virtual WT_Result providePathAttributes(
00113         XamlDrawableAttributes::PathAttributeConsumer *,    // consumer, != 0
00114         WT_XAML_File &) const;                      // current file
00115 
00116     //
00117     // from XamlDrawableAttributes::Fill::Provider
00118     //
00119     virtual WT_Result provideFill(
00120         XamlDrawableAttributes::Fill *&);               // memento, may be null
00121 
00123     WT_Result        serialize (WT_File & /*file*/) const;
00125         WT_Result                parseAttributeList(XamlXML::tAttributeMap& rMap, WT_XAML_File& rFile);
00127 };
00128 
00129 #endif //XAML_USER_HATCH_PATTERN_HEADER

Generated on Tue Jan 6 22:40:06 2009 for Autodesk DWF Toolkit by  doxygen 1.4.5