tooltip="Select a set of objects"
type_choice="Vertices Edges Faces Solids"
use_choice="true"
+ use_filters="true"
clear_in_neutral_point="false"
filter_points="false" >
<validator id="GeomValidators_BodyShapes"/>
ModuleBase_WidgetRadiobox.h
ModuleBase_WidgetPointInput.h
ModuleBase_ITreeNode.h
+ ModuleBase_WidgetSelectionFilter.h
)
SET(PROJECT_MOC_HEADERS
ModuleBase_WidgetNameEdit.h
ModuleBase_WidgetRadiobox.h
ModuleBase_WidgetPointInput.h
+ ModuleBase_WidgetSelectionFilter.h
)
SET(PROJECT_SOURCES
ModuleBase_WidgetNameEdit.cpp
ModuleBase_WidgetRadiobox.cpp
ModuleBase_WidgetPointInput.cpp
+ ModuleBase_WidgetSelectionFilter.cpp
)
SET(PROJECT_LIBRARIES
: QWidget(theParent), myType(theType)
{
QHBoxLayout* aLayout = new QHBoxLayout(this);
- ModuleBase_Tools::adjustMargins(aLayout);
+ aLayout->setContentsMargins(0, 0, 0, 0);
switch (myType) {
case RadioButtons:
#include <ModuleBase_ViewerPrs.h>
#include <ModuleBase_WidgetShapeSelector.h>
#include <ModuleBase_ChoiceCtrl.h>
+#include <ModuleBase_WidgetSelectionFilter.h>
#include <ModelAPI_Data.h>
#include <ModelAPI_Object.h>
myShapeTypes = aTypesStr.split(' ', QString::SkipEmptyParts);
myIsUseChoice = theData->getBooleanAttribute("use_choice", false);
- QGridLayout* aMainLay = new QGridLayout(this);
+ QVBoxLayout* aMainLay = new QVBoxLayout(this);
ModuleBase_Tools::adjustMargins(aMainLay);
QStringList aIconsList = getIconsList(myShapeTypes);
myTypeCtrl = new ModuleBase_ChoiceCtrl(this, myShapeTypes, aIconsList);
myTypeCtrl->setLabel(tr("Type"));
myTypeCtrl->setValue(0);
- aMainLay->addWidget(myTypeCtrl, 0, 0, 1, 2);
+ aMainLay->addWidget(myTypeCtrl);
myDefMode = myShapeTypes.first().toStdString();
// There is no sense to parameterize list of types while we can not parameterize selection mode
}
QString aLabelText = translate(theData->getProperty("label"));
- QLabel* aListLabel = new QLabel(aLabelText, this);
- aMainLay->addWidget(aListLabel, 1, 0);
- // if the xml definition contains one type, an information label
- // should be shown near to the latest
- if (myShapeTypes.size() <= 1) {
- QString aLabelIcon = QString::fromStdString(theData->widgetIcon());
- if (!aLabelIcon.isEmpty()) {
- QLabel* aSelectedLabel = new QLabel("", this);
- aSelectedLabel->setPixmap(ModuleBase_IconFactory::loadPixmap(aLabelIcon));
- aMainLay->addWidget(aSelectedLabel, 1, 1);
+ if (aLabelText.size() > 0) {
+ QWidget* aLabelWgt = new QWidget(this);
+ QHBoxLayout* aLabelLayout = new QHBoxLayout(aLabelWgt);
+ aLabelLayout->setContentsMargins(0, 0, 0, 0);
+ aMainLay->addWidget(aLabelWgt);
+
+ QLabel* aListLabel = new QLabel(aLabelText, this);
+ aLabelLayout->addWidget(aListLabel);
+ // if the xml definition contains one type, an information label
+ // should be shown near to the latest
+ if (myShapeTypes.size() <= 1) {
+ QString aLabelIcon = QString::fromStdString(theData->widgetIcon());
+ if (!aLabelIcon.isEmpty()) {
+ QLabel* aSelectedLabel = new QLabel("", this);
+ aSelectedLabel->setPixmap(ModuleBase_IconFactory::loadPixmap(aLabelIcon));
+ aLabelLayout->addWidget(aSelectedLabel);
+ aLabelLayout->addStretch(1);
+ }
}
- aMainLay->setColumnStretch(2, 1);
+ }
+ bool aUseFilters = theData->getBooleanAttribute("use_filters", false);
+ if (aUseFilters) {
+ myFiltersWgt = new ModuleBase_FilterStarter(this, theWorkshop);
+ aMainLay->addWidget(myFiltersWgt);
}
QString aToolTip = QString::fromStdString(theData->widgetTooltip());
connect(myListView, SIGNAL(deleteActionClicked()), SLOT(onDeleteItem()));
connect(myListView, SIGNAL(listActivated()), SLOT(onListActivated()));
- aMainLay->addWidget(myListView->getControl(), 2, 0, 1, -1);
- aMainLay->setRowStretch(2, 1);
- //aMainLay->addWidget(new QLabel(this)); //FIXME(sbh)???
- //aMainLay->setRowMinimumHeight(3, 20);
- //this->setLayout(aMainLay);
+ aMainLay->addWidget(myListView->getControl());
connect(myTypeCtrl, SIGNAL(valueChanged(int)), this, SLOT(onSelectionTypeChanged()));
myIsNeutralPointClear = theData->getBooleanAttribute("clear_in_neutral_point", true);
class ModuleBase_ListView;
class ModuleBase_IWorkshop;
class ModuleBase_ChoiceCtrl;
+class ModuleBase_FilterStarter;
/**
* \ingroup GUI
bool myIsFirst;
std::string myDefMode;
+
+ ModuleBase_FilterStarter* myFiltersWgt;
};
#endif /* MODULEBASE_WIDGETFILESELECTOR_H_ */
--- /dev/null
+// Copyright (C) 2014-2017 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or
+// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+//
+
+#include "ModuleBase_WidgetSelectionFilter.h"
+#include "ModuleBase_Tools.h"
+#include "ModuleBase_IWorkshop.h"
+
+#include <QLayout>
+#include <QPushButton>
+#include <QLabel>
+#include <QPicture>
+
+ModuleBase_FilterStarter::ModuleBase_FilterStarter(QWidget* theParent,
+ ModuleBase_IWorkshop* theWorkshop)
+ : QWidget(theParent),
+ myWorkshop(theWorkshop)
+{
+ QHBoxLayout* aMainLayout = new QHBoxLayout(this);
+ ModuleBase_Tools::adjustMargins(aMainLayout);
+
+ aMainLayout->addStretch(1);
+ QPushButton* aLaunchBtn = new QPushButton(tr("Selection by filters"), this);
+ connect(aLaunchBtn, SIGNAL(clicked()), SLOT(onFiltersLaunch()));
+ aMainLayout->addWidget(aLaunchBtn);
+
+ myFilterLbl = new QLabel(this);
+ myFilterLbl->setPixmap(QPixmap(":pictures/filter.png"));
+ aMainLayout->addWidget(myFilterLbl);
+
+ myModifyLbl = new QLabel(this);
+ myModifyLbl->setPixmap(QPixmap(":pictures/plus_minus.png"));
+ aMainLayout->addWidget(myModifyLbl);
+ aMainLayout->addStretch(1);
+
+ myFilterLbl->hide();
+ myModifyLbl->hide();
+}
+
+void ModuleBase_FilterStarter::onFiltersLaunch()
+{
+
+}
\ No newline at end of file
--- /dev/null
+// Copyright (C) 2014-2017 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or
+// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+//
+
+#ifndef ModuleBase_WidgetSelectionFilter_H
+#define ModuleBase_WidgetSelectionFilter_H
+
+#include <ModuleBase.h>
+#include <QWidget>
+
+class QLabel;
+class ModuleBase_IWorkshop;
+
+class MODULEBASE_EXPORT ModuleBase_FilterStarter: public QWidget
+{
+ Q_OBJECT
+public:
+ ModuleBase_FilterStarter(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop);
+
+ ~ModuleBase_FilterStarter() {}
+
+private slots:
+ void onFiltersLaunch();
+
+private:
+ QLabel* myFilterLbl;
+ QLabel* myModifyLbl;
+
+ ModuleBase_IWorkshop* myWorkshop;
+};
+
+
+#endif
\ No newline at end of file
bool aHidePreview = myPreviewPlanes->isPreviewDisplayed();
myPreviewPlanes->erasePreviewPlanes(myWorkshop);
- // Launch Sketch operation
- CompositeFeaturePtr aCompFeature =
- std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(myFeature);
-
// start edit operation for the sketch
ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
(myModule->createOperation("Sketch"));
<file>pictures/autoapply_start.png</file>
<file>pictures/autoapply_stop.png</file>
<file>pictures/whatis.png</file>
+
+ <file>pictures/filter.png</file>
+ <file>pictures/plus_minus.png</file>
</qresource>
</RCC>