00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _MoMeshPointProbe_H
00024 #define _MoMeshPointProbe_H
00025
00026 #include <MeshVizXLM/mapping/nodes/MoActionNode.h>
00027 #include <MeshVizXLM/extrmesh/data/MeXDataSetI.h>
00028
00029 #include <Inventor/fields/SoMFInt32.h>
00030
00031 #ifdef _WIN32
00032 #pragma warning(push)
00033 #pragma warning(disable:4251)
00034 #endif
00035
00036 class MiPointProbeUnstructured;
00037 class MiPointProbeUnstructuredIjk;
00038 class MiPointProbeIjk;
00039 class MiPointProbeIj;
00040 class MxNodeSensor;
00041 class MxProbeCallback;
00042 class MxAttributesManager;
00043 class MiMesh;
00044
00088 class MESHIVIZDM_API MoMeshPointProbe : public MoActionNode
00089 {
00090
00091 SO_NODE_HEADER(MoMeshPointProbe) ;
00092
00093 public:
00094
00098 MoMeshPointProbe() ;
00099
00103 SoSFVec3f position;
00104
00112 SoMFInt32 scalarSetIds;
00113
00121 SoMFInt32 vectorSetIds;
00122
00129 class MoProbeCallback
00130 {
00131 public:
00145 virtual void motionCallback(size_t SO_UNUSED_PARAM(cellId), const MeXScalardSetI& SO_UNUSED_PARAM(scalars), const MeXVec3dSetI& SO_UNUSED_PARAM(vectors)) {}
00146
00161 virtual void motionCallback(size_t SO_UNUSED_PARAM(cellIdI), size_t SO_UNUSED_PARAM(cellIdJ),
00162 const MeXScalardSetI& SO_UNUSED_PARAM(scalars), const MeXVec3dSetI& SO_UNUSED_PARAM(vectors)) {}
00178 virtual void motionCallback(size_t SO_UNUSED_PARAM(cellIdI), size_t SO_UNUSED_PARAM(cellIdJ), size_t SO_UNUSED_PARAM(cellIdK),
00179 const MeXScalardSetI& SO_UNUSED_PARAM(scalars), const MeXVec3dSetI& SO_UNUSED_PARAM(vectors)) {}
00180
00181 virtual ~MoProbeCallback() {}
00182 };
00183
00188 void setProbeCallback(MoProbeCallback& probeCallback);
00189
00194 void removeProbeCallback();
00195
00197
00204 const MiPointProbeUnstructured* getPointProbeUnstructured();
00205 const MiPointProbeUnstructuredIjk* getPointProbeUnstructuredIjk();
00206 const MiPointProbeIjk* getPointProbeIjk();
00207 const MiPointProbeIj* getPointProbeIj();
00209
00210
00211
00212 private:
00213 static void initClass() ;
00214 static void exitClass() ;
00215
00216 private:
00217 virtual void doAction(SoAction *action);
00218
00219 private:
00220 virtual ~MoMeshPointProbe() ;
00221
00222 private:
00223 void clear();
00224
00225 template<typename _ScalarSet, typename _VectorSet, typename _MeshInterface, typename _Probe>
00226 void doProbing(SoState * state,const _MeshInterface* mesh, _Probe** probe);
00227
00228 template<typename _Probe, typename _ScalarSet, typename _VectorSet>
00229 void probeAtPosition(SoState * state,_Probe* probe, std::vector<const _ScalarSet*>& sSets,
00230 std::vector<const _VectorSet*>& vSets);
00231
00232 const MiMesh* getMeshFromState(SoState* state, MeshType& meshType);
00233
00234
00235 MiPointProbeUnstructured* m_pointProbeU;
00236 MiPointProbeUnstructuredIjk* m_pointProbeUIjk;
00237 MiPointProbeIjk* m_pointProbeIjk;
00238 MiPointProbeIj* m_pointProbeIj;
00239
00240
00241 MxNodeSensor* m_sensor;
00242
00243
00244 MxAttributesManager* m_attributesManager;
00245
00246
00247 MxProbeCallback* m_probeCallback;
00248
00249 } ;
00250
00251 #ifdef _WIN32
00252 #pragma warning(pop)
00253 #endif
00254
00255 #endif
00256
00257
00258
00259