+ fix whitespaces

This commit is contained in:
wmayer 2015-05-30 20:30:12 +02:00
parent 3b1873f1dc
commit eef340f19c
3 changed files with 71 additions and 71 deletions

View File

@ -632,7 +632,7 @@ GCS::Curve* Sketch::getGCSCurveByGeoId(int geoId)
int Sketch::addConstraint(const Constraint *constraint) int Sketch::addConstraint(const Constraint *constraint)
{ {
if(int(Geoms.size()) <= 0) if (Geoms.empty())
throw Base::Exception("Sketch::addConstraint. Can't add constraint to a sketch with no geometry!"); throw Base::Exception("Sketch::addConstraint. Can't add constraint to a sketch with no geometry!");
int rtn = -1; int rtn = -1;
@ -648,6 +648,7 @@ int Sketch::addConstraint(const Constraint *constraint)
FixParameters.push_back(c.value); FixParameters.push_back(c.value);
else else
Parameters.push_back(c.value); Parameters.push_back(c.value);
rtn = addDistanceXConstraint(constraint->First,c.value); rtn = addDistanceXConstraint(constraint->First,c.value);
} }
else if (constraint->Second == Constraint::GeoUndef) {// point on fixed x-coordinate else if (constraint->Second == Constraint::GeoUndef) {// point on fixed x-coordinate
@ -658,7 +659,7 @@ int Sketch::addConstraint(const Constraint *constraint)
Parameters.push_back(c.value); Parameters.push_back(c.value);
rtn = addCoordinateXConstraint(constraint->First,constraint->FirstPos,c.value); rtn = addCoordinateXConstraint(constraint->First,constraint->FirstPos,c.value);
} }
else if (constraint->SecondPos != none) {// point to point horizontal distance else if (constraint->SecondPos != none) {// point to point horizontal distance
c.value = new double(constraint->Value); c.value = new double(constraint->Value);
if(c.driving) if(c.driving)
@ -677,6 +678,7 @@ int Sketch::addConstraint(const Constraint *constraint)
FixParameters.push_back(c.value); FixParameters.push_back(c.value);
else else
Parameters.push_back(c.value); Parameters.push_back(c.value);
rtn = addDistanceYConstraint(constraint->First,c.value); rtn = addDistanceYConstraint(constraint->First,c.value);
} }
else if (constraint->Second == Constraint::GeoUndef){ // point on fixed y-coordinate else if (constraint->Second == Constraint::GeoUndef){ // point on fixed y-coordinate
@ -742,8 +744,6 @@ int Sketch::addConstraint(const Constraint *constraint)
constraint->Third, constraint->ThirdPos, constraint->Third, constraint->ThirdPos,
c.value, constraint->Type); c.value, constraint->Type);
} }
break; break;
case Tangent: case Tangent:
if (constraint->FirstPos == none && if (constraint->FirstPos == none &&
@ -835,6 +835,7 @@ int Sketch::addConstraint(const Constraint *constraint)
FixParameters.push_back(c.value); FixParameters.push_back(c.value);
else else
Parameters.push_back(c.value); Parameters.push_back(c.value);
rtn = addAngleConstraint(constraint->First,c.value); rtn = addAngleConstraint(constraint->First,c.value);
} }
break; break;
@ -845,6 +846,7 @@ int Sketch::addConstraint(const Constraint *constraint)
FixParameters.push_back(c.value); FixParameters.push_back(c.value);
else else
Parameters.push_back(c.value); Parameters.push_back(c.value);
rtn = addRadiusConstraint(constraint->First, c.value); rtn = addRadiusConstraint(constraint->First, c.value);
break; break;
} }
@ -877,25 +879,25 @@ int Sketch::addConstraint(const Constraint *constraint)
} }
break; break;
case SnellsLaw: case SnellsLaw:
{ {
c.value = new double(constraint->Value); c.value = new double(constraint->Value);
c.secondvalue = new double(constraint->Value); c.secondvalue = new double(constraint->Value);
if(c.driving) { if(c.driving) {
FixParameters.push_back(c.value); FixParameters.push_back(c.value);
FixParameters.push_back(c.secondvalue); FixParameters.push_back(c.secondvalue);
} }
else { else {
Parameters.push_back(c.value); Parameters.push_back(c.value);
Parameters.push_back(c.secondvalue); Parameters.push_back(c.secondvalue);
} }
//assert(constraint->ThirdPos==none); //will work anyway... //assert(constraint->ThirdPos==none); //will work anyway...
rtn = addSnellsLawConstraint(constraint->First, constraint->FirstPos, rtn = addSnellsLawConstraint(constraint->First, constraint->FirstPos,
constraint->Second, constraint->SecondPos, constraint->Second, constraint->SecondPos,
constraint->Third, constraint->Third,
c.value, c.secondvalue); c.value, c.secondvalue);
} }
break; break;
case None: case None:
break; break;

View File

@ -54,8 +54,8 @@ bool isAlterGeoActive(Gui::Document *doc)
return true; return true;
} }
} }
return false;
return false;
} }
namespace SketcherGui { namespace SketcherGui {
@ -202,9 +202,7 @@ void CmdSketcherToggleConstruction::activated(int iMsg)
index==3?Gui::BitmapFactory().pixmap("Sketcher_CreateHexagon_Constr"): index==3?Gui::BitmapFactory().pixmap("Sketcher_CreateHexagon_Constr"):
index==4?Gui::BitmapFactory().pixmap("Sketcher_CreateHeptagon_Constr"): index==4?Gui::BitmapFactory().pixmap("Sketcher_CreateHeptagon_Constr"):
Gui::BitmapFactory().pixmap("Sketcher_CreateOctagon_Constr")); Gui::BitmapFactory().pixmap("Sketcher_CreateOctagon_Constr"));
} }
} }
else // there was a selection, so operate in toggle mode. else // there was a selection, so operate in toggle mode.
{ {