data()->addAttribute(VALUES_ID(), ModelAPI_AttributeTables::typeId());
data()->addAttribute(VALUES_CURV_ID(), ModelAPI_AttributeTables::typeId());
data()->addAttribute(EDGE_SELECTED_ID(), ModelAPI_AttributeSelection::typeId());
- data()->addAttribute(EDGEFACE_SELECTED_ID(), ModelAPI_AttributeSelection::typeId());
data()->addAttribute(ARRAY_POINT_RADIUS_BY_POINTS(), ModelAPI_AttributeSelectionList::typeId());
AttributeSelectionPtr anEdges =
std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(attribute(EDGE_SELECTED_ID()));
AttributeSelectionListPtr array = selectionList(OBJECT_LIST_ID());
- array->append(anEdges->namingName() );
-
- selection( EDGEFACE_SELECTED_ID())->setValue( anEdges->context(), anEdges->value());
- }
- else if (theID == EDGEFACE_SELECTED_ID()
- && string(CREATION_METHOD())->value() == CREATION_METHOD_MULTIPLES_RADIUSES()) {
-
- AttributeSelectionPtr anEdges =
- std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(attribute(EDGEFACE_SELECTED_ID()));
- AttributeSelectionListPtr array = selectionList(OBJECT_LIST_ID());
+ if(array->isInitialized())
+ array->clear();
array->append(anEdges->namingName() );
}
}
ListOfShape aFilletEdges = extractEdges(theEdges);
+ std::cout << "coucou aCreationMethod->value() = " << aCreationMethod->value()<< std::endl;
if ( aCreationMethod->value() == CREATION_METHOD_MULTIPLES_RADIUSES() )
{
{
QVBoxLayout* aMainLayout = new QVBoxLayout(this);
- aMainLayout->addWidget(new QLabel("Raduises", this));
+ aMainLayout->addWidget(new QLabel("Radii", this));
// Radiuses controls
QFrame* aRadiusesFrame = new QFrame(this);
+ aRadiusesFrame->setFrameShape( QFrame::HLine );
aRadiusesFrame->setFrameShape(QFrame::Box);
aRadiusesFrame->setFrameStyle(QFrame::StyledPanel);
- QVBoxLayout* aRadiusesLayout = new QVBoxLayout(aRadiusesFrame);
- aMainLayout->addWidget(aRadiusesFrame);
+ QVBoxLayout* aRadiusesLayout = new QVBoxLayout();
+
myDataTbl = new QTableWidget(2, 3, aRadiusesFrame);
QStringList aHeaders;
aHeaders << "Point";
- aHeaders << "Curvilinear /n Abscissa";
+ aHeaders << "Curvilinear Abscissa";
aHeaders << "Radius";
font.setPointSize(12);
myRemoveBtn->setFont(font);
aBtnLayout->addWidget(myRemoveBtn);
+
+ aRadiusesFrame->setLayout(aRadiusesLayout ) ;
+ aMainLayout->addWidget(aRadiusesFrame);
- connect(aAddBtn, SIGNAL(clicked(bool)), SLOT(onAddStep()));
- connect(myRemoveBtn, SIGNAL(clicked(bool)), SLOT(onRemoveStep()));
+ connect(aAddBtn, SIGNAL(clicked(bool)), SLOT(onAdd()));
+ connect(myRemoveBtn, SIGNAL(clicked(bool)), SLOT(onRemove()));
connect(qApp, SIGNAL(focusChanged(QWidget*, QWidget*)), SLOT(onFocusChanged(QWidget*, QWidget*)));
}
AttributeSelectionPtr anEdges =
std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(aData->attribute(FeaturesPlugin_Fillet::EDGE_SELECTED_ID()));
- if( !anEdges->isInitialized() )
- return;
+
std::map<double,std::pair<QString,QString>> aValuesSort;
std::map<double,std::pair<QString,QString>>::iterator itValuesSort;
if(myTypeMethodeBypoint)
{
+ if( !anEdges->isInitialized() )
+ return;
+
GeomEdgePtr anEdge = GeomEdgePtr(new GeomAPI_Edge( anEdges->value()));
GeomPointPtr first = anEdge->firstPoint();
GeomPointPtr last = anEdge->lastPoint();
}else{
ModelAPI_AttributeTables::Value aVal;
- if (aTablesAttr->isInitialized()){
+ if (aTablesAttr->isInitialized()){
for (int anIndex = 0; anIndex < aTablesAttr->rows(); ++anIndex) {
aVal = aTablesAttr->value(anIndex,0);
double curv = getValueText(aVal).toDouble();
- if ( aValuesSort.find( curv ) == aValuesSort.end() )
+ if ( aValuesSort.find( curv ) == aValuesSort.end() )
aValuesSort[ curv ] = std::make_pair(getValueText(aVal), findRadius(getValueText(aVal)));
}
aRows = aTablesAttr->rows();
aItem = new QTableWidgetItem(aCurv);
myDataTbl->setItem(k, 1, aItem);
}
- aItem = myDataTbl->item(k, 2);
+ aItem = myDataTbl->item(k, 2);
if (aItem) {
aItem->setText( elem.second);
} else {
//**********************************************************************************
-void FeaturesPlugin_WidgetFilletMultiRadiuses::onAddStep()
+void FeaturesPlugin_WidgetFilletMultiRadiuses::onAdd()
{
QModelIndex index = myDataTbl->currentIndex();
i = myDataTbl->rowCount() - 2;
if ( i == 0)
- i =1;
+ i = 1;
+ else
+ i= i+1;
+
myDataTbl->model()->insertRow(i);
QTableWidgetItem* aItem =0;
myDataTbl->setItem(i, 2, aItem);
aItem = new QTableWidgetItem(myLastRowValue[2]);
myDataTbl->setItem(i, 2, aItem);
-
myDataTbl->blockSignals(false);
-
+
emit valuesChanged();
+ myDataTbl->setCurrentCell( i, 0);
}
//**********************************************************************************
-void FeaturesPlugin_WidgetFilletMultiRadiuses::onRemoveStep()
+void FeaturesPlugin_WidgetFilletMultiRadiuses::onRemove()
{
QModelIndex index = myDataTbl->currentIndex();
aShape = aValue->shape();
if ( (aResult.get() || aShape.get() ) && !aSelList->isInList(aResult, aShape)) {
aSelList->append(aResult, aShape);
- onRemoveStep();
+ onRemove();
}else{
mySetSelection = false;
return false;
icon="icons/Features/edge.png"
label="Start"
tooltip="Select edge"
- shape_types="edge">
+ shape_types="edge"
+ use_choice="false"
+ concealment="true">
<validator id="GeomValidators_ShapeType" parameters="empty,line"/>
+ <!--validator id="FeaturesPlugin_ValidatorFilletSelection"/-->
</shape_selector>
<multiradius-panel id="array_point_radius_by_point"
filter_points="false">
title="By curvilinear abscissa"
tooltip="Fillet with multiple radiuses by curvilinear abscissa"
icon="icons/Features/fillet_multiradius_by_curv.png">
- <shape_selector id="edgeface_selected"
- icon="icons/Features/edge.png"
- label="Start"
- tooltip="Select edge"
- shape_types="edge face">
- <validator id="GeomValidators_ShapeType" parameters="empty,line,face"/>
- </shape_selector>
+ <multi_selector id="main_objects"
+ label="Faces, edges or/and solids"
+ icon=""
+ tooltip="Select objects"
+ shape_types="edges faces solids"
+ use_choice="false"
+ concealment="true">
+ <validator id="PartSet_DifferentObjects"/>
+ <validator id="FeaturesPlugin_ValidatorFilletSelection"/>
+ </multi_selector>
<multiradiuscurv-panel id="array_point_radius_by_point"
filter_points="false">
<validator id="GeomValidators_ShapeType" parameters="empty,vertex"/>