Fix critical warnings
This commit is contained in:
parent
09040e1d95
commit
b4aff85333
|
@ -192,7 +192,6 @@ PyObject* BoundBoxPy::getIntersectionPoint(PyObject *args)
|
|||
*(static_cast<Base::VectorPy*>(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)) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 //<< "<g"
|
||||
//<< " id=\"" << ViewName << "\"" << endl
|
||||
|
@ -278,7 +278,7 @@ std::string ProjectionAlgos::getDXF(SvgExtractionType type, float scale)
|
|||
//<< "</g>" << endl;
|
||||
}
|
||||
if (!HO.IsNull() && (type & WithHidden)) {
|
||||
float width = 0.15f/scale;
|
||||
//float width = 0.15f/scale;
|
||||
BRepMesh::Mesh(HO,0.1);
|
||||
result //<< "<g"
|
||||
//<< " id=\"" << ViewName << "\"" << endl
|
||||
|
@ -293,7 +293,7 @@ std::string ProjectionAlgos::getDXF(SvgExtractionType type, float scale)
|
|||
//<< "</g>" << endl;
|
||||
}
|
||||
if (!VO.IsNull()) {
|
||||
float width = 0.35f/scale;
|
||||
//float width = 0.35f/scale;
|
||||
BRepMesh::Mesh(VO,0.1);
|
||||
result //<< "<g"
|
||||
//<< " id=\"" << ViewName << "\"" << endl
|
||||
|
@ -309,8 +309,7 @@ std::string ProjectionAlgos::getDXF(SvgExtractionType type, float scale)
|
|||
//<< "</g>" << endl;
|
||||
}
|
||||
if (!V.IsNull()) {
|
||||
float width = 0.35f/scale;
|
||||
|
||||
//float width = 0.35f/scale;
|
||||
BRepMesh::Mesh(V,0.1);
|
||||
result //<< "<g"
|
||||
//<< " id=\"" << ViewName << "\"" << endl
|
||||
|
@ -326,7 +325,7 @@ std::string ProjectionAlgos::getDXF(SvgExtractionType type, float scale)
|
|||
|
||||
}
|
||||
if (!V1.IsNull() && (type & WithSmooth)) {
|
||||
float width = 0.35f/scale;
|
||||
//float width = 0.35f/scale;
|
||||
BRepMesh::Mesh(V1,0.1);
|
||||
result //<< "<g"
|
||||
|
||||
|
@ -342,8 +341,7 @@ std::string ProjectionAlgos::getDXF(SvgExtractionType type, float scale)
|
|||
//<< "</g>" << endl;
|
||||
}
|
||||
if (!H1.IsNull() && (type & WithSmooth) && (type & WithHidden)) {
|
||||
|
||||
float width = 0.15f/scale;
|
||||
//float width = 0.15f/scale;
|
||||
BRepMesh::Mesh(H1,0.1);
|
||||
result //<< "<g"
|
||||
//<< " id=\"" << ViewName << "\"" << endl
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#include <Gui/Command.h>
|
||||
#include <Base/BoundBoxPy.h>
|
||||
#include <Mod/Part/App/PartFeature.h>
|
||||
#include <Mod/Drawing/App/FeaturePage.h>
|
||||
#include <Mod/Drawing/App/FeaturePage.h>
|
||||
|
||||
#include <Base/FileInfo.h>
|
||||
#include <iostream>
|
||||
|
@ -301,7 +301,7 @@ TaskOrthoViews::TaskOrthoViews(QWidget *parent)
|
|||
App::Document* doc = App::GetApplication().getActiveDocument();
|
||||
|
||||
std::vector<App::DocumentObject*> 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);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
# define WNT // avoid conflict with GUID
|
||||
#endif
|
||||
#ifndef _PreComp_
|
||||
# include <climits>
|
||||
# include <Python.h>
|
||||
# include <climits>
|
||||
# include <Standard_Version.hxx>
|
||||
# include <BRep_Builder.hxx>
|
||||
# include <Handle_TDocStd_Document.hxx>
|
||||
|
|
|
@ -641,8 +641,8 @@ bool MeshAlgorithm::FillupHole(const std::vector<unsigned long>& 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<std::pair<Base::Vector3f, Base::Vect
|
|||
rclLines.erase(pFront);
|
||||
}
|
||||
|
||||
|
||||
if (pEnd != rclLines.end())
|
||||
{
|
||||
if (bEndFirst == true)
|
||||
|
@ -1913,17 +1914,17 @@ void MeshRefNormalToPoints::Rebuild (void)
|
|||
|
||||
const MeshFacetArray& rFacets = _rclMesh.GetFacets();
|
||||
for (MeshFacetArray::_TConstIterator pF = rFacets.begin(); pF != rFacets.end(); ++pF) {
|
||||
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));
|
||||
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<Base::Vector3f>::iterator it = _norm.begin(); it != _norm.end(); ++it)
|
||||
it->Normalize();
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -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<App::Color> &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 << " "
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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<Gui::View3DInventor*>(doc->getActiveView());
|
||||
#endif
|
||||
//if (view) {
|
||||
// Gui::View3DInventorViewer* viewer = view->getViewer();
|
||||
// viewer->setEditing(true);
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
#include <Gui/Command.h>
|
||||
#include <Gui/View3DInventor.h>
|
||||
#include <Gui/View3DInventorViewer.h>
|
||||
#include <Gui/TaskView/TaskView.h>
|
||||
#include <Gui/TaskView/TaskView.h>
|
||||
#include <Mod/Part/App/Tools.h>
|
||||
|
||||
#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<Base::Vector3d>(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<const SoMouseButtonEvent*>(n->getEvent());
|
||||
Gui::View3DInventorViewer* view = reinterpret_cast<Gui::View3DInventorViewer*>(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<Gui::View3DInventor*>
|
||||
|
@ -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<double> 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<double> 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<Base::Vector3d>(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"
|
||||
|
|
|
@ -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!
|
||||
|
|
|
@ -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"));
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user