contour_set.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 CONTOUR_SET_HEADER
00020 #define CONTOUR_SET_HEADER
00021 
00025 
00026 #include "whiptk/whipcore.h"
00027 #include "whiptk/file.h"
00028 #include "whiptk/drawable.h"
00029 #include "whiptk/pointset.h"
00030 
00035 
00036 
00041 class WHIPTK_API WT_Contour_Set : public WT_Drawable
00042 {
00043         friend class WT_W2D_Class_Factory;
00044         friend class WT_Viewport;
00045         friend class WT_Opcode;
00046 
00047 protected:
00048 
00049     WT_Unsigned_Integer32   m_incarnation; 
00050     WT_Integer32            m_num_contours; 
00051     WT_Integer32 *          m_counts_list; 
00052     WT_Integer32            m_total_point_count; 
00053     WT_Boolean              m_local_copy; 
00054     WT_Boolean              m_local_copy_counts; 
00055     WT_Logical_Point *      m_points; 
00056     WT_Boolean              m_transformed; 
00057     WT_Boolean              m_relativized; 
00059 
00060     enum WT_Materialize_Stage
00061     {
00062         Getting_Num_Contours,
00063         Getting_Count_List,
00064         Getting_Points,
00065         Skipping_Close_Paren
00066     }                       m_stage;
00067 
00068     WT_Integer32            m_stage_item_counter; 
00071 public:
00072 
00074     WT_Contour_Set ()
00075         : m_incarnation(0xFFFFFFFFU)
00076         , m_num_contours(0)
00077         , m_counts_list (WD_Null)
00078         , m_total_point_count(0)
00079         , m_local_copy(WD_False)
00080         , m_local_copy_counts(WD_False)
00081         , m_points(WD_Null)
00082         , m_transformed(WD_False)
00083         , m_relativized(WD_False)
00084         , m_stage(Getting_Num_Contours)
00085         , m_stage_item_counter(0)
00086     { }
00087 
00089     WT_Contour_Set(
00090         WT_File &                   file, 
00091         WT_Integer32                contours, 
00092         WT_Integer32 const *        counts, 
00093         WT_Integer32                point_count, 
00094         WT_Logical_Point const *    points, 
00095         WT_Boolean                  copy 
00096         ) throw(WT_Result);
00097 
00099     WT_Contour_Set(
00100         WT_File &                   file, 
00101         WT_Integer32                point_count, 
00102         WT_Logical_Point const *    points 
00103         ) throw(WT_Result);
00104 
00106     WT_Contour_Set(
00107         WT_Contour_Set const &  source, 
00108         WT_Boolean              copy = WD_True 
00109         ) throw(WT_Result);
00110 
00112     virtual ~WT_Contour_Set();
00113 
00115     virtual WT_Contour_Set* copy(
00116         WT_Boolean              copy = WD_True 
00117         ) const;
00118 
00119 public:
00121 
00122     WT_Integer32 const&        contours() const    {   return m_num_contours;  }
00123     WT_Integer32&              contours()          {   return m_num_contours;  }
00125     WT_Integer32 *              counts()   const    {   return m_counts_list;   }
00127     WT_Logical_Point const *    points()   const    {   return m_points;        }
00129     WT_Integer32 const&         total_points() const{   return m_total_point_count; }
00130     WT_Integer32&               total_points()      {   return m_total_point_count; }
00132 
00134 
00135     virtual WT_Result             de_relativize(WT_File & file);
00137     virtual WT_Result             relativize(WT_File & file);
00139     WT_Result set(
00140         WT_Unsigned_Integer32       incarnation, 
00141         WT_Integer32                contours, 
00142         WT_Integer32 const *        counts, 
00143         WT_Integer32                point_count, 
00144         WT_Logical_Point const *    points, 
00145         WT_Boolean                  copy 
00146         );
00148     WT_Result             transform(WT_Transform const & transform);
00150     WT_Contour_Set const & operator=(WT_Contour_Set const & source) throw(WT_Result);
00152 
00154 
00155     WT_Boolean       first_point_fits_in_16_bits() const;
00157     WT_Boolean       remaining_points_fit_in_16_bits() const;
00159     WT_Boolean  operator==(WT_Contour_Set const & other) const;
00161 
00163     WT_Result        materialize(WT_Opcode const & opcode, WT_File & file);
00165 
00170     WT_Result        materialize_16_bit(WT_File & file);
00172 
00177     WT_Result        materialize_32_bit(WT_File & file);
00178     WT_ID            object_id() const;
00179     WT_Result        process(WT_File & file);
00180     WT_Result        serialize(WT_File & file) const
00181     {   return serialize(file, WD_False);   }
00183 
00189     WT_Result        serialize(
00190         WT_File & file, 
00191         WT_Boolean embeded_in_another_opcode 
00192         ) const;
00194 
00196     WT_Result        skip_operand(WT_File & file);
00197     WT_Result        skip_operand(WT_Opcode const & opcode, WT_File & file);
00199 
00201     WT_Result        skip_operand_16_bit(WT_File & file);
00202     virtual void     update_bounds(WT_File * file);
00204 
00205 
00207 
00209     static WT_Result default_process(
00210         WT_Contour_Set & item, 
00211         WT_File & file 
00212         );
00213 
00214 };
00215 
00217 
00218 #endif // CONTOUR_SET_HEADER

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