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

rendopts.h

00001 //  Copyright (c) 1996-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 RENDOPTS_HEADER
00019 #define RENDOPTS_HEADER
00020 
00021 #include "whiptk/whipcore.h"
00022 #include "whiptk/backgrnd.h"
00023 #include "whiptk/view.h"
00024 #include "whiptk/plot_optimized.h"
00025 #include "whiptk/inked_area.h"
00026 #include "whiptk/penpat_options.h"
00027 
00028 #define WHIP_RENDERING_OPTION_LIST\
00029     WHIP_RENDERING_OPTION(Background,background)\
00030     WHIP_RENDERING_OPTION(Inked_Area,inked_area)\
00031     WHIP_RENDERING_OPTION(PenPat_Options,penpat_options)\
00032     WHIP_RENDERING_OPTION(Plot_Optimized,plot_optimized)\
00033     WHIP_RENDERING_OPTION(View,view)
00034 
00046 
00047 
00048 class WHIPTK_API WT_Rendering_Options
00049 {
00050 private:
00051 
00052     WT_Integer32            m_changed_flags;
00053 
00054 #define WHIP_RENDERING_OPTION(class_type, class_lower) \
00055     WT_##class_type            m_##class_lower;
00056     WHIP_RENDERING_OPTION_LIST
00057 #undef WHIP_RENDERING_OPTION
00058 
00059     WT_Result sync_parts(WT_File & file, WT_Integer32 needed);
00060 
00061 public:
00062 
00064     enum WT_Rendering_Option_Bits
00065     {
00066         // For speed's sake, these should be ordered from most oftenly changed
00067         // to least oftenly changed...
00068         View_Bit            = 0x00000001,
00069         Background_Bit      = 0x00000002,
00070         Plot_Optimized_Bit  = 0x00000004,
00071         Inked_Area_Bit      = 0x00000008,
00072         PenPat_Options_Bit  = 0x00000010
00073     };
00074 
00076 
00077     WT_Rendering_Options()
00078         : m_changed_flags(0)
00079     { }
00080 
00082     WT_Rendering_Options (WT_Rendering_Options const & other)
00083         : m_changed_flags     (other.m_changed_flags)
00084         #define WHIP_RENDERING_OPTION(class_name, class_lower) \
00085             , m_##class_lower (other.m_##class_lower)
00086             WHIP_RENDERING_OPTION_LIST
00087         #undef WHIP_RENDERING_OPTION
00088     { }
00090 
00092     WT_Rendering_Options & operator= (WT_Rendering_Options const & other)
00093     {
00094         m_changed_flags     = other.m_changed_flags;
00095 
00096         #define WHIP_RENDERING_OPTION(class_name, class_lower) \
00097             m_##class_lower = other.m_##class_lower;
00098             WHIP_RENDERING_OPTION_LIST
00099         #undef WHIP_RENDERING_OPTION
00100 
00101         return *this;
00102     }
00103 
00104 
00110     #define WHIP_RENDERING_OPTION(class_type, class_lower) \
00111         WT_##class_type const & class_lower() const  { return m_##class_lower; }
00112         WHIP_RENDERING_OPTION_LIST
00113     #undef WHIP_RENDERING_OPTION
00114 
00115 
00121     #define WHIP_RENDERING_OPTION(class_type, class_lower) \
00122         WT_##class_type & class_lower() { m_changed_flags |= class_type##_Bit; return m_##class_lower; }
00123         WHIP_RENDERING_OPTION_LIST
00124     #undef WHIP_RENDERING_OPTION
00125 
00126 
00128 
00132     WT_Result sync(WT_File & file)
00133     {
00134         if (m_changed_flags)
00135         {
00136             WT_Integer32    needed = m_changed_flags;
00137 
00138             m_changed_flags = 0;
00139             return sync_parts(file, needed);
00140         }
00141 
00142         return WT_Result::Success;
00143     }
00144 };
00145 
00147 
00148 #endif // RENDOPTS_HEADER

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