Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SoOrthoSliceDragger.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-2022 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : David Beilloin (Dec 2008)
22**=======================================================================*/
23
24
25
26#ifndef _SO_ORTHOSLICE_DRAGGER_H_
27#define _SO_ORTHOSLICE_DRAGGER_H_
28
29#include <Inventor/draggers/SoTranslate1Dragger.h>
30#include <Inventor/fields/SoSFPath.h>
31#include <Inventor/fields/SoSFVec3i32.h>
32#include <Inventor/fields/SoSFBox3f.h>
33#include <Inventor/fields/SoSFColor.h>
34
35class SoCallback;
36class SoOrthoSlice;
37class SoSensor;
38class SoNodeSensor;
39class SoFieldSensor;
41namespace inventor{namespace helper{class SoOrthoSliceBorderHelper;}}
42
164{
165 SO_KIT_HEADER(SoOrthoSliceDragger);
166
167public:
172
178
179#if 1 SoDEPRECATED
186SoDEPRECATED
192
193#endif
200
209
210private:
214 static void initClass();
218 static void exitClass();
219
220 virtual void internalRemoveChild(int);
221 virtual void internalRemoveChild(SoNode*);
222 virtual void internalRemoveAllChildren();
223 virtual void internalAddChild(SoNode*);
224 virtual void internalInsertChild(SoNode*, int);
225 virtual void internalReplaceChild(int, SoNode*);
226 virtual void internalReplaceChild(SoNode*, SoNode*);
227
228private:
232 virtual void grabEventsSetup();
233
234 virtual void callback(SoCallbackAction* action);
235 virtual void getBoundingBox(SoGetBoundingBoxAction* action);
236 virtual void getMatrix(SoGetMatrixAction* action);
237 virtual void rayPick(SoRayPickAction* action);
238
239private:
243 virtual ~SoOrthoSliceDragger();
244
248 virtual void notify(SoNotList *list);
249
250 void handleEvent(SoHandleEventAction *action) override;
251
253 virtual SbBool readInstance(SoInput* in, unsigned short flags);
254
255private:
259 static void valueChangedCB( void *data, SoDragger *dragger);
260
266 void initialize( const SoPath *pathToSlice);
267
271 void synchronize();
272
276 void setDraggerDirection();
277
278 void GLRender(SoGLRenderAction* action) override;
279
280 bool pushDataSetModelMatrix(SoAction* action);
281
282private:
283 // current handled orthoSlice.
284 SoOrthoSlice* m_orthoSlice;
285 SoCallback* m_updateBorderCBNode;
286 SoCallback* m_orthoSliceMatrixCBNode;
287 bool m_useDataSetMatrix;
288 SbMatrix m_savedDataSetMatrix;
289 int m_sliceAxis;
290 int m_sliceNumber;
291
292 // Enables/disables axis switch when camera faces the dragger
293 // ( see m_isOrthoSliceInSamePlaneThanViewer )
294 static bool s_enableAxisSwitch;
295
296 // Detect if orthoSlice is in the same plane than the viewer
297 // If true then draggerDirection is changed to be able to move the slices.
298 bool m_isOrthoSliceInSamePlaneThanViewer;
299
300 // Track changes to SoOrthoSlice node
301 SoNodeSensor* m_sliceChangedSensor;
302 static void sliceChangedSensorCB( void *, SoSensor * );
303 static void sliceDeletedSensorCB( void *, SoSensor * );
304
305 // Used to avoid recursive notification.
306 static bool m_isNotifying;
307
308 inventor::helper::SoOrthoSliceBorderHelper *m_orthoSliceBorderHelper;
309 void drawHighLight(const bool enable);
310 bool m_drawHightLight;
311 SoFieldSensor* m_onValueChangedFieldSensorEnableBorder;
312 SoFieldSensor* m_onValueChangedFieldSensorEnableImage;
313
314 void setupAutoValues(SoState* state);
315 SbVec3i32 m_autoVolumeDimensions;
316 SbBox3f m_autoVolumeExtent;
317};
318
319#endif //_SO_ORTHOSLICE_DRAGGER_H_
320
321
3D box class.
Definition SbBox.h:649
4x4 matrix class.
Definition SbMatrix.h:309
3D vector class.
Definition SbVec.h:1517
Abstract base class for all actions.
Definition SoAction.h:132
Performs a generic traversal of a scene graph or path.
Provides custom behavior during actions.
Definition SoCallback.h:441
Base class for nodekits that move in response to click-drag-release mouse events.
Definition SoDragger.h:537
Sensor class that can be attached to Open Inventor fields.
Renders a scene graph using Open Inventor's Render Engine.
Computes bounding box of a scene.
Computes transformation matrix for a subgraph.
Allows nodes in a graph to receive input events.
Used to read Open Inventor data files.
Definition SoInput.h:363
Abstract base class for all database nodes.
Definition SoNode.h:145
Sensor class that can be attached to Open Inventor nodes.
<a href="IconLegend.html"><img src="extVR.gif" alt="VolumeViz" border="0"></a> Object that moves an ...
SoDEPRECATED SoSFBox3f volumeExtent
Extent of the volume.
SoSFBool enableHighlight
Enables highlighting.
SoDEPRECATED SoSFVec3i32 volumeDimension
Dimension of the volume.
SoSFColor highlightColor
Specifies the highlight color.
SoSFPath orthoSlicePath
Path to the SoOrthoSlice node to drag.
SoOrthoSliceDragger()
Constructor.
<a href="IconLegend.html"><img src="extVR.gif" alt="VolumeViz" border="0"></a> Ortho slice shape nod...
Path that points to a list of hierarchical nodes.
Definition SoPath.h:187
Intersects objects with a ray cast into scene.
Field containing a single Boolean value.
Definition SoSFBool.h:79
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Field containing...
Definition SoSFBox3f.h:55
Field containing an RGB color.
Definition SoSFColor.h:82
Field containing an SoPath.
Definition SoSFPath.h:89
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Field containing...
Definition SoSFVec3i32.h:48
Abstract base class for Open Inventor sensors.
Definition SoSensor.h:100
Traversal state.
Definition SoState.h:74
Object you can translate along a line by dragging with the mouse.
int SbBool
Boolean type.
Definition SbBase.h:87