gouraud_polytri.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 #if !defined GOURAUD_POLYTRI_HEADER
00019 #define GOURAUD_POLYTRI_HEADER
00020 
00024 
00025 #include "whiptk/whipcore.h"
00026 #include "whiptk/file.h"
00027 #include "whiptk/drawable.h"
00028 #include "whiptk/gouraud_pointset.h"
00029 
00030 
00035 
00036 
00040 class WHIPTK_API WT_Gouraud_Polytriangle : public WT_Drawable, public WT_Gouraud_Point_Set
00041 {
00042         friend class WT_W2D_Class_Factory;
00043         friend class WT_Opcode;
00044 
00045 public:
00046 
00048     WT_Gouraud_Polytriangle ()
00049     { }
00050 
00052     WT_Gouraud_Polytriangle(
00053         int                         count, 
00054         WT_Logical_Point const *    points, 
00055         WT_RGBA32 const *           colors, 
00056         WT_Boolean                  copy 
00057         ) throw(WT_Result)
00058         : WT_Gouraud_Point_Set(count, points, colors, copy)
00059     { }
00060 
00061         WT_Gouraud_Polytriangle(WT_Gouraud_Polytriangle const& polytri) throw(WT_Result)
00062         {
00063                 set(polytri.count(),polytri.points(),WD_True);
00064                 m_colors = new WT_RGBA32[polytri.count()];
00065         if (m_colors == NULL)
00066             throw WT_Result::Out_Of_Memory_Error;
00067         
00068         // set the allocated count.
00069         m_colors_allocated = polytri.count();
00070         WD_COPY_MEMORY((void *)polytri.colors(), polytri.count() * sizeof(WT_RGBA32), m_colors);
00071         }
00072 
00074     virtual ~WT_Gouraud_Polytriangle()
00075     { }
00076 public:
00077     // Mandatory WT_Object virtual methods
00078     WT_ID            object_id() const { return Gouraud_Polytriangle_ID;}
00079     WT_Result        serialize(WT_File & file) const;
00080     WT_Result        materialize(WT_Opcode const & opcode, WT_File & file);
00081     WT_Result        skip_operand(WT_Opcode const & opcode, WT_File & file);
00082     WT_Result        process(WT_File & file);
00083     virtual void     update_bounds(WT_File * file);
00084 
00086 
00088     static WT_Result default_process(
00089         WT_Gouraud_Polytriangle & item, 
00090         WT_File & file 
00091         );
00092 };
00094 
00095 #endif // GOURAUD_POLYTRI_HEADER

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