23 #ifndef OCCVIEWER_VIEWMODEL_H
24 #define OCCVIEWER_VIEWMODEL_H
37 #include <V3d_View.hxx>
38 #include <AIS_ColorScale.hxx>
39 #include <AIS_Trihedron.hxx>
40 #include <AIS_ViewCube.hxx>
41 #include <AIS_InteractiveContext.hxx>
42 #include <AIS_ListOfInteractive.hxx>
43 #include <Graphic3d_SequenceOfHClipPlane.hxx>
45 #include <Basics_OCCTVersion.hxx>
60 #pragma warning( disable:4251 )
87 LastGradient = Corner4Gradient
97 static QString
Type() {
return "OCCViewer"; }
99 static void stereoData( QStringList&,
QIntList&);
114 void getSelectedObjects(AIS_ListOfInteractive& theList);
115 void setObjectsSelected(
const AIS_ListOfInteractive& theList);
118 void performSelectionChanged();
121 void setDefaultLights();
123 QColor backgroundColor()
const;
124 void setBackgroundColor(
const QColor& );
128 QColor backgroundColor(
int theViewId)
const;
129 void setBackgroundColor(
int theViewId,
const QColor& );
133 bool isColorScaleVisible()
const;
134 virtual void setColorScaleShown(
const bool );
136 void initTrihedron();
137 void setTrihedronTextFont();
138 void setTrihedronTextColor();
143 bool isTrihedronVisible()
const;
144 virtual void setTrihedronShown(
const bool );
146 double trihedronSize()
const;
147 virtual void setTrihedronSize(
const double ,
bool isRelative =
true);
152 bool computeTrihedronSize(
double& theNewSize,
double& theSize );
153 virtual double computeSceneSize(
const Handle(V3d_View)&)
const;
155 void updateTrihedron();
159 bool isViewCubeVisible()
const;
160 virtual void setViewCubeShown(
const bool );
161 void setViewCubeParamsFromPreferences();
173 myFitter = theFitter;
178 Handle(V3d_Viewer) getViewer3d()
const {
return myV3dViewer;}
179 Handle(AIS_InteractiveContext) getAISContext()
const {
return myAISContext; }
180 Handle(AIS_ColorScale) getColorScale()
const {
return myColorScale; }
181 Handle(AIS_Trihedron) getTrihedron()
const {
return myTrihedron; }
182 Handle(AIS_ViewCube) getViewCube()
const {
return myViewCube; }
186 int interactionStyle()
const;
187 void setInteractionStyle(
const int );
189 int projectionType()
const;
190 void setProjectionType(
const int );
191 int stereoType()
const;
192 void setStereoType(
const int );
197 int anaglyphFilter()
const;
198 void setAnaglyphFilter(
const int );
200 void setStereographicFocus(
const int,
const double );
201 int stereographicFocusType()
const;
202 double stereographicFocusValue()
const;
204 void setInterocularDistance(
const int,
const double );
205 int interocularDistanceType()
const;
206 double interocularDistanceValue()
const;
208 bool isReverseStereo()
const;
209 void setReverseStereo(
const bool );
211 bool isVSync()
const;
212 void setVSync(
const bool );
214 bool isQuadBufferSupport()
const;
215 void setQuadBufferSupport(
const bool );
216 int zoomingStyle()
const;
217 void setZoomingStyle(
const int );
219 void enablePreselection(
bool isEnabled);
220 bool isPreselectionEnabled()
const;
222 void enableSelection(
bool isEnabled);
223 bool isSelectionEnabled()
const;
225 void setSelectionOptions(
bool,
bool );
227 void enableMultiselection(
bool isEnable);
230 bool enableDrawMode(
bool on );
232 void setClippingUseObjColor(
bool use );
233 bool isClippingObjColorUsed()
const;
235 void setClippingColor(
const QColor& );
236 QColor clippingColor()
const;
238 void setClippingTextureParams(
const bool,
const QString&,
const bool,
const double );
239 bool isDefaultTextureUsed()
const;
240 QString clippingTexture()
const;
241 bool isTextureModulated()
const;
242 double clippingTextureScale()
const;
244 int getSelectionCount()
const {
return (!myAISContext.IsNull())? myAISContext->NbSelected():0; }
246 void setStaticTrihedronDisplayed(
const bool on);
247 void setStaticTrihedronTextFont();
248 void setStaticTrihedronTextColor();
253 Handle(Graphic3d_ClipPlane) createClipPlane(
const gp_Pln& thePlane,
const Standard_Boolean theIsOn);
264 bool unHighlightAll(
bool=
true,
bool=
true );
271 void setIsos(
const int u,
const int v );
272 void isos(
int& u,
int& v )
const;
289 void onChangeBackground();
293 double computeHatchScale()
const;
300 Handle(AIS_InteractiveContext) myAISContext;
347 #pragma warning( default:4251 )
Handle(TDocStd_Application) CAF_Application
Get OCAF application.
Definition: CAF_Application.cxx:97
#define OCCVIEWER_EXPORT
Definition: OCCViewer.h:33
std::vector< OCCViewer_ClipPlane > ClipPlanesList
Definition: OCCViewer_ClipPlane.h:123
QList< int > QIntList
list of int values
Definition: Qtx.h:55
Dialog allowing to assign parameters of clipping plane.
Definition: OCCViewer_ClippingDlg.h:55
An object wich provides alternative way to fit scene in a view.
Definition: OCCViewer_ViewModel.h:67
virtual void fitAll(Handle(V3d_View) theView)=0
A method which has top be reimplemented to provide alterantive implementation FitAll command.
Definition: OCCViewer_ViewPort3d.h:43
Definition: OCCViewer_ViewWindow.h:147
SelectionStyle
Definition: OCCViewer_ViewWindow.h:173
Definition: OCCViewer_ViewModel.h:77
bool mySelectionEnabled
Definition: OCCViewer_ViewModel.h:315
void setFitter(OCCViewer_Fitter *theFitter)
Installs new fitter.
Definition: OCCViewer_ViewModel.h:172
double myTrihedronSize
Definition: OCCViewer_ViewModel.h:327
int myTopLayerId
Definition: OCCViewer_ViewModel.h:322
Handle(AIS_Trihedron) getTrihedron() const
Definition: OCCViewer_ViewModel.h:181
void setSelected(const Handle(AIS_InteractiveObject)&theIO)
Definition: OCCViewer_ViewModel.h:116
Handle(AIS_ViewCube) getViewCube() const
Definition: OCCViewer_ViewModel.h:182
Handle(V3d_Viewer) getViewer3d() const
Definition: OCCViewer_ViewModel.h:178
bool myIsRelative
Definition: OCCViewer_ViewModel.h:317
double myClippingTextureScale
Definition: OCCViewer_ViewModel.h:341
int myInteractionStyle
Definition: OCCViewer_ViewModel.h:302
QColor myClippingColor
Definition: OCCViewer_ViewModel.h:337
Handle(AIS_InteractiveContext) getAISContext() const
Definition: OCCViewer_ViewModel.h:179
bool myClippingUseObjColor
Definition: OCCViewer_ViewModel.h:336
int myStereographicFocusType
Definition: OCCViewer_ViewModel.h:307
OCCViewer_ClippingDlg * myClippingDlg
Definition: OCCViewer_ViewModel.h:331
Handle(AIS_InteractiveContext) myAISContext
OCCViewer_Fitter * fitter() const
Returns currently installed fitter.
Definition: OCCViewer_ViewModel.h:168
QPoint myCurPnt
Definition: OCCViewer_ViewModel.h:325
double myInterocularDistanceValue
Definition: OCCViewer_ViewModel.h:312
bool myPreselectionEnabled
Definition: OCCViewer_ViewModel.h:314
bool trihedronRelative() const
Definition: OCCViewer_ViewModel.h:149
QString myClippingTexture
Definition: OCCViewer_ViewModel.h:339
int getSelectionCount() const
Definition: OCCViewer_ViewModel.h:244
virtual QString getType() const
Definition: OCCViewer_ViewModel.h:109
Handle(AIS_ColorScale) myColorScale
Handle(AIS_Trihedron) myTrihedron
ClipPlanesList myClipPlanes
Definition: OCCViewer_ViewModel.h:333
double myStereographicFocusValue
Definition: OCCViewer_ViewModel.h:311
bool myVSyncMode
Definition: OCCViewer_ViewModel.h:319
bool myQuadBufferSupport
Definition: OCCViewer_ViewModel.h:320
OCCViewer_Fitter * myFitter
Definition: OCCViewer_ViewModel.h:343
int myProjectionType
Definition: OCCViewer_ViewModel.h:304
int myStereoType
Definition: OCCViewer_ViewModel.h:305
int myAnaglyphFilter
Definition: OCCViewer_ViewModel.h:306
int myInterocularDistanceType
Definition: OCCViewer_ViewModel.h:308
QVector< Qtx::BackgroundData > myBackgrounds
Definition: OCCViewer_ViewModel.h:329
int myZoomingStyle
Definition: OCCViewer_ViewModel.h:303
bool myToReverseStereo
Definition: OCCViewer_ViewModel.h:318
bool isMultiSelectionEnabled() const
Definition: OCCViewer_ViewModel.h:228
Handle(V3d_Viewer) myV3dViewer
@ HorizontalGradient
Definition: OCCViewer_ViewModel.h:83
@ Corner3Gradient
Definition: OCCViewer_ViewModel.h:86
@ Diagonal1Gradient
Definition: OCCViewer_ViewModel.h:84
@ Corner1Gradient
Definition: OCCViewer_ViewModel.h:85
@ AnaglyphType
Definition: OCCViewer_ViewModel.h:91
@ ColumnInterlacedType
Definition: OCCViewer_ViewModel.h:92
@ ChessBoardType
Definition: OCCViewer_ViewModel.h:93
bool myTextureModulated
Definition: OCCViewer_ViewModel.h:340
OCCViewer_ViewWindow::SelectionStyle mySelectionStyle
Definition: OCCViewer_ViewModel.h:309
bool myDefaultTextureUsed
Definition: OCCViewer_ViewModel.h:338
bool viewCubeActivated() const
Definition: OCCViewer_ViewModel.h:158
bool trihedronActivated() const
returns true if 3d Trihedron in viewer was created
Definition: OCCViewer_ViewModel.h:141
Graphic3d_SequenceOfHClipPlane myInternalClipPlanes
Definition: OCCViewer_ViewModel.h:334
Handle(AIS_ColorScale) getColorScale() const
Definition: OCCViewer_ViewModel.h:180
Handle(Graphic3d_ClipPlane) createClipPlane(const gp_Pln &thePlane
Handle(AIS_ViewCube) myViewCube
bool myMultiSelectionEnabled
Definition: OCCViewer_ViewModel.h:316
static QString Type()
Definition: OCCViewer_ViewModel.h:97
Generic action class.
Definition: QtxAction.h:39
Stores background data.
Definition: Qtx.h:178
Definition: SUIT_Desktop.h:47
Definition: SUIT_ViewManager.h:50
Definition: SUIT_ViewModel.h:47
virtual void contextMenuPopup(QMenu *)
Definition: SUIT_ViewModel.h:69
virtual SUIT_ViewWindow * createView(SUIT_Desktop *theDesktop)
Definition: SUIT_ViewModel.cxx:77
virtual void applyClippingPlanes(bool theUpdateHatch)
Definition: SUIT_ViewModel.h:70
virtual void setViewManager(SUIT_ViewManager *theViewManager)
Definition: SUIT_ViewModel.cxx:85
Definition: SUIT_ViewWindow.h:42
int Type
Definition: VTKViewer_Actor.h:62