xsi_meshbuilder.h
Go to the documentation of this file.
00001 //*****************************************************************************
00011 //*****************************************************************************
00012 
00013 #if (_MSC_VER > 1000) || defined(SGI_COMPILER)
00014 #pragma once
00015 #endif
00016 
00017 #ifndef __XSIMESHBUILDER_H__
00018 #define __XSIMESHBUILDER_H__
00019 
00020 #include <xsi_base.h>
00021 #include <xsi_value.h>
00022 #include <xsi_status.h>
00023 #include <xsi_longarray.h>
00024 
00025 #ifdef _MSC_VER
00026 #pragma warning(disable:4251)
00027 #endif
00028 
00029 namespace XSI {
00030 
00031 //*****************************************************************************
00113 //*****************************************************************************
00114 
00115 class SICPPSDKDECL CMeshBuilder : public CBase
00116 {
00117 public:
00118 
00119     //*************************************************************************
00127     //*************************************************************************
00128 
00129     class SICPPSDKDECL CErrorDescriptor : public CStatus
00130     {
00131         public:
00132 
00136         CErrorDescriptor(CStatus::Code in_code);
00137 
00140         ~CErrorDescriptor();
00141 
00145         CLongArray m_polygonIndices;
00146 
00150         CLongArray m_vertexIndices;
00151 
00155         CLongArray m_edgeIndices;
00156 
00160         CLongArray m_nodeIndices;
00161     };
00162 
00164     CMeshBuilder();
00165 
00167     ~CMeshBuilder();
00168 
00172     CMeshBuilder(const CRef& in_ref);
00173 
00177     CMeshBuilder(const CMeshBuilder& in_obj);
00178 
00183     bool IsA( siClassID in_ClassID) const;
00184 
00188     siClassID GetClassID() const;
00189 
00195     CMeshBuilder& operator=(const CMeshBuilder& in_obj);
00196 
00202     CMeshBuilder& operator=(const CRef& in_ref);
00203 
00214     CStatus AddVertices( LONG in_nVertices, const double* in_pPos=0 );
00215 
00288     CStatus SetVertexPositions( LONG in_nVertices, const double* in_pPos, LONG in_nOffset=0 );
00289 
00303     CStatus AddPolygons(
00304         LONG in_nPolygons,
00305         const LONG* in_pPolyVertexCounts,
00306         const LONG* in_pVtxIndices );
00307 
00317     CStatus AddTriangles( LONG in_nTriangles, const LONG* in_pVtxIndices );
00318 
00326     CStatus SetEdgeCreaseValue( LONG in_nPolyID, LONG in_nPolyEdgeIndex, float in_value );
00327 
00335     CStatus SetHardEdge( LONG in_nPolyID, LONG in_nPolyEdgeIndex, bool in_bFlag=true );
00336 
00342     CStatus SetVertexCreaseValue( LONG in_nVtxID, float in_value );
00343 
00455     CStatus SetPolygonsMaterial(
00456         const CRef& in_refMat,
00457         LONG        in_nSize,
00458         const LONG* in_pPolyIndices );
00459 
00493     CStatus SetPolygonsMaterial(
00494         const CRef& in_refMat,
00495         LONG in_nSize,
00496         const LONG* in_pPolyIndices,
00497         CString& io_clsName );
00498 
00515     CErrorDescriptor Build(bool in_bUndoRequired);
00516 
00517     private:
00518     CMeshBuilder * operator&() const;
00519     CMeshBuilder * operator&();
00520 };
00521 
00522 };
00523 
00524 #endif // __XSIMESHBUILDER_H__