00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __GAS_Lookup__
00020 #define __GAS_Lookup__
00021
00022 #include "GAS_API.h"
00023
00024 #include <UT/UT_ThreadedAlgorithm.h>
00025 #include <UT/UT_VoxelArray.h>
00026 #include <GU/GU_Detail.h>
00027
00028 #include <SIM/SIM_RawField.h>
00029
00030 #include "GAS_SubSolver.h"
00031 #include "GAS_Utils.h"
00032
00033 class GU_Detail;
00034 class UT_Vector4Array;
00035
00036 class GAS_API GAS_Lookup : public GAS_SubSolver
00037 {
00038 public:
00039 bool shouldMultiThread(UT_VoxelArrayF *field) const
00040 { return field->numTiles() > 1; }
00041
00042 protected:
00043 explicit GAS_Lookup(const SIM_DataFactory *factory);
00044 virtual ~GAS_Lookup();
00045
00046
00047
00048 virtual bool solveGasSubclass(SIM_Engine &engine,
00049 SIM_Object *obj,
00050 SIM_Time time,
00051 SIM_Time timestep);
00052
00053 void doLookup(SIM_RawField *dstfield,
00054 const SIM_VectorField *posfield,
00055 const SIM_RawField *srcfield);
00056
00057 THREADED_METHOD3_CONST(GAS_Lookup, shouldMultiThread(dstfield->field()),
00058 lookup,
00059 SIM_RawField *, dstfield,
00060 const SIM_VectorField *, posfield,
00061 const SIM_RawField *, srcfield);
00062 void lookupPartial(SIM_RawField *dstfield,
00063 const SIM_VectorField *posfield,
00064 const SIM_RawField *srcfield,
00065 const UT_JobInfo &jobinfo) const;
00066
00067 private:
00068 static const SIM_DopDescription *getDopDescription();
00069
00070 DECLARE_STANDARD_GETCASTTOTYPE();
00071 DECLARE_DATAFACTORY(GAS_Lookup,
00072 GAS_SubSolver,
00073 "Gas Lookup",
00074 getDopDescription());
00075 };
00076
00077 #endif