Base: translate doxygen from DE/FR to EN
For the purpose of making the source documentation uniform, source comments in this file were translated to english.
This commit is contained in:
@@ -277,7 +277,7 @@ static short _CalcTorsion (double *pfLine, double fX, double fY)
|
||||
int sQuad[2], i; // Changing this from short to int allows the compiler to inline this function
|
||||
double fResX;
|
||||
|
||||
// Klassifizierung der beiden Polygonpunkte in Quadranten
|
||||
// Classification of both polygon points into quadrants
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
if (pfLine[i * 2] <= fX)
|
||||
@@ -286,46 +286,46 @@ static short _CalcTorsion (double *pfLine, double fX, double fY)
|
||||
sQuad[i] = (pfLine[i * 2 + 1] > fY) ? 1 : 2;
|
||||
}
|
||||
|
||||
// Abbruch bei Linienpunkten innerhalb eines Quadranten
|
||||
// Abbruch bei nichtschneidenden Linienpunkten
|
||||
// Abort at line points within a quadrant
|
||||
// Abort at non-intersecting line points
|
||||
if (abs (sQuad[0] - sQuad[1]) <= 1) return 0;
|
||||
|
||||
// Beide Punkte links von ulX
|
||||
// Both points to the left of ulX
|
||||
if (abs (sQuad[0] - sQuad[1]) == 3)
|
||||
return (sQuad[0] == 0) ? 1 : -1;
|
||||
|
||||
// Restfaelle : Quadrantendifferenz von 2
|
||||
// mathematischer Test auf Schnitt
|
||||
// Remaining cases: Quadrant difference from 2
|
||||
// mathematical tests on intersection
|
||||
fResX = pfLine[0] + (fY - pfLine[1]) /
|
||||
((pfLine[3] - pfLine[1]) / (pfLine[2] - pfLine[0]));
|
||||
if (fResX < fX)
|
||||
|
||||
// oben/unten oder unten/oben
|
||||
// up/down or down/up
|
||||
return (sQuad[0] <= 1) ? 1 : -1;
|
||||
|
||||
// Verbleibende Faelle ?
|
||||
// Remaining cases?
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool Polygon2d::Contains (const Vector2d &rclV) const
|
||||
{
|
||||
// Ermittelt mit dem Verfahren der Windungszahl, ob ein Punkt innerhalb
|
||||
// eines Polygonzugs enthalten ist.
|
||||
// Summe aller Windungszahlen gibt an, ob ja oder nein.
|
||||
// Using the number of turns method, determines
|
||||
// whether a point is contained within a polygon.
|
||||
// The sum of all turns indicates whether yes or no.
|
||||
double pfTmp[4];
|
||||
unsigned long i;
|
||||
short sTorsion = 0;
|
||||
|
||||
// Fehlercheck
|
||||
// Error check
|
||||
if (GetCtVectors() < 3) return false;
|
||||
|
||||
// fuer alle Polygon-Linien
|
||||
// for all polygon lines
|
||||
for (i = 0; i < GetCtVectors(); i++)
|
||||
{
|
||||
// Linienstruktur belegen
|
||||
// Evidence of line structure
|
||||
if (i == GetCtVectors() - 1)
|
||||
{
|
||||
// Polygon automatisch schliessen
|
||||
// Close polygon automatically
|
||||
pfTmp[0] = _aclVct[i].x;
|
||||
pfTmp[1] = _aclVct[i].y;
|
||||
pfTmp[2] = _aclVct[0].x;
|
||||
@@ -333,25 +333,25 @@ bool Polygon2d::Contains (const Vector2d &rclV) const
|
||||
}
|
||||
else
|
||||
{
|
||||
// uebernehmen Punkt i und i+1
|
||||
// accept point i and i+1
|
||||
pfTmp[0] = _aclVct[i].x;
|
||||
pfTmp[1] = _aclVct[i].y;
|
||||
pfTmp[2] = _aclVct[i + 1].x;
|
||||
pfTmp[3] = _aclVct[i + 1].y;
|
||||
}
|
||||
|
||||
// Schnitt-Test durchfuehren und Windungszaehler berechnen
|
||||
// Carry out a cut test and calculate the turn counter
|
||||
sTorsion += _CalcTorsion (pfTmp, rclV.x, rclV.y);
|
||||
}
|
||||
|
||||
// Windungszaehler auswerten
|
||||
// Evaluate turn counter
|
||||
return sTorsion != 0;
|
||||
}
|
||||
|
||||
void Polygon2d::Intersect (const Polygon2d &rclPolygon, std::list<Polygon2d> &rclResultPolygonList) const
|
||||
{
|
||||
// trimmen des uebergebenen Polygons mit dem aktuellen, Ergebnis ist eine Liste von Polygonen (Untermenge des uebergebenen Polygons)
|
||||
// das eigene (Trim-) Polygon ist geschlossen
|
||||
// trim the passed polygon with the current one, the result is a list of polygons (subset of the passed polygon)
|
||||
// your own (trim) polygon is closed
|
||||
//
|
||||
if ((rclPolygon.GetCtVectors() < 2) || (GetCtVectors() < 2))
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user