Constraint.h

00001 //***************************************************************************************
00002 //
00003 // File supervisor: Crosswalk team
00004 //
00005 // Copyright 2008 Autodesk, Inc.  All rights reserved.
00006 // Use of this software is subject to the terms of the Autodesk license agreement
00007 // provided at the time of installation or download, or which otherwise accompanies
00008 // this software in either electronic or hard copy form.
00009 //
00010 //***************************************************************************************
00011 
00012 #ifndef _CONSTRAINT_H
00013 #define _CONSTRAINT_H
00014 
00015 #include "Template.h"
00016 
00017 // Forward declaration
00018 class CSLModel;
00019 
00020 
00024 class XSIEXPORT CSLConstraint
00025     : public CSLTemplate
00026 {
00027 public:
00031     enum EConstraintType
00032     {
00033         SI_SCALING,         
00034         SI_ORIENTATION,     
00035         SI_DIRECTION,       
00036         SI_POSITION,        
00037         SI_INTEREST,        
00038         SI_UP_VECTOR,       
00039         SI_PREFERED_AXIS,   
00040     };
00041 
00048     CSLConstraint(CSLScene* in_pScene, CSLModel *in_pModel, CdotXSITemplate* in_pTemplate, EConstraintType in_ConstraintType);
00049 
00052     virtual ~CSLConstraint();
00053 
00057     CSLModel*               GetReference();
00058 
00062     EConstraintType         GetConstraintType();
00063 
00068     SI_Error                AddConstrainingObject(CSLModel* in_pConstrainingObject);
00069 
00073     SI_Int                  GetConstrainingObjectCount();
00074 
00078     CSLModel**              ConstrainingObjects();
00079 
00084     SI_Error                RemoveConstrainingObject(SI_Int in_nIndex);
00085 
00090     SI_Error                RemoveConstrainingObject(CSLModel* in_pConstrainingObject);
00091 
00095     SI_Error                ClearConstrainingObjects();
00096 
00100     CSLConstraint*          CreateUpVector();
00101 
00105     CSLConstraint*          UpVector();
00106 
00110     SI_Error                DestroyUpVector();
00111 
00112     // Connection functions
00117     CSLConstraint*          ConnectUpVector(CSLConstraint* in_pUpVector);
00118 
00123     CSLModel*               ConnectConstrainingObject(CSLModel* in_pModel);
00124 
00129     virtual SI_Error        Synchronize();
00130 
00134     virtual ETemplateType   Type() { return CSLTemplate::SI_CONSTRAINT; }
00135 
00136 private:
00137     CSLStrEnumProxy<EConstraintType, SI_PREFERED_AXIS>  m_ConstraintType;
00138     CSIBCArray<CSLModel *>  m_ConstrainingModels;
00139     CSLConstraint*          m_pUpVector;
00140 
00141     void *m_pReserved;  // reserved for future extension
00142 };
00143 
00144 #endif