Constraint.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 _CONSTRAINT_H
00025 #define _CONSTRAINT_H
00026 
00027 #include "Template.h"
00028 
00029 // Forward declaration
00030 class CSLModel;
00031 
00032 
00034 class XSIEXPORT CSLConstraint
00035     : public CSLTemplate
00036 {
00037 public:
00041     enum EConstraintType
00042     {
00043         SI_SCALING,         
00044         SI_ORIENTATION,     
00045         SI_DIRECTION,       
00046         SI_POSITION,        
00047         SI_INTEREST,        
00048         SI_UP_VECTOR,       
00049         SI_PREFERED_AXIS,   
00050     };
00051 
00058     CSLConstraint(CSLScene* in_pScene, CSLModel *in_pModel, CdotXSITemplate* in_pTemplate, EConstraintType in_ConstraintType);
00059 
00062     virtual ~CSLConstraint();
00063 
00067     CSLModel*               GetReference();
00068 
00072     EConstraintType         GetConstraintType();
00073 
00078     SI_Error                AddConstrainingObject(CSLModel* in_pConstrainingObject);
00079 
00083     SI_Int                  GetConstrainingObjectCount();
00084 
00088     CSLModel**              ConstrainingObjects();
00089 
00094     SI_Error                RemoveConstrainingObject(SI_Int in_nIndex);
00095 
00100     SI_Error                RemoveConstrainingObject(CSLModel* in_pConstrainingObject);
00101 
00105     SI_Error                ClearConstrainingObjects();
00106 
00110     CSLConstraint*          CreateUpVector();
00111 
00115     CSLConstraint*          UpVector();
00116 
00120     SI_Error                DestroyUpVector();
00121 
00122     // Connection functions
00127     CSLConstraint*          ConnectUpVector(CSLConstraint* in_pUpVector);
00128 
00133     CSLModel*               ConnectConstrainingObject(CSLModel* in_pModel);
00134 
00139     virtual SI_Error        Synchronize();
00140 
00144     virtual ETemplateType   Type() { return CSLTemplate::SI_CONSTRAINT; }
00145 
00146 private:
00147     CSLStrEnumProxy<EConstraintType, SI_PREFERED_AXIS>  m_ConstraintType;
00148     CSIBCArray<CSLModel *>  m_ConstrainingModels;
00149     CSLConstraint*          m_pUpVector;
00150 
00151     void *m_pReserved;  // reserved for future extension
00152 };
00153 
00154 #endif