20 #ifndef PartSet_WidgetSketchLabel_H
21 #define PartSet_WidgetSketchLabel_H
24 #include "PartSet_Tools.h"
26 #include <ModuleBase_WidgetValidated.h>
27 #include <ModuleBase_ViewerFilters.h>
28 #include <ModuleBase_ViewerPrs.h>
30 #include <GeomAPI_Dir.h>
32 #include <TopoDS_Shape.hxx>
34 #include <QStackedWidget>
35 #include <QDoubleSpinBox>
79 const QMap<PartSet_Tools::ConstraintVisibleState, bool>& toShowConstraints);
84 const FeaturePtr& theFeature,
85 const bool theToStoreValue =
false,
86 const bool isUpdateFlushed =
true
89 virtual bool isModified()
const {
return mySketchDataIsModified; }
97 virtual bool setSelection(QList<std::shared_ptr<ModuleBase_ViewerPrs>>& theValues,
98 const bool theToValidate);
103 virtual void selectionModes(
int& theModuleSelectionModes, QIntList& theModes);
109 SelectMgr_ListOfFilter& theSelectionFilters);
122 std::shared_ptr<GeomAPI_Pln> plane()
const;
131 void setShowPointsState(
bool theState);
135 static bool canFillSketch(
const ModuleBase_ViewerPrsPtr& thePrs);
140 if (myStackWidget) myStackWidget->setCurrentIndex(1);
173 const bool theValid);
198 virtual void blockAttribute(
const AttributePtr& theAttribute,
const bool& theToBlock,
199 bool& isFlushesActived,
200 bool& isAttributeSetInitializedBlocked,
201 bool& isAttributeSendUpdatedBlocked);
212 bool setSelectionInternal(
const QList<ModuleBase_ViewerPrsPtr>& theValues,
213 const bool theToValidate);
217 void updateByPlaneSelected(
const ModuleBase_ViewerPrsPtr& thePrs);
222 bool fillSketchPlaneBySelection(
const ModuleBase_ViewerPrsPtr& thePrs);
225 virtual void showEvent(QShowEvent* theEvent);
228 virtual void hideEvent(QHideEvent* theEvent);
235 void onSetPlaneView();
239 void onShowConstraint(
bool theOn);
242 void onChangePlane();
250 void onShowAxes(
bool);
251 void onShowSubstrate(
bool);
253 void onGridTypeChanged(
int);
254 void onGridSnappingModeChanged(
int);
257 void reconfigureSketchViewWidgets();
259 void saveSketchViewPreferenceToSkethData();
264 std::shared_ptr<GeomAPI_Dir> setSketchPlane(
const TopoDS_Shape& theShape);
268 std::shared_ptr<GeomAPI_Dir> setSketchPlane(std::shared_ptr<GeomAPI_Pln> thePlane);
275 QList<ModuleBase_ViewerPrsPtr> findCircularEdgesInPlane();
281 bool mySketchDataIsModified;
284 QCheckBox* myViewInverted;
285 QCheckBox* myAxesVisibleCheckBox;
286 QCheckBox* mySubstrateVisibleCheckBox;
288 QComboBox* myGridTypeComboBox;
289 QComboBox* myGridSnappingModeComboBox;
297 QCheckBox* myRemoveExternal;
298 QCheckBox* myShowPoints;
299 QCheckBox* myAutoConstraints;
301 QMap<PartSet_Tools::ConstraintVisibleState, QCheckBox*> myShowConstraints;
305 QStackedWidget* myStackWidget;
308 QPushButton* myShowDOFBtn;
310 bool myOpenTransaction;
316 GeomPlanePtr myTmpPlane;
327 void setValue(
double theVal);
330 void valueSet(
double theVal);
333 virtual void onTextChanged();
334 virtual void onEditingFinished();
349 virtual void reconfigure() = 0;
352 virtual void onResetClicked() = 0;
353 virtual void onOffsetAngleChanged(
double theOffset) = 0;
354 virtual void onOffsetXChanged(
double theOffset) = 0;
355 virtual void onOffsetYChanged(
double theOffset) = 0;
359 static double clampValue(
double theValue,
double theIntervalWidth);
362 static double reasonableOffsetIncrement(
double theStep);
365 static double reasonablePitchIncrement(
double theStep);
367 void retrieveSketchAndPlane();
376 static const int SPIN_BOX_MIN_WIDTH;
382 QGridLayout* myLayout;
384 QPushButton* myResetButton;
403 virtual void reconfigure();
406 void onStepXSet(
double theStep);
407 void onStepYSet(
double theStep);
410 virtual void onResetClicked();
411 virtual void onOffsetAngleChanged(
double theOffset);
412 virtual void onOffsetXChanged(
double theOffset);
413 virtual void onOffsetYChanged(
double theOffset);
430 virtual void reconfigure();
433 void onStepRChanged(
double theStep);
434 void onNumOfAngularSegmentsChanged(
int theNum);
437 virtual void onResetClicked();
438 virtual void onOffsetAngleChanged(
double theOffset);
439 virtual void onOffsetXChanged(
double theOffset);
440 virtual void onOffsetYChanged(
double theOffset);
443 void updateSegmentsToolTip();
Feature that consists of other features: like sketcher with edges inside.
Definition: ModelAPI_CompositeFeature.h:33
Class which provides access to Workshop object services.
Definition: ModuleBase_IWorkshop.h:48
A class to show/hide sketch preview planes.
Definition: PartSet_PreviewPlanes.h:37
Visualization of 2D-bluebrint' accessories: translucent rectangular substrate, basis axes,...
Definition: PartSet_PreviewSketchPlane.h:51
Definition: PartSet_WidgetSketchLabel.h:321
Operation manager.
Definition: XGUI_OperationMgr.h:49
Class which defines a configuration of the application (Workshop) and launches it.
Definition: XGUI_Workshop.h:83