#include <GeomAlgoAPI_PointBuilder.h>
#include <GeomAPI_Edge.h>
#include <GeomAPI_Pnt.h>
+#include <GeomAPI_Curve.h>
static GeomAPI_Shape::ShapeType typeOfSelection(
const std::list<ModelHighAPI_Selection>& theBaseObjects)
GeomPointPtr first = anEdge->firstPoint();
GeomPointPtr last = anEdge->lastPoint();
double taille = first->distance(last);
+
+ std::shared_ptr<GeomAPI_Curve> aCurve(new GeomAPI_Curve(edgeselected()->value()));
+
ListOfShape aPoints;
std::set<GeomShapePtr> aContexts;
for (int anIndex = 0; anIndex < myarraypointradiusbypoint->size(); ++anIndex) {
ListOfShape::const_iterator aPointsIt = aPoints.begin();
for (; aPointsIt != aPoints.end(); ++aPointsIt, aRowsRadiusIter++) {
std::shared_ptr<GeomAPI_Pnt> aPnt = GeomAlgoAPI_PointBuilder::point(*aPointsIt);
- double res = (aPnt->distance(first) / taille);
+ std::shared_ptr<GeomAPI_Pnt> aPntCurv = aCurve->project(aPnt);
+ double res = (aPntCurv->distance(first) / taille);
aVal.myDouble = res;
myvaluescurv()->setValue(aVal, aRowIndex, 0 );
aVal.myDouble = aRowsRadiusIter->value();
}
void FeaturesAPI_Fillet2D::setRadius(const ModelHighAPI_Double& theRadius)
-{
- std::cout << "FeaturesAPI_Fillet2D::setRadius" << std::endl;
+{
fillAttribute(FeaturesPlugin_Fillet::CREATION_METHOD_SINGLE_RADIUS(), mycreationMethod);
fillAttribute(theRadius, myradius);
void FeaturesAPI_Fillet2D::setRadius(const ModelHighAPI_Double& theRadius1,
const ModelHighAPI_Double& theRadius2)
-{
- std::cout << "FeaturesAPI_Fillet2D::setRadius CREATION_METHOD_VARYING_RADIUS" << std::endl;
+{
fillAttribute(FeaturesPlugin_Fillet::CREATION_METHOD_VARYING_RADIUS(), mycreationMethod);
fillAttribute(theRadius1, mystartRadius);
fillAttribute(theRadius2, myendRadius);
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());
AttributePtr FeaturesPlugin_Fillet::objectsAttribute()
{
-
return attribute(OBJECT_LIST_ID());
}
AttributeSelectionPtr anEdges =
std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(attribute(EDGE_SELECTED_ID()));
AttributeSelectionListPtr array = selectionList(OBJECT_LIST_ID());
- //if (array->isInitialized() )
- // array->clear();
-
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());
+ array->append(anEdges->namingName() );
}
}
aVal = aTablesAttr->value(k, 1);
radiuses.push_back(aVal.myDouble);
}
+
aFilletBuilder.reset(new GeomAlgoAPI_Fillet(theSolid, aFilletEdges, coodCurv,radiuses));
}else
return MY_EDGE_SELECTED_ID;
}
+ /// Attribute name of edge selected.
+ inline static const std::string& EDGEFACE_SELECTED_ID()
+ {
+ static const std::string MY_EDGEFACE_SELECTED_ID("edgeface_selected");
+ return MY_EDGEFACE_SELECTED_ID;
+ }
+
/// attribute name of list of tables that contain deafult values (row 0) and the custom values
inline static const std::string& VALUES_ID()
{
#include <GeomAlgoAPI_PointBuilder.h>
#include <GeomAPI_Edge.h>
#include <GeomAPI_Pnt.h>
+#include <GeomAPI_Curve.h>
#include <Locale_Convert.h>
#include <QStandardItem>
#include <map>
else
myDataTbl->hideColumn(0);
-
QStringList aHeaders;
aHeaders << "Point";
aHeaders << "Curvilinear /n Abscissa";
//**********************************************************************************
bool FeaturesPlugin_WidgetFilletMultiRadiuses::storeValueCustom()
{
-
DataPtr aData = myFeature->data();
AttributeTablesPtr aTablesAttr;
GeomPointPtr first = anEdge->firstPoint();
GeomPointPtr last = anEdge->lastPoint();
double taille = first->distance(last);
-
+
+ std::shared_ptr<GeomAPI_Curve> aCurve(new GeomAPI_Curve(anEdges->value()));
+
// Load points
AttributeSelectionListPtr aSelectionListAttr = aData->selectionList(FeaturesPlugin_Fillet::ARRAY_POINT_RADIUS_BY_POINTS());
AttributeDoubleArrayPtr aArrayAttr;
for (; aPointsIt != aPoints.end(); ++aPointsIt) {
AttributeSelectionPtr attsel = aSelectionListAttr->value(i);
std::shared_ptr<GeomAPI_Pnt> aPnt = GeomAlgoAPI_PointBuilder::point(*aPointsIt);
- res = (aPnt->distance(first) / taille);
+ std::shared_ptr<GeomAPI_Pnt> aPntCurv = aCurve->project(aPnt);
+ res = (aPntCurv->distance(first) / taille);
QString aName = QString::fromStdWString(attsel->namingName());
QString aRad = findRadius( QString::number(res) );
if ( aValuesSort.find( res ) == aValuesSort.end() )
ModuleBase_ViewerPrsPtr aValue = theValues.first();
aResult = std::dynamic_pointer_cast<ModelAPI_Result>(aValue->object());
aShape = aValue->shape();
-
if ( (aResult.get() || aShape.get() ) && !aSelList->isInList(aResult, aShape)) {
aSelList->append(aResult, aShape);
onRemoveStep();
title="By curvilinear abscissa"
tooltip="Fillet with multiple radiuses by curvilinear abscissa"
icon="icons/Features/fillet_multiradius_by_curv.png">
- <shape_selector id="edge_selected"
+ <shape_selector id="edgeface_selected"
icon="icons/Features/edge.png"
label="Start"
tooltip="Select edge"
- shape_types="edge">
- <validator id="GeomValidators_ShapeType" parameters="empty,line"/>
+ shape_types="edge face">
+ <validator id="GeomValidators_ShapeType" parameters="empty,line,face"/>
</shape_selector>
<multiradiuscurv-panel id="array_point_radius_by_point"
filter_points="false">
for( ; itCurv != theCurvCoord.end(); ++itCurv, ++itRadius )
{
array.SetValue(i, gp_Pnt2d( (*itCurv) , (*itRadius)));
- std::cout << "Value lance " << (*itCurv) << " "<< (*itRadius) << std::endl;
i++;
}
// assign fillet radii for each contour of filleting edges