pointset.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 POINTSET_HEADER
00020 #define POINTSET_HEADER
00021 
00025 
00026 #include "whiptk/whipcore.h"
00027 
00028 class WT_File;
00029 
00031 class WHIPTK_API WT_Point_Set_Data
00032 {
00033 protected:
00034     WT_Integer32                m_count;  
00035     WT_Integer32                m_allocated; 
00036     WT_Logical_Point *          m_points; 
00037     WT_Boolean                  m_transformed; 
00038     WT_Boolean                  m_relativized; 
00039     int                         m_points_materialized; 
00041 private:
00042     WT_Point_Set_Data (WT_Point_Set_Data const &)
00043       : m_count (0)
00044       , m_allocated (0)
00045       , m_points (WD_Null)
00046       , m_transformed(WD_False)
00047       , m_relativized(WD_False)
00048       , m_points_materialized (0)
00049     {
00050         WD_Complain ("cannot copy WT_Point_Set_Data");
00051     } // prohibited
00052 
00053     WT_Point_Set_Data & operator= (WT_Point_Set_Data const &)
00054     {
00055         WD_Complain ("cannot assign WT_Point_Set_Data");
00056         return *this;
00057     } // prohibited
00058 
00059 public:
00060 
00062 
00063     WT_Point_Set_Data()
00064         : m_count (0)
00065         , m_allocated (0)
00066         , m_points (WD_Null)
00067         , m_transformed(WD_False)
00068         , m_relativized(WD_False)
00069     { }
00070 
00072 
00079     WT_Point_Set_Data(
00080         int                         count, 
00081         WT_Logical_Point const *    points, 
00082         WT_Boolean                  copy 
00083         ) throw(WT_Result);
00084 
00086     virtual ~WT_Point_Set_Data();
00087 
00089 
00090 
00092 
00093 
00094     WT_Logical_Point * points() const
00095     {
00096         return m_points;
00097     }
00099 
00101 
00102 
00103     int allocated() const
00104     {
00105         return m_allocated;
00106     }
00107 
00110     void clear();
00111 
00114     int count() const
00115     {
00116         return m_count;
00117     }
00118 
00120     virtual WT_Boolean first_point_fits_in_16_bits() const;
00121 
00123     virtual WT_Boolean remaining_points_fit_in_16_bits() const;
00124 
00126     virtual WT_Boolean operator== (WT_Point_Set_Data const & set) const;
00128 
00129 
00131 
00132     virtual WT_Result de_relativize(WT_File & file);
00134     virtual WT_Result relativize(WT_File & file);
00136     virtual WT_Point_Set_Data const & set(
00137         int                         count, 
00138         WT_Logical_Point const *    points, 
00139         WT_Boolean                  copy 
00140         ) throw(WT_Result);
00141 
00143     virtual WT_Result transform(WT_Transform const & transform);
00145 
00146 };
00147 
00149 class WHIPTK_API WT_Point_Set : public WT_Point_Set_Data
00150 {
00151     friend class WT_W2D_Class_Factory;
00152     friend class WT_Viewport;
00153     
00154 protected:
00155     int                         m_points_materialized; 
00157 private:
00158     WT_Point_Set (WT_Point_Set const &)
00159     {
00160         WD_Complain ("cannot copy WT_Point_Set");
00161     } // prohibited
00162 
00163     WT_Point_Set & operator= (WT_Point_Set const &)
00164     {
00165         WD_Complain ("cannot assign WT_Point_Set");
00166         return *this;
00167     } // prohibited
00168 
00169 public:
00170 
00172 
00173     WT_Point_Set()
00174         : m_points_materialized (0)
00175     { }
00176 
00178 
00185     WT_Point_Set(
00186         int                         count, 
00187         WT_Logical_Point const *    points, 
00188         WT_Boolean                  copy 
00189         ) throw(WT_Result)
00190     : WT_Point_Set_Data( count, points, copy)
00191     { }
00192 
00193 public:
00194 
00196     virtual ~WT_Point_Set();
00198 
00200     virtual void clear();
00201 
00203 
00204 
00209     virtual WT_Result   materialize(WT_File & file);
00210 
00212 
00218     virtual WT_Result   materialize_ascii(WT_File & file);
00219 
00221 
00226     virtual WT_Result   materialize_16_bit(WT_File & file);
00227 
00229 
00235     virtual WT_Result serialize(WT_File &  file, 
00236                                   WT_Byte    opcode_ascii, 
00237                                   WT_Byte    opcode_32bit, 
00238                                   WT_Byte    opcode_16bit 
00239                                   ) const;
00240 
00242 
00244     virtual WT_Result   skip_operand(WT_File & file);
00245 
00247 
00249     virtual WT_Result   skip_operand_ascii(WT_File & file);
00250 
00252 
00254     virtual WT_Result   skip_operand_16_bit(WT_File & file);
00256 
00257 };
00258 
00259 
00260 #endif // POINTSET_HEADER

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