00001
00002
00012
00013
00014 #ifndef _CONSTRAINT_H
00015 #define _CONSTRAINT_H
00016
00017 #include "Template.h"
00018
00019
00020 class CSLModel;
00021
00022
00028 class XSIEXPORT CSLConstraint
00029 : public CSLTemplate
00030 {
00031 public:
00034 enum EConstraintType
00035 {
00036 SI_SCALING,
00037 SI_ORIENTATION,
00038 SI_DIRECTION,
00039 SI_POSITION,
00040 SI_INTEREST,
00041 SI_UP_VECTOR,
00042 SI_PREFERED_AXIS,
00043 };
00044
00052 CSLConstraint(CSLScene* in_pScene, CSLModel *in_pModel, CdotXSITemplate* in_pTemplate, EConstraintType in_ConstraintType);
00053
00056 virtual ~CSLConstraint();
00057
00061 CSLModel* GetReference();
00062
00066 EConstraintType GetConstraintType();
00067
00072 SI_Error AddConstrainingObject(CSLModel* in_pConstrainingObject);
00073
00077 SI_Int GetConstrainingObjectCount();
00078
00082 CSLModel** ConstrainingObjects();
00083
00088 SI_Error RemoveConstrainingObject(SI_Int in_nIndex);
00089
00094 SI_Error RemoveConstrainingObject(CSLModel* in_pConstrainingObject);
00095
00099 SI_Error ClearConstrainingObjects();
00100
00104 CSLConstraint* CreateUpVector();
00105
00109 CSLConstraint* UpVector();
00110
00114 SI_Error DestroyUpVector();
00115
00116
00121 CSLConstraint* ConnectUpVector(CSLConstraint* in_pUpVector);
00122
00127 CSLModel* ConnectConstrainingObject(CSLModel* in_pModel);
00128
00132 virtual SI_Error Synchronize();
00133
00137 virtual ETemplateType Type() { return CSLTemplate::SI_CONSTRAINT; }
00138
00139 private:
00140 CSLStrEnumProxy<EConstraintType, SI_PREFERED_AXIS> m_ConstraintType;
00141 CSIBCArray<CSLModel *> m_ConstrainingModels;
00142 CSLConstraint* m_pUpVector;
00143
00144 void *m_pReserved;
00145 };
00146
00147 #endif