NurbsSurface.h

00001 //***************************************************************************************
00002 //
00003 // File supervisor: Softimage 3D Games & 3D Bridge team
00004 //
00005 // (c) Copyright 2001-2002 Avid Technology, Inc. . All rights reserved.
00006 //
00007 //***************************************************************************************
00008 
00009 /****************************************************************************************
00010 THIS CODE IS PUBLISHED AS A SAMPLE ONLY AND IS PROVIDED "AS IS".
00011 IN NO EVENT SHALL SOFTIMAGE, AVID TECHNOLOGY, INC. AND/OR THEIR RESPECTIVE
00012 SUPPLIERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
00013 DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
00014 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
00015 CONNECTION WITH THE USE OR PERFORMANCE OF THIS CODE .
00016 
00017 COPYRIGHT NOTICE. Copyright © 1999-2002 Avid Technology Inc. . All rights reserved. 
00018 
00019 SOFTIMAGE is a registered trademark of Avid Technology Inc. or its subsidiaries 
00020 or divisions. Windows NT is a registered trademark of Microsoft Corp. All other
00021 trademarks contained herein are the property of their respective owners. 
00022 ****************************************************************************************/
00023 
00024 #ifndef _NURBSSURFACE_H
00025 #define _NURBSSURFACE_H
00026 
00027 #include "Geometry.h"
00028 
00029 
00030 #ifndef _SL_FLOAT_ARRAY_PROXY_EXPORT_
00031 #define _SL_FLOAT_ARRAY_PROXY_EXPORT_
00032 
00033 //XSITEMPLATEEXP template class XSIEXPORT CSLArrayProxy<SI_Float, SI_Float, 1>;
00034 //XSITEMPLATEEXP template class XSIEXPORT CSLArrayProxy<CSIBCVector4D, SI_Float, 4>;
00035 
00036 #endif // _SL_FLOAT_ARRAY_PROXY_EXPORT_
00037 
00038 class CSLNurbsProjection;
00039 class CSLNurbsTrim;
00040 
00041 
00043 class XSIEXPORT CSLNurbsSurface
00044     : public CSLGeometry
00045 {
00046 public:
00050     typedef CSLArrayProxy<SI_Float, SI_Float, 1>        CSLFloatArray;
00051 
00055     typedef CSLArrayProxy<CSIBCVector4D, SI_Float, 4>   CSLVector4DArray;
00056 
00060     enum EParametrizationType
00061     {
00062         SI_UNIFORM,         
00063         SI_NON_UNIFORM,     
00064         SI_CHORD_LENGTH,    
00065         SI_CENTRIPETAL,     
00066     };
00067 
00074     CSLNurbsSurface(CSLScene* in_pScene, CSLModel *in_pModel, CdotXSITemplate* in_pTemplate);
00075 
00078     virtual ~CSLNurbsSurface();
00079 
00083     virtual SI_Error        Fix();
00084 
00089     virtual SI_Error Synchronize();
00090 
00094     virtual ETemplateType   Type() { return SI_NURBS_SURFACE; }
00095 
00099     SI_Int                  GetUDegree();
00100 
00105     SI_Void                 SetUDegree(SI_Int in_nValue);
00106 
00110     SI_Int                  GetVDegree();
00111 
00116     SI_Void                 SetVDegree(SI_Int in_nValue);
00117 
00121     SI_Bool                 GetUClosedFlag();
00122 
00127     SI_Void                 SetUClosedFlag(SI_Bool in_nValue);
00128 
00132     SI_Bool                 GetVClosedFlag();
00133 
00138     SI_Void                 SetVClosedFlag(SI_Bool in_nValue);
00139 
00143     EParametrizationType    GetParametrization();
00144 
00149     SI_Void                 SetParametrization(EParametrizationType in_Type);
00150 
00154     SI_Int                  GetUKnotCount();
00155 
00159     CSLFloatArray*          GetUKnotList();
00160 
00164     SI_Float*               GetUKnotListPtr();
00165 
00169     SI_Int                  GetVKnotCount();
00170 
00174     CSLFloatArray*          GetVKnotList();
00175 
00179     SI_Float*               GetVKnotListPtr();
00180 
00184     SI_Int                  GetUControlPointCount();
00185 
00190     SI_Void                 SetUControlPointCount(SI_Int in_nValue);
00191 
00195     SI_Int                  GetVControlPointCount();
00196 
00201     SI_Void                 SetVControlPointCount(SI_Int in_nValue);
00202 
00206     SI_Int                  GetControlPointCount();
00207 
00211     CSLVector4DArray*       GetControlPointList();
00212 
00216     CSIBCVector4D*          GetControlPointListPtr();
00217 
00219     // Nurbs projection functionnality ////////////////////////////////////////
00221 
00226     CSLNurbsProjection* AddNurbsProjection();
00227 
00232     SI_Error RemoveNurbsProjection( SI_Int in_nIndex );
00233 
00238     SI_Error RemoveNurbsProjection( CSLNurbsProjection* in_pToRemove );
00239 
00243     SI_Error ClearNurbsProjections();
00244 
00249     CSLNurbsProjection* ConnectNurbsProjection( CSLNurbsProjection* in_pToConnect );
00250 
00255     CSLNurbsProjection** GetNurbsProjections();
00256 
00260     SI_Int GetNurbsProjectionCount();
00261 
00266     CSLNurbsProjection* FindNurbsProjection( SI_Char* in_szNurbsProjectionName );
00267 
00269     // Nurbs trim functionnality //////////////////////////////////////////////
00271 
00275     CSLNurbsTrim* AddNurbsTrim();
00276 
00282     SI_Error RemoveNurbsTrim( SI_Int in_nIndex );
00283 
00288     SI_Error RemoveNurbsTrim( CSLNurbsTrim* in_pToRemove );
00289 
00293     SI_Error ClearNurbsTrims();
00294 
00299     CSLNurbsTrim* ConnectNurbsTrim( CSLNurbsTrim* in_pToConnect );
00300 
00305     CSLNurbsTrim** GetNurbsTrims();
00306 
00310     SI_Int GetNurbsTrimCount();
00311 
00316     CSLNurbsTrim* FindNurbsTrim( SI_Char* in_szNurbsTrimName );
00317 
00318 private:
00319     CSLIntProxy             m_UDegree;
00320     CSLIntProxy             m_VDegree;
00321     CSLBoolProxy            m_UClosed;
00322     CSLBoolProxy            m_VClosed;
00323     CSLEnumProxy<EParametrizationType, SI_CENTRIPETAL>  m_Parametrization;
00324     CSLIntProxy             m_NbUControlPoints;
00325     CSLIntProxy             m_NbVControlPoints;
00326     CSLFloatArray           m_UKnots;
00327     CSLFloatArray           m_VKnots;
00328     CSLVector4DArray        m_ControlPoints;
00329     CSIBCArray<CSLNurbsProjection*> m_NurbsProjections;
00330     CSIBCArray<CSLNurbsTrim*> m_NurbsTrims;
00331 
00332     void *m_pReserved;  // reserved for future extension
00333 };
00334 
00335 #endif