Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
MoMeshPointProbe.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2017 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : Martial Bonaventure (October 2009)
22**=======================================================================*/
23#ifndef _MoMeshPointProbe_H
24#define _MoMeshPointProbe_H
25
26#include <MeshVizXLM/mapping/nodes/MoActionNode.h>
27#include <MeshVizXLM/extrmesh/data/MeXDataSetI.h>
28
29#include <Inventor/fields/SoMFInt32.h>
30
31#ifdef _WIN32
32#pragma warning(push)
33#pragma warning(disable:4251)
34#endif
35
38class MiPointProbeIjk;
39class MiPointProbeIj;
40class MxNodeSensor;
41class MxProbeCallback;
42class MxAttributesManager;
43class MiMesh;
44
88class MESHVIZXLM_DMAP_API MoMeshPointProbe : public MoActionNode
89{
90
91 SO_NODE_HEADER(MoMeshPointProbe) ;
92
93 public:
94
99
104
113
122
130 {
131 public:
145 virtual void motionCallback(size_t SO_UNUSED_PARAM(cellId), const MeXScalardSetI& SO_UNUSED_PARAM(scalars), const MeXVec3dSetI& SO_UNUSED_PARAM(vectors)) {}
146
161 virtual void motionCallback(size_t SO_UNUSED_PARAM(cellIdI), size_t SO_UNUSED_PARAM(cellIdJ),
162 const MeXScalardSetI& SO_UNUSED_PARAM(scalars), const MeXVec3dSetI& SO_UNUSED_PARAM(vectors)) {}
178 virtual void motionCallback(size_t SO_UNUSED_PARAM(cellIdI), size_t SO_UNUSED_PARAM(cellIdJ), size_t SO_UNUSED_PARAM(cellIdK),
179 const MeXScalardSetI& SO_UNUSED_PARAM(scalars), const MeXVec3dSetI& SO_UNUSED_PARAM(vectors)) {}
180
181 virtual ~MoProbeCallback() {}
182 };
183
188 void setProbeCallback(MoProbeCallback& probeCallback);
189
195
197
209
211
212 /*----------------------------------------------------------------------------*/
213 private:
214 static void initClass() ;
215 static void exitClass() ;
216
217 private:
218 virtual void doAction(SoAction *action);
219
220private:
221 virtual ~MoMeshPointProbe() ;
222
223private:
224 void clear();
225
226 template<typename _ScalarSet, typename _VectorSet, typename _MeshInterface, typename _Probe>
227 void doProbing(SoState * state,const _MeshInterface* mesh, _Probe** probe);
228
229 template<typename _Probe, typename _ScalarSet, typename _VectorSet>
230 void probeAtPosition(SoState * state,_Probe* probe, std::vector<const _ScalarSet*>& sSets,
231 std::vector<const _VectorSet*>& vSets);
232
233 const MiMesh* getMeshFromState(SoState* state, MeshType& meshType);
234
235 // Probes used internally
236 MiPointProbeUnstructured* m_pointProbeU;
237 MiPointProbeHexahedronIjk* m_pointProbeUIjk;
238 MiPointProbeIjk* m_pointProbeIjk;
239 MiPointProbeIj* m_pointProbeIj;
240
241 // Internal mechanism used to detect that the node has changed.
242 MxNodeSensor* m_sensor;
243
244 // Internal mechanism to retrieve the attributes for the extraction
245 MxAttributesManager* m_attributesManager;
246
247 // call back
248 MxProbeCallback* m_probeCallback;
249
250} ;
251
252#ifdef _WIN32
253#pragma warning(pop)
254#endif
255
256#endif /* _MoMeshPointProbe_H */
257
258
259
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Generic data set interfa...
Definition MeXDataSetI.h:45
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Abstract mesh interface.
Definition MiMesh.h:62
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Probe at a given locatio...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Probe at a given locatio...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Probe at a given locatio...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Probe at a given locatio...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Utility class that provi...
This class specifies the interface used by this node to notify the application when the position of t...
virtual void motionCallback(size_t cellId, const MeXScalardSetI &scalars, const MeXVec3dSetI &vectors)
Callback that is triggered each time the field MoMeshPointProbe::position changes on a unstructured m...
virtual void motionCallback(size_t cellIdI, size_t cellIdJ, const MeXScalardSetI &scalars, const MeXVec3dSetI &vectors)
Callback that is triggered each time the field MoMeshPointProbe::position changes on a structured IJ ...
virtual void motionCallback(size_t cellIdI, size_t cellIdJ, size_t cellIdK, const MeXScalardSetI &scalars, const MeXVec3dSetI &vectors)
Callback that is triggered each time the field MoMeshPointProbe::position changes on a structured IJK...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Action node that probes ...
SoMFInt32 scalarSetIds
Field representing the scalar set nodes to use when probing at the current position.
void removeProbeCallback()
remove the user defined probe callback (see setProbeCallback()) which will disable the node.
SoMFInt32 vectorSetIds
Field representing the vector set nodes to use when probing at the current position.
const MiPointProbeUnstructured * getPointProbeUnstructured()
Get probes for reuse outside this node.
MoMeshPointProbe()
Constructor.
const MiPointProbeIj * getPointProbeIj()
SoSFVec3f position
Field representing the position of the probe.
const MiPointProbeHexahedronIjk * getPointProbeUnstructuredIjk()
const MiPointProbeHexahedronIjk * getPointProbeHexahedronIjk()
void setProbeCallback(MoProbeCallback &probeCallback)
Set the user defined probe callback which will be called when the motion event occurs.
const MiPointProbeIjk * getPointProbeIjk()
Abstract base class for all actions.
Definition SoAction.h:132
Multiple-value field containing any number of int32_t integers.
Definition SoMFInt32.h:88
Field containing a three-dimensional vector.
Definition SoSFVec3f.h:80
Traversal state.
Definition SoState.h:74
MeshType
All supported mesh types.