overpost.h

Go to the documentation of this file.
00001 //  Copyright (c) 1996-2006 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 
00021 
00022 
00023 
00024 #if !defined OVERPOST_HEADER
00025 #define OVERPOST_HEADER
00026 
00027 #include "whiptk/whipcore.h"
00028 #include "whiptk/object_stream.h"
00029 
00030 
00031 
00032 class WHIPTK_API WT_Overpost : public WT_Object_Stream
00033 {
00034         friend class WT_W2D_Class_Factory;
00035         friend class WT_Opcode;
00036 
00037 public:
00038     enum WT_AcceptMode
00039     {
00040         AcceptAll,      // process all entities in the overpost group
00041         AcceptAllFit,   // process entities in the overpost group which fit
00042         AcceptFirstFit  // process first entity in the overpost group which fits
00043     };
00044 public:
00045     // Constructors and destructor
00046     WT_Overpost();
00047     WT_Overpost( WT_AcceptMode  acceptMode,
00048                  WT_Boolean     renderEntities,
00049                  WT_Boolean     addExtents);
00050         
00051     virtual ~WT_Overpost();
00052 public:
00053     // return the overpost options
00054     WT_AcceptMode       acceptMode() const;
00055     WT_AcceptMode&      acceptMode() { return m_eAcceptMode; }
00056     WT_Boolean          renderEntities() const;
00057     WT_Boolean&         renderEntities() { return m_renderEntities; }
00058     WT_Boolean          addExtents() const;
00059     WT_Boolean&         addExtents() { return m_addExtents; }
00060 
00061     // add drawables to this overpost
00062     // Note: This class takes ownership of the WT_Drawable. 
00063     //       The WT_Drawable should be created on the heap.
00064     WT_Result           add(const WT_Object&);
00065 
00067     WT_Type             object_type() const ;
00068     WT_ID               object_id() const ;
00069     WT_Result           materialize(WT_Opcode const & opcode, WT_File & file);
00070     WT_Result           process(WT_File & file);
00071     WT_Result           serialize(WT_File & file) const ;
00072 
00074 
00076     static WT_Result    default_process(WT_Overpost&, WT_File&);
00077 
00078 protected:
00079     // overriden from class WT_Object_Stream
00080     WT_Result           on_materialize(WT_Object&, WT_File&);    
00081     
00082 protected:
00083     // Hidden copy constructor and Assignment operator
00084     WT_Overpost(const WT_Overpost& );
00085     void operator=(const WT_Overpost&);
00086 
00087     static const char*  enum_to_string(WT_AcceptMode);
00088     static WT_Boolean   string_to_enum(const char* pStr, WT_AcceptMode&);
00089     static WT_Boolean   string_to_boolean(const char* pStr, WT_Boolean&);
00090 
00091     WT_Byte             binary_serialize_var() const ;
00092     WT_Result           binary_materialize_var(WT_Byte byte);
00093 
00094 protected:
00095     static const char* str_AcceptMode_All;
00096     static const char* str_AcceptMode_AllFit;
00097     static const char* str_AcceptMode_FirstFit;
00098     static const char* str_True;
00099     static const char* str_False;
00100 
00101 private:
00102     // Data members
00103     WT_AcceptMode       m_eAcceptMode;
00104     WT_Boolean          m_renderEntities;
00105     WT_Boolean          m_addExtents;
00106 };
00107 
00108 #endif // OVERPOST_HEADER
00109 // End of file.

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