#include <ModuleBase_OperationDescription.h>
#include <ModuleBase_WidgetFactory.h>
#include <ModuleBase_IModule.h>
#include <ModuleBase_OperationDescription.h>
#include <ModuleBase_WidgetFactory.h>
#include <ModuleBase_IModule.h>
ModuleBase_WidgetSelector::ModuleBase_WidgetSelector(QWidget* theParent,
ModuleBase_IWorkshop* theWorkshop,
ModuleBase_WidgetSelector::ModuleBase_WidgetSelector(QWidget* theParent,
ModuleBase_IWorkshop* theWorkshop,
- const Config_WidgetAPI* theData,
- const std::string& theParentId)
- : ModuleBase_WidgetValidated(theParent, theWorkshop, theData, theParentId)
+ const Config_WidgetAPI* theData)
+: ModuleBase_WidgetValidated(theParent, theWorkshop, theData)
//********************************************************************
void ModuleBase_WidgetSelector::onSelectionChanged()
{
//********************************************************************
void ModuleBase_WidgetSelector::onSelectionChanged()
{
// "false" flag should be used here, it connects to the #26658 OCC bug, when the user click in
// the same place repeatedly without mouse moved. In the case validation by filters is not
// perfromed, so an invalid object is selected. E.g. distance constraint, selection of a point.
// "false" flag should be used here, it connects to the #26658 OCC bug, when the user click in
// the same place repeatedly without mouse moved. In the case validation by filters is not
// perfromed, so an invalid object is selected. E.g. distance constraint, selection of a point.
//********************************************************************
bool ModuleBase_WidgetSelector::acceptSubShape(const GeomShapePtr& theShape,
const ResultPtr& theResult) const
//********************************************************************
bool ModuleBase_WidgetSelector::acceptSubShape(const GeomShapePtr& theShape,
const ResultPtr& theResult) const
QIntList::const_iterator anIt = aShapeTypes.begin(), aLast = aShapeTypes.end();
for (; anIt != aLast; anIt++) {
QIntList::const_iterator anIt = aShapeTypes.begin(), aLast = aShapeTypes.end();
for (; anIt != aLast; anIt++) {
// try to process the construction shape only if there is no a selected shape in the viewer
if (!theShape.get() && theResult.get()) {
ResultConstructionPtr aCResult =
std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(theResult);
aValid = aCResult.get() && aCResult->facesNum() > 0;
}
// try to process the construction shape only if there is no a selected shape in the viewer
if (!theShape.get() && theResult.get()) {
ResultConstructionPtr aCResult =
std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(theResult);
aValid = aCResult.get() && aCResult->facesNum() > 0;
}
{
GeomShapePtr aShape = myWorkshop->selection()->getShape(thePrs);
ResultPtr aResult = myWorkshop->selection()->getResult(thePrs);
{
GeomShapePtr aShape = myWorkshop->selection()->getShape(thePrs);
ResultPtr aResult = myWorkshop->selection()->getResult(thePrs);
- setObject(anObject, aShape);
+ ModuleBase_Tools::setObject(attribute(), anObject, aShape, myWorkshop, myIsInValidate);
ModuleBase_WidgetFactory aFactory(aXmlCfg, theWorkshop);
std::string anAttributeTitle;
ModuleBase_WidgetFactory aFactory(aXmlCfg, theWorkshop);
std::string anAttributeTitle;
std::stringstream aStreamName;
aStreamName << theAttribute->owner()->data()->name() << "/"<< anAttributeTitle.c_str();
std::stringstream aStreamName;
aStreamName << theAttribute->owner()->data()->name() << "/"<< anAttributeTitle.c_str();