Fit all for the planes preview.
//PartSet_TestOCC::testSelection(myWorkshop);
}
+void PartSet_Module::onFitAllView()
+{
+ myWorkshop->viewer()->fitAll();
+}
+
void PartSet_Module::onLaunchOperation(std::string theName, boost::shared_ptr<ModelAPI_Feature> theFeature)
{
ModuleBase_Operation* anOperation = createOperation(theName.c_str());
if (aSketchOp) {
connect(aSketchOp, SIGNAL(planeSelected(double, double, double)),
this, SLOT(onPlaneSelected(double, double, double)));
+ connect(aSketchOp, SIGNAL(fitAllView()),
+ this, SLOT(onFitAllView()));
}
}
/// \param theZ the Z projection value
void onPlaneSelected(double theX, double theY, double theZ);
+ /// SLOT, to fit all current viewer
+ void onFitAllView();
+
void onLaunchOperation(std::string theName, boost::shared_ptr<ModelAPI_Feature> theFeature);
/// SLOT, to switch on/off the multi selection in the viewer
void PartSet_OperationSketch::startOperation()
{
- if (!feature())
+ if (!feature()) {
setFeature(createFeature());
+ emit fitAllView();
+ }
}
bool PartSet_OperationSketch::hasSketchPlane() const
/// \param theX the value in the Y direction value of the plane
/// \param theX the value in the Z direction of the plane
void planeSelected(double theX, double theY, double theZ);
+ // signal about the viewer fit all perform
+ void fitAllView();
protected:
/// Virtual method called when operation started (see start() method for more description)
//! Returns true if multiselection is enabled
virtual bool isMultiSelectionEnabled() const = 0;
+ //! Perfroms the fit all for the active view
+ virtual void fitAll() = 0;
+
signals:
void lastViewClosed();
void tryCloseView();
}
}
+void XGUI_ViewerProxy::fitAll()
+{
+ if (myWorkshop->isSalomeMode()) {
+ myWorkshop->salomeConnector()->viewer()->fitAll();
+ }
+ else {
+ XGUI_Viewer* aViewer = myWorkshop->mainWindow()->viewer();
+ aViewer->activeViewWindow()->viewPort()->fitAll();
+ }
+}
void XGUI_ViewerProxy::connectToViewer()
{
/// \param theZ the Z projection value
void setViewProjection(double theX, double theY, double theZ);
+ //! Sets the view fitted all
+ void fitAll();
+
/// Connects to a viewer according to current environment
void connectToViewer();