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 MiPointProbeHexahedronIjk;
00038 class MiPointProbeIjk;
00039 class MiPointProbeIj;
00040 class MxNodeSensor;
00041 class MxProbeCallback;
00042 class MxAttributesManager;
00043 class MiMesh;
00044
00088 class MESHVIZXLM_DMAP_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 MiPointProbeHexahedronIjk* getPointProbeHexahedronIjk();
00206 const MiPointProbeIjk* getPointProbeIjk();
00207 const MiPointProbeIj* getPointProbeIj();
00209
00210 const MiPointProbeHexahedronIjk* getPointProbeUnstructuredIjk();
00211
00212
00213 private:
00214 static void initClass() ;
00215 static void exitClass() ;
00216
00217 private:
00218 virtual void doAction(SoAction *action);
00219
00220 private:
00221 virtual ~MoMeshPointProbe() ;
00222
00223 private:
00224 void clear();
00225
00226 template<typename _ScalarSet, typename _VectorSet, typename _MeshInterface, typename _Probe>
00227 void doProbing(SoState * state,const _MeshInterface* mesh, _Probe** probe);
00228
00229 template<typename _Probe, typename _ScalarSet, typename _VectorSet>
00230 void probeAtPosition(SoState * state,_Probe* probe, std::vector<const _ScalarSet*>& sSets,
00231 std::vector<const _VectorSet*>& vSets);
00232
00233 const MiMesh* getMeshFromState(SoState* state, MeshType& meshType);
00234
00235
00236 MiPointProbeUnstructured* m_pointProbeU;
00237 MiPointProbeHexahedronIjk* m_pointProbeUIjk;
00238 MiPointProbeIjk* m_pointProbeIjk;
00239 MiPointProbeIj* m_pointProbeIj;
00240
00241
00242 MxNodeSensor* m_sensor;
00243
00244
00245 MxAttributesManager* m_attributesManager;
00246
00247
00248 MxProbeCallback* m_probeCallback;
00249
00250 } ;
00251
00252 #ifdef _WIN32
00253 #pragma warning(pop)
00254 #endif
00255
00256 #endif
00257
00258
00259
00260