SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_8.startPoint())
SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_8.endPoint())
model.do()
-Part_1_doc.setCurrentFeature(Boolean_1.feature())
+Part_1_doc.setCurrentFeature(Boolean_1.feature(), True)
model.end()
# check that the plane is located as previously
/// \return a widget or null
ModuleBase_ModelWidget* findFirstAcceptingValueWidget();
+ /// The method is called on accepting of operation
+ virtual void onAcceptData() = 0;
+
/// Returns the first widget, where canAcceptFocus returns true
/// \return a widget or null
static ModuleBase_ModelWidget* findFirstAcceptingValueWidget(
if (anActiveWidget && anActiveWidget->getValueState() == ModuleBase_ModelWidget::ModifiedInPP) {
anActiveWidget->storeValue();
}
+ aPanel->onAcceptData();
}
if (canBeCommitted()) {
emit beforeCommitted();
#include <QLineEdit>
+ModuleBase_WidgetNameEdit::ModuleBase_WidgetNameEdit(QWidget* theParent,
+ const Config_WidgetAPI* theData,
+ const std::string& thePlaceHolder )
+ : ModuleBase_WidgetLineEdit(theParent, theData, thePlaceHolder)
+{
+ // Disconnect the signal in order to avoid Apply button activation automatically
+ // it will activate apply because of value isApplyEnabledByActiveWidget in
+ // XGUI_ErrorMgr::updateActions
+ disconnect(myLineEdit, SIGNAL(textChanged(const QString&)), this, SIGNAL(valuesModified()));
+}
+
+
bool ModuleBase_WidgetNameEdit::storeValueCustom()
{
if(!myFeature)
public:
ModuleBase_WidgetNameEdit( QWidget* theParent,
const Config_WidgetAPI* theData,
- const std::string& thePlaceHolder )
- : ModuleBase_WidgetLineEdit(theParent, theData, thePlaceHolder) {}
+ const std::string& thePlaceHolder );
/// Returns True if the widget uses feature attribute.
/// If not then it means that the widget do not need attribute at all.
selectionList.append(selection)
shapeExplorer.next()
# Create group with this selection list
+ # (do not create group if nothing is selected)
+ if (len(selectionList) == 0):
+ return
Group_1 = theModel.addGroup(thePartDoc, selectionList)
theModel.do()
double aEnd = aCurve->endParam();
GeomCirclePtr aCircle = GeomCirclePtr(new GeomAPI_Circ(aCurve));
GeomPointPtr aProjPnt = aCircle->project(thePnt);
- if (thePnt->distance(aProjPnt) <= Precision::Confusion())
+ if (aProjPnt && thePnt->distance(aProjPnt) <= Precision::Confusion())
aList.push_back(aResObj);
}
}
//! Returns index of the object
//! \param theObject object to find
- virtual QModelIndex objectIndex(const ObjectPtr theObject, int theColumn = 0) const;
+ virtual QModelIndex objectIndex(const ObjectPtr theObject, int theColumn = 1) const;
//! Clear internal data
virtual void clear();
/// Returns an index which is root of the given document
/// \param theDoc a document
- QModelIndex documentRootIndex(DocumentPtr theDoc, int theColumn = 0) const;
+ QModelIndex documentRootIndex(DocumentPtr theDoc, int theColumn = 1) const;
/// Returns last history object index
virtual QModelIndex lastHistoryIndex() const;
ObjectPtr aObj;
for (int i = 0; i < aNb; i++) {
aObj = theDoc->object(ModelAPI_Folder::group(), i);
- QModelIndex aIdx = myDocModel->objectIndex(aObj);
+ QModelIndex aIdx = myDocModel->objectIndex(aObj, 0);
aMap[aObj] = myTreeView->isExpanded(aIdx);
}
return aMap;
{
QMap<ObjectPtr, bool>::const_iterator aIt;
for (aIt = theStates.constBegin(); aIt != theStates.constEnd(); aIt++) {
- QModelIndex aIdx = myDocModel->objectIndex(aIt.key());
+ QModelIndex aIdx = myDocModel->objectIndex(aIt.key(), 0);
myTreeView->setExpanded(aIdx, aIt.value());
}
}
QAction* anAct = theMgr->operationStateAction(aActionIds.at(i));
aBtn->setDefaultAction(anAct);
}
- // This code is necessary for remembering of user choice in property panel
- QToolButton* aBtn = findButton(PROP_PANEL_OK);
- if (aBtn)
- connect(aBtn->defaultAction(), SIGNAL(triggered(bool)), this, SLOT(onAcceptData()));
- aBtn = findButton(PROP_PANEL_OK_PLUS);
- if (aBtn)
- connect(aBtn->defaultAction(), SIGNAL(triggered(bool)), this, SLOT(onAcceptData()));
}
void XGUI_PropertyPanel::onAcceptData()
/// \param theIsNext true, if Tab(to the next widget) or false(moving to the previous)
bool setFocusNextPrevChild(bool theIsNext);
+ /// The method is called on accepting of operation
+ virtual void onAcceptData();
+
public slots:
/// \brief Update all widgets in property panel with values from the given feature
/// \param theFeature a Feature to update values in widgets
/// \param theWidget the current widget
void onActivateNextWidget(ModuleBase_ModelWidget* theWidget);
- /// The method is called on accepting of operation
- void onAcceptData();
-
signals:
/// The signal is emitted if the enter is clicked in the control of the widget
/// \param theObject a sender of the event
model.testResultsVolumes(Partition_1, [28288.886256640704232268035411835])
Result = model.addRemoveSubShapes(Part_1_doc, model.selection("COMPSOLID", "Partition_1_1"))
-Result.setSubShapesToRemove([model.selection("SOLID", "Partition_1_1_1")])
+Result.setSubShapesToRemove([model.selection("SOLID", "Partition_1_1_2")])
Result.result().setName("Plug")
# check Remove_SubShapes_1
model.testNbResults(Result, 1)
model.testNbSubShapes(Result, GeomAPI_Shape.VERTEX, [732])
model.testResultsVolumes(Result, [14144.443128843522572424262762070])
-Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Plug/Modified_Face_1_1"), model.selection("FACE", "Plug/Modified_Face_2_1"), model.selection("FACE", "Plug/Modified_Face_3_1"), model.selection("FACE", "Plug/Modified_Face_4_1")])
+Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Plug/Modified_Face_3_1"), model.selection("FACE", "Plug/Modified_Face_5_1"), model.selection("FACE", "Plug/Modified_Face_46_1"), model.selection("FACE", "Plug/Modified_Face_48_1")])
Group_1.result().setColor(68, 68, 68)
# check Group_1
model.checkGroup(Group_1, GeomAPI_Shape.FACE)