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

gouraud_pointset.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 GOURAUD_POINTSET_HEADER
00019 #define GOURAUD_POINTSET_HEADER
00020 
00021 #include "whiptk/pointset.h"
00022 
00023 class WT_File;
00024 
00026 class WHIPTK_API WT_Gouraud_Point_Set : public WT_Point_Set
00027 {
00028 
00029 protected:
00030     WT_RGBA32 *                 m_colors; 
00031     WT_Integer32                m_colors_allocated; 
00033 
00034     enum {
00035         Materialize,
00036         Skip
00037     }                           m_read_mode;
00038 
00040     enum {
00041         Getting_Count,
00042         Getting_Point,
00043         Getting_Color,
00044         Getting_Close_Paren
00045     }                           m_stage;
00046 
00047 public:
00048 
00050     WT_Gouraud_Point_Set()
00051         : WT_Point_Set ()
00052         , m_colors (WD_Null)
00053         , m_colors_allocated(0)
00054         , m_read_mode (Materialize)
00055         , m_stage (Getting_Count)
00056     {
00057         m_points_materialized  = 0; //inherited members cannot go in member initialization above
00058     }
00059 
00061     WT_Gouraud_Point_Set(
00062         int                         count, 
00063         WT_Logical_Point const *    points, 
00064         WT_RGBA32 const *           colors, 
00065         WT_Boolean                  copy 
00066         );
00067 
00069     ~WT_Gouraud_Point_Set();
00070 
00072     WT_RGBA32 * colors() const
00073     {
00074         return m_colors;
00075     }
00076 
00078 
00084     virtual WT_Result   serialize(WT_File &  file, 
00085                                   WT_String  opcode_ascii, 
00086                                   WT_Byte    opcode_32bit, 
00087                                   WT_Byte    opcode_16bit 
00088                                   ) const;
00089 
00090     // WT_Point_Set virtual methods
00091     WT_Result    materialize(WT_File & file);
00092     WT_Result    materialize_ascii(WT_File & file);
00093     WT_Result    materialize_16_bit(WT_File & file);
00094     WT_Result    skip_operand(WT_File & file);
00095     WT_Result    skip_operand_16_bit(WT_File & file);
00096     WT_Result    skip_operand_ascii(WT_File & file);
00097 
00098 private:
00099     WT_Result    read_pointset(WT_File & file);
00100     WT_Result    read_pointset_16_bit(WT_File & file);
00101     WT_Result    read_pointset_ascii(WT_File & file);
00102 
00103     WT_Gouraud_Point_Set (WT_Gouraud_Point_Set const &)
00104       : WT_Point_Set ()
00105       , m_colors ()
00106       , m_colors_allocated(0)
00107       , m_read_mode (Materialize)
00108       , m_stage (Getting_Count)
00109     {
00110         WD_Complain ("cannot copy WT_Gouraud_Point_Set");
00111     } // prohibited
00112 
00113     WT_Gouraud_Point_Set & operator= (WT_Gouraud_Point_Set const &)
00114     {
00115         WD_Complain ("cannot assign WT_Gouraud_Point_Set");
00116         return *this;
00117     } // prohibited
00118 };
00119 
00120 #endif // GOURAUD_POINTSET_HEADER

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