Skip to content

Commit

Permalink
Merge pull request #925 from luzpaz/typos
Browse files Browse the repository at this point in the history
Fix source code typos
  • Loading branch information
joergbrech authored Sep 26, 2022
2 parents ab8a7d3 + d89aa43 commit a516521
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 46 deletions.
4 changes: 2 additions & 2 deletions TIGLViewer/src/TIGLViewerApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ int TIGLViewerApp::parseArguments(QStringList argList)
return 0;
}

void TIGLViewerApp::onWindowInitalized()
void TIGLViewerApp::onWindowInitialized()
{
// suppress errors
mainwindow.setSuppressErrorsEnabled(config.suppressErrors);
Expand Down Expand Up @@ -162,7 +162,7 @@ int TIGLViewerApp::run()
return retval;
}

connect(&mainwindow, SIGNAL(windowInitialized()), this, SLOT(onWindowInitalized()));
connect(&mainwindow, SIGNAL(windowInitialized()), this, SLOT(onWindowInitialized()));
if (!config.windowTitle.isEmpty()) {
mainwindow.setTiglWindowTitle(config.windowTitle, true);
}
Expand Down
2 changes: 1 addition & 1 deletion TIGLViewer/src/TIGLViewerApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class TIGLViewerApp : public QApplication
signals:

public slots:
void onWindowInitalized();
void onWindowInitialized();
};

#endif // TIGLVIEWERAPP_H
6 changes: 3 additions & 3 deletions TIGLViewer/src/TIGLViewerWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1097,13 +1097,13 @@ void TIGLViewerWidget::drawRubberBand( const QPoint origin, const QPoint positio
#if OCC_VERSION_HEX < 0x070000
if ( !myLayer.IsNull() && !myView.IsNull() ) {

int witdh, height;
myView->Window()->Size(witdh, height);
int width, height;
myView->Window()->Size(width, height);

myLayer->Clear();
// The -1 is a hack from the opencascade forums to avoid clipping
// of the coordinates. This way it behaves identically to opengl
myLayer->SetOrtho(0, witdh, height, 0, (Aspect_TypeOfConstraint) -1);
myLayer->SetOrtho(0, width, height, 0, (Aspect_TypeOfConstraint) -1);

myLayer->Begin();
myLayer->SetTransparency(1.0);
Expand Down
10 changes: 5 additions & 5 deletions src/geometry/CTiglBSplineAlgorithms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -679,11 +679,11 @@ CTiglApproxResult CTiglBSplineAlgorithms::reparametrizeBSplineContinuouslyApprox
points(static_cast<Standard_Integer>(i)) = spline->Value(oldParameter);
}

bool makeContinous = spline->IsClosed() &&
bool makeContinuous = spline->IsClosed() &&
spline->DN(spline->FirstParameter(), 1).Angle(spline->DN(spline->LastParameter(), 1)) < 6. / 180. * M_PI;

// Create the new spline as a interpolation of the old one
CTiglBSplineApproxInterp approximationObj(points, static_cast<int>(n_control_pnts), 3, makeContinous);
CTiglBSplineApproxInterp approximationObj(points, static_cast<int>(n_control_pnts), 3, makeContinuous);

breaks.insert(breaks.begin(), new_parameters.front());
breaks.push_back(new_parameters.back());
Expand Down Expand Up @@ -723,12 +723,12 @@ Handle(Geom_BSplineSurface) CTiglBSplineAlgorithms::flipSurface(const Handle(Geo
Handle(Geom_BSplineSurface) CTiglBSplineAlgorithms::pointsToSurface(const TColgp_Array2OfPnt& points,
const std::vector<double>& uParams,
const std::vector<double>& vParams,
bool uContinousIfClosed, bool vContinousIfClosed)
bool uContinuousIfClosed, bool vContinuousIfClosed)
{

double tolerance = REL_TOL_CLOSED * scale(points);
bool makeVDirClosed = vContinousIfClosed & isVDirClosed(points, tolerance);
bool makeUDirClosed = uContinousIfClosed & isUDirClosed(points, tolerance);
bool makeVDirClosed = vContinuousIfClosed & isVDirClosed(points, tolerance);
bool makeUDirClosed = uContinuousIfClosed & isUDirClosed(points, tolerance);

// first interpolate all points by B-splines in u-direction
std::vector<Handle(Geom_Curve)> uSplines;
Expand Down
10 changes: 5 additions & 5 deletions src/geometry/CTiglBSplineAlgorithms.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,17 +193,17 @@ class CTiglBSplineAlgorithms
* parameters in u-direction where the points shall be at on the interpolating surface
* @param vParams:
* parameters in v-direction where the points shall be at on the interpolating surface
* @param uContinousIfClosed:
* Make a continous junction in u d-directions, if the u direction is closed
* @param vContinousIfClosed:
* Make a continous junction in v d-directions, if the v direction is closed
* @param uContinuousIfClosed:
* Make a continuous junction in u d-directions, if the u direction is closed
* @param vContinuousIfClosed:
* Make a continuous junction in v d-directions, if the v direction is closed
* @return
* B-spline surface which interpolates the given points with the given parameters
*/
TIGL_EXPORT static Handle(Geom_BSplineSurface) pointsToSurface(const TColgp_Array2OfPnt& points,
const std::vector<double>& uParams,
const std::vector<double>& vParams,
bool uContinousIfClosed, bool vContinousIfClosed);
bool uContinuousIfClosed, bool vContinuousIfClosed);

/**
* @brief intersections:
Expand Down
6 changes: 3 additions & 3 deletions src/geometry/CTiglBSplineApproxInterp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,12 @@ CTiglApproxResult CTiglBSplineApproxInterp::FitCurveOptimal(const std::vector<do
return result;
}

ProjectResult CTiglBSplineApproxInterp::projectOnCurve(const gp_Pnt& pnt, const Handle(Geom_Curve) &curve, double inital_Parm) const
ProjectResult CTiglBSplineApproxInterp::projectOnCurve(const gp_Pnt& pnt, const Handle(Geom_Curve) &curve, double initial_Parm) const
{
const int maxIter = 10; // maximum No of iterations
const double eps = 1.0E-6; // accuracy of arc length parameter

double t = inital_Parm;
double t = initial_Parm;

// newton step
double dt = 0;
Expand Down Expand Up @@ -309,7 +309,7 @@ ProjectResult CTiglBSplineApproxInterp::projectOnCurve(const gp_Pnt& pnt, const

// if parameter out of range reset it to the start value
if (t_new < curve->FirstParameter() || t_new > curve->LastParameter()) {
t_new = inital_Parm;
t_new = initial_Parm;
dt = 0.;
}
t = t_new;
Expand Down
2 changes: 1 addition & 1 deletion src/geometry/CTiglBSplineApproxInterp.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class CTiglBSplineApproxInterp
TIGL_EXPORT CTiglApproxResult FitCurveOptimal(const std::vector<double>& initialParms = std::vector<double>(), int maxIter=10) const;

private:
ProjectResult projectOnCurve(const gp_Pnt& pnt, const Handle(Geom_Curve)& curve, double inital_Parm) const;
ProjectResult projectOnCurve(const gp_Pnt& pnt, const Handle(Geom_Curve)& curve, double initial_Parm) const;
std::vector<double> computeParameters(double alpha) const;
void computeKnots(int ncp, const std::vector<double>& params, std::vector<double>& knots, std::vector<int>& mults) const;

Expand Down
12 changes: 6 additions & 6 deletions src/geometry/CTiglInterpolatePointsWithKinks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,15 @@ void CTiglInterpolatePointsWithKinks::ComputeResult(Result& result) const
auto kinks = m_kinks;
std::sort(std::begin(kinks), std::end(kinks));

bool make_continous = false;
bool make_continuous = false;
if (m_pnts->Value(m_pnts->Lower()).IsEqual(m_pnts->Value(m_pnts->Upper()), 1e-6)) {
if (!in(0, kinks) && ! in(n_pnts - 1, kinks)) {
make_continous = true;
make_continuous = true;
}
}

// make sure, that first and last points are in kink list
if (!make_continous) {
if (!make_continuous) {
if (!in(0, kinks)) {
kinks.insert(kinks.begin(), 0);
}
Expand All @@ -193,8 +193,8 @@ void CTiglInterpolatePointsWithKinks::ComputeResult(Result& result) const
curve_segments.push_back(segment_curve);
}

// create a continous spline from the last to the first kink
if (make_continous && kinks.size() > 0) {
// create a continuous spline from the last to the first kink
if (make_continuous && kinks.size() > 0) {
double offset = new_params.front() - new_params.back();

auto last_kink_idx = kinks.back();
Expand Down Expand Up @@ -222,7 +222,7 @@ void CTiglInterpolatePointsWithKinks::ComputeResult(Result& result) const
curve_segments.insert(curve_segments.begin(), first);
curve_segments.push_back(last);
}
else if (make_continous && kinks.empty()) {
else if (make_continuous && kinks.empty()) {
auto curve = CTiglPointsToBSplineInterpolation(m_pnts, new_params, m_maxDegree, true).Curve();
curve_segments.push_back(curve);
}
Expand Down
2 changes: 1 addition & 1 deletion src/structural_elements/CCPACSFuselageWallSegment.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class CCPACSFuselageWallSegment : public generated::CPACSWallSegment, public CTi

std::string GetDefaultedUID() const override
{
return GetUID().value_or("UnkownWallSegment");
return GetUID().value_or("UnknownWallSegment");
}

TiglGeometricComponentIntent GetComponentIntent() const override
Expand Down
16 changes: 8 additions & 8 deletions src/wing/CCPACSWing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -756,28 +756,28 @@ void CCPACSWing::GetWingMAC(double& mac_chord, double& mac_x, double& mac_y, do
double len3 = outerLeadingPoint.Y() - innerLeadingPoint.Y();
double len4 = innterTrailingPoint.Y()- innerTrailingPoint.Y();

double lenght =(len1+len2)/2.;
double lenght2 =(len3+len4)/2.;
double length =(len1+len2)/2.;
double length2 =(len3+len4)/2.;

double T = distance2/distance;

double b_mac =lenght*(2*distance2+distance)/(3*(distance2+distance));
double c_mac =distance-(distance-distance2)/lenght*b_mac;
double b_mac =length*(2*distance2+distance)/(3*(distance2+distance));
double c_mac =distance-(distance-distance2)/length*b_mac;

gp_Pnt quarterchord = segment.GetChordPoint(0, 0.25);
gp_Pnt quarterchord2 = segment.GetChordPoint(1, 0.25);

double sw_tan = (quarterchord2.X()-quarterchord.X())/lenght;
double dihe_sin = (quarterchord2.Z()-quarterchord.Z())/lenght;
double dihe_cos = lenght2/lenght;
double sw_tan = (quarterchord2.X()-quarterchord.X())/length;
double dihe_sin = (quarterchord2.Z()-quarterchord.Z())/length;
double dihe_cos = length2/length;

gp_XYZ seg_mac_p;
seg_mac_p.SetX(0.25*distance - 0.25*c_mac + b_mac*sw_tan);
seg_mac_p.SetY(dihe_cos*b_mac);
seg_mac_p.SetZ(dihe_sin*b_mac);
seg_mac_p.Add(innerLeadingPoint.XYZ());

double A =((1. + T)*distance*lenght/2.);
double A =((1. + T)*distance*length/2.);

A_sum += A;
cc_mac_sum_p += seg_mac_p.Multiplied(A);
Expand Down
2 changes: 1 addition & 1 deletion tests/integrationtests/TestData/D150WithGuides.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5538,7 +5538,7 @@
</ribsDefinition>
<ribsDefinition uID="ribs_EM">
<name>ribs_EM</name>
<description>ribs for the Enginge Mount</description>
<description>ribs for the Engine Mount</description>
<ribsPositioning>
<ribReference>frontSpar</ribReference>
<startCurvePoint>
Expand Down
2 changes: 1 addition & 1 deletion tests/integrationtests/testShapeInvalidation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ TEST(TestInvalidation, invalidation)
const char* ribUid = "Wing_CS_RibDef2";
const tigl::CCPACSWingRibsDefinition& rib = config.GetUIDManager().ResolveObject<tigl::CCPACSWingRibsDefinition>(ribUid);

// get inital start point of rib
// get initial start point of rib
gp_Pnt initialStartPnt, finalStartPnt, dummy;
rib.GetRibMidplanePoints(1, initialStartPnt, dummy);

Expand Down
2 changes: 1 addition & 1 deletion tests/integrationtests/tiglFuseAircraft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class tiglFuseAircraftCPACS : public ::testing::TestWithParam<testcase>


//*********************************************************************
// Tests the successfull creation of the wing and fuselage surfaces
// Tests the successful creation of the wing and fuselage surfaces
//*********************************************************************
TopoDS_Compound wingProfiles;
TopoDS_Compound fuselageProfiles;
Expand Down
4 changes: 2 additions & 2 deletions tests/unittests/testctiglcurvestosurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ TEST(CTiglCurvesToSurface, testSkinnedBSplineSurface)
}
}

TEST(TiglBSplineAlgorithms, curvesToSurfaceContinous)
TEST(TiglBSplineAlgorithms, curvesToSurfaceContinuous)
{
// Read in nacelle data from BRep
TopoDS_Shape shape_u;
Expand Down Expand Up @@ -122,7 +122,7 @@ TEST(TiglBSplineAlgorithms, curvesToSurfaceContinous)
EXPECT_TRUE(surface->DN(umax, vmin, 0, 1).IsEqual(surface->DN(umax, vmax, 0, 1), 1e-10, 1e-6));

// Write surface
BRepTools::Write(BRepBuilderAPI_MakeFace(surface, Precision::Confusion()).Face(), "TestData/curvesToSurfaceContinous.brep");
BRepTools::Write(BRepBuilderAPI_MakeFace(surface, Precision::Confusion()).Face(), "TestData/curvesToSurfaceContinuous.brep");
}

TEST(TiglBSplineAlgorithms, curvesToSurfaceBug)
Expand Down
12 changes: 6 additions & 6 deletions tests/unittests/tiglBSplines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ TEST_F(BSplineInterpolation, interpolateAll)
StoreResult("TestData/analysis/BSplineInterpolation-interpolateAll.brep", curve, pnt2);
}

TEST_F(BSplineInterpolation, interpolateAllContinous)
TEST_F(BSplineInterpolation, interpolateAllContinuous)
{
int nPoints = 8;
TColgp_Array1OfPnt pnt2(1, nPoints);
Expand All @@ -335,7 +335,7 @@ TEST_F(BSplineInterpolation, interpolateAllContinous)
StoreResult("TestData/analysis/BSplineInterpolation-interpolateAllCont.brep", curve, pnt2);
}

TEST_F(BSplineInterpolation, interpolateAllContinousHalfCircle)
TEST_F(BSplineInterpolation, interpolateAllContinuousHalfCircle)
{
int nPoints = 8;
TColgp_Array1OfPnt pnt2(1, nPoints);
Expand Down Expand Up @@ -593,7 +593,7 @@ TEST_F(BSplineInterpolation, withKinksSmooth)
StoreResult("TestData/analysis/BSplineInterpolation-withKinksSmooth.brep", curve, points->Array1());
}

TEST_F(BSplineInterpolation, interpolationContinous)
TEST_F(BSplineInterpolation, interpolationContinuous)
{

Handle(TColgp_HArray1OfPnt) pnt2 = new TColgp_HArray1OfPnt(1, 13);
Expand Down Expand Up @@ -624,12 +624,12 @@ TEST_F(BSplineInterpolation, interpolationContinous)
}

std::stringstream str;
str << "TestData/analysis/BSplineInterpolation-interpolationContinousDegree" << degree << ".brep";
str << "TestData/analysis/BSplineInterpolation-interpolationContinuousDegree" << degree << ".brep";
StoreResult(str.str(), result, pnt2->Array1());
}
}

TEST_F(BSplineInterpolation, interpolationDiscontinous)
TEST_F(BSplineInterpolation, interpolationDiscontinuous)
{

Handle(TColgp_HArray1OfPnt) pnt2 = new TColgp_HArray1OfPnt(1, 12);
Expand Down Expand Up @@ -660,7 +660,7 @@ TEST_F(BSplineInterpolation, interpolationDiscontinous)
}

std::stringstream str;
str << "TestData/analysis/BSplineInterpolation-interpolationDiscontinousDegree" << degree << ".brep";
str << "TestData/analysis/BSplineInterpolation-interpolationDiscontinuousDegree" << degree << ".brep";
StoreResult(str.str(), result, pnt2->Array1());
}
}
Expand Down

0 comments on commit a516521

Please sign in to comment.