23 #ifndef OCCVIEWER_VIEWWINDOW_H
24 #define OCCVIEWER_VIEWWINDOW_H
30 #include <V3d_Plane.hxx>
31 #include <TopAbs_ShapeEnum.hxx>
138 #pragma warning( disable:4251 )
146 enum { DumpId, FitAllId, FitRectId, FitSelectionId,
ZoomId, PanId, GlobalPanId,
148 FrontId, BackId,
TopId, BottomId, LeftId, RightId, ClockWiseId, AntiClockWiseId,
154 OrthographicId, PerspectiveId,
StereoId, RayTracingId, EnvTextureId, LightSourceId,
158 PANGLOBAL,
WINDOWFIT, FITALLVIEW, FITSELECTION, RESETVIEW,
159 FRONTVIEW, BACKVIEW,
TOPVIEW, BOTTOMVIEW, LEFTVIEW, RIGHTVIEW,
160 CLOCKWISEVIEW, ANTICLOCKWISEVIEW, PROJECTION };
170 enum StereoType { QuadBuffer, Anaglyph, RowInterlaced, ColumnInterlaced, ChessBoard, SideBySide, OverUnder, SoftPageFlip, NumberOfModes };
185 virtual void performRestoring(
const viewAspect&,
bool =
false );
187 virtual void initLayout();
189 virtual bool enableDrawMode(
bool );
191 virtual void updateEnabledDrawMode();
193 virtual void setCuttingPlane(
bool on,
const double x = 0 ,
const double y = 0 ,
const double z = 0,
194 const double dx = 0,
const double dy = 0,
const double dz = 1);
196 virtual void setCuttingPlane(
bool on,
const gp_Pln thePln );
198 virtual bool isCuttingPlane();
203 virtual void initSketchers();
206 virtual void activateSketching(
int );
208 virtual int interactionStyle()
const;
209 virtual void setInteractionStyle(
const int );
211 virtual int zoomingStyle()
const;
212 virtual void setZoomingStyle(
const int );
214 virtual bool isPreselectionEnabled()
const;
215 virtual void enablePreselection(
bool );
216 virtual bool isSelectionEnabled()
const;
217 virtual void enableSelection(
bool );
219 virtual int projectionType()
const;
220 virtual void setProjectionType(
int );
222 virtual int stereoType()
const;
223 virtual void setStereoType(
const int );
225 virtual int anaglyphFilter()
const;
226 virtual void setAnaglyphFilter(
const int );
228 virtual void setStereographicFocus(
const int,
const double );
229 virtual int stereographicFocusType()
const;
230 virtual double stereographicFocusValue()
const;
232 virtual void setInterocularDistance(
const int,
const double );
233 virtual int interocularDistanceType()
const;
234 virtual double interocularDistanceValue()
const;
236 virtual bool isReverseStereo()
const;
237 virtual void setReverseStereo(
const bool );
239 virtual bool isVSync()
const;
240 virtual void setVSync(
const bool );
242 virtual bool isQuadBufferSupport()
const;
243 virtual void setQuadBufferSupport(
const bool );
245 void setTransformEnabled(
const OperationType,
const bool );
246 bool transformEnabled(
const OperationType )
const;
248 void set2dMode( Mode2dType );
251 void setMaximized(
bool,
bool =
true );
252 bool isMaximized()
const;
253 void setReturnedTo3dView(
bool =
true );
255 void setSketcherStyle(
bool enable );
256 bool isSketcherStyle()
const;
258 virtual QColor backgroundColor()
const;
259 virtual void setBackgroundColor(
const QColor& );
261 virtual void showStaticTrihedron(
bool );
267 virtual void appendViewAspect(
const viewAspect& );
269 virtual void clearViewAspects();
274 virtual void onFrontView();
275 virtual void onViewFitAll();
276 virtual void onBackView();
277 virtual void onClipping(
bool on);
278 virtual void onTopView();
279 virtual void onBottomView();
280 virtual void onLeftView();
281 virtual void onRightView();
282 virtual void onClockWiseView();
283 virtual void onAntiClockWiseView();
284 virtual void onProjectionType(
QAction* theAction );
285 virtual void onStereoType(
bool activate );
286 virtual void onProjectionType();
287 virtual void onResetView();
288 virtual void onFitAll();
289 virtual void onFitSelection();
290 virtual void activateZoom();
291 virtual void activateWindowFit();
292 virtual void activateRotation();
293 virtual void activatePanning();
294 virtual void activateGlobalPanning();
295 virtual void onSetRotationPoint(
bool on );
296 virtual void onCloneView();
297 virtual void onAxialScale();
298 virtual void onGraduatedAxes();
299 virtual void onAmbientToogle();
300 virtual void onMemorizeView();
301 virtual void onRestoreView();
302 virtual void onTrihedronShow(
bool);
303 virtual void setRestoreFlag();
304 virtual void onSwitchInteractionStyle(
bool on );
305 virtual void onSwitchZoomingStyle(
bool on );
306 virtual void onSwitchPreselection(
bool on );
307 virtual void onSwitchSelection(
bool on );
308 virtual void onRayTracing();
309 virtual void onEnvTexture();
310 virtual void onLightSource();
312 virtual void activateSetRotationGravity();
313 virtual void activateSetRotationSelected(
double theX,
double theY,
double theZ );
314 virtual void activateStartPointSelection( TopAbs_ShapeEnum );
315 virtual void updateGravityCoords();
317 virtual void showEvent( QShowEvent * );
318 virtual void hideEvent( QHideEvent * );
320 virtual void onMaximizedView();
321 virtual void returnTo3dView();
328 void Show( QShowEvent * );
329 void Hide( QHideEvent * );
331 void returnedTo3d( );
338 virtual bool dumpViewToFormat(
const QImage&,
const QString& fileName,
const QString& format );
341 virtual QString
filter()
const;
343 bool isOpenGlStereoSupport()
const;
346 bool transformRequested()
const;
347 bool setTransformRequested ( OperationType );
350 bool transformInProcess()
const;
351 void setTransformInProcess(
bool );
353 void vpMousePressEvent(QMouseEvent* theEvent);
354 void vpMouseReleaseEvent(QMouseEvent* theEvent);
355 void vpMouseMoveEvent(QMouseEvent* theEvent);
361 void createActions();
362 void createToolBar();
364 virtual OperationType getButtonState(QMouseEvent* theEvent,
int theInteractionStyle);
368 bool computeGravityCenter(
double& theX,
double& theY,
double& theZ );
370 virtual void onSketchingStarted();
371 virtual void onSketchingFinished();
430 Handle(V3d_Plane) myReserveClipPlane;
436 #pragma warning( default:4251 )