diff --git a/src/Mod/PartDesign/App/DatumPlane.cpp b/src/Mod/PartDesign/App/DatumPlane.cpp index 0f00df51ca..7b8b1fe195 100644 --- a/src/Mod/PartDesign/App/DatumPlane.cpp +++ b/src/Mod/PartDesign/App/DatumPlane.cpp @@ -244,9 +244,9 @@ void Plane::onChanged(const App::Property *prop) normal = new Base::Vector3d; if (strcmp(p->PlaneType.getValue(), App::Part::BaseplaneTypes[0]) == 0) *normal = Base::Vector3d(0,0,1); - else if (strcmp(p->PlaneType.getValue(), App::Part::BaseplaneTypes[2]) == 0) - *normal = Base::Vector3d(0,1,0); else if (strcmp(p->PlaneType.getValue(), App::Part::BaseplaneTypes[1]) == 0) + *normal = Base::Vector3d(0,1,0); + else if (strcmp(p->PlaneType.getValue(), App::Part::BaseplaneTypes[2]) == 0) *normal = Base::Vector3d(1,0,0); } else if (refs[i]->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId())) { Part::Feature* feature = static_cast(refs[i]); diff --git a/src/Mod/PartDesign/App/FeaturePipe.cpp b/src/Mod/PartDesign/App/FeaturePipe.cpp index c042a85a2c..db29a6007c 100644 --- a/src/Mod/PartDesign/App/FeaturePipe.cpp +++ b/src/Mod/PartDesign/App/FeaturePipe.cpp @@ -41,6 +41,14 @@ # include # include # include +#include +#include +#include +#include +#include +#include +#include +#include #endif #include @@ -57,7 +65,8 @@ using namespace PartDesign; const char* Pipe::TypeEnums[] = {"FullPath","UpToFace",NULL}; const char* Pipe::TransitionEnums[] = {"Transformed","Right corner", "Round corner",NULL}; -const char* Pipe::ModeEnums[] = {"Standart", "Fixed", "Binormal", "Frenet", NULL}; +const char* Pipe::ModeEnums[] = {"Standart", "Fixed", "Binormal", "Frenet", "Auxillery", NULL}; +const char* Pipe::TransformEnums[] = {"Constant", "Multisection", "Auxillery", NULL}; PROPERTY_SOURCE(PartDesign::Pipe, PartDesign::SketchBased) @@ -66,10 +75,18 @@ Pipe::Pipe() { ADD_PROPERTY_TYPE(Sections,(0),"Sweep",App::Prop_None,"List of sections"); Sections.setSize(0); - ADD_PROPERTY_TYPE(Spine,(0,0),"Sweep",App::Prop_None,"Path to sweep along"); - ADD_PROPERTY_TYPE(Mode,(long(1)),"Sweep",App::Prop_None,"Profile mode"); - ADD_PROPERTY_TYPE(Transition,(long(1)),"Sweep",App::Prop_None,"Transition mode"); + ADD_PROPERTY_TYPE(Spine,(0),"Sweep",App::Prop_None,"Path to sweep along"); + ADD_PROPERTY_TYPE(SpineTangent,(false),"Sweep",App::Prop_None,"Include tangent edges into path"); + ADD_PROPERTY_TYPE(AuxillerySpine,(0),"Sweep",App::Prop_None,"Secondary path to orient sweep"); + ADD_PROPERTY_TYPE(AuxillerySpineTangent,(false),"Sweep",App::Prop_None,"Include tangent edges into secondary path"); + ADD_PROPERTY_TYPE(AuxilleryCurvelinear, (true), "Sweep", App::Prop_None,"Calculate normal between equidistant points on both spines"); + ADD_PROPERTY_TYPE(Mode,(long(0)),"Sweep",App::Prop_None,"Profile mode"); + ADD_PROPERTY_TYPE(Binormal,(Base::Vector3d()),"Sweep",App::Prop_None,"Binormal vector for coresponding orientation mode"); + ADD_PROPERTY_TYPE(Transition,(long(0)),"Sweep",App::Prop_None,"Transition mode"); + ADD_PROPERTY_TYPE(Transformation,(long(0)),"Sweep",App::Prop_None,"Section transformation mode"); + Mode.setEnums(ModeEnums); Transition.setEnums(TransitionEnums); + Transformation.setEnums(TransformEnums); } short Pipe::mustExecute() const @@ -87,10 +104,234 @@ short Pipe::mustExecute() const App::DocumentObjectExecReturn *Pipe::execute(void) { + + Part::Part2DObject* sketch = 0; + std::vector wires; + try { + sketch = getVerifiedSketch(); + wires = getSketchWires(); + } catch (const Base::Exception& e) { + return new App::DocumentObjectExecReturn(e.what()); + } + + TopoDS_Shape sketchshape = makeFace(wires); + if (sketchshape.IsNull()) + return new App::DocumentObjectExecReturn("Pipe: Creating a face from sketch failed"); + + // if the Base property has a valid shape, fuse the pipe into it + TopoDS_Shape base; + try { + base = getBaseShape(); + } catch (const Base::Exception&) { + try { + // fall back to support (for legacy features) + base = getSupportShape(); + } catch (const Base::Exception&) { + // ignore, because support isn't mandatory + base = TopoDS_Shape(); + } + } - return SketchBased::execute(); + try { + App::DocumentObject* spine = Spine.getValue(); + if (!(spine && spine->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId()))) + return new App::DocumentObjectExecReturn("No spine linked."); + std::vector subedge = Spine.getSubValues(); + + TopoDS_Shape path; + const Part::TopoShape& shape = static_cast(spine)->Shape.getValue(); + buildPipePath(shape, subedge, path); + + BRepOffsetAPI_MakePipeShell mkPipeShell(TopoDS::Wire(path)); + mkPipeShell.SetTolerance(Precision::Confusion()); + //mkPipeShell.SetMode(isFrenet); + switch(Transition.getValue()) { + case 0: + mkPipeShell.SetTransitionMode(BRepBuilderAPI_Transformed); + break; + case 1: + mkPipeShell.SetTransitionMode(BRepBuilderAPI_RightCorner); + break; + case 2: + mkPipeShell.SetTransitionMode(BRepBuilderAPI_RoundCorner); + break; + } + + bool auxillery = false; + const Base::Vector3d& bVec = Binormal.getValue(); + switch(Mode.getValue()) { + case 1: + mkPipeShell.SetMode(gp_Ax2(gp_Pnt(0,0,0), gp_Dir(0,0,1), gp_Dir(1,0,0))); + break; + case 2: + mkPipeShell.SetMode(gp_Dir(bVec.x,bVec.y,bVec.z)); + break; + case 3: + mkPipeShell.SetMode(true); + break; + case 4: + auxillery = true; + } + + if(auxillery) { + TopoDS_Shape auxpath; + App::DocumentObject* auxspine = AuxillerySpine.getValue(); + if (!(auxspine && auxspine->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId()))) + return new App::DocumentObjectExecReturn("No auxillery spine linked."); + std::vector auxsubedge = AuxillerySpine.getSubValues(); + + TopoDS_Shape path; + const Part::TopoShape& auxshape = static_cast(auxspine)->Shape.getValue(); + buildPipePath(auxshape, auxsubedge, auxpath); + + if(Transformation.getValue()!=2) + mkPipeShell.SetMode(TopoDS::Wire(auxshape._Shape), AuxilleryCurvelinear.getValue()); + else + mkPipeShell.SetMode(TopoDS::Wire(auxshape._Shape), AuxilleryCurvelinear.getValue(), BRepFill_ContactOnBorder); + } + + // TopTools_ListIteratorOfListOfShape iter; + // for (iter.Initialize(profiles); iter.More(); iter.Next()) { + // mkPipeShell.Add(TopoDS_Shape(iter.Value())); + // } + + mkPipeShell.Add(wires.front()); + + if (!mkPipeShell.IsReady()) + Standard_Failure::Raise("shape is not ready to build"); + mkPipeShell.Build(); + mkPipeShell.MakeSolid(); +/* + TopTools_ListOfShape sim; + mkPipeShell.Simulate(5, sim); + BRep_Builder builder; + TopoDS_Compound Comp; + builder.MakeCompound(Comp); + + TopTools_ListIteratorOfListOfShape simIt; + for (simIt.Initialize(sim); simIt.More(); simIt.Next()) + builder.Add(Comp, simIt.Value()) ; + */ + this->Shape.setValue(mkPipeShell.Shape()); + return App::DocumentObject::StdReturn; + + return SketchBased::execute(); + } + catch (Standard_Failure) { + Handle_Standard_Failure e = Standard_Failure::Caught(); + return new App::DocumentObjectExecReturn(e->GetMessageString()); + } + catch (...) { + return new App::DocumentObjectExecReturn("A fatal error occurred when making the sweep"); + } } +void Pipe::getContiniusEdges(Part::TopoShape TopShape, std::vector< std::string >& SubNames) { + + + TopTools_IndexedMapOfShape mapOfEdges; + TopTools_IndexedDataMapOfShapeListOfShape mapEdgeEdge; + TopExp::MapShapesAndAncestors(TopShape._Shape, TopAbs_EDGE, TopAbs_EDGE, mapEdgeEdge); + TopExp::MapShapes(TopShape._Shape, TopAbs_EDGE, mapOfEdges); + + Base::Console().Message("Initial edges:\n"); + for(int i=0; i(SubNames.at(i)); + + if (aSubName.size() > 4 && aSubName.substr(0,4) == "Edge") { + TopoDS_Edge edge = TopoDS::Edge(TopShape.getSubShape(aSubName.c_str())); + const TopTools_ListOfShape& los = mapEdgeEdge.FindFromKey(edge); + + if(los.Extent() != 2) + { + SubNames.erase(SubNames.begin()+i); + continue; + } + + const TopoDS_Shape& face1 = los.First(); + const TopoDS_Shape& face2 = los.Last(); + GeomAbs_Shape cont = BRep_Tool::Continuity(TopoDS::Edge(edge), + TopoDS::Face(face1), + TopoDS::Face(face2)); + if (cont != GeomAbs_C0) { + SubNames.erase(SubNames.begin()+i); + continue; + } + + i++; + } + // empty name or any other sub-element + else { + SubNames.erase(SubNames.begin()+i); + } + } + + Base::Console().Message("Final edges:\n"); + for(int i=0; i& subedge, TopoDS_Shape& path) { + + if (!shape._Shape.IsNull()) { + try { + if (!subedge.empty()) { + //if(SpineTangent.getValue()) + //getContiniusEdges(shape, subedge); + + BRepBuilderAPI_MakeWire mkWire; + for (std::vector::const_iterator it = subedge.begin(); it != subedge.end(); ++it) { + TopoDS_Shape subshape = shape.getSubShape(it->c_str()); + mkWire.Add(TopoDS::Edge(subshape)); + } + path = mkWire.Wire(); + } + else if (shape._Shape.ShapeType() == TopAbs_EDGE) { + path = shape._Shape; + } + else if (shape._Shape.ShapeType() == TopAbs_WIRE) { + BRepBuilderAPI_MakeWire mkWire(TopoDS::Wire(shape._Shape)); + path = mkWire.Wire(); + } + else if (shape._Shape.ShapeType() == TopAbs_COMPOUND) { + TopoDS_Iterator it(shape._Shape); + for (; it.More(); it.Next()) { + if (it.Value().IsNull()) + throw Base::Exception("In valid element in spine."); + if ((it.Value().ShapeType() != TopAbs_EDGE) && + (it.Value().ShapeType() != TopAbs_WIRE)) { + throw Base::Exception("Element in spine is neither an edge nor a wire."); + } + } + + Handle(TopTools_HSequenceOfShape) hEdges = new TopTools_HSequenceOfShape(); + Handle(TopTools_HSequenceOfShape) hWires = new TopTools_HSequenceOfShape(); + for (TopExp_Explorer xp(shape._Shape, TopAbs_EDGE); xp.More(); xp.Next()) + hEdges->Append(xp.Current()); + + ShapeAnalysis_FreeBounds::ConnectEdgesToWires(hEdges, Precision::Confusion(), Standard_True, hWires); + int len = hWires->Length(); + if (len != 1) + throw Base::Exception("Spine is not connected."); + path = hWires->Value(1); + } + else { + throw Base::Exception("Spine is neither an edge nor a wire."); + } + } + catch (Standard_Failure) { + throw Base::Exception("Invalid spine."); + } + } +} + + + PROPERTY_SOURCE(PartDesign::AdditivePipe, PartDesign::Pipe) AdditivePipe::AdditivePipe() { addSubType = Additive; diff --git a/src/Mod/PartDesign/App/FeaturePipe.h b/src/Mod/PartDesign/App/FeaturePipe.h index 78838f79db..6e693a1339 100644 --- a/src/Mod/PartDesign/App/FeaturePipe.h +++ b/src/Mod/PartDesign/App/FeaturePipe.h @@ -37,10 +37,17 @@ class PartDesignExport Pipe : public SketchBased public: Pipe(); - App::PropertyLinkList Sections; - App::PropertyLinkSubList Spine; + + App::PropertyLinkSub Spine; + App::PropertyBool SpineTangent; + App::PropertyLinkSub AuxillerySpine; + App::PropertyBool AuxillerySpineTangent; + App::PropertyBool AuxilleryCurvelinear; App::PropertyEnumeration Mode; + App::PropertyVector Binormal; App::PropertyEnumeration Transition; + App::PropertyEnumeration Transformation; + App::PropertyLinkList Sections; App::DocumentObjectExecReturn *execute(void); short mustExecute() const; @@ -49,11 +56,17 @@ public: return "PartDesignGui::ViewProviderPipe"; } //@} + +protected: + ///get the given edges and all their tangent ones + void getContiniusEdges(Part::TopoShape TopShape, std::vector< std::string >& SubNames); + void buildPipePath(const Part::TopoShape& input, const std::vector& edges, TopoDS_Shape& result); private: static const char* TypeEnums[]; static const char* TransitionEnums[]; static const char* ModeEnums[]; + static const char* TransformEnums[]; }; class PartDesignExport AdditivePipe : public Pipe { diff --git a/src/Mod/PartDesign/Gui/CMakeLists.txt b/src/Mod/PartDesign/Gui/CMakeLists.txt index f72578060a..9c2fcaad5b 100644 --- a/src/Mod/PartDesign/Gui/CMakeLists.txt +++ b/src/Mod/PartDesign/Gui/CMakeLists.txt @@ -78,6 +78,8 @@ set(PartDesignGui_UIC_SRCS TaskDatumParameters.ui TaskPrimitiveParameters.ui TaskPipeParameters.ui + TaskPipeOrientation.ui + TaskPipeScaling.ui ) qt4_wrap_ui(PartDesignGui_UIC_HDRS ${PartDesignGui_UIC_SRCS}) @@ -203,6 +205,8 @@ SET(PartDesignGuiTaskDlgs_SRCS TaskPrimitiveParameters.h TaskPrimitiveParameters.cpp TaskPipeParameters.ui + TaskPipeOrientation.ui + TaskPipeScaling.ui TaskPipeParameters.h TaskPipeParameters.cpp ) diff --git a/src/Mod/PartDesign/Gui/Resources/PartDesign.qrc b/src/Mod/PartDesign/Gui/Resources/PartDesign.qrc index 8cfa14e2d5..313370adc4 100644 --- a/src/Mod/PartDesign/Gui/Resources/PartDesign.qrc +++ b/src/Mod/PartDesign/Gui/Resources/PartDesign.qrc @@ -29,6 +29,7 @@ icons/PartDesign_Body_Create_New.svg icons/PartDesign_Body_Tree.svg icons/PartDesign_Additive_Pipe.svg + icons/PartDesign_Subtractive_Pipe.svg icons/PartDesign_Additive_Box.svg icons/PartDesign_Additive_Cylinder.svg icons/PartDesign_Additive_Sphere.svg diff --git a/src/Mod/PartDesign/Gui/Resources/icons/PartDesign_Subtractive_Pipe.svg b/src/Mod/PartDesign/Gui/Resources/icons/PartDesign_Subtractive_Pipe.svg new file mode 100644 index 0000000000..8e72798f02 --- /dev/null +++ b/src/Mod/PartDesign/Gui/Resources/icons/PartDesign_Subtractive_Pipe.svg @@ -0,0 +1,256 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/src/Mod/PartDesign/Gui/TaskDatumParameters.cpp b/src/Mod/PartDesign/Gui/TaskDatumParameters.cpp index 704ef87f41..5b706e3a0f 100644 --- a/src/Mod/PartDesign/Gui/TaskDatumParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskDatumParameters.cpp @@ -197,6 +197,7 @@ TaskDatumParameters::TaskDatumParameters(ViewProviderDatum *DatumView,QWidget *p origin = static_cast(Gui::Application::Instance->activeDocument()->getViewProvider(app_origin[0])); origin->setTemporaryVisibilityMode(true, Gui::Application::Instance->activeDocument()); origin->setTemporaryVisibilityAxis(true); + origin->setTemporaryVisibilityPlanes(true); } } } diff --git a/src/Mod/PartDesign/Gui/TaskPipeOrientation.ui b/src/Mod/PartDesign/Gui/TaskPipeOrientation.ui new file mode 100644 index 0000000000..c405a57304 --- /dev/null +++ b/src/Mod/PartDesign/Gui/TaskPipeOrientation.ui @@ -0,0 +1,264 @@ + + + PartDesignGui::TaskPipeOrientation + + + + 0 + 0 + 305 + 420 + + + + Form + + + + + + + + Orientation mode + + + + + + + + 0 + 0 + + + + + Standart + + + + + Fixed + + + + + Binormal + + + + + Frenet + + + + + Auxillery + + + + + + + + + + 2 + + + + + + + + + Set the constant binormal vector used to calculate the profiles orientation + + + true + + + + + + + QFormLayout::ExpandingFieldsGrow + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing + + + 20 + + + + + X + + + + + + + Y + + + + + + + Z + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + Curvelinear equivalenz + + + + + + + Profile + + + + + + + + Object + + + true + + + + + + + + + + + + + + true + + + + 0 + 0 + + + + Add Edge + + + true + + + false + + + + + + + + 0 + 0 + + + + Remove Edge + + + true + + + + + + + + + + + + Extend to tangent edges + + + + + + + + + + + + + + + + comboBoxMode + currentIndexChanged(int) + stackedWidget + setCurrentIndex(int) + + + 241 + 24 + + + 176 + 231 + + + + + diff --git a/src/Mod/PartDesign/Gui/TaskPipeParameters.cpp b/src/Mod/PartDesign/Gui/TaskPipeParameters.cpp index 6125138f38..b227bc58a7 100644 --- a/src/Mod/PartDesign/Gui/TaskPipeParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskPipeParameters.cpp @@ -32,6 +32,8 @@ #endif #include "ui_TaskPipeParameters.h" +#include "ui_TaskPipeOrientation.h" +#include "ui_TaskPipeScaling.h" #include "TaskPipeParameters.h" #include #include @@ -55,6 +57,12 @@ using namespace Gui; /* TRANSLATOR PartDesignGui::TaskPipeParameters */ + +//************************************************************************** +//************************************************************************** +// Task Parameter +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + TaskPipeParameters::TaskPipeParameters(ViewProviderPipe *PipeView,bool newObj, QWidget *parent) : TaskSketchBasedParameters(PipeView, parent, "PartDesign_Pipe",tr("Pipe parameters")) { @@ -63,195 +71,68 @@ TaskPipeParameters::TaskPipeParameters(ViewProviderPipe *PipeView,bool newObj, Q ui = new Ui_TaskPipeParameters(); ui->setupUi(proxy); QMetaObject::connectSlotsByName(this); -/* - connect(ui->lengthEdit, SIGNAL(valueChanged(double)), - this, SLOT(onLengthChanged(double))); - connect(ui->checkBoxMidplane, SIGNAL(toggled(bool)), - this, SLOT(onMidplane(bool))); - connect(ui->checkBoxReversed, SIGNAL(toggled(bool)), - this, SLOT(onReversed(bool))); - connect(ui->lengthEdit2, SIGNAL(valueChanged(double)), - this, SLOT(onLength2Changed(double))); - connect(ui->spinOffset, SIGNAL(valueChanged(double)), - this, SLOT(onOffsetChanged(double))); - connect(ui->changeMode, SIGNAL(currentIndexChanged(int)), - this, SLOT(onModeChanged(int))); - connect(ui->buttonFace, SIGNAL(clicked()), - this, SLOT(onButtonFace())); - connect(ui->lineFaceName, SIGNAL(textEdited(QString)), - this, SLOT(onFaceName(QString))); - connect(ui->checkBoxUpdateView, SIGNAL(toggled(bool)), - this, SLOT(onUpdateView(bool))); -*/ + + connect(ui->comboBoxTransition, SIGNAL(currentIndexChanged(int)), + this, SLOT(onTransitionChanged(int))); + connect(ui->buttonRefAdd, SIGNAL(toggled(bool)), + this, SLOT(onButtonRefAdd(bool))); + connect(ui->buttonRefRemove, SIGNAL(toggled(bool)), + this, SLOT(onButtonRefRemove(bool))); + connect(ui->tangent, SIGNAL(toggled(bool)), + this, SLOT(onTangentChanged(bool))); + connect(ui->buttonProfileBase, SIGNAL(toggled(bool)), + this, SLOT(onBaseButton(bool))); + this->groupLayout()->addWidget(proxy); -/* - // Temporarily prevent unnecessary feature recomputes - ui->lengthEdit->blockSignals(true); - ui->lengthEdit2->blockSignals(true); - ui->checkBoxMidplane->blockSignals(true); - ui->checkBoxReversed->blockSignals(true); - ui->buttonFace->blockSignals(true); - ui->lineFaceName->blockSignals(true); - ui->changeMode->blockSignals(true); + + //add initial values + PartDesign::Pipe* pipe = static_cast(PipeView->getObject()); + std::vector strings = pipe->Spine.getSubValues(); + for (std::vector::const_iterator i = strings.begin(); i != strings.end(); i++) + ui->listWidgetReferences->addItem(QString::fromStdString(*i)); + + ui->comboBoxTransition->setCurrentIndex(pipe->Transition.getValue()); + ui->tangent->setChecked(pipe->SpineTangent.getValue()); - // set the history path - ui->lengthEdit->setParamGrpPath(QByteArray("User parameter:BaseApp/History/PipeLength")); - ui->lengthEdit2->setParamGrpPath(QByteArray("User parameter:BaseApp/History/PipeLength2")); - - // Get the feature data - PartDesign::Pipe* pcPipe = static_cast(PipeView->getObject()); - Base::Quantity l = pcPipe->Length.getQuantityValue(); - bool midplane = pcPipe->Midplane.getValue(); - bool reversed = pcPipe->Reversed.getValue(); - Base::Quantity l2 = pcPipe->Length2.getQuantityValue(); - int index = pcPipe->Type.getValue(); // must extract value here, clear() kills it! - App::DocumentObject* obj = pcPipe->UpToFace.getValue(); - std::vector subStrings = pcPipe->UpToFace.getSubValues(); - std::string upToFace; - int faceId = -1; - if ((obj != NULL) && !subStrings.empty()) { - upToFace = subStrings.front(); - if (upToFace.substr(0,4) == "Face") - faceId = std::atoi(&upToFace[4]); - } - - // Fill data into dialog elements - ui->lengthEdit->setMinimum(0); - ui->lengthEdit->setMaximum(INT_MAX); - ui->lengthEdit->setValue(l); - ui->lengthEdit2->setMinimum(0); - ui->lengthEdit2->setMaximum(INT_MAX); - ui->lengthEdit2->setValue(l2); - - - ui->checkBoxMidplane->setChecked(midplane); - // According to bug #0000521 the reversed option - // shouldn't be de-activated if the pad has a support face - ui->checkBoxReversed->setChecked(reversed); - if ((obj != NULL) && PartDesign::Feature::isDatum(obj)) - ui->lineFaceName->setText(QString::fromAscii(obj->getNameInDocument())); - else if (faceId >= 0) - ui->lineFaceName->setText(QString::fromAscii(obj->getNameInDocument()) + QString::fromAscii(":") + tr("Face") + - QString::number(faceId)); - else - ui->lineFaceName->setText(tr("No face selected")); - ui->lineFaceName->setProperty("FaceName", QByteArray(upToFace.c_str())); - ui->changeMode->clear(); - ui->changeMode->insertItem(0, tr("Dimension")); - ui->changeMode->insertItem(1, tr("To last")); - ui->changeMode->insertItem(2, tr("To first")); - ui->changeMode->insertItem(3, tr("Up to face")); - ui->changeMode->insertItem(4, tr("Two dimensions")); - ui->changeMode->setCurrentIndex(index); - - // activate and de-activate dialog elements as appropriate - ui->lengthEdit->blockSignals(false); - ui->lengthEdit2->blockSignals(false); - ui->checkBoxMidplane->blockSignals(false); - ui->checkBoxReversed->blockSignals(false); - ui->buttonFace->blockSignals(false); - ui->lineFaceName->blockSignals(false); - ui->changeMode->blockSignals(false); - updateUI(index); - - // if it is a newly created object use the last value of the history - if(newObj){ - ui->lengthEdit->setToLastUsedValue(); - ui->lengthEdit->selectNumber(); - ui->lengthEdit2->setToLastUsedValue(); - ui->lengthEdit2->selectNumber(); - }*/ + updateUI(); } -void TaskPipeParameters::updateUI(int index) -{/* - if (index == 0) { // dimension - ui->labelLength->setVisible(true); - ui->spinOffset->setVisible(false); - ui->spinOffset->setEnabled(false); - ui->labelOffset->setVisible(false); - ui->lengthEdit->setEnabled(true); - ui->lengthEdit->selectNumber(); - // Make sure that the spin box has the focus to get key events - // Calling setFocus() directly doesn't work because the spin box is not - // yet visible. - QMetaObject::invokeMethod(ui->lengthEdit, "setFocus", Qt::QueuedConnection); - ui->checkBoxMidplane->setEnabled(true); - // Reverse only makes sense if Midplane is not true - ui->checkBoxReversed->setEnabled(!ui->checkBoxMidplane->isChecked()); - ui->lengthEdit2->setEnabled(false); - ui->buttonFace->setEnabled(false); - ui->lineFaceName->setEnabled(false); - onButtonFace(false); - } else if (index == 1 || index == 2) { // up to first/last - ui->labelLength->setVisible(false); - ui->spinOffset->setVisible(true); - ui->spinOffset->setEnabled(true); - ui->labelOffset->setVisible(true); - ui->lengthEdit->setEnabled(false); - ui->checkBoxMidplane->setEnabled(false); - ui->checkBoxReversed->setEnabled(true); - ui->lengthEdit2->setEnabled(false); - ui->buttonFace->setEnabled(false); - ui->lineFaceName->setEnabled(false); - onButtonFace(false); - } else if (index == 3) { // up to face - ui->labelLength->setVisible(false); - ui->spinOffset->setVisible(true); - ui->spinOffset->setEnabled(true); - ui->labelOffset->setVisible(true); - ui->lengthEdit->setEnabled(false); - ui->checkBoxMidplane->setEnabled(false); - ui->checkBoxReversed->setEnabled(false); - ui->lengthEdit2->setEnabled(false); - ui->buttonFace->setEnabled(true); - ui->lineFaceName->setEnabled(true); - QMetaObject::invokeMethod(ui->lineFaceName, "setFocus", Qt::QueuedConnection); - // Go into reference selection mode if no face has been selected yet - if (ui->lineFaceName->text().isEmpty() || (ui->lineFaceName->text() == tr("No face selected"))) - onButtonFace(true); - } else { // two dimensions - ui->labelLength->setVisible(true); - ui->spinOffset->setVisible(false); - ui->spinOffset->setEnabled(false); - ui->labelOffset->setVisible(false); - ui->lengthEdit->setEnabled(true); - ui->lengthEdit->selectNumber(); - QMetaObject::invokeMethod(ui->lengthEdit, "setFocus", Qt::QueuedConnection); - ui->checkBoxMidplane->setEnabled(false); - ui->checkBoxReversed->setEnabled(false); - ui->lengthEdit2->setEnabled(true); - ui->buttonFace->setEnabled(false); - ui->lineFaceName->setEnabled(false); - onButtonFace(false); - }*/ +void TaskPipeParameters::updateUI() +{ + } void TaskPipeParameters::onSelectionChanged(const Gui::SelectionChanges& msg) -{/* - if (msg.Type == Gui::SelectionChanges::AddSelection) { - QString refText = onAddSelection(msg); - if (refText.length() != 0) { - ui->lineFaceName->blockSignals(true); - ui->lineFaceName->setText(refText); - ui->lineFaceName->setProperty("FaceName", QByteArray(msg.pSubName)); - ui->lineFaceName->blockSignals(false); - // Turn off reference selection mode - onButtonFace(false); - } else { - ui->lineFaceName->blockSignals(true); - ui->lineFaceName->setText(tr("No face selected")); - ui->lineFaceName->setProperty("FaceName", QByteArray()); - ui->lineFaceName->blockSignals(false); - } - } +{ + if (selectionMode == none) + return; - else if (msg.Type == Gui::SelectionChanges::ClrSelection) { - ui->lineFaceName->blockSignals(true); - ui->lineFaceName->setText(tr("")); - ui->lineFaceName->setProperty("FaceName", QByteArray()); - ui->lineFaceName->blockSignals(false); - }*/ + if (msg.Type == Gui::SelectionChanges::AddSelection) { + if (referenceSelected(msg)) { + if (selectionMode == refAdd) { + QString sub = QString::fromStdString(msg.pSubName); + if(!sub.isEmpty()) + ui->listWidgetReferences->addItem(QString::fromStdString(msg.pSubName)); + + ui->profileBaseEdit->setText(QString::fromStdString(msg.pObjectName)); + } + else if (selectionMode == refRemove) { + QString sub = QString::fromStdString(msg.pSubName); + if(!sub.isEmpty()) + removeFromListWidget(ui->listWidgetReferences, QString::fromAscii(msg.pSubName)); + else { + ui->profileBaseEdit->clear(); + } + } else if(selectionMode == refObjAdd) { + ui->listWidgetReferences->clear(); + ui->profileBaseEdit->setText(QString::fromAscii(msg.pObjectName)); + } + //clearButtons(none); + recomputeFeature(); + } + clearButtons(); + exitSelectionMode(); + } } TaskPipeParameters::~TaskPipeParameters() @@ -259,44 +140,404 @@ TaskPipeParameters::~TaskPipeParameters() delete ui; } -void TaskPipeParameters::changeEvent(QEvent *e) -{/* - TaskBox::changeEvent(e); - if (e->type() == QEvent::LanguageChange) { - ui->spinOffset->blockSignals(true); - ui->lengthEdit->blockSignals(true); - ui->lengthEdit2->blockSignals(true); - ui->lineFaceName->blockSignals(true); - ui->changeMode->blockSignals(true); - int index = ui->changeMode->currentIndex(); - ui->retranslateUi(proxy); - ui->changeMode->clear(); - ui->changeMode->addItem(tr("Dimension")); - ui->changeMode->addItem(tr("To last")); - ui->changeMode->addItem(tr("To first")); - ui->changeMode->addItem(tr("Up to face")); - ui->changeMode->addItem(tr("Two dimensions")); - ui->changeMode->setCurrentIndex(index); +void TaskPipeParameters::onTransitionChanged(int idx) { + + static_cast(vp->getObject())->Transition.setValue(idx); + recomputeFeature(); +} - QStringList parts = ui->lineFaceName->text().split(QChar::fromAscii(':')); - QByteArray upToFace = ui->lineFaceName->property("FaceName").toByteArray(); - int faceId = -1; - bool ok = false; - if (upToFace.indexOf("Face") == 0) { - faceId = upToFace.remove(0,4).toInt(&ok); +void TaskPipeParameters::onButtonRefAdd(bool checked) { + + if (checked) { + //clearButtons(refAdd); + //hideObject(); + Gui::Selection().clearSelection(); + selectionMode = refAdd; + //DressUpView->highlightReferences(true); + } +} + +void TaskPipeParameters::onButtonRefRemove(bool checked) { + + if (checked) { + //clearButtons(refRemove); + //hideObject(); + Gui::Selection().clearSelection(); + selectionMode = refRemove; + //DressUpView->highlightReferences(true); + } +} + +void TaskPipeParameters::onBaseButton(bool checked) { + + if (checked) { + //clearButtons(refRemove); + //hideObject(); + Gui::Selection().clearSelection(); + selectionMode = refObjAdd; + //DressUpView->highlightReferences(true); + } +} + + +void TaskPipeParameters::onTangentChanged(bool checked) { + + static_cast(vp->getObject())->SpineTangent.setValue(checked); + recomputeFeature(); +} + + +void TaskPipeParameters::removeFromListWidget(QListWidget* widget, QString itemstr) { + + QList items = widget->findItems(itemstr, Qt::MatchExactly); + if (!items.empty()) { + for (QList::const_iterator i = items.begin(); i != items.end(); i++) { + QListWidgetItem* it = widget->takeItem(widget->row(*i)); + delete it; } -#if QT_VERSION >= 0x040700 - ui->lineFaceName->setPlaceholderText(tr("No face selected")); -#endif - ui->lineFaceName->setText(ok ? - parts[0] + QString::fromAscii(":") + tr("Face") + QString::number(faceId) : - tr("No face selected")); - ui->spinOffset->blockSignals(false); - ui->lengthEdit->blockSignals(false); - ui->lengthEdit2->blockSignals(false); - ui->lineFaceName->blockSignals(false); - ui->changeMode->blockSignals(false); - }*/ + } +} + +bool TaskPipeParameters::referenceSelected(const SelectionChanges& msg) const { + + if ((msg.Type == Gui::SelectionChanges::AddSelection) && ( + (selectionMode == refAdd) || (selectionMode == refRemove) + || (selectionMode == refObjAdd))) { + + if (strcmp(msg.pDocName, vp->getObject()->getDocument()->getName()) != 0) + return false; + + // not allowed to reference ourself + const char* fname = vp->getObject()->getNameInDocument(); + if (strcmp(msg.pObjectName, fname) == 0) + return false; + + //change the references + std::string subName(msg.pSubName); + std::vector refs = static_cast(vp->getObject())->Spine.getSubValues(); + std::vector::iterator f = std::find(refs.begin(), refs.end(), subName); + + if(selectionMode != refObjAdd) { + if (selectionMode == refAdd) { + if (f == refs.end()) + refs.push_back(subName); + else + return false; // duplicate selection + } else { + if (f != refs.end()) + refs.erase(f); + else + return false; + } + } + else { + refs.clear(); + } + static_cast(vp->getObject())->Spine.setValue(vp->getObject()->getDocument()->getObject(msg.pObjectName), + refs); + return true; + } + + return false; +} + +void TaskPipeParameters::clearButtons() { + + ui->buttonRefAdd->setChecked(false); + ui->buttonRefRemove->setChecked(false); + ui->buttonProfileBase->setChecked(false); +} + +void TaskPipeParameters::exitSelectionMode() { + + selectionMode = none; + Gui::Selection().clearSelection(); +} + + +//************************************************************************** +//************************************************************************** +// Tassk Orientation +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +TaskPipeOrientation::TaskPipeOrientation(ViewProviderPipe* PipeView, bool newObj, QWidget* parent) + : TaskSketchBasedParameters(PipeView, parent, "PartDesign_Pipe", tr("Section orientation")) { + + // we need a separate container widget to add all controls to + proxy = new QWidget(this); + ui = new Ui_TaskPipeOrientation(); + ui->setupUi(proxy); + QMetaObject::connectSlotsByName(this); + + connect(ui->comboBoxMode, SIGNAL(currentIndexChanged(int)), + this, SLOT(onOrientationChanged(int))); + connect(ui->buttonRefAdd, SIGNAL(toggled(bool)), + this, SLOT(onButtonRefAdd(bool))); + connect(ui->buttonRefRemove, SIGNAL(toggled(bool)), + this, SLOT(onButtonRefRemove(bool))); + connect(ui->tangent, SIGNAL(toggled(bool)), + this, SLOT(onTangentChanged(bool))); + connect(ui->buttonProfileBase, SIGNAL(toggled(bool)), + this, SLOT(onBaseButton(bool))); + connect(ui->stackedWidget, SIGNAL(currentChanged(int)), + this, SLOT(updateUI(int))); + connect(ui->curvelinear, SIGNAL(toggled(bool)), + this, SLOT(onCurvelinearChanged(bool))); + connect(ui->doubleSpinBoxX, SIGNAL(valueChanged(double)), + this, SLOT(onBinormalChanged(double))); + connect(ui->doubleSpinBoxY, SIGNAL(valueChanged(double)), + this, SLOT(onBinormalChanged(double))); + connect(ui->doubleSpinBoxZ, SIGNAL(valueChanged(double)), + this, SLOT(onBinormalChanged(double))); + + this->groupLayout()->addWidget(proxy); + + //add initial values + PartDesign::Pipe* pipe = static_cast(PipeView->getObject()); + std::vector strings = pipe->AuxillerySpine.getSubValues(); + for (std::vector::const_iterator i = strings.begin(); i != strings.end(); i++) + ui->listWidgetReferences->addItem(QString::fromStdString(*i)); + + ui->comboBoxMode->setCurrentIndex(pipe->Mode.getValue()); + ui->tangent->setChecked(pipe->AuxillerySpineTangent.getValue()); + ui->curvelinear->setChecked(pipe->AuxilleryCurvelinear.getValue()); + + updateUI(0); +} + +TaskPipeOrientation::~TaskPipeOrientation() { + +} + +void TaskPipeOrientation::onOrientationChanged(int idx) { + + static_cast(vp->getObject())->Mode.setValue(idx); + recomputeFeature(); +} + +void TaskPipeOrientation::clearButtons() { + +} + +void TaskPipeOrientation::exitSelectionMode() { + +} + +void TaskPipeOrientation::onButtonRefAdd(bool checked) { + + if (checked) { + Gui::Selection().clearSelection(); + selectionMode = refAdd; + } +} + +void TaskPipeOrientation::onButtonRefRemove(bool checked) { + + if (checked) { + Gui::Selection().clearSelection(); + selectionMode = refRemove; + } +} + +void TaskPipeOrientation::onBaseButton(bool checked) { + + if (checked) { + Gui::Selection().clearSelection(); + selectionMode = refObjAdd; + } +} + +void TaskPipeOrientation::onTangentChanged(bool checked) { + +} + +void TaskPipeOrientation::onCurvelinearChanged(bool checked) { + + static_cast(vp->getObject())->AuxilleryCurvelinear.setValue(checked); + recomputeFeature(); +} + +void TaskPipeOrientation::onBinormalChanged(double) { + + Base::Vector3d vec(ui->doubleSpinBoxX->value(), + ui->doubleSpinBoxY->value(), + ui->doubleSpinBoxZ->value()); + + static_cast(vp->getObject())->Binormal.setValue(vec); + recomputeFeature(); +} + + + +void TaskPipeOrientation::onSelectionChanged(const SelectionChanges& msg) { + + if (selectionMode == none) + return; + + if (msg.Type == Gui::SelectionChanges::AddSelection) { + if (referenceSelected(msg)) { + if (selectionMode == refAdd) { + QString sub = QString::fromStdString(msg.pSubName); + if(!sub.isEmpty()) + ui->listWidgetReferences->addItem(QString::fromStdString(msg.pSubName)); + + ui->profileBaseEdit->setText(QString::fromStdString(msg.pObjectName)); + } + else if (selectionMode == refRemove) { + QString sub = QString::fromStdString(msg.pSubName); + if(!sub.isEmpty()) + removeFromListWidget(ui->listWidgetReferences, QString::fromAscii(msg.pSubName)); + else { + ui->profileBaseEdit->clear(); + } + } else if(selectionMode == refObjAdd) { + ui->listWidgetReferences->clear(); + ui->profileBaseEdit->setText(QString::fromAscii(msg.pObjectName)); + } + //clearButtons(none); + recomputeFeature(); + } + clearButtons(); + exitSelectionMode(); + } +} + +bool TaskPipeOrientation::referenceSelected(const SelectionChanges& msg) const { + + if ((msg.Type == Gui::SelectionChanges::AddSelection) && ( + (selectionMode == refAdd) || (selectionMode == refRemove) + || (selectionMode == refObjAdd))) { + + if (strcmp(msg.pDocName, vp->getObject()->getDocument()->getName()) != 0) + return false; + + // not allowed to reference ourself + const char* fname = vp->getObject()->getNameInDocument(); + if (strcmp(msg.pObjectName, fname) == 0) + return false; + + //change the references + std::string subName(msg.pSubName); + std::vector refs = static_cast(vp->getObject())->AuxillerySpine.getSubValues(); + std::vector::iterator f = std::find(refs.begin(), refs.end(), subName); + + if(selectionMode != refObjAdd) { + if (selectionMode == refAdd) { + if (f == refs.end()) + refs.push_back(subName); + else + return false; // duplicate selection + } else { + if (f != refs.end()) + refs.erase(f); + else + return false; + } + } + else { + refs.clear(); + } + static_cast(vp->getObject())->AuxillerySpine.setValue(vp->getObject()->getDocument()->getObject(msg.pObjectName), + refs); + return true; + } + + return false; +} + +void TaskPipeOrientation::removeFromListWidget(QListWidget* w, QString name) { + +} + +void TaskPipeOrientation::updateUI(int idx) { + + //make sure we resize to the size of the current page + for(int i=0; istackedWidget->count(); ++i) + ui->stackedWidget->widget(i)->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); + + ui->stackedWidget->widget(idx)->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); +} + + +//************************************************************************** +//************************************************************************** +// Task Scaling +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +TaskPipeScaling::TaskPipeScaling(ViewProviderPipe* PipeView, bool newObj, QWidget* parent) + : TaskSketchBasedParameters(PipeView, parent, "PartDesign_Pipe", tr("Section transformation")) { + + // we need a separate container widget to add all controls to + proxy = new QWidget(this); + ui = new Ui_TaskPipeScaling(); + ui->setupUi(proxy); + QMetaObject::connectSlotsByName(this); + + connect(ui->comboBoxScaling, SIGNAL(currentIndexChanged(int)), + this, SLOT(onScalingChanged(int))); + connect(ui->buttonRefAdd, SIGNAL(toggled(bool)), + this, SLOT(onButtonRefAdd(bool))); + connect(ui->buttonRefRemove, SIGNAL(toggled(bool)), + this, SLOT(onButtonRefRemove(bool))); + connect(ui->stackedWidget, SIGNAL(currentChanged(int)), + this, SLOT(updateUI(int))); + + this->groupLayout()->addWidget(proxy); + +// ui->comboBoxTransition->clear(); +// ui->comboBoxTransition->insertItem(0, tr("Transformed")); +// ui->comboBoxTransition->insertItem(1, tr("Right Corner")); +// ui->comboBoxTransition->insertItem(2, tr("Round Corner")); +// ui->comboBoxTransition->setCurrentIndex(0); + + + updateUI(0); +} + +TaskPipeScaling::~TaskPipeScaling() { + +} + +void TaskPipeScaling::clearButtons() { + +} + +void TaskPipeScaling::exitSelectionMode() { + +} + +void TaskPipeScaling::onButtonRefAdd(bool checked) { + +} + +void TaskPipeScaling::onButtonRefRemove(bool checked) { + +} + +void TaskPipeScaling::onScalingChanged(int idx) { + + static_cast(vp->getObject())->Transformation.setValue(idx); + recomputeFeature(); +} + +void TaskPipeScaling::onSelectionChanged(const SelectionChanges& msg) { + +} + +bool TaskPipeScaling::referenceSelected(const SelectionChanges& msg) const { + +} + +void TaskPipeScaling::removeFromListWidget(QListWidget* w, QString name) { + +} + +void TaskPipeScaling::updateUI(int idx) { + + //make sure we resize to the size of the current page + for(int i=0; istackedWidget->count(); ++i) + ui->stackedWidget->widget(i)->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); + + ui->stackedWidget->widget(idx)->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); } @@ -309,9 +550,13 @@ TaskDlgPipeParameters::TaskDlgPipeParameters(ViewProviderPipe *PipeView,bool new : TaskDlgSketchBasedParameters(PipeView) { assert(PipeView); - parameter = new TaskPipeParameters(PipeView,newObj); + parameter = new TaskPipeParameters(PipeView,newObj); + orientation = new TaskPipeOrientation(PipeView,newObj); + scaling = new TaskPipeScaling(PipeView,newObj); Content.push_back(parameter); + Content.push_back(orientation); + Content.push_back(scaling); } TaskDlgPipeParameters::~TaskDlgPipeParameters() diff --git a/src/Mod/PartDesign/Gui/TaskPipeParameters.h b/src/Mod/PartDesign/Gui/TaskPipeParameters.h index dbcb6ee783..09b6d8ec96 100644 --- a/src/Mod/PartDesign/Gui/TaskPipeParameters.h +++ b/src/Mod/PartDesign/Gui/TaskPipeParameters.h @@ -30,8 +30,12 @@ #include "TaskSketchBasedParameters.h" #include "ViewProviderPipe.h" +#include "TaskDressUpParameters.h" class Ui_TaskPipeParameters; +class Ui_TaskPipeOrientation; +class Ui_TaskPipeScaling; + namespace App { class Property; @@ -55,19 +59,100 @@ public: private Q_SLOTS: + void onTangentChanged(bool checked); + void onTransitionChanged(int); + void onButtonRefAdd(bool checked); + void onButtonRefRemove(bool checked); + void onBaseButton(bool checked); protected: - void changeEvent(QEvent *e); + enum selectionModes { none, refAdd, refRemove, refObjAdd }; + selectionModes selectionMode = none; + + void removeFromListWidget(QListWidget*w, QString name); + bool referenceSelected(const Gui::SelectionChanges& msg) const; private: void onSelectionChanged(const Gui::SelectionChanges& msg); - void updateUI(int index); + void updateUI(); + void clearButtons(); + void exitSelectionMode(); private: QWidget* proxy; Ui_TaskPipeParameters* ui; }; +class TaskPipeOrientation : public TaskSketchBasedParameters +{ + Q_OBJECT + +public: + TaskPipeOrientation(ViewProviderPipe *PipeView,bool newObj=false,QWidget *parent = 0); + virtual ~TaskPipeOrientation(); + + +private Q_SLOTS: + void onOrientationChanged(int); + void onButtonRefAdd(bool checked); + void onButtonRefRemove(bool checked); + void updateUI(int idx); + void onBaseButton(bool checked); + void onTangentChanged(bool checked); + void onCurvelinearChanged(bool checked); + void onBinormalChanged(double); + +protected: + enum selectionModes { none, refAdd, refRemove, refObjAdd }; + selectionModes selectionMode = none; + + void removeFromListWidget(QListWidget*w, QString name); + bool referenceSelected(const Gui::SelectionChanges& msg) const; + +private: + void onSelectionChanged(const Gui::SelectionChanges& msg); + void clearButtons(); + void exitSelectionMode(); + +private: + QWidget* proxy; + Ui_TaskPipeOrientation* ui; +}; + + +class TaskPipeScaling : public TaskSketchBasedParameters +{ + Q_OBJECT + +public: + TaskPipeScaling(ViewProviderPipe *PipeView,bool newObj=false,QWidget *parent = 0); + virtual ~TaskPipeScaling(); + + +private Q_SLOTS: + void onScalingChanged(int); + void onButtonRefAdd(bool checked); + void onButtonRefRemove(bool checked); + void updateUI(int idx); + +protected: + enum selectionModes { none, refAdd, refRemove }; + selectionModes selectionMode = none; + + void removeFromListWidget(QListWidget*w, QString name); + bool referenceSelected(const Gui::SelectionChanges& msg) const; + +private: + void onSelectionChanged(const Gui::SelectionChanges& msg); + void clearButtons(); + void exitSelectionMode(); + +private: + QWidget* proxy; + Ui_TaskPipeScaling* ui; +}; + + /// simulation dialog for the TaskView class TaskDlgPipeParameters : public TaskDlgSketchBasedParameters { @@ -88,6 +173,8 @@ public: protected: TaskPipeParameters *parameter; + TaskPipeOrientation *orientation; + TaskPipeScaling *scaling; }; } //namespace PartDesignGui diff --git a/src/Mod/PartDesign/Gui/TaskPipeParameters.ui b/src/Mod/PartDesign/Gui/TaskPipeParameters.ui index bd9095f7bf..5006d1c810 100644 --- a/src/Mod/PartDesign/Gui/TaskPipeParameters.ui +++ b/src/Mod/PartDesign/Gui/TaskPipeParameters.ui @@ -6,65 +6,131 @@ 0 0 - 257 - 305 + 306 + 421 Form - - - - - - - Add Edge - - - true - - - - - - - Remove Edge - - - true - - - - - - - - + + + QFormLayout::ExpandingFieldsGrow + - + - Profile orientation + Corner Transition - - - - - - Transition type + + + + 0 + 0 + + + + Transformed + + + + + Right Corner + + + + + Round Corner + + - - - + + + + Profile + + + + + + + + Object + + + true + + + + + + + + + + + + + + true + + + + 0 + 0 + + + + Add Edge + + + true + + + false + + + + + + + + 0 + 0 + + + + Remove Edge + + + true + + + + + + + + + + + + Extend to tangent edges + + + + + + diff --git a/src/Mod/PartDesign/Gui/TaskPipeScaling.ui b/src/Mod/PartDesign/Gui/TaskPipeScaling.ui new file mode 100644 index 0000000000..211f328c3a --- /dev/null +++ b/src/Mod/PartDesign/Gui/TaskPipeScaling.ui @@ -0,0 +1,156 @@ + + + PartDesignGui::TaskPipeScaling + + + + 0 + 0 + 353 + 407 + + + + Form + + + + + + + + Transform mode + + + + + + + + 0 + 0 + + + + + Constant + + + + + Multisection + + + + + Auxillery + + + + + + + + + + 0 + + + + + + + + Automaticly build profile from sections + + + + + + + + + true + + + Add Section + + + true + + + false + + + + + + + Remove Section + + + true + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + + + This mode is only available if the orientation is given by a secondary profile + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + true + + + + + + + + + + + + + comboBoxScaling + currentIndexChanged(int) + stackedWidget + setCurrentIndex(int) + + + 237 + 24 + + + 176 + 225 + + + + +