XamlViewport.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 #if !defined XAML_VIEWPORT_HEADER
00020 #define XAML_VIEWPORT_HEADER
00021 
00025 
00026 #include "XAML/XamlCore.h"
00027 
00028 #include "whiptk/viewport.h"
00029 #include "XAML/XamlDrawableAttributes.h"
00030 #include "XAML/XamlXML.h"
00031 
00036 
00037 
00040 class XAMLTK_API WT_XAML_Viewport : public WT_Viewport
00041                                   , public XamlDrawableAttributes::CanvasAttributeProvider
00042                                   , public XamlDrawableAttributes::Clip::Provider
00043                                   , public XamlDrawableAttributes::Clip::Consumer
00044 {
00045         friend class WT_XAML_Class_Factory;
00046         friend class WT_XAML_Rendition;
00047 
00048 private :
00049 
00050     WT_XAML_File *_pSerializeFile;
00051 
00052     //
00053     // materialization specific : when creating a materialized viewport,
00054     // we need to assign a new incarnation # to the inner contour set -
00055     // otherwise an incorrect clip will be specified and most likely we
00056     // won't see parts of the drawing in the viewer
00057     //
00058     int _nContourIncarnation;
00059 
00060 protected:
00061 
00063 
00064     WT_XAML_Viewport()
00065     : WT_Viewport(),
00066       _pSerializeFile(NULL),
00067       _nContourIncarnation(-1)
00068         {
00069     }
00070 
00072     WT_XAML_Viewport( WT_XAML_Viewport const & vport) throw(WT_Result)
00073     : WT_Viewport(static_cast<WT_Viewport const &> (vport)),
00074       _pSerializeFile(NULL),
00075       _nContourIncarnation(-1)
00076     {
00077     }
00078 
00080     WT_XAML_Viewport(
00081         WT_File &                   file, 
00082         char const *                name, 
00083         int                         num_points, 
00084         WT_Logical_Point const *    points, 
00085         WT_Boolean                  copy = WD_True 
00086         ) throw(WT_Result)
00087         : WT_Viewport(file,name,num_points,points,copy),
00088       _pSerializeFile(NULL),
00089       _nContourIncarnation(-1)
00090         {
00091     }
00092 
00094     WT_XAML_Viewport(
00095         WT_File &                   file, 
00096         WT_Unsigned_Integer16 const * name, 
00097         int                         num_points, 
00098         WT_Logical_Point const *    points, 
00099         WT_Boolean                  copy = WD_True 
00100         ) throw(WT_Result)
00101         : WT_Viewport(file,name,num_points,points,copy),
00102       _pSerializeFile(NULL),
00103       _nContourIncarnation(-1)
00104         {
00105     }
00106 
00108     WT_XAML_Viewport(
00109         WT_File &                   file, 
00110         WT_String const &           name, 
00111         WT_Contour_Set const &      boundary, 
00112         WT_Boolean                  copy = WD_True 
00113         ) throw(WT_Result)
00114         : WT_Viewport(file,name,boundary,copy),
00115       _pSerializeFile(NULL),
00116       _nContourIncarnation(-1)
00117     {
00118     }
00119 
00121     virtual ~WT_XAML_Viewport()
00122         {
00123     }
00124 
00126 
00127 public:
00128 
00130         WT_XAML_Viewport &  operator=(WT_XAML_Viewport const & vport)
00131         {
00132                 WT_Viewport::operator= (vport);
00133                 return *this;
00134         }
00135 
00136     //
00137     // from XamlDrawableAttributes::CanvasAttributeProvider
00138     //
00139     virtual WT_Result provideCanvasAttributes(
00140         XamlDrawableAttributes::CanvasAttributeConsumer *,    // consumer, not null
00141         WT_XAML_File &) const;                              // file
00142 
00143     //
00144     // from XamlDrawableAttributes::Clip::Provider
00145     //
00146     virtual WT_Result provideClip( 
00147         XamlDrawableAttributes::Clip *&);                   // memento, may be null
00148 
00149     //
00150     // from XamlDrawableAttributes::Clip::consumeClip
00151     //
00155     virtual WT_Result consumeClip( XamlDrawableAttributes::Clip::Provider* p );
00156 
00157 
00159     WT_Result        serialize (WT_File & file) const;
00161         WT_Result                parseAttributeList(XamlXML::tAttributeMap& rMap, WT_XAML_File& rFile);
00163 };
00165 
00166 #endif //XAML_VIEWPORT_HEADER
00167 

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