diff --git a/src/Base/BoundBoxPyImp.cpp b/src/Base/BoundBoxPyImp.cpp index 63dc76378..8a6d4e132 100644 --- a/src/Base/BoundBoxPyImp.cpp +++ b/src/Base/BoundBoxPyImp.cpp @@ -192,7 +192,6 @@ PyObject* BoundBoxPy::getIntersectionPoint(PyObject *args) *(static_cast(object2)->getVectorPtr()), point, epsilon); // IsInBox() doesn't handle border points correctly - BoundBoxPy::PointerType bb = getBoundBoxPtr(); if (ok) { return new VectorPy(point); } @@ -209,6 +208,7 @@ PyObject* BoundBoxPy::move(PyObject *args) { double x,y,z; PyObject *object; + Base::Vector3d vec; if (PyArg_ParseTuple(args, "ddd", &x,&y,&z)) { diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index 33da94c7c..4399325dd 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -452,6 +452,7 @@ void StdCmdFreezeViews::languageChange() } } + //=========================================================================== // Std_ToggleClipPlane //=========================================================================== @@ -522,8 +523,8 @@ Gui::Action * StdCmdDrawStyle::createAction(void) pcAction->setDropDownMenu(true); applyCommandData(pcAction); - QAction* a0 = pcAction->addAction(QString()); - QAction* a1 = pcAction->addAction(QString()); + pcAction->addAction(QString()); + pcAction->addAction(QString()); _pcAction = pcAction; languageChange(); return pcAction; diff --git a/src/Mod/Drawing/App/ProjectionAlgos.cpp b/src/Mod/Drawing/App/ProjectionAlgos.cpp index a5f844619..b37c6cb48 100644 --- a/src/Mod/Drawing/App/ProjectionAlgos.cpp +++ b/src/Mod/Drawing/App/ProjectionAlgos.cpp @@ -263,7 +263,7 @@ std::string ProjectionAlgos::getDXF(SvgExtractionType type, float scale) << "ENTITIES" << endl; if (!H.IsNull() && (type & WithHidden)) { - float width = 0.15f/scale; + //float width = 0.15f/scale; BRepMesh::Mesh(H,0.1); result //<< "" << endl; } if (!HO.IsNull() && (type & WithHidden)) { - float width = 0.15f/scale; + //float width = 0.15f/scale; BRepMesh::Mesh(HO,0.1); result //<< "" << endl; } if (!VO.IsNull()) { - float width = 0.35f/scale; + //float width = 0.35f/scale; BRepMesh::Mesh(VO,0.1); result //<< "" << endl; } if (!V.IsNull()) { - float width = 0.35f/scale; - + //float width = 0.35f/scale; BRepMesh::Mesh(V,0.1); result //<< "" << endl; } if (!H1.IsNull() && (type & WithSmooth) && (type & WithHidden)) { - - float width = 0.15f/scale; + //float width = 0.15f/scale; BRepMesh::Mesh(H1,0.1); result //<< " #include #include -#include +#include #include #include @@ -301,7 +301,7 @@ TaskOrthoViews::TaskOrthoViews(QWidget *parent) App::Document* doc = App::GetApplication().getActiveDocument(); std::vector pages = doc->getObjectsOfType(Drawing::FeaturePage::getClassTypeId()); - std::string PageName = pages.front()->getNameInDocument(); + std::string PageName = pages.front()->getNameInDocument(); const char * page = PageName.c_str(); App::DocumentObject * this_page = doc->getObject(page); @@ -409,7 +409,7 @@ TaskOrthoViews::TaskOrthoViews(QWidget *parent) data[1] = &x_pos; data[2] = &y_pos; data[3] = &horiz; - data[4] = | + data[4] = | // Command::doCommand(Command::Doc,"#%d", map1[2][2][1]); @@ -636,24 +636,24 @@ void TaskOrthoViews::compute() void TaskOrthoViews::validate_cbs() { - for (int i=0; i < 5; i++) - for (int j=0; j < 5; j++) - if ((abs(i-2) + abs(j-2)) < 3) //if i,j combination corresponds to valid check box, then proceed with: + for (int i=0; i < 5; i++) { + for (int j=0; j < 5; j++) { + if ((abs(i-2) + abs(j-2)) < 3) { //if i,j combination corresponds to valid check box, then proceed with: if (view_count == 0) { c_boxes[i][j]->setEnabled(false); c_boxes[i][j]->setChecked(false); } - else if (!c_boxes[i][j]->isChecked()) //only questions boxes 'enableability' if it's not checked - if (view_count == 4) + else if (!c_boxes[i][j]->isChecked()) { //only questions boxes 'enableability' if it's not checked + if (view_count == 4) { c_boxes[i][j]->setEnabled(false); //if there are four checked boxes then all others are disabled - else - { - if ((abs(i-2) + abs(j-2)) == 1) //only true for boxes immediately up/down/left/right of centre + } + else { + if ((abs(i-2) + abs(j-2)) == 1) { //only true for boxes immediately up/down/left/right of centre c_boxes[i][j]->setEnabled(c_boxes[2][2]->isChecked()); //which are enabled if centre box is checked - else - { + } + else { int di = ((i-2) < 0) - ((i-2) > 0); //which direction is towards centre? int dj = ((j-2) < 0) - ((j-2) > 0); @@ -668,9 +668,12 @@ void TaskOrthoViews::validate_cbs() c_boxes[i][j]->setEnabled(false); } } + } + } + } + } } - void TaskOrthoViews::cb_toggled(bool toggle) { QString name = sender()->objectName().right(2); diff --git a/src/Mod/Fem/App/FemMesh.cpp b/src/Mod/Fem/App/FemMesh.cpp index 440b5cb01..a3c98e586 100644 --- a/src/Mod/Fem/App/FemMesh.cpp +++ b/src/Mod/Fem/App/FemMesh.cpp @@ -99,7 +99,7 @@ FemMesh &FemMesh::operator=(const FemMesh& mesh) void FemMesh::copyMeshData(const FemMesh& mesh) { - const SMDS_MeshInfo& info = mesh.myMesh->GetMeshDS()->GetMeshInfo(); + //const SMDS_MeshInfo& info = mesh.myMesh->GetMeshDS()->GetMeshInfo(); //int numPoly = info.NbPolygons(); //int numVolu = info.NbVolumes(); //int numTetr = info.NbTetras(); diff --git a/src/Mod/Import/Gui/AppImportGuiPy.cpp b/src/Mod/Import/Gui/AppImportGuiPy.cpp index 8edbcada5..d98a299d3 100644 --- a/src/Mod/Import/Gui/AppImportGuiPy.cpp +++ b/src/Mod/Import/Gui/AppImportGuiPy.cpp @@ -26,8 +26,8 @@ # define WNT // avoid conflict with GUID #endif #ifndef _PreComp_ -# include # include +# include # include # include # include diff --git a/src/Mod/Mesh/App/Core/Algorithm.cpp b/src/Mod/Mesh/App/Core/Algorithm.cpp index 281fba7f7..f72bba760 100644 --- a/src/Mod/Mesh/App/Core/Algorithm.cpp +++ b/src/Mod/Mesh/App/Core/Algorithm.cpp @@ -641,8 +641,8 @@ bool MeshAlgorithm::FillupHole(const std::vector& boundary, bool ready = false; for (MeshFacetArray::_TConstIterator it = _rclMesh._aclFacetArray.begin(); it != _rclMesh._aclFacetArray.end(); ++it) { for (int i=0; i<3; i++) { - if ((it->_aulPoints[i] == refPoint0) && (it->_aulPoints[(i+1)%3] == refPoint1) || - (it->_aulPoints[i] == refPoint1) && (it->_aulPoints[(i+1)%3] == refPoint0)) { + if (((it->_aulPoints[i] == refPoint0) && (it->_aulPoints[(i+1)%3] == refPoint1)) || + ((it->_aulPoints[i] == refPoint1) && (it->_aulPoints[(i+1)%3] == refPoint0))) { rFace = *it; rTriangle = _rclMesh.GetFacet(*it); ready = true; @@ -1527,6 +1527,7 @@ bool MeshAlgorithm::ConnectLines (std::list_aulPoints[0]]; - const MeshPoint &p1 = rPoints[pF->_aulPoints[1]]; - const MeshPoint &p2 = rPoints[pF->_aulPoints[2]]; - float l2p01 = Base::DistanceP2(p0,p1); - float l2p12 = Base::DistanceP2(p1,p2); - float l2p20 = Base::DistanceP2(p2,p0); - - Base::Vector3f facenormal = _rclMesh.GetFacet(*pF).GetNormal(); - _norm[pF->_aulPoints[0]] += facenormal * (1.0f / (l2p01 * l2p20)); - _norm[pF->_aulPoints[1]] += facenormal * (1.0f / (l2p12 * l2p01)); - _norm[pF->_aulPoints[2]] += facenormal * (1.0f / (l2p20 * l2p12)); + const MeshPoint &p0 = rPoints[pF->_aulPoints[0]]; + const MeshPoint &p1 = rPoints[pF->_aulPoints[1]]; + const MeshPoint &p2 = rPoints[pF->_aulPoints[2]]; + float l2p01 = Base::DistanceP2(p0,p1); + float l2p12 = Base::DistanceP2(p1,p2); + float l2p20 = Base::DistanceP2(p2,p0); + + Base::Vector3f facenormal = _rclMesh.GetFacet(*pF).GetNormal(); + _norm[pF->_aulPoints[0]] += facenormal * (1.0f / (l2p01 * l2p20)); + _norm[pF->_aulPoints[1]] += facenormal * (1.0f / (l2p12 * l2p01)); + _norm[pF->_aulPoints[2]] += facenormal * (1.0f / (l2p20 * l2p12)); } for (std::vector::iterator it = _norm.begin(); it != _norm.end(); ++it) it->Normalize(); diff --git a/src/Mod/Mesh/App/Core/Curvature.cpp b/src/Mod/Mesh/App/Core/Curvature.cpp index d0371da4b..93a0234e4 100644 --- a/src/Mod/Mesh/App/Core/Curvature.cpp +++ b/src/Mod/Mesh/App/Core/Curvature.cpp @@ -151,7 +151,7 @@ private: // -------------------------------------------------------- FacetCurvature::FacetCurvature(const MeshKernel& kernel, const MeshRefPointToFacets& search, float r, unsigned long pt) - : myKernel(kernel), mySearch(search), myRadius(r), myMinPoints(pt) + : myKernel(kernel), mySearch(search), myMinPoints(pt), myRadius(r) { } diff --git a/src/Mod/Mesh/App/Core/MeshIO.cpp b/src/Mod/Mesh/App/Core/MeshIO.cpp index 4003e019c..7d7024771 100644 --- a/src/Mod/Mesh/App/Core/MeshIO.cpp +++ b/src/Mod/Mesh/App/Core/MeshIO.cpp @@ -544,7 +544,6 @@ bool MeshInput::LoadOFF (std::istream &rstrIn) if (!buf) return false; - bool readvertices=false; std::getline(rstrIn, line); boost::algorithm::to_lower(line); if (line.find("off") == std::string::npos) @@ -2315,6 +2314,7 @@ bool MeshVRML::Save (std::ostream &rstrOut, const std::vector &raclC MeshFacetIterator pFIter(_rclMesh); pFIter.Transform(this->_transform); i = 0, k = _rclMesh.CountFacets(); + for (pFIter.Init(); pFIter.More(); pFIter.Next()) { MeshFacet clFacet = pFIter.GetIndices(); rstrOut << " " diff --git a/src/Mod/Mesh/App/Core/Trim.cpp b/src/Mod/Mesh/App/Core/Trim.cpp index 7d94592a8..27a64c156 100644 --- a/src/Mod/Mesh/App/Core/Trim.cpp +++ b/src/Mod/Mesh/App/Core/Trim.cpp @@ -32,7 +32,7 @@ using namespace MeshCore; MeshTrimming::MeshTrimming(MeshKernel &rclM, const Base::ViewProjMethod* pclProj, const Base::Polygon2D& rclPoly) - : myMesh(rclM), myProj(pclProj), myPoly(rclPoly), myInner(true) + : myMesh(rclM), myInner(true), myProj(pclProj), myPoly(rclPoly) { } diff --git a/src/Mod/Part/App/ImportIges.cpp b/src/Mod/Part/App/ImportIges.cpp index 98cb5393f..e8030ee22 100644 --- a/src/Mod/Part/App/ImportIges.cpp +++ b/src/Mod/Part/App/ImportIges.cpp @@ -95,7 +95,7 @@ int Part::ImportIgesParts(App::Document *pcDoc, const char* FileName) // make model aReader.ClearShapes(); - Standard_Integer nbRootsForTransfer = aReader.NbRootsForTransfer(); + //Standard_Integer nbRootsForTransfer = aReader.NbRootsForTransfer(); aReader.TransferRoots(); pi->EndScope(); diff --git a/src/Mod/Part/App/TopoShape.cpp b/src/Mod/Part/App/TopoShape.cpp index 9bf487074..f40916e5b 100644 --- a/src/Mod/Part/App/TopoShape.cpp +++ b/src/Mod/Part/App/TopoShape.cpp @@ -1403,7 +1403,7 @@ TopoDS_Shape TopoShape::makeTube(double radius, double tol, int cont, int maxdeg { // http://opencascade.blogspot.com/2009/11/surface-modeling-part3.html Standard_Real theTol = tol; - Standard_Boolean theIsPolynomial = Standard_True; + //Standard_Boolean theIsPolynomial = Standard_True; Standard_Boolean myIsElem = Standard_True; GeomAbs_Shape theContinuity = GeomAbs_Shape(cont); Standard_Integer theMaxDegree = maxdegree; @@ -1445,7 +1445,7 @@ TopoDS_Shape TopoShape::makeTube(double radius, double tol, int cont, int maxdeg mkSweep.Build (aSec, GeomFill_Location, theContinuity, theMaxDegree, theMaxSegment); if (mkSweep.IsDone()) { Handle_Geom_Surface mySurface = mkSweep.Surface(); - Standard_Real myError = mkSweep.ErrorOnSurface(); + //Standard_Real myError = mkSweep.ErrorOnSurface(); Standard_Real u1,u2,v1,v2; mySurface->Bounds(u1,u2,v1,v2); diff --git a/src/Mod/Part/Gui/Command.cpp b/src/Mod/Part/Gui/Command.cpp index 60d199d9c..edd0c41e6 100644 --- a/src/Mod/Part/Gui/Command.cpp +++ b/src/Mod/Part/Gui/Command.cpp @@ -664,6 +664,7 @@ DEF_STD_CMD_A(CmdPartReverseShape); CmdPartReverseShape::CmdPartReverseShape() :Command("Part_ReverseShape") { + sAppModule = "Part"; sGroup = QT_TR_NOOP("Part"); sMenuText = QT_TR_NOOP("Reverse shapes"); @@ -1008,6 +1009,7 @@ CmdShapeInfo::CmdShapeInfo() void CmdShapeInfo::activated(int iMsg) { +#if 0 static const char * const part_pipette[]={ "32 32 17 1", "# c #000000", @@ -1062,6 +1064,7 @@ void CmdShapeInfo::activated(int iMsg) Gui::Document* doc = Gui::Application::Instance->activeDocument(); Gui::View3DInventor* view = static_cast(doc->getActiveView()); +#endif //if (view) { // Gui::View3DInventorViewer* viewer = view->getViewer(); // viewer->setEditing(true); diff --git a/src/Mod/Part/Gui/DlgPrimitives.cpp b/src/Mod/Part/Gui/DlgPrimitives.cpp index 3665dd196..3e4628646 100644 --- a/src/Mod/Part/Gui/DlgPrimitives.cpp +++ b/src/Mod/Part/Gui/DlgPrimitives.cpp @@ -47,7 +47,7 @@ #include #include #include -#include +#include #include #include "DlgPrimitives.h" @@ -55,43 +55,43 @@ using namespace PartGui; namespace PartGui { - -const char* gce_ErrorStatusText(gce_ErrorType et) -{ - switch (et) - { - case gce_Done: - return "Construction was successful"; - case gce_ConfusedPoints: - return "Two points are coincident"; - case gce_NegativeRadius: - return "Radius value is negative"; - case gce_ColinearPoints: - return "Three points are collinear"; - case gce_IntersectionError: - return "Intersection cannot be computed"; - case gce_NullAxis: - return "Axis is undefined"; - case gce_NullAngle: - return "Angle value is invalid (usually null)"; - case gce_NullRadius: - return "Radius is null"; - case gce_InvertAxis: - return "Axis value is invalid"; - case gce_BadAngle: - return "Angle value is invalid"; - case gce_InvertRadius: - return "Radius value is incorrect (usually with respect to another radius)"; - case gce_NullFocusLength: - return "Focal distance is null"; - case gce_NullVector: - return "Vector is null"; - case gce_BadEquation: - return "Coefficients are incorrect (applies to the equation of a geometric object)"; - default: - return "Creation of geometry failed"; - } -} + +const char* gce_ErrorStatusText(gce_ErrorType et) +{ + switch (et) + { + case gce_Done: + return "Construction was successful"; + case gce_ConfusedPoints: + return "Two points are coincident"; + case gce_NegativeRadius: + return "Radius value is negative"; + case gce_ColinearPoints: + return "Three points are collinear"; + case gce_IntersectionError: + return "Intersection cannot be computed"; + case gce_NullAxis: + return "Axis is undefined"; + case gce_NullAngle: + return "Angle value is invalid (usually null)"; + case gce_NullRadius: + return "Radius is null"; + case gce_InvertAxis: + return "Axis value is invalid"; + case gce_BadAngle: + return "Angle value is invalid"; + case gce_InvertRadius: + return "Radius value is incorrect (usually with respect to another radius)"; + case gce_NullFocusLength: + return "Focal distance is null"; + case gce_NullVector: + return "Vector is null"; + case gce_BadEquation: + return "Coefficients are incorrect (applies to the equation of a geometric object)"; + default: + return "Creation of geometry failed"; + } +} void Picker::createPrimitive(QWidget* widget, const QString& descr, Gui::Document* doc) { @@ -113,17 +113,17 @@ void Picker::createPrimitive(QWidget* widget, const QString& descr, Gui::Documen QString Picker::toPlacement(const gp_Ax2& axis) const { - gp_Dir dir = axis.Direction(); - gp_Pnt pnt = gp_Pnt(0.0,0.0,0.0); - gp_Ax3 ax3(pnt, dir, axis.XDirection()); - - gp_Trsf Trf; - Trf.SetTransformation(ax3); - Trf.Invert(); - - gp_XYZ theAxis(0,0,1); - Standard_Real theAngle = 0.0; - Trf.GetRotation(theAxis,theAngle); + gp_Dir dir = axis.Direction(); + gp_Pnt pnt = gp_Pnt(0.0,0.0,0.0); + gp_Ax3 ax3(pnt, dir, axis.XDirection()); + + gp_Trsf Trf; + Trf.SetTransformation(ax3); + Trf.Invert(); + + gp_XYZ theAxis(0,0,1); + Standard_Real theAngle = 0.0; + Trf.GetRotation(theAxis,theAngle); Base::Rotation rot(Base::convertTo(theAxis), theAngle); gp_Pnt loc = axis.Location(); @@ -153,10 +153,10 @@ public: QString command(App::Document* doc) const { GC_MakeArcOfCircle arc(points[0], points[1], points[2]); - if (!arc.IsDone()) - throw Base::Exception(gce_ErrorStatusText(arc.Status())); - Handle_Geom_TrimmedCurve trim = arc.Value(); - Handle_Geom_Circle circle = Handle_Geom_Circle::DownCast(trim->BasisCurve()); + if (!arc.IsDone()) + throw Base::Exception(gce_ErrorStatusText(arc.Status())); + Handle_Geom_TrimmedCurve trim = arc.Value(); + Handle_Geom_Circle circle = Handle_Geom_Circle::DownCast(trim->BasisCurve()); QString name = QString::fromAscii(doc->getUniqueObjectName("Circle").c_str()); return QString::fromAscii( @@ -270,7 +270,6 @@ DlgPrimitives::~DlgPrimitives() void DlgPrimitives::pickCallback(void * ud, SoEventCallback * n) { const SoMouseButtonEvent * mbe = static_cast(n->getEvent()); - Gui::View3DInventorViewer* view = reinterpret_cast(n->getUserData()); // Mark all incoming mouse button events as handled, especially, to deactivate the selection node n->setHandled(); @@ -569,18 +568,18 @@ void DlgPrimitives::createPrimitive(const QString& placement) .arg(ui.comboBox1->currentText()), QString::fromLatin1(e.what())); } } - -// ---------------------------------------------- - -/* TRANSLATOR PartGui::Location */ - -Location::Location(QWidget* parent) -{ - ui.setupUi(this); -} - -Location::~Location() -{ + +// ---------------------------------------------- + +/* TRANSLATOR PartGui::Location */ + +Location::Location(QWidget* parent) +{ + ui.setupUi(this); +} + +Location::~Location() +{ // no need to delete child widgets, Qt does it all for us if (!this->activeView.isNull()) { Gui::View3DInventorViewer* viewer = static_cast @@ -589,7 +588,7 @@ Location::~Location() viewer->setRedirectToSceneGraph(false); viewer->removeEventCallback(SoMouseButtonEvent::getClassTypeId(), pickCallback,this); } -} +} void Location::on_viewPositionButton_clicked() { @@ -643,46 +642,46 @@ void Location::pickCallback(void * ud, SoEventCallback * n) QString Location::toPlacement() const { Base::Vector3f d = ui.loc->getDirection(); - gp_Dir dir = gp_Dir(d.x,d.y,d.z); - gp_Pnt pnt = gp_Pnt(0.0,0.0,0.0); - gp_Ax3 ax3; - - double cosNX = dir.Dot(gp::DX()); - double cosNY = dir.Dot(gp::DY()); - double cosNZ = dir.Dot(gp::DZ()); - std::vector cosXYZ; - cosXYZ.push_back(fabs(cosNX)); - cosXYZ.push_back(fabs(cosNY)); - cosXYZ.push_back(fabs(cosNZ)); - - int pos = std::max_element(cosXYZ.begin(), cosXYZ.end()) - cosXYZ.begin(); - - // +X/-X - if (pos == 0) { - if (cosNX > 0) - ax3 = gp_Ax3(pnt, dir, gp_Dir(0,1,0)); - else - ax3 = gp_Ax3(pnt, dir, gp_Dir(0,-1,0)); - } - // +Y/-Y - else if (pos == 1) { - if (cosNY > 0) - ax3 = gp_Ax3(pnt, dir, gp_Dir(0,0,1)); - else - ax3 = gp_Ax3(pnt, dir, gp_Dir(0,0,-1)); - } - // +Z/-Z - else { - ax3 = gp_Ax3(pnt, dir, gp_Dir(1,0,0)); - } - - gp_Trsf Trf; - Trf.SetTransformation(ax3); - Trf.Invert(); - - gp_XYZ theAxis(0,0,1); - Standard_Real theAngle = 0.0; - Trf.GetRotation(theAxis,theAngle); + gp_Dir dir = gp_Dir(d.x,d.y,d.z); + gp_Pnt pnt = gp_Pnt(0.0,0.0,0.0); + gp_Ax3 ax3; + + double cosNX = dir.Dot(gp::DX()); + double cosNY = dir.Dot(gp::DY()); + double cosNZ = dir.Dot(gp::DZ()); + std::vector cosXYZ; + cosXYZ.push_back(fabs(cosNX)); + cosXYZ.push_back(fabs(cosNY)); + cosXYZ.push_back(fabs(cosNZ)); + + int pos = std::max_element(cosXYZ.begin(), cosXYZ.end()) - cosXYZ.begin(); + + // +X/-X + if (pos == 0) { + if (cosNX > 0) + ax3 = gp_Ax3(pnt, dir, gp_Dir(0,1,0)); + else + ax3 = gp_Ax3(pnt, dir, gp_Dir(0,-1,0)); + } + // +Y/-Y + else if (pos == 1) { + if (cosNY > 0) + ax3 = gp_Ax3(pnt, dir, gp_Dir(0,0,1)); + else + ax3 = gp_Ax3(pnt, dir, gp_Dir(0,0,-1)); + } + // +Z/-Z + else { + ax3 = gp_Ax3(pnt, dir, gp_Dir(1,0,0)); + } + + gp_Trsf Trf; + Trf.SetTransformation(ax3); + Trf.Invert(); + + gp_XYZ theAxis(0,0,1); + Standard_Real theAngle = 0.0; + Trf.GetRotation(theAxis,theAngle); Base::Rotation rot(Base::convertTo(theAxis), theAngle); Base::Vector3f loc = ui.loc->getPosition(); @@ -696,52 +695,52 @@ QString Location::toPlacement() const .arg(rot[2],0,'f',2) .arg(rot[3],0,'f',2); } - -// ---------------------------------------------- - -/* TRANSLATOR PartGui::TaskPrimitives */ - -TaskPrimitives::TaskPrimitives() -{ - Gui::TaskView::TaskBox* taskbox; - widget = new DlgPrimitives(); - taskbox = new Gui::TaskView::TaskBox(QPixmap(), widget->windowTitle(),true, 0); - taskbox->groupLayout()->addWidget(widget); - Content.push_back(taskbox); - - location = new Location(); - taskbox = new Gui::TaskView::TaskBox(QPixmap(), location->windowTitle(),true, 0); - taskbox->groupLayout()->addWidget(location); - taskbox->hideGroupBox(); - Content.push_back(taskbox); -} - -TaskPrimitives::~TaskPrimitives() -{ - // automatically deleted in the sub-class -} - -QDialogButtonBox::StandardButtons TaskPrimitives::getStandardButtons() const -{ - return QDialogButtonBox::Close| - QDialogButtonBox::Ok; -} + +// ---------------------------------------------- + +/* TRANSLATOR PartGui::TaskPrimitives */ + +TaskPrimitives::TaskPrimitives() +{ + Gui::TaskView::TaskBox* taskbox; + widget = new DlgPrimitives(); + taskbox = new Gui::TaskView::TaskBox(QPixmap(), widget->windowTitle(),true, 0); + taskbox->groupLayout()->addWidget(widget); + Content.push_back(taskbox); + + location = new Location(); + taskbox = new Gui::TaskView::TaskBox(QPixmap(), location->windowTitle(),true, 0); + taskbox->groupLayout()->addWidget(location); + taskbox->hideGroupBox(); + Content.push_back(taskbox); +} + +TaskPrimitives::~TaskPrimitives() +{ + // automatically deleted in the sub-class +} + +QDialogButtonBox::StandardButtons TaskPrimitives::getStandardButtons() const +{ + return QDialogButtonBox::Close| + QDialogButtonBox::Ok; +} void TaskPrimitives::modifyStandardButtons(QDialogButtonBox* box) { QPushButton* btn = box->button(QDialogButtonBox::Ok); btn->setText(QApplication::translate("PartGui::DlgPrimitives", "&Create")); } - -bool TaskPrimitives::accept() -{ - widget->createPrimitive(location->toPlacement()); - return false; -} - -bool TaskPrimitives::reject() -{ - return true; -} + +bool TaskPrimitives::accept() +{ + widget->createPrimitive(location->toPlacement()); + return false; +} + +bool TaskPrimitives::reject() +{ + return true; +} #include "moc_DlgPrimitives.cpp" diff --git a/src/Mod/PartDesign/App/FeaturePocket.cpp b/src/Mod/PartDesign/App/FeaturePocket.cpp index a0ef1cdd4..beec62191 100644 --- a/src/Mod/PartDesign/App/FeaturePocket.cpp +++ b/src/Mod/PartDesign/App/FeaturePocket.cpp @@ -178,7 +178,7 @@ App::DocumentObjectExecReturn *Pocket::execute(void) it_near = it; upToFace = (std::string(Type.getValueAsString()) == "UpToLast" ? it_far->face : it_near->face); } else { - if (FaceName.getValue() == "") + if (FaceName.isEmpty()) return new App::DocumentObjectExecReturn("Cannot extrude up to face: No face selected"); // Get active object, this is the object that the user referenced when he clicked on the face! diff --git a/src/Mod/PartDesign/Gui/TaskPadParameters.cpp b/src/Mod/PartDesign/Gui/TaskPadParameters.cpp index d7c37b7b3..c28e35f5a 100644 --- a/src/Mod/PartDesign/Gui/TaskPadParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskPadParameters.cpp @@ -92,7 +92,7 @@ TaskPadParameters::TaskPadParameters(ViewProviderPad *PadView,QWidget *parent) // According to bug #0000521 the reversed option // shouldn't be de-activated if the pad has a support face ui->checkBoxReversed->setChecked(reversed); - ui->lineFaceName->setText(upToFace == "" ? tr("No face selected") : tr(upToFace)); + ui->lineFaceName->setText(pcPad->FaceName.isEmpty() ? tr("No face selected") : tr(upToFace)); ui->changeMode->clear(); ui->changeMode->insertItem(0, tr("Dimension")); ui->changeMode->insertItem(1, tr("To last")); diff --git a/src/Mod/PartDesign/Gui/TaskPocketParameters.cpp b/src/Mod/PartDesign/Gui/TaskPocketParameters.cpp index 2122bafd1..cfa9f7155 100644 --- a/src/Mod/PartDesign/Gui/TaskPocketParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskPocketParameters.cpp @@ -86,7 +86,7 @@ TaskPocketParameters::TaskPocketParameters(ViewProviderPocket *PocketView,QWidge ui->lineFaceName->setEnabled(false); } else if (index == 4) { // Only this option requires to select a face ui->doubleSpinBox->setEnabled(false); - ui->lineFaceName->setText(upToFace == "" ? tr("No face selected") : tr(upToFace)); + ui->lineFaceName->setText(pcPocket->FaceName.isEmpty() ? tr("No face selected") : tr(upToFace)); } else { // Neither value nor face required ui->doubleSpinBox->setEnabled(false); ui->lineFaceName->setEnabled(false); diff --git a/src/Mod/Sketcher/App/ConstraintPyImp.cpp b/src/Mod/Sketcher/App/ConstraintPyImp.cpp index 7dad2b759..3a9ee1782 100644 --- a/src/Mod/Sketcher/App/ConstraintPyImp.cpp +++ b/src/Mod/Sketcher/App/ConstraintPyImp.cpp @@ -51,7 +51,7 @@ int ConstraintPy::PyInit(PyObject* args, PyObject* /*kwd*/) int SecondIndex= Constraint::GeoUndef; int SecondPos = none; int ThirdIndex = Constraint::GeoUndef; - int ThirdPos = none; + //int ThirdPos = none; double Value = 0; // Note: In Python 2.x PyArg_ParseTuple prints a warning if a float is given but an integer is expected. // This means we must use a PyObject and check afterwards if it's a float or integer. diff --git a/src/Mod/Web/Gui/BrowserView.cpp b/src/Mod/Web/Gui/BrowserView.cpp index 7410edc1d..81c02dd8b 100644 --- a/src/Mod/Web/Gui/BrowserView.cpp +++ b/src/Mod/Web/Gui/BrowserView.cpp @@ -182,7 +182,7 @@ bool BrowserView::chckHostAllowed(const QString& host) void BrowserView::onDownloadRequested(const QNetworkRequest & request) { Dialog::DownloadDialog dlg (request.url(),this); - int result = dlg.exec(); + dlg.exec(); } void BrowserView::load(const char* URL)