Skip to content

Commit

Permalink
fix whitespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Jan 20, 2017
1 parent 7a3c8d0 commit 0955ccf
Show file tree
Hide file tree
Showing 13 changed files with 288 additions and 307 deletions.
42 changes: 21 additions & 21 deletions src/Mod/Part/App/Geometry.cpp
Expand Up @@ -809,11 +809,11 @@ void GeomBSplineCurve::Save(Base::Writer& writer) const
// save the attributes of the father class
GeomCurve::Save(writer);

std::vector<Base::Vector3d> poles = this->getPoles();
std::vector<double> weights = this->getWeights();
std::vector<double> knots = this->getKnots();
std::vector<int> mults = this->getMultiplicities();
int degree = this->getDegree();
std::vector<Base::Vector3d> poles = this->getPoles();
std::vector<double> weights = this->getWeights();
std::vector<double> knots = this->getKnots();
std::vector<int> mults = this->getMultiplicities();
int degree = this->getDegree();
bool isperiodic = this->isPeriodic();

writer.Stream()
Expand All @@ -830,27 +830,27 @@ void GeomBSplineCurve::Save(Base::Writer& writer) const
std::vector<Base::Vector3d>::const_iterator itp;
std::vector<double>::const_iterator itw;

for(itp = poles.begin(), itw = weights.begin(); itp != poles.end() && itw != weights.end(); ++itp, ++itw){
writer.Stream()
<< writer.ind()
<< "<Pole "
<< "X=\"" << (*itp).x <<
"\" Y=\"" << (*itp).y <<
"\" Z=\"" << (*itp).z <<
"\" Weight=\"" << (*itw) <<
"\"/>" << endl;
for (itp = poles.begin(), itw = weights.begin(); itp != poles.end() && itw != weights.end(); ++itp, ++itw) {
writer.Stream()
<< writer.ind()
<< "<Pole "
<< "X=\"" << (*itp).x <<
"\" Y=\"" << (*itp).y <<
"\" Z=\"" << (*itp).z <<
"\" Weight=\"" << (*itw) <<
"\"/>" << endl;
}

std::vector<double>::const_iterator itk;
std::vector<int>::const_iterator itm;

for(itk = knots.begin(), itm = mults.begin(); itk != knots.end() && itm != mults.end(); ++itk, ++itm){
writer.Stream()
<< writer.ind()
<< "<Knot "
<< "Value=\"" << (*itk)
<< "\" Mult=\"" << (*itm) <<
"\"/>" << endl;
for (itk = knots.begin(), itm = mults.begin(); itk != knots.end() && itm != mults.end(); ++itk, ++itm) {
writer.Stream()
<< writer.ind()
<< "<Knot "
<< "Value=\"" << (*itk)
<< "\" Mult=\"" << (*itm) <<
"\"/>" << endl;
}

writer.decInd();
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Sketcher/App/Constraint.h
Expand Up @@ -67,7 +67,7 @@ enum InternalAlignmentType {
HyperbolaMajor = 5,
HyperbolaMinor = 6,
HyperbolaFocus = 7,
ParabolaFocus = 8,
ParabolaFocus = 8,
BSplineControlPoint = 9 // in this constraint "Third" is used to indicate the index of the control point (0-poles), it is not a GeoId
};

Expand Down Expand Up @@ -111,7 +111,7 @@ class SketcherExport Constraint : public Base::Persistence
PointPos FirstPos;
int Second;
PointPos SecondPos;
int Third;
int Third;
PointPos ThirdPos;
float LabelDistance;
float LabelPosition;
Expand Down
82 changes: 39 additions & 43 deletions src/Mod/Sketcher/App/Sketch.cpp
Expand Up @@ -185,7 +185,7 @@ const char* nameByType(Sketch::GeoType type)
case Sketch::ArcOfParabola:
return "arcofparabola";
case Sketch::BSpline:
return "bspline";
return "bspline";
case Sketch::None:
default:
return "unknown";
Expand Down Expand Up @@ -738,12 +738,12 @@ int Sketch::addBSpline(const Part::GeomBSplineCurve &bspline, bool fixed)
GCS::BSpline bs;
bs.start = p1;
bs.end = p2;
bs.poles = spoles;
bs.weights = sweights;
bs.knots = sknots;
bs.mult = mult;
bs.degree = degree;
bs.periodic = periodic;
bs.poles = spoles;
bs.weights = sweights;
bs.knots = sknots;
bs.mult = mult;
bs.degree = degree;
bs.periodic = periodic;
def.index = BSplines.size();
BSplines.push_back(bs);

Expand Down Expand Up @@ -945,10 +945,10 @@ GCS::Curve* Sketch::getGCSCurveByGeoId(int geoId)
case ArcOfHyperbola:
return &ArcsOfHyperbola[Geoms[geoId].index];
break;
case ArcOfParabola:
case ArcOfParabola:
return &ArcsOfParabola[Geoms[geoId].index];
break;
case BSpline:
case BSpline:
return &BSplines[Geoms[geoId].index];
break;
default:
Expand Down Expand Up @@ -1213,10 +1213,10 @@ int Sketch::addConstraint(const Constraint *constraint)
case HyperbolaFocus:
rtn = addInternalAlignmentHyperbolaFocus(constraint->First,constraint->Second);
break;
case ParabolaFocus:
case ParabolaFocus:
rtn = addInternalAlignmentParabolaFocus(constraint->First,constraint->Second);
break;
case BSplineControlPoint:
case BSplineControlPoint:
rtn = addInternalAlignmentBSplineControlPoint(constraint->First,constraint->Second, constraint->InternalAlignmentIndex);
default:
break;
Expand Down Expand Up @@ -2596,43 +2596,40 @@ bool Sketch::updateGeometry()

Base::Vector3d fd=f1-vertex;

aop->setXAxisDir(fd);

aop->setXAxisDir(fd);
aop->setCenter(vertex);

aop->setFocal(fd.Length());

aop->setFocal(fd.Length());
aop->setRange(*myArc.startAngle, *myArc.endAngle, /*emulateCCW=*/true);
} else if (it->type == BSpline) {
GCS::BSpline &mybsp = BSplines[it->index];

GeomBSplineCurve *bsp = dynamic_cast<GeomBSplineCurve*>(it->geo);

std::vector<Base::Vector3d> poles;
std::vector<double> weights;
std::vector<GCS::Point>::const_iterator it1;
std::vector<double *>::const_iterator it2;

for( it1 = mybsp.poles.begin(), it2 = mybsp.weights.begin(); it1 != mybsp.poles.end() && it2 != mybsp.weights.end(); ++it1, ++it2) {
poles.push_back(Vector3d( *(*it1).x , *(*it1).y , 0.0));
weights.push_back(*(*it2));
}
bsp->setPoles(poles, weights);

std::vector<double> knots;
std::vector<int> mult;
std::vector<double *>::const_iterator it3;
std::vector<int>::const_iterator it4;

for( it3 = mybsp.knots.begin(), it4 = mybsp.mult.begin(); it3 != mybsp.knots.end() && it4 != mybsp.mult.end(); ++it3, ++it4) {
knots.push_back(*(*it3));
mult.push_back((*it4));
}
bsp->setKnots(knots,mult);
std::vector<Base::Vector3d> poles;
std::vector<double> weights;

std::vector<GCS::Point>::const_iterator it1;
std::vector<double *>::const_iterator it2;

for( it1 = mybsp.poles.begin(), it2 = mybsp.weights.begin(); it1 != mybsp.poles.end() && it2 != mybsp.weights.end(); ++it1, ++it2) {
poles.push_back(Vector3d( *(*it1).x , *(*it1).y , 0.0));
weights.push_back(*(*it2));
}

bsp->setPoles(poles, weights);

std::vector<double> knots;
std::vector<int> mult;

std::vector<double *>::const_iterator it3;
std::vector<int>::const_iterator it4;

for( it3 = mybsp.knots.begin(), it4 = mybsp.mult.begin(); it3 != mybsp.knots.end() && it4 != mybsp.mult.end(); ++it3, ++it4) {
knots.push_back(*(*it3));
mult.push_back((*it4));
}

bsp->setKnots(knots,mult);

}
} catch (Base::Exception e) {
Expand Down Expand Up @@ -2937,8 +2934,7 @@ int Sketch::initMove(int geoId, PointPos pos, bool fine)
int i=GCSsys.addConstraintP2PCoincident(p1,center,-1);
GCSsys.rescaleConstraint(i-1, 0.01);
GCSsys.rescaleConstraint(i, 0.01);
}

}
} else if (Geoms[geoId].type == ArcOfHyperbola) {

GCS::Point &center = Points[Geoms[geoId].midPointId];
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Sketcher/App/Sketch.h
Expand Up @@ -343,7 +343,7 @@ class SketcherExport Sketch :public Base::Persistence
ArcOfEllipse = 6,
ArcOfHyperbola = 7,
ArcOfParabola = 8,
BSpline = 9
BSpline = 9
};

float SolveTime;
Expand Down

0 comments on commit 0955ccf

Please sign in to comment.