Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SoStereoDialog.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-2014 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : VSG (MMM YYYY)
22**=======================================================================*/
23
24#ifndef _SOWIN_STEREO_DIALOG_
25#define _SOWIN_STEREO_DIALOG_
26
27#ifdef SOQT
28#include <Inventor/components/stereo/SoQtStereoDialog.h>
29#else // SOQT
30
31#include <Inventor/sys/port.h>
32#ifdef _WIN32
33# include <Inventor/Win/SoWinBeginStrict.h>
34#else
35# include <Xm/Xm.h>
36# include <Inventor/Xt/SoXtMaterialEditor.h>
37#endif
38
39#include <Inventor/components/stereo/SoWinXt2Stereo.h>
40#include <Inventor/Xt/SoXtComponent.h>
41
42class SoStereoViewer;
43class SoBaseStereo;
44class SoWinSlider;
45
64class SoStereoDialog : public SoXtComponent {
65 public:
66
70 SoStereoDialog(SoWidget parent = NULL, SoStereoViewer * viewer = NULL,
71 const char *name = NULL, SbBool buildInsideParent = TRUE);
76
80 virtual void update();
81
82 private:
83
84
85 // This constructor takes a boolean whether to build the widget now.
86 // Subclasses can pass FALSE, then call SoStereoDialog::buildWidget()
87 // when they are ready for it to be built.
88 SoEXTENDER SoStereoDialog(SoWidget parent, SoStereoViewer * viewer,
89 const char *name, SbBool buildInsideParent, SbBool buildNow);
90
91 // redefine these
92 virtual SbString getDefaultWidgetName() const;
93 virtual SbString getDefaultTitle() const;
94 virtual SbString getDefaultIconTitle() const;
95
96 // NEW STEREO
97 // Added by Squale on 11 sep 2000
98 private:
99 static void onParallaxToggleCB(SoWidget widget, XtPointer clientData, void *state );
100 static void onCameraToggleCB(SoWidget widget, XtPointer clientData, void *state );
101 static void onButtonCB( SoWidget widget, XtPointer clientData, void* cbs );
102 static void onStereoToggleCB(SoWidget widget, XtPointer clientData, void *state );
103 static void scaleParallaxCB( SoWidget w, XtPointer clientData, void* callData );
104 static void scaleCameraCB( SoWidget w, XtPointer clientData, void* callData );
105
106#ifndef _WIN32
107 virtual void widgetDestroyed();
108#endif
109
110 // SteroItem size is NUM_STEREO_TYPE on SoXtStereoDialog
111 SoWidget m_stereoItem[14], m_rawStereoItem;
112 SoWidget m_stereoPopup;
113 SoWidget m_stereoToggle;
114 SoWidget m_adjustStereoToggle;
115 SoWidget m_scaleParallax;
116 SoWidget m_scaleCamOffset;
117 SoWidget m_cameraToggle;
118 SoWidget m_parallaxToggle;
119 SoBaseStereo* m_viewType;
120
121 SbBool m_destroyFlag;
122 SbBool m_cameraFlag, m_parallaxFlag;
123
124#ifdef _WIN32
125 static WBOOL CALLBACK mgrDlgProc(Hwnd hdlg, UINT message, WPARAM wParam, LPARAM lParam);
126 static void onCommand(Hwnd hdlg, int id, Hwnd hCtrl, UINT codeNotify ) ;
127#endif
128
129 static void sliderCallback(void * userData, float value) ;
130
131 static SoBaseStereo * getStereoViewType(int stereoTypeListIndex=0) ;
132
133 // widgets to edit the material
134 SoWidget mgrWidget; // topmost widget
135
136 // local scene vars
137 SoStereoViewer *stereoViewer;
138 SoWinSlider * sliders[2];
139
140 struct SliderData
141 {
142 SoStereoDialog *dialog;
143 SoWinSlider *slider;
144 long sliderId;
145
146 SliderData()
147 : dialog(NULL)
148 , slider(NULL)
149 , sliderId(0)
150 {
151 }
152
153 ~SliderData()
154 {
155 }
156 };
157
158 SliderData m_firstSlider;
159 SliderData m_secondSlider;
160
161 // Callback routines from Xt/Motif
162#ifndef _WIN32
163 static void menuPick(SoWidget, int, XmAnyCallbackStruct *);
164 static void menuDisplay(SoWidget, SoXtMaterialEditor *, XtPointer);
165 static void radioButtonPick(SoWidget, int, XtPointer);
166 static void diamondButtonPick(SoWidget, int, XtPointer);
167#endif
168
169 // Build routines
170 SoWidget buildWidget(SoWidget parent);
171 SoWidget buildControls(SoWidget parent);
172 SoWidget buildSliders(SoWidget parent);
173 void updateSliders();
174
175
176 // this is called by both constructors
177 void constructorCommon(SoStereoViewer * viewer, SbBool buildNow);
178 int m_lastStereoMode;
179 bool m_isStereoActive;
180 bool m_lastStereoReversed;
181};
182#ifdef _WIN32
183#include <Inventor/Win/SoWinEndStrict.h>
184#endif
185
186#endif // SOQT
187
188#endif // _SOWIN_STEREO_DIALOG_
189
Class for smart character strings.
Definition SbString.h:202
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Class for stereo...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Component that l...
~SoStereoDialog()
Destructor.
virtual void update()
Notify the stereo dialog that the viewer state may have changed.
SoStereoDialog(SoWidget parent=NULL, SoStereoViewer *viewer=NULL, const char *name=NULL, SbBool buildInsideParent=TRUE)
Constructor.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Pure virtual cla...
Abstract base class for all Open Inventor components.
Component which lets you edit a material interactively.
int SbBool
Boolean type.
Definition SbBase.h:87
void * XtPointer
Definition SoQtDef.h:122