fix whitespaces
This commit is contained in:
parent
7496eeef18
commit
cbf717f317
|
@ -25,7 +25,7 @@
|
||||||
#ifndef _PreComp_
|
#ifndef _PreComp_
|
||||||
# include <Geom_Parabola.hxx>
|
# include <Geom_Parabola.hxx>
|
||||||
# include <gp_Parab.hxx>
|
# include <gp_Parab.hxx>
|
||||||
#include <gce_MakeParab.hxx>
|
# include <gce_MakeParab.hxx>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <Base/VectorPy.h>
|
#include <Base/VectorPy.h>
|
||||||
|
@ -80,23 +80,22 @@ int ParabolaPy::PyInit(PyObject* args, PyObject* kwds)
|
||||||
PyObject *pV1, *pV2, *pV3;
|
PyObject *pV1, *pV2, *pV3;
|
||||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!O!O!", keywords_ssc,
|
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!O!O!", keywords_ssc,
|
||||||
&(Base::VectorPy::Type), &pV1,
|
&(Base::VectorPy::Type), &pV1,
|
||||||
&(Base::VectorPy::Type), &pV2,
|
&(Base::VectorPy::Type), &pV2,
|
||||||
&(Base::VectorPy::Type), &pV3)) {
|
&(Base::VectorPy::Type), &pV3)) {
|
||||||
Base::Vector3d focus = static_cast<Base::VectorPy*>(pV1)->value();
|
Base::Vector3d focus = static_cast<Base::VectorPy*>(pV1)->value();
|
||||||
Base::Vector3d center = static_cast<Base::VectorPy*>(pV2)->value();
|
Base::Vector3d center = static_cast<Base::VectorPy*>(pV2)->value();
|
||||||
Base::Vector3d normal = static_cast<Base::VectorPy*>(pV3)->value();
|
Base::Vector3d normal = static_cast<Base::VectorPy*>(pV3)->value();
|
||||||
|
|
||||||
Base::Vector3d xvect = focus-center;
|
Base::Vector3d xvect = focus-center;
|
||||||
|
|
||||||
// set the geometry
|
// set the geometry
|
||||||
gp_Pnt p1(center.x,center.y,center.z);
|
gp_Pnt p1(center.x,center.y,center.z);
|
||||||
gp_Dir norm(normal.x,normal.y,normal.z);
|
gp_Dir norm(normal.x,normal.y,normal.z);
|
||||||
gp_Dir xdiroce(xvect.x,xvect.y,xvect.z);
|
gp_Dir xdiroce(xvect.x,xvect.y,xvect.z);
|
||||||
|
|
||||||
gp_Ax2 xdir(p1, norm, xdiroce);
|
gp_Ax2 xdir(p1, norm, xdiroce);
|
||||||
|
|
||||||
gce_MakeParab mc(xdir, (Standard_Real) xvect.Length());
|
|
||||||
|
|
||||||
|
gce_MakeParab mc(xdir, (Standard_Real) xvect.Length());
|
||||||
if (!mc.IsDone()) {
|
if (!mc.IsDone()) {
|
||||||
PyErr_SetString(PartExceptionOCCError, gce_ErrorStatusText(mc.Status()));
|
PyErr_SetString(PartExceptionOCCError, gce_ErrorStatusText(mc.Status()));
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -339,7 +339,7 @@ public:
|
||||||
Ellipse = 5, // 1 Point(mid), 5 Parameters(x,y,r1,r2,phi) phi=angle xaxis of elipse with respect of sketch xaxis
|
Ellipse = 5, // 1 Point(mid), 5 Parameters(x,y,r1,r2,phi) phi=angle xaxis of elipse with respect of sketch xaxis
|
||||||
ArcOfEllipse = 6,
|
ArcOfEllipse = 6,
|
||||||
ArcOfHyperbola = 7,
|
ArcOfHyperbola = 7,
|
||||||
ArcOfParabola = 8
|
ArcOfParabola = 8
|
||||||
};
|
};
|
||||||
|
|
||||||
float SolveTime;
|
float SolveTime;
|
||||||
|
@ -385,9 +385,9 @@ protected:
|
||||||
std::vector<GCS::Arc> Arcs;
|
std::vector<GCS::Arc> Arcs;
|
||||||
std::vector<GCS::Circle> Circles;
|
std::vector<GCS::Circle> Circles;
|
||||||
std::vector<GCS::Ellipse> Ellipses;
|
std::vector<GCS::Ellipse> Ellipses;
|
||||||
std::vector<GCS::ArcOfEllipse> ArcsOfEllipse;
|
std::vector<GCS::ArcOfEllipse> ArcsOfEllipse;
|
||||||
std::vector<GCS::ArcOfHyperbola> ArcsOfHyperbola;
|
std::vector<GCS::ArcOfHyperbola> ArcsOfHyperbola;
|
||||||
std::vector<GCS::ArcOfParabola> ArcsOfParabola;
|
std::vector<GCS::ArcOfParabola> ArcsOfParabola;
|
||||||
|
|
||||||
bool isInitMove;
|
bool isInitMove;
|
||||||
bool isFine;
|
bool isFine;
|
||||||
|
|
|
@ -66,8 +66,8 @@ namespace GCS
|
||||||
CurveValue = 20,
|
CurveValue = 20,
|
||||||
PointOnHyperbola = 21,
|
PointOnHyperbola = 21,
|
||||||
InternalAlignmentPoint2Hyperbola = 22,
|
InternalAlignmentPoint2Hyperbola = 22,
|
||||||
PointOnParabola = 23,
|
PointOnParabola = 23,
|
||||||
EqualFocalDistance = 24
|
EqualFocalDistance = 24
|
||||||
};
|
};
|
||||||
|
|
||||||
enum InternalAlignmentType {
|
enum InternalAlignmentType {
|
||||||
|
|
|
@ -182,11 +182,11 @@ namespace GCS
|
||||||
int addConstraintPointOnCircle(Point &p, Circle &c, int tagId=0);
|
int addConstraintPointOnCircle(Point &p, Circle &c, int tagId=0);
|
||||||
int addConstraintPointOnEllipse(Point &p, Ellipse &e, int tagId=0);
|
int addConstraintPointOnEllipse(Point &p, Ellipse &e, int tagId=0);
|
||||||
int addConstraintPointOnHyperbolicArc(Point &p, ArcOfHyperbola &e, int tagId=0);
|
int addConstraintPointOnHyperbolicArc(Point &p, ArcOfHyperbola &e, int tagId=0);
|
||||||
int addConstraintPointOnParabolicArc(Point &p, ArcOfParabola &e, int tagId=0);
|
int addConstraintPointOnParabolicArc(Point &p, ArcOfParabola &e, int tagId=0);
|
||||||
int addConstraintArcOfEllipseRules(ArcOfEllipse &a, int tagId=0);
|
int addConstraintArcOfEllipseRules(ArcOfEllipse &a, int tagId=0);
|
||||||
int addConstraintCurveValue(Point &p, Curve &a, double *u, int tagId=0);
|
int addConstraintCurveValue(Point &p, Curve &a, double *u, int tagId=0);
|
||||||
int addConstraintArcOfHyperbolaRules(ArcOfHyperbola &a, int tagId=0);
|
int addConstraintArcOfHyperbolaRules(ArcOfHyperbola &a, int tagId=0);
|
||||||
int addConstraintArcOfParabolaRules(ArcOfParabola &a, int tagId=0);
|
int addConstraintArcOfParabolaRules(ArcOfParabola &a, int tagId=0);
|
||||||
int addConstraintPointOnArc(Point &p, Arc &a, int tagId=0);
|
int addConstraintPointOnArc(Point &p, Arc &a, int tagId=0);
|
||||||
int addConstraintPerpendicularLine2Arc(Point &p1, Point &p2, Arc &a,
|
int addConstraintPerpendicularLine2Arc(Point &p1, Point &p2, Arc &a,
|
||||||
int tagId=0);
|
int tagId=0);
|
||||||
|
@ -213,7 +213,7 @@ namespace GCS
|
||||||
int addConstraintEqualRadii(ArcOfHyperbola &a1, ArcOfHyperbola &a2, int tagId=0);
|
int addConstraintEqualRadii(ArcOfHyperbola &a1, ArcOfHyperbola &a2, int tagId=0);
|
||||||
int addConstraintEqualRadius(Circle &c1, Arc &a2, int tagId=0);
|
int addConstraintEqualRadius(Circle &c1, Arc &a2, int tagId=0);
|
||||||
int addConstraintEqualRadius(Arc &a1, Arc &a2, int tagId=0);
|
int addConstraintEqualRadius(Arc &a1, Arc &a2, int tagId=0);
|
||||||
int addConstraintEqualFocus(ArcOfParabola &a1, ArcOfParabola &a2, int tagId=0);
|
int addConstraintEqualFocus(ArcOfParabola &a1, ArcOfParabola &a2, int tagId=0);
|
||||||
int addConstraintP2PSymmetric(Point &p1, Point &p2, Line &l, int tagId=0);
|
int addConstraintP2PSymmetric(Point &p1, Point &p2, Line &l, int tagId=0);
|
||||||
int addConstraintP2PSymmetric(Point &p1, Point &p2, Point &p, int tagId=0);
|
int addConstraintP2PSymmetric(Point &p1, Point &p2, Point &p, int tagId=0);
|
||||||
int addConstraintSnellsLaw(Curve &ray1, Curve &ray2,
|
int addConstraintSnellsLaw(Curve &ray1, Curve &ray2,
|
||||||
|
@ -232,7 +232,7 @@ namespace GCS
|
||||||
int addConstraintInternalAlignmentHyperbolaMajorDiameter(Hyperbola &e, Point &p1, Point &p2, int tagId=0);
|
int addConstraintInternalAlignmentHyperbolaMajorDiameter(Hyperbola &e, Point &p1, Point &p2, int tagId=0);
|
||||||
int addConstraintInternalAlignmentHyperbolaMinorDiameter(Hyperbola &e, Point &p1, Point &p2, int tagId=0);
|
int addConstraintInternalAlignmentHyperbolaMinorDiameter(Hyperbola &e, Point &p1, Point &p2, int tagId=0);
|
||||||
int addConstraintInternalAlignmentHyperbolaFocus(Hyperbola &e, Point &p1, int tagId=0);
|
int addConstraintInternalAlignmentHyperbolaFocus(Hyperbola &e, Point &p1, int tagId=0);
|
||||||
int addConstraintInternalAlignmentParabolaFocus(Parabola &e, Point &p1, int tagId=0);
|
int addConstraintInternalAlignmentParabolaFocus(Parabola &e, Point &p1, int tagId=0);
|
||||||
|
|
||||||
double calculateAngleViaPoint(Curve &crv1, Curve &crv2, Point &p);
|
double calculateAngleViaPoint(Curve &crv1, Curve &crv2, Point &p);
|
||||||
double calculateAngleViaPoint(Curve &crv1, Curve &crv2, Point &p1, Point &p2);
|
double calculateAngleViaPoint(Curve &crv1, Curve &crv2, Point &p1, Point &p2);
|
||||||
|
|
|
@ -2013,11 +2013,11 @@ void CmdSketcherConstrainPerpendicular::activated(int iMsg)
|
||||||
if( geo1->getTypeId() == Part::GeomEllipse::getClassTypeId() ||
|
if( geo1->getTypeId() == Part::GeomEllipse::getClassTypeId() ||
|
||||||
geo1->getTypeId() == Part::GeomArcOfEllipse::getClassTypeId() ||
|
geo1->getTypeId() == Part::GeomArcOfEllipse::getClassTypeId() ||
|
||||||
geo1->getTypeId() == Part::GeomArcOfHyperbola::getClassTypeId() ||
|
geo1->getTypeId() == Part::GeomArcOfHyperbola::getClassTypeId() ||
|
||||||
geo1->getTypeId() == Part::GeomArcOfParabola::getClassTypeId() ) {
|
geo1->getTypeId() == Part::GeomArcOfParabola::getClassTypeId() ) {
|
||||||
|
|
||||||
Base::Vector3d center;
|
Base::Vector3d center;
|
||||||
Base::Vector3d majdir;
|
Base::Vector3d majdir;
|
||||||
Base::Vector3d focus;
|
Base::Vector3d focus;
|
||||||
double majord = 0;
|
double majord = 0;
|
||||||
double minord = 0;
|
double minord = 0;
|
||||||
double phi = 0;
|
double phi = 0;
|
||||||
|
@ -2030,8 +2030,8 @@ void CmdSketcherConstrainPerpendicular::activated(int iMsg)
|
||||||
minord=ellipse->getMinorRadius();
|
minord=ellipse->getMinorRadius();
|
||||||
majdir=ellipse->getMajorAxisDir();
|
majdir=ellipse->getMajorAxisDir();
|
||||||
phi=atan2(majdir.y, majdir.x);
|
phi=atan2(majdir.y, majdir.x);
|
||||||
} else
|
}
|
||||||
if( geo1->getTypeId() == Part::GeomArcOfEllipse::getClassTypeId() ){
|
else if( geo1->getTypeId() == Part::GeomArcOfEllipse::getClassTypeId() ){
|
||||||
const Part::GeomArcOfEllipse *aoe = static_cast<const Part::GeomArcOfEllipse *>(geo1);
|
const Part::GeomArcOfEllipse *aoe = static_cast<const Part::GeomArcOfEllipse *>(geo1);
|
||||||
|
|
||||||
center=aoe->getCenter();
|
center=aoe->getCenter();
|
||||||
|
@ -2040,23 +2040,21 @@ void CmdSketcherConstrainPerpendicular::activated(int iMsg)
|
||||||
majdir=aoe->getMajorAxisDir();
|
majdir=aoe->getMajorAxisDir();
|
||||||
phi=atan2(majdir.y, majdir.x);
|
phi=atan2(majdir.y, majdir.x);
|
||||||
}
|
}
|
||||||
else
|
else if( geo1->getTypeId() == Part::GeomArcOfHyperbola::getClassTypeId() ){
|
||||||
if( geo1->getTypeId() == Part::GeomArcOfHyperbola::getClassTypeId() ){
|
const Part::GeomArcOfHyperbola *aoh = static_cast<const Part::GeomArcOfHyperbola *>(geo1);
|
||||||
const Part::GeomArcOfHyperbola *aoh = static_cast<const Part::GeomArcOfHyperbola *>(geo1);
|
|
||||||
|
|
||||||
center=aoh->getCenter();
|
center=aoh->getCenter();
|
||||||
majord=aoh->getMajorRadius();
|
majord=aoh->getMajorRadius();
|
||||||
minord=aoh->getMinorRadius();
|
minord=aoh->getMinorRadius();
|
||||||
majdir=aoh->getMajorAxisDir();
|
majdir=aoh->getMajorAxisDir();
|
||||||
phi=atan2(majdir.y, majdir.x);
|
phi=atan2(majdir.y, majdir.x);
|
||||||
}
|
}
|
||||||
else
|
else if( geo1->getTypeId() == Part::GeomArcOfParabola::getClassTypeId() ){
|
||||||
if( geo1->getTypeId() == Part::GeomArcOfParabola::getClassTypeId() ){
|
const Part::GeomArcOfParabola *aop = static_cast<const Part::GeomArcOfParabola *>(geo1);
|
||||||
const Part::GeomArcOfParabola *aop = static_cast<const Part::GeomArcOfParabola *>(geo1);
|
|
||||||
|
|
||||||
center=aop->getCenter();
|
center=aop->getCenter();
|
||||||
focus=aop->getFocus();
|
focus=aop->getFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
const Part::GeomLineSegment *line = static_cast<const Part::GeomLineSegment *>(geo2);
|
const Part::GeomLineSegment *line = static_cast<const Part::GeomLineSegment *>(geo2);
|
||||||
|
|
||||||
|
@ -2076,8 +2074,7 @@ void CmdSketcherConstrainPerpendicular::activated(int iMsg)
|
||||||
|
|
||||||
PoO = point1 + direction / 2;
|
PoO = point1 + direction / 2;
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
Base::Vector3d direction=point1-center;
|
Base::Vector3d direction=point1-center;
|
||||||
double tapprox=atan2(direction.y,direction.x)-phi; // we approximate the eccentric anomally by the polar
|
double tapprox=atan2(direction.y,direction.x)-phi; // we approximate the eccentric anomally by the polar
|
||||||
|
|
||||||
|
|
|
@ -4222,16 +4222,16 @@ void CmdSketcherCompCreateConic::updateAction(int mode)
|
||||||
a[0]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateEllipse"));
|
a[0]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateEllipse"));
|
||||||
a[1]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateEllipse_3points"));
|
a[1]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateEllipse_3points"));
|
||||||
a[2]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_Elliptical_Arc"));
|
a[2]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_Elliptical_Arc"));
|
||||||
a[3]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_Hyperbolic_Arc"));
|
a[3]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_Hyperbolic_Arc"));
|
||||||
a[4]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_Parabolic_Arc"));
|
a[4]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_Parabolic_Arc"));
|
||||||
getAction()->setIcon(a[index]->icon());
|
getAction()->setIcon(a[index]->icon());
|
||||||
break;
|
break;
|
||||||
case Construction:
|
case Construction:
|
||||||
a[0]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateEllipse_Constr"));
|
a[0]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateEllipse_Constr"));
|
||||||
a[1]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateEllipse_3points_Constr"));
|
a[1]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateEllipse_3points_Constr"));
|
||||||
a[2]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_Elliptical_Arc_Constr"));
|
a[2]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_Elliptical_Arc_Constr"));
|
||||||
a[3]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_Hyperbolic_Arc_Constr"));
|
a[3]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_Hyperbolic_Arc_Constr"));
|
||||||
a[4]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_Parabolic_Arc_Constr"));
|
a[4]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_Parabolic_Arc_Constr"));
|
||||||
getAction()->setIcon(a[index]->icon());
|
getAction()->setIcon(a[index]->icon());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -141,7 +141,7 @@ inline void SketcherAddWorkspaceArcs<Gui::MenuItem>(Gui::MenuItem& geom){
|
||||||
<< "Sketcher_CreateEllipseBy3Points"
|
<< "Sketcher_CreateEllipseBy3Points"
|
||||||
<< "Sketcher_CreateArcOfEllipse"
|
<< "Sketcher_CreateArcOfEllipse"
|
||||||
<< "Sketcher_CreateArcOfHyperbola"
|
<< "Sketcher_CreateArcOfHyperbola"
|
||||||
<< "Sketcher_CreateArcOfParabola";
|
<< "Sketcher_CreateArcOfParabola";
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
inline void SketcherAddWorkspaceArcs<Gui::ToolBarItem>(Gui::ToolBarItem& geom){
|
inline void SketcherAddWorkspaceArcs<Gui::ToolBarItem>(Gui::ToolBarItem& geom){
|
||||||
|
|
Loading…
Reference in New Issue
Block a user