dwginfo.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 
00019 #if !defined DWGINFO_HEADER
00020 #define DWGINFO_HEADER
00021 
00025 
00026 #include "whiptk/whipcore.h"
00027 #include "whiptk/timestamp.h"
00028 #include "whiptk/informational.h"
00029 #include "whiptk/named_view_list.h"
00030 #include "whiptk/units.h"
00031 
00032 #define WHIP_DRAWING_INFO_LIST\
00033     WHIP_DRAWING_INFO_MACRO(Author,author)\
00034     WHIP_DRAWING_INFO_MACRO(Comments,comments)\
00035     WHIP_DRAWING_INFO_MACRO(Copyright,copyright)\
00036     WHIP_DRAWING_INFO_MACRO(Creation_Time,creation_time)\
00037     WHIP_DRAWING_INFO_MACRO(Creator,creator)\
00038     WHIP_DRAWING_INFO_MACRO(Description,description)\
00039     WHIP_DRAWING_INFO_MACRO(Keywords,keywords)\
00040     WHIP_DRAWING_INFO_MACRO(Modification_Time,modification_time)\
00041     WHIP_DRAWING_INFO_MACRO(Named_View_List,named_view_list)\
00042     WHIP_DRAWING_INFO_MACRO(Source_Creation_Time,source_creation_time)\
00043     WHIP_DRAWING_INFO_MACRO(Source_Filename,source_filename)\
00044     WHIP_DRAWING_INFO_MACRO(Source_Modification_Time,source_modification_time)\
00045     WHIP_DRAWING_INFO_MACRO(Subject,subject)\
00046     WHIP_DRAWING_INFO_MACRO(Title,title)\
00047     WHIP_DRAWING_INFO_MACRO(Units,units)
00048 
00053 
00054 
00060 class WHIPTK_API WT_Drawing_Info
00061 {
00062     friend class WT_DWF_Header;
00063         friend class WT_Rendition;
00064         friend class WT_W2D_Class_Factory;
00065 
00066 protected:
00067     WT_Integer32    m_changed;
00068     int             m_major_revision;
00069     int             m_minor_revision;
00070 
00071     void set_major_revision(int rev)
00072     {
00073         m_major_revision = rev;
00074         m_changed = WD_True;
00075     }
00076 
00077     void set_minor_revision(int rev)
00078     {
00079         m_minor_revision = rev;
00080         m_changed = WD_True;
00081     }
00082 
00083 private:
00084     #define WHIP_DRAWING_INFO_MACRO(class_type, class_lower) \
00085         WT_##class_type            m_##class_lower;
00086         WHIP_DRAWING_INFO_LIST
00087     #undef WHIP_DRAWING_INFO_MACRO
00088 
00089 public:
00091     enum WT_Drawing_Info_Bits
00092     {
00093         Description_Bit                 = 0x00000001,
00094         Author_Bit                      = 0x00000002,
00095         Comments_Bit                    = 0x00000004,
00096         Creator_Bit                     = 0x00000008,
00097         Creation_Time_Bit               = 0x00000010,
00098         Modification_Time_Bit           = 0x00000020,
00099         Source_Filename_Bit             = 0x00000040,
00100         Source_Creation_Time_Bit        = 0x00000080,
00101         Source_Modification_Time_Bit    = 0x00000100,
00102         Named_View_List_Bit             = 0x00000200,
00103         Units_Bit                       = 0x00000400,
00104         Copyright_Bit                   = 0x00000800,
00105         Keywords_Bit                    = 0x00001000,
00106         Title_Bit                       = 0x00002000,
00107         Subject_Bit                     = 0x00004000
00108     };
00109 
00111     WT_Drawing_Info()
00112         : m_changed(0)
00113         , m_major_revision(0)
00114         , m_minor_revision(0)
00115     { }
00116 
00118     virtual ~WT_Drawing_Info()
00119     { }
00120 
00121     WT_Drawing_Info (WT_Drawing_Info const & other)
00122         : m_changed         (other.m_changed)
00123         , m_major_revision  (other.m_major_revision)
00124         , m_minor_revision  (other.m_minor_revision)
00125         #define WHIP_DRAWING_INFO_MACRO(class_type, class_lower) \
00126             , m_##class_lower (other.m_##class_lower)
00127             WHIP_DRAWING_INFO_LIST
00128         #undef WHIP_DRAWING_INFO_MACRO
00129     {  }
00130 
00131     WT_Drawing_Info & operator= (WT_Drawing_Info const & other)
00132     {
00133         m_changed         = other.m_changed;
00134         m_major_revision  = other.m_major_revision;
00135         m_minor_revision  = other.m_minor_revision;
00136         #define WHIP_DRAWING_INFO_MACRO(class_type, class_lower) \
00137             m_##class_lower = other.m_##class_lower;
00138             WHIP_DRAWING_INFO_LIST
00139         #undef WHIP_DRAWING_INFO_MACRO
00140 
00141         return *this;
00142     }
00143 
00145 
00147 
00155     int decimal_revision() const
00156     {    return (major_revision() * 100) + minor_revision();    }
00157 
00159 
00162     int major_revision() const
00163     {    return m_major_revision;    }
00164 
00166 
00169     int minor_revision() const
00170     {    return m_minor_revision;    }
00172 
00177     #define WHIP_DRAWING_INFO_MACRO(class_type, class_lower)\
00178         WT_##class_type const & class_lower() const  { return m_##class_lower; }
00179         WHIP_DRAWING_INFO_LIST
00180     #undef WHIP_DRAWING_INFO_MACRO
00181 
00182 
00187     #define WHIP_DRAWING_INFO_MACRO(class_type, class_lower)\
00188         WT_##class_type & class_lower() { m_changed |=  class_type##_Bit ; return m_##class_lower; }
00189         WHIP_DRAWING_INFO_LIST
00190     #undef WHIP_DRAWING_INFO_MACRO
00191 
00192 
00194 
00198     virtual WT_Result sync(WT_File & file);
00199 
00201 
00203     static WT_Result default_process(
00204         WT_Drawing_Info & item, 
00205         WT_File & file 
00206         );
00207 };
00208 
00210 
00211 #endif // DWGINFO_HEADER

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