+ fix typos, strip trailing spaces, homogenize coding style
+ remove redundant header git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5063 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
parent
bdcb36c0f8
commit
61de5e037e
|
@ -175,7 +175,7 @@ protected:
|
|||
void resetError(void){StatusBits.reset(1);}
|
||||
void setDocument(App::Document* doc);
|
||||
|
||||
/// get called befor the value is changed
|
||||
/// get called before the value is changed
|
||||
virtual void onBeforeChange(const Property* prop);
|
||||
/// get called by the container when a property was changed
|
||||
virtual void onChanged(const Property* prop);
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include <Base/Exception.h>
|
||||
#include <Base/Reader.h>
|
||||
#include <Base/Writer.h>
|
||||
#include <Base/Console.h>
|
||||
|
||||
#include "Geometry.h"
|
||||
#include "GeometryPy.h"
|
||||
|
|
|
@ -566,13 +566,13 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point)
|
|||
|
||||
PointPos secondPos1 = Sketcher::none, secondPos2 = Sketcher::none;
|
||||
ConstraintType constrType1 = Sketcher::PointOnObject, constrType2 = Sketcher::PointOnObject;
|
||||
for (std::vector<Constraint *>::const_iterator it=constraints.begin(); it != constraints.end(); ++it)
|
||||
{
|
||||
for (std::vector<Constraint *>::const_iterator it=constraints.begin();
|
||||
it != constraints.end(); ++it) {
|
||||
Constraint *constr = *(it);
|
||||
if(secondPos1 == Sketcher::none && (constr->First == GeoId1 && constr->Second == GeoId)) {
|
||||
if (secondPos1 == Sketcher::none && (constr->First == GeoId1 && constr->Second == GeoId)) {
|
||||
constrType1= Sketcher::Coincident;
|
||||
secondPos1 = constr->FirstPos;
|
||||
} else if(secondPos2 == Sketcher::none && (constr->First == GeoId2 && constr->Second == GeoId)) {
|
||||
} else if (secondPos2 == Sketcher::none && (constr->First == GeoId2 && constr->Second == GeoId)) {
|
||||
constrType2 = Sketcher::Coincident;
|
||||
secondPos2 = constr->FirstPos;
|
||||
}
|
||||
|
@ -585,7 +585,7 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point)
|
|||
newConstr->FirstPos = end;
|
||||
newConstr->Second = GeoId1;
|
||||
|
||||
if(constrType1 == Sketcher::Coincident) {
|
||||
if (constrType1 == Sketcher::Coincident) {
|
||||
newConstr->SecondPos = secondPos1;
|
||||
delConstraintOnPoint(GeoId1, secondPos1, false);
|
||||
}
|
||||
|
@ -600,7 +600,7 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point)
|
|||
newConstr->FirstPos = start;
|
||||
newConstr->Second = GeoId2;
|
||||
|
||||
if(constrType2 == Sketcher::Coincident) {
|
||||
if (constrType2 == Sketcher::Coincident) {
|
||||
newConstr->SecondPos = secondPos2;
|
||||
delConstraintOnPoint(GeoId2, secondPos2, false);
|
||||
}
|
||||
|
@ -635,10 +635,10 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point)
|
|||
|
||||
ConstraintType constrType = Sketcher::PointOnObject;
|
||||
PointPos secondPos = Sketcher::none;
|
||||
for (std::vector<Constraint *>::const_iterator it=constraints.begin(); it != constraints.end(); ++it)
|
||||
{
|
||||
for (std::vector<Constraint *>::const_iterator it=constraints.begin();
|
||||
it != constraints.end(); ++it) {
|
||||
Constraint *constr = *(it);
|
||||
if((constr->First == GeoId1 && constr->Second == GeoId)) {
|
||||
if ((constr->First == GeoId1 && constr->Second == GeoId)) {
|
||||
constrType = Sketcher::Coincident;
|
||||
secondPos = constr->FirstPos;
|
||||
delConstraintOnPoint(GeoId1, constr->FirstPos, false);
|
||||
|
@ -657,10 +657,8 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point)
|
|||
newConstr->FirstPos = start;
|
||||
newConstr->Second = GeoId1;
|
||||
|
||||
if(constrType == Sketcher::Coincident)
|
||||
{
|
||||
if (constrType == Sketcher::Coincident)
|
||||
newConstr->SecondPos = secondPos;
|
||||
}
|
||||
|
||||
addConstraint(newConstr);
|
||||
delete newConstr;
|
||||
|
@ -675,10 +673,8 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point)
|
|||
newConstr->FirstPos = end;
|
||||
newConstr->Second = GeoId1;
|
||||
|
||||
if(constrType == Sketcher::Coincident)
|
||||
{
|
||||
if (constrType == Sketcher::Coincident)
|
||||
newConstr->SecondPos = secondPos;
|
||||
}
|
||||
|
||||
addConstraint(newConstr);
|
||||
delete newConstr;
|
||||
|
@ -719,10 +715,10 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point)
|
|||
|
||||
PointPos secondPos1 = Sketcher::none, secondPos2 = Sketcher::none;
|
||||
ConstraintType constrType1 = Sketcher::PointOnObject, constrType2 = Sketcher::PointOnObject;
|
||||
for (std::vector<Constraint *>::const_iterator it=constraints.begin(); it != constraints.end(); ++it)
|
||||
{
|
||||
for (std::vector<Constraint *>::const_iterator it=constraints.begin();
|
||||
it != constraints.end(); ++it) {
|
||||
Constraint *constr = *(it);
|
||||
if(secondPos1 == Sketcher::none && (constr->First == GeoId1 && constr->Second == GeoId)) {
|
||||
if (secondPos1 == Sketcher::none && (constr->First == GeoId1 && constr->Second == GeoId)) {
|
||||
constrType1= Sketcher::Coincident;
|
||||
secondPos1 = constr->FirstPos;
|
||||
} else if(secondPos2 == Sketcher::none && (constr->First == GeoId2 && constr->Second == GeoId)) {
|
||||
|
@ -731,7 +727,6 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// constrain the trimming points on the corresponding geometries
|
||||
Sketcher::Constraint *newConstr = new Sketcher::Constraint();
|
||||
newConstr->Type = constrType1;
|
||||
|
@ -739,7 +734,7 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point)
|
|||
newConstr->FirstPos = start;
|
||||
newConstr->Second = GeoId1;
|
||||
|
||||
if(constrType1 == Sketcher::Coincident) {
|
||||
if (constrType1 == Sketcher::Coincident) {
|
||||
newConstr->SecondPos = secondPos1;
|
||||
delConstraintOnPoint(GeoId1, secondPos1, false);
|
||||
}
|
||||
|
@ -754,7 +749,7 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point)
|
|||
newConstr->FirstPos = end;
|
||||
newConstr->Second = GeoId2;
|
||||
|
||||
if(constrType2 == Sketcher::Coincident) {
|
||||
if (constrType2 == Sketcher::Coincident) {
|
||||
newConstr->SecondPos = secondPos2;
|
||||
delConstraintOnPoint(GeoId2, secondPos2, false);
|
||||
}
|
||||
|
@ -806,14 +801,14 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point)
|
|||
PointPos secondPos1 = Sketcher::none, secondPos2 = Sketcher::none;
|
||||
ConstraintType constrType1 = Sketcher::PointOnObject, constrType2 = Sketcher::PointOnObject;
|
||||
|
||||
for (std::vector<Constraint *>::const_iterator it=constraints.begin(); it != constraints.end(); ++it)
|
||||
{
|
||||
for (std::vector<Constraint *>::const_iterator it=constraints.begin();
|
||||
it != constraints.end(); ++it) {
|
||||
Constraint *constr = *(it);
|
||||
if(secondPos1 == Sketcher::none &&
|
||||
if (secondPos1 == Sketcher::none &&
|
||||
(constr->First == GeoId1 && constr->Second == GeoId)) {
|
||||
constrType1= Sketcher::Coincident;
|
||||
secondPos1 = constr->FirstPos;
|
||||
} else if(secondPos2 == Sketcher::none &&
|
||||
} else if (secondPos2 == Sketcher::none &&
|
||||
(constr->First == GeoId2 && constr->Second == GeoId)) {
|
||||
constrType2 = Sketcher::Coincident;
|
||||
secondPos2 = constr->FirstPos;
|
||||
|
@ -825,7 +820,7 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point)
|
|||
newConstr->FirstPos = end;
|
||||
newConstr->Second = GeoId1;
|
||||
|
||||
if(constrType1 == Sketcher::Coincident) {
|
||||
if (constrType1 == Sketcher::Coincident) {
|
||||
newConstr->SecondPos = secondPos1;
|
||||
delConstraintOnPoint(GeoId1, secondPos1, false);
|
||||
}
|
||||
|
@ -840,7 +835,7 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point)
|
|||
newConstr->FirstPos = start;
|
||||
newConstr->Second = GeoId2;
|
||||
|
||||
if(constrType2 == Sketcher::Coincident) {
|
||||
if (constrType2 == Sketcher::Coincident) {
|
||||
newConstr->SecondPos = secondPos2;
|
||||
delConstraintOnPoint(GeoId2, secondPos2, false);
|
||||
}
|
||||
|
@ -872,10 +867,10 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point)
|
|||
|
||||
ConstraintType constrType = Sketcher::PointOnObject;
|
||||
PointPos secondPos = Sketcher::none;
|
||||
for (std::vector<Constraint *>::const_iterator it=constraints.begin(); it != constraints.end(); ++it)
|
||||
{
|
||||
for (std::vector<Constraint *>::const_iterator it=constraints.begin();
|
||||
it != constraints.end(); ++it) {
|
||||
Constraint *constr = *(it);
|
||||
if((constr->First == GeoId1 && constr->Second == GeoId)) {
|
||||
if ((constr->First == GeoId1 && constr->Second == GeoId)) {
|
||||
constrType = Sketcher::Coincident;
|
||||
secondPos = constr->FirstPos;
|
||||
delConstraintOnPoint(GeoId1, constr->FirstPos, false);
|
||||
|
@ -896,10 +891,8 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point)
|
|||
newConstr->FirstPos = start;
|
||||
newConstr->Second = GeoId1;
|
||||
|
||||
if(constrType == Sketcher::Coincident)
|
||||
{
|
||||
if (constrType == Sketcher::Coincident)
|
||||
newConstr->SecondPos = secondPos;
|
||||
}
|
||||
|
||||
addConstraint(newConstr);
|
||||
delete newConstr;
|
||||
|
@ -915,10 +908,8 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point)
|
|||
newConstr->FirstPos = end;
|
||||
newConstr->Second = GeoId1;
|
||||
|
||||
if(constrType == Sketcher::Coincident)
|
||||
{
|
||||
if (constrType == Sketcher::Coincident)
|
||||
newConstr->SecondPos = secondPos;
|
||||
}
|
||||
|
||||
addConstraint(newConstr);
|
||||
delete newConstr;
|
||||
|
@ -1044,7 +1035,7 @@ void SketchObject::appendConflictMsg(const std::vector<int> &conflicting, std::s
|
|||
ss << msg;
|
||||
if (conflicting.size() > 0) {
|
||||
ss << "Please remove at least one of the constraints (" << conflicting[0];
|
||||
for (int i=1; i < conflicting.size(); i++)
|
||||
for (unsigned int i=1; i < conflicting.size(); i++)
|
||||
ss << ", " << conflicting[i];
|
||||
ss << ")\n";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user