00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __DOP_FullPathData_h__
00019 #define __DOP_FullPathData_h__
00020
00021 #include "DOP_API.h"
00022 #include <UT/UT_RefArray.h>
00023 #include <UT/UT_String.h>
00024 #include <OP/OP_Node.h>
00025 #include "DOP_Engine.h"
00026
00027 class UT_WorkBuffer;
00028 class UT_StringArray;
00029 class GU_ConstDetailHandle;
00030 class SIM_Data;
00031 class SIM_Object;
00032 class SIM_ConstObjectArray;
00033 class SIM_SDF;
00034 class OP_Context;
00035 class OP_GlobContext;
00036 class DOP_Parent;
00037 class DOP_SimulationChangeSink;
00038
00039 class DOP_API DOP_FullPathData
00040 {
00041 public:
00042 DOP_FullPathData()
00043 {
00044 myNode = 0;
00045 myParent = 0;
00046 myRootData = 0;
00047 myData = 0;
00048 myDataName = "";
00049 }
00050 DOP_FullPathData(const DOP_FullPathData &src)
00051 {
00052 *this = src;
00053 }
00054 ~DOP_FullPathData()
00055 {
00056 }
00057
00058 const SIM_Position *getBestPosition() const
00059 {
00060 const SIM_Position *position = 0;
00061 const SIM_Object *obj;
00062
00063
00064 obj = SIM_DATA_CASTCONST(myRootData, SIM_Object);
00065
00066
00067 if( myData )
00068 position = SIM_DATA_CASTCONST(myData,
00069 SIM_Position);
00070
00071 if( !position && obj && obj == myData )
00072 position = obj->getPosition();
00073
00074
00075 if( !position && obj )
00076 position = obj->
00077 getPositionForGeometry(myDataName);
00078
00079 if (!position && obj &&
00080 SIM_DATA_CASTCONST(myData, SIM_SDF))
00081 {
00082 UT_String geopath, sdfname;
00083 myDataName.splitPath(geopath, sdfname);
00084 position = obj->
00085 getPositionForGeometry(geopath);
00086 }
00087
00088 return position;
00089 }
00090
00091 bool operator==(const DOP_FullPathData &cmp)
00092 {
00093 return ((myNode == cmp.myNode) &&
00094 (myParent == cmp.myParent) &&
00095 (myRootData == cmp.myRootData) &&
00096 (myData == cmp.myData) &&
00097 (myDataName == cmp.myDataName));
00098 }
00099
00100 const DOP_FullPathData &operator=(const DOP_FullPathData &src)
00101 {
00102 myNode = src.myNode;
00103 myParent = src.myParent;
00104 myRootData = src.myRootData;
00105 myData = src.myData;
00106 myDataName.harden(src.myDataName);
00107
00108 return *this;
00109 }
00110
00111 void clear()
00112 {
00113 myNode = 0;
00114 myParent = 0;
00115 myRootData = 0;
00116 myData = 0;
00117 myDataName = "";
00118 }
00119
00120 OP_Node *myNode;
00121 const DOP_Parent *myParent;
00122 const SIM_RootData *myRootData;
00123 const SIM_Data *myData;
00124 UT_String myDataName;
00125 };
00126
00127 class DOP_API DOP_FullPathDataArray : public UT_RefArray<DOP_FullPathData>
00128 {
00129 public:
00130 DOP_FullPathDataArray();
00131 virtual ~DOP_FullPathDataArray();
00132
00133 void buildFromPaths(const UT_StringArray &paths);
00134 void getObjectArray(SIM_ConstObjectArray &objects) const;
00135 void getObjectString(UT_WorkBuffer &buffer) const;
00136 };
00137
00138 DOP_API bool DOPfindDataFromPath(const char *path,
00139 DOP_FullPathData &fulldata,
00140 fpreal time, OP_Node *relativetonode = 0,
00141 bool dopparentisenough = false);
00142 DOP_API bool DOPfindAllDataFromPath(const char *path,
00143 DOP_FullPathDataArray &fulldata,
00144 fpreal time, OP_Node *relativetonode = 0,
00145 bool dopparentisenough = false);
00146 DOP_API void DOPglobPathAndFindAllData(const char *path,
00147 DOP_FullPathDataArray &fulldata,
00148 OP_NodeList &nodatadopnets,
00149 fpreal time, OP_Node *relativetonode = 0,
00150 OP_GlobContext *context = 0);
00151
00152
00153
00154
00155
00156
00157
00158
00159 DOP_API SIM_Time DOPsetBestTime(DOP_Parent *dopparent, SIM_Time time);
00160
00161
00162
00163
00164
00165
00166 DOP_API OP_Node * DOPgetNodeFromDataPath(
00167 const char *path,
00168 fpreal time, OP_Node *relativetonode = 0,
00169 bool dopparentisenough = false);
00170
00171
00172
00173
00174 DOP_API bool DOPgetWorldTransformFromDataPath(
00175 UT_DMatrix4 &xform,
00176 GU_ConstDetailHandle *gdh,
00177 bool &timedep,
00178 const char *path,
00179 OP_Context &context,
00180 OP_Node *relativetonode = 0,
00181 bool dopparentisenough = false,
00182 OP_Node *interested_node = 0);
00183
00184
00185
00186 #endif
00187