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

contour_set.h

00001 //  Copyright (c) 1997-1999 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 CONTOUR_SET_HEADER
00019 #define CONTOUR_SET_HEADER
00020 
00021 #include "whiptk/whipcore.h"
00022 #include "whiptk/file.h"
00023 #include "whiptk/drawable.h"
00024 #include "whiptk/pointset.h"
00025 
00030 
00031 
00037 class WHIPTK_API WT_Contour_Set : public WT_Drawable
00038 {
00039 protected:
00040 
00041     WT_Unsigned_Integer32   m_incarnation; 
00042     WT_Integer32            m_num_contours; 
00043     WT_Integer32 *          m_counts_list; 
00044     WT_Integer32            m_total_point_count; 
00045     WT_Boolean              m_local_copy; 
00046     WT_Boolean              m_local_copy_counts; 
00047     WT_Logical_Point *      m_points; 
00048     WT_Boolean              m_transformed; 
00049     WT_Boolean              m_relativized; 
00051 
00052     enum WT_Materialize_Stage
00053     {
00054         Getting_Num_Contours,
00055         Getting_Count_List,
00056         Getting_Points,
00057         Skipping_Close_Paren
00058     }                       m_stage;
00059 
00060     WT_Integer32            m_stage_item_counter; 
00063 public:
00064 
00066     WT_Contour_Set ()
00067         : m_incarnation(0xFFFFFFFFU)
00068         , m_num_contours(0)
00069         , m_counts_list (WD_Null)
00070         , m_total_point_count(0)
00071         , m_local_copy(WD_False)
00072         , m_points(WD_Null)
00073         , m_transformed(WD_False)
00074         , m_relativized(WD_False)
00075         , m_stage(Getting_Num_Contours)
00076         , m_stage_item_counter(0)
00077     { }
00078 
00080     WT_Contour_Set(
00081         WT_File &                   file, 
00082         WT_Integer32                contours, 
00083         WT_Integer32 const *        counts, 
00084         WT_Integer32                point_count, 
00085         WT_Logical_Point const *    points, 
00086         WT_Boolean                  copy 
00087         );
00088 
00090     WT_Contour_Set(
00091         WT_File &                   file, 
00092         WT_Integer32                point_count, 
00093         WT_Logical_Point const *    points 
00094         );
00095 
00097     WT_Contour_Set(
00098         WT_Contour_Set const &  source, 
00099         WT_Boolean              copy = WD_True 
00100         );
00101 
00103     ~WT_Contour_Set();
00104 
00106 
00107     WT_Integer32                contours() const    {   return m_num_contours;  }
00109     WT_Integer32 *              counts()   const    {   return m_counts_list;   }
00111     WT_Logical_Point const *    points()   const    {   return m_points;        }
00113     WT_Integer32                total_points() const{   return m_total_point_count; }
00115 
00117 
00118     void             de_relativize(WT_File & file);
00120     void             relativize(WT_File & file);
00122     void set(
00123         WT_Unsigned_Integer32       incarnation, 
00124         WT_Integer32                contours, 
00125         WT_Integer32 const *        counts, 
00126         WT_Integer32                point_count, 
00127         WT_Logical_Point const *    points, 
00128         WT_Boolean                  copy 
00129         );
00131     void             transform(WT_Transform const & transform);
00133     WT_Contour_Set const & operator=(WT_Contour_Set const & source);
00135 
00137 
00138     WT_Boolean       first_point_fits_in_16_bits() const;
00140     WT_Boolean       remaining_points_fit_in_16_bits() const;
00142     WT_Boolean  operator==(WT_Contour_Set const & other) const;
00144 
00146     WT_Result        materialize(WT_Opcode const & opcode, WT_File & file);
00148 
00153     WT_Result        materialize_16_bit(WT_File & file);
00155 
00160     WT_Result        materialize_32_bit(WT_File & file);
00161     WT_ID            object_id() const;
00162     WT_Result        process(WT_File & file);
00163     WT_Result        serialize(WT_File & file) const
00164     {   return serialize(file, WD_False);   }
00166 
00172     WT_Result        serialize(
00173         WT_File & file, 
00174         WT_Boolean embeded_in_another_opcode 
00175         ) const;
00177 
00179     WT_Result        skip_operand(WT_File & file);
00180     WT_Result        skip_operand(WT_Opcode const & opcode, WT_File & file);
00182 
00184     WT_Result        skip_operand_16_bit(WT_File & file);
00185     virtual void     update_bounds(WT_File * file);
00187 
00188 
00190 
00192     static WT_Result default_process(
00193         WT_Contour_Set & item, 
00194         WT_File & file 
00195         );
00196 
00197 };
00198 
00200 
00201 #endif // CONTOUR_SET_HEADER

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