From d32c6da03985ec82a38ef1c236f71d0c2df2ebb2 Mon Sep 17 00:00:00 2001 From: vsv Date: Wed, 23 Nov 2016 16:12:12 +0300 Subject: [PATCH] Issue #1865: Create a field --- .../CollectionPlugin_WidgetField.cpp | 29 +++++-------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/src/CollectionPlugin/CollectionPlugin_WidgetField.cpp b/src/CollectionPlugin/CollectionPlugin_WidgetField.cpp index 8dd768c62..9219199cc 100644 --- a/src/CollectionPlugin/CollectionPlugin_WidgetField.cpp +++ b/src/CollectionPlugin/CollectionPlugin_WidgetField.cpp @@ -607,6 +607,9 @@ void CollectionPlugin_WidgetField::onNbCompChanged(int theVal) myCompNamesList.removeLast(); } + AttributeTablesPtr aTablesAttr = myFeature->data()->tables(CollectionPlugin_Field::VALUES_ID()); + aTablesAttr->setSize(aNbRows, myCompNamesList.size(), myDataTblList.size()); + foreach(QTableWidget* aDataTbl, myDataTblList) { aDataTbl->setColumnCount(theVal + 1); updateHeaders(aDataTbl); @@ -677,27 +680,7 @@ void CollectionPlugin_WidgetField::onSelectionChanged() AttributeSelectionListPtr aSelList = myFeature->data()->selectionList(CollectionPlugin_Field::SELECTED_ID()); aSelList->clear(); - - switch (myShapeTypeCombo->currentIndex()) { - case 0: //"Vertices" - aSelList->setSelectionType("vertex"); - break; - case 1: // "Edges" - aSelList->setSelectionType("edge"); - break; - case 2: // "Faces" - aSelList->setSelectionType("face"); - break; - case 3: // "Solids" - aSelList->setSelectionType("solid"); - break; - case 4: // "Results" - aSelList->setSelectionType("object"); - break; - case 5: // "Parts" - // TODO: Selection mode for Parts - break; - } + aSelList->setSelectionType(getSelectionType(myShapeTypeCombo->currentIndex())); ResultPtr aResult; GeomShapePtr aShape; @@ -772,6 +755,7 @@ void CollectionPlugin_WidgetField::onFieldTypeChanged(int theIdx) } } +//********************************************************************************** void CollectionPlugin_WidgetField::onTableEdited(int theRow, int theCol) { // Do not store here column of names @@ -792,8 +776,11 @@ void CollectionPlugin_WidgetField::onTableEdited(int theRow, int theCol) emit valuesChanged(); } +//********************************************************************************** void CollectionPlugin_WidgetField::onShapeTypeChanged(int theType) { + activateSelectionAndFilters(true); + AttributeSelectionListPtr aSelList = myFeature->data()->selectionList(CollectionPlugin_Field::SELECTED_ID()); if (!aSelList->isInitialized()) -- 2.39.2