Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

BOpcodeShell.h

00001 
00002 //
00003 // Copyright (c) 2000 by Tech Soft America, LLC.
00004 // The information contained herein is confidential and proprietary to
00005 // Tech Soft America, LLC., and considered a trade secret as defined under
00006 // civil and criminal statutes.  Tech Soft America shall pursue its civil
00007 // and criminal remedies in the event of unauthorized use or misappropriation
00008 // of its trade secrets.  Use of this information by anyone other than
00009 // authorized employees of Tech Soft America, LLC. is granted only under a
00010 // written non-disclosure agreement, expressly prescribing the scope and
00011 // manner of such use.
00012 //
00013 //
00014 //  Copyright (c) 1996-2005 by Autodesk, Inc.
00015 //
00016 //  By using this code, you are agreeing to the terms and conditions of
00017 //  the License Agreement included in the documentation for this code.
00018 //
00019 //  AUTODESK MAKES NO WARRANTIES, EXPRESS OR IMPLIED,
00020 //  AS TO THE CORRECTNESS OF THIS CODE OR ANY DERIVATIVE
00021 //  WORKS WHICH INCORPORATE IT.
00022 //
00023 //  AUTODESK PROVIDES THE CODE ON AN "AS-IS" BASIS
00024 //  AND EXPLICITLY DISCLAIMS ANY LIABILITY, INCLUDING
00025 //  CONSEQUENTIAL AND INCIDENTAL DAMAGES FOR ERRORS,
00026 //  OMISSIONS, AND OTHER PROBLEMS IN THE CODE.
00027 //
00028 //  Use, duplication, or disclosure by the U.S. Government is subject to
00029 //  restrictions set forth in FAR 52.227-19 (Commercial Computer Software
00030 //  Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) (Rights in Technical
00031 //  Data and Computer Software), as applicable.
00032 //
00033 // $Header: /Components/Internal/DWF Toolkit/v7.0.1/develop/global/src/dwf/w3dtk/BOpcodeShell.h 3     5/10/05 1:01a Evansg $
00034 //
00035 
00036 #ifndef BBINFILETK_SHELL
00037 #define BBINFILETK_SHELL
00038 
00039 #include "dwf/w3dtk/BOpcodeHandler.h"
00040 #include "dwf/w3dtk/BPolyhedron.h"
00041 
00042 
00043 
00045 
00051 class BBINFILETK_API TK_Shell : public TK_Polyhedron {
00052     private:
00053         TK_Shell(const TK_Shell&);
00054         TK_Shell& operator=(const TK_Shell&);
00055 
00056     private:
00057         virtual TK_Status read_advanced (BStreamFileToolkit & tk) alter;
00058         virtual TK_Status read_uncompressed_points (BStreamFileToolkit & tk) alter;
00059         virtual TK_Status read_uncompressed_faces (BStreamFileToolkit & tk) alter;
00060         virtual TK_Status read_bounding (BStreamFileToolkit & tk) alter;
00061 
00062         virtual TK_Status compute_advanced (BStreamFileToolkit & tk) alter;
00063         virtual TK_Status write_advanced (BStreamFileToolkit & tk) alter;
00064         virtual TK_Status write_uncompressed_points (BStreamFileToolkit & tk) alter;
00065         virtual TK_Status write_uncompressed_faces (BStreamFileToolkit & tk) alter;
00066         virtual TK_Status write_bounding (BStreamFileToolkit & tk) alter;
00067         TK_Status write_null (BStreamFileToolkit & tk) alter;
00068 
00069     public:
00070         int             m_substage;     
00071         unsigned char   m_compression_scheme; 
00072         int             m_flistlen;      
00073         int             *m_flist;        
00074         char            m_lodlevel;      
00114         TK_Status SetFaces( int length, int const *face_list = 0 ) alter;
00116         TK_Status SetLodLevel( int level ) alter { m_lodlevel = (char)level; return TK_Normal; };
00118         int const *GetFaces() const { return m_flist; };
00120         int GetFacesLength() const { return m_flistlen; };
00122         int GetLodLevel() const { return m_lodlevel; };
00123 
00127         virtual void serialize( const void* pTag = NULL )
00128             throw( DWFException );
00129 
00148         void optimize( bool    bOptimize = true,
00149                        double  nVertexTolerance = 0.0,
00150                        double  nVertexNormalsTolerance = 0.0,
00151                        double  nTextureParametersTolerance = 0.0 )
00152         {
00153             _bOptimizeThisShell = bOptimize;
00154             _nOptimizeVertexTolerance = nVertexTolerance;
00155             _nOptimizeVertexNormalsTolerance = nVertexNormalsTolerance;
00156             _nOptimizeTextureParametersTolerance = nTextureParametersTolerance;
00157         }
00158 
00159 
00160     public:
00161         TK_Shell ();
00162         ~TK_Shell ();
00163 
00165         void    set_flist (int count, int const * list = 0) alter { SetFaces( count, list ); };
00166 
00167         TK_Status   Read (BStreamFileToolkit & tk) alter;
00168         TK_Status   Write (BStreamFileToolkit & tk) alter;
00169         void        Reset (void) alter;
00170 
00171     private:
00172 
00173         void _optimizeThisShell()
00174             throw( DWFException );
00175 
00176         void _optimizeVertexNormals();
00177 
00178     private:
00179 
00180         bool    _bOptimizeThisShell;
00181         double  _nOptimizeVertexTolerance;
00182         double  _nOptimizeVertexNormalsTolerance;
00183         double  _nOptimizeTextureParametersTolerance;
00184 
00185 }; //end declaration of class TK_Shell
00186 
00187 
00188 
00189 /*
00190  * SOME UTILITY MACROS
00191  */
00192 #define SEMI_PROTECT(x) do {x} while (0)
00193 
00194 //warning: implicitly references the BStreamFileToolkit &, tk
00195 #define ENSURE_ALLOCATED(var,type,count) SEMI_PROTECT( \
00196     delete [] (var); \
00197     (var) = new type[(count)]; \
00198     if( (var) == 0 ) \
00199         return tk.Error(); \
00200 )
00201 
00202 //warning: implicitly references the BStreamFileToolkit &, tk
00203 #define ENSURE_ALLOCATED_CLEAR(var,type,count) SEMI_PROTECT( \
00204     delete [] (var); \
00205     (var) = new type[(count)]; \
00206     if( (var) == 0 ) \
00207         return tk.Error(); \
00208     memset (var, 0, (count) * sizeof(type)); \
00209 )
00210 
00211 #endif

Generated on Tue May 17 12:06:00 2005 for Autodesk DWF 3D Toolkit by  doxygen 1.4.1