+ fix whitespaces
This commit is contained in:
parent
3b1873f1dc
commit
eef340f19c
|
@ -632,7 +632,7 @@ GCS::Curve* Sketch::getGCSCurveByGeoId(int geoId)
|
|||
|
||||
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!");
|
||||
int rtn = -1;
|
||||
|
||||
|
@ -648,6 +648,7 @@ int Sketch::addConstraint(const Constraint *constraint)
|
|||
FixParameters.push_back(c.value);
|
||||
else
|
||||
Parameters.push_back(c.value);
|
||||
|
||||
rtn = addDistanceXConstraint(constraint->First,c.value);
|
||||
}
|
||||
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);
|
||||
|
||||
rtn = addCoordinateXConstraint(constraint->First,constraint->FirstPos,c.value);
|
||||
}
|
||||
}
|
||||
else if (constraint->SecondPos != none) {// point to point horizontal distance
|
||||
c.value = new double(constraint->Value);
|
||||
if(c.driving)
|
||||
|
@ -677,6 +678,7 @@ int Sketch::addConstraint(const Constraint *constraint)
|
|||
FixParameters.push_back(c.value);
|
||||
else
|
||||
Parameters.push_back(c.value);
|
||||
|
||||
rtn = addDistanceYConstraint(constraint->First,c.value);
|
||||
}
|
||||
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,
|
||||
c.value, constraint->Type);
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
case Tangent:
|
||||
if (constraint->FirstPos == none &&
|
||||
|
@ -835,6 +835,7 @@ int Sketch::addConstraint(const Constraint *constraint)
|
|||
FixParameters.push_back(c.value);
|
||||
else
|
||||
Parameters.push_back(c.value);
|
||||
|
||||
rtn = addAngleConstraint(constraint->First,c.value);
|
||||
}
|
||||
break;
|
||||
|
@ -845,6 +846,7 @@ int Sketch::addConstraint(const Constraint *constraint)
|
|||
FixParameters.push_back(c.value);
|
||||
else
|
||||
Parameters.push_back(c.value);
|
||||
|
||||
rtn = addRadiusConstraint(constraint->First, c.value);
|
||||
break;
|
||||
}
|
||||
|
@ -877,25 +879,25 @@ int Sketch::addConstraint(const Constraint *constraint)
|
|||
}
|
||||
break;
|
||||
case SnellsLaw:
|
||||
{
|
||||
c.value = new double(constraint->Value);
|
||||
c.secondvalue = new double(constraint->Value);
|
||||
{
|
||||
c.value = new double(constraint->Value);
|
||||
c.secondvalue = new double(constraint->Value);
|
||||
|
||||
if(c.driving) {
|
||||
FixParameters.push_back(c.value);
|
||||
FixParameters.push_back(c.secondvalue);
|
||||
}
|
||||
else {
|
||||
Parameters.push_back(c.value);
|
||||
Parameters.push_back(c.secondvalue);
|
||||
}
|
||||
if(c.driving) {
|
||||
FixParameters.push_back(c.value);
|
||||
FixParameters.push_back(c.secondvalue);
|
||||
}
|
||||
else {
|
||||
Parameters.push_back(c.value);
|
||||
Parameters.push_back(c.secondvalue);
|
||||
}
|
||||
|
||||
//assert(constraint->ThirdPos==none); //will work anyway...
|
||||
rtn = addSnellsLawConstraint(constraint->First, constraint->FirstPos,
|
||||
constraint->Second, constraint->SecondPos,
|
||||
constraint->Third,
|
||||
c.value, c.secondvalue);
|
||||
}
|
||||
//assert(constraint->ThirdPos==none); //will work anyway...
|
||||
rtn = addSnellsLawConstraint(constraint->First, constraint->FirstPos,
|
||||
constraint->Second, constraint->SecondPos,
|
||||
constraint->Third,
|
||||
c.value, c.secondvalue);
|
||||
}
|
||||
break;
|
||||
case None:
|
||||
break;
|
||||
|
|
|
@ -54,8 +54,8 @@ bool isAlterGeoActive(Gui::Document *doc)
|
|||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
namespace SketcherGui {
|
||||
|
@ -202,9 +202,7 @@ void CmdSketcherToggleConstruction::activated(int iMsg)
|
|||
index==3?Gui::BitmapFactory().pixmap("Sketcher_CreateHexagon_Constr"):
|
||||
index==4?Gui::BitmapFactory().pixmap("Sketcher_CreateHeptagon_Constr"):
|
||||
Gui::BitmapFactory().pixmap("Sketcher_CreateOctagon_Constr"));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else // there was a selection, so operate in toggle mode.
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user