[Wsplgen-commits] r148 - in trunk: . src

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Nov 9 16:34:44 CET 2009


Author: mrchip
Date: 2009-11-09 16:34:43 +0100 (Mon, 09 Nov 2009)
New Revision: 148

Modified:
   trunk/NEWS
   trunk/src/file.cpp
   trunk/src/tools.cpp
   trunk/src/tools.h
   trunk/src/wsplgen.h
   trunk/src/xy.cpp
Log:
es wurden zwei Schnheitsfehler behoben

Modified: trunk/NEWS
===================================================================
--- trunk/NEWS	2009-11-02 17:55:51 UTC (rev 147)
+++ trunk/NEWS	2009-11-09 15:34:43 UTC (rev 148)
@@ -10,6 +10,11 @@
 // Read the file COPYING coming with WSPLGEN for details.
 //
 
+Version 1.3.2
+
+       - Die Dämme und Gräben werden nun wieder mit der richtigen (geringen Breite dargestellt)
+       - Zwei Ausgabefehler wurden behoben (einmal die Verwendung von Tabulatoren und einmal die Ausgabe ohne Zeitnagabe)
+       
 Version 1.3.1
 
        - Ein neues DGM-Format ASCII-TIN wird nun unterstützt

Modified: trunk/src/file.cpp
===================================================================
--- trunk/src/file.cpp	2009-11-02 17:55:51 UTC (rev 147)
+++ trunk/src/file.cpp	2009-11-09 15:34:43 UTC (rev 148)
@@ -2261,7 +2261,8 @@
 
 		if (DebugLevel >= 9 || (DebugLevel >= 1 && Count % 10 == 0) || (Count > 0 && Count % 100 == 0))
 		{
-			write_fortschritt("%d von %d Liniensstrukturen geladen.\n%d Sperren, %d Gräben, %d Rohre Tpy 1, %d Rohre Tpy 2\n", Count, RecordCount, SperrenList->size(), GrabenList->size(), Rohre1List->size(), Rohre2List->size());
+			write_fortschritt("%d von %d Liniensstrukturen geladen.\n", Count, RecordCount);
+			write_fortschritt("(%d Sperren, %d Gräben, %d Rohre Typ 1, %d Rohre Typ 2)\n", SperrenList->size(), GrabenList->size(), Rohre1List->size(), Rohre2List->size());
 		}
 	}
 	write_fortschritt("%d von %d Liniensstrukturen geladen.\n", Count, RecordCount);

Modified: trunk/src/tools.cpp
===================================================================
--- trunk/src/tools.cpp	2009-11-02 17:55:51 UTC (rev 147)
+++ trunk/src/tools.cpp	2009-11-09 15:34:43 UTC (rev 148)
@@ -2318,7 +2318,7 @@
 }
 
 //---------------------------------------------------------------------
-bool CalcProfilSchnitt (long P0x, long P0y, long P1x, long P1y, TProfilList *ProfilList, double *x, double *y, double *z, double *meter)
+bool CalcProfilSchnitt (long P0x, long P0y, long P1x, long P1y, TProfilList *ProfilList, long *x, long *y, int *z)
 {
 	long PDx = P1x - P0x;
 	long PDy = P1y - P0y;
@@ -2364,18 +2364,24 @@
 				write_error(3207, "Profil-Punktabstand (%.3f %.3f) - (%.3f %.3f) ist zu klein\n", S0x / 100.0, S0y / 100.0, S1x / 100.0, S1y / 100.0);
 			}
 
-			bool Found = Calc2Schnitt(P0x, P0y, P1x, P1y, S0x, S0y, S1x, S1y, x, y);
-
+			double X;
+			double Y;
+			bool Found = Calc2Schnitt(P0x, P0y, P1x, P1y, S0x, S0y, S1x, S1y, &X, &Y);
 			if (Found)
 			{
 				long double Lambda = 0.0;
-				if (PDx != 0)		Lambda = (*x - P0x) / PDx;
-				else if (PDy != 0)	Lambda = (*y - P0y) / PDy;
+				if (PDx != 0)		Lambda = (X - P0x) / PDx;
+				else if (PDy != 0)	Lambda = (Y - P0y) / PDy;
 				else				dump_error(__FILE__, __LINE__, "Profil-Punktabstand (%.3f %.3f) - (%.3f %.3f) ist zu klein\n", P0x / 100.0, P0y / 100.0, P1x / 100.0, P1y / 100.0);
 
-				*meter = (double)(S0->Meter + Lambda * (S1->Meter - S0->Meter));
-				*z = (double)(S0->Z + Lambda * (S1->Z - S0->Z));
+				*x = (long)(X + 0.5);
+				*y = (long)(Y + 0.5);
 
+				// *meter = (double)(S0->Meter + Lambda * (S1->Meter - S0->Meter));
+				if (S0->Z == DammZ || S1->Z == DammZ)			*z = DammZ;
+				else if (S0->Z == GrabenZ || S1->Z == GrabenZ)	*z = GrabenZ;
+				else 											*z = (int)(S0->Z + Lambda * (S1->Z - S0->Z) + 0.5);
+
 				return (true);
 			}
 		}
@@ -2818,16 +2824,16 @@
 
 				if (Faktor > 0.99)	Faktor = 0.99;
 
-
-
 				if (Z1 == GrabenZ || Z1 == DammZ)
 				{
-					Faktor = 0.99;
+//					Faktor = 0.99;
+					Faktor = 0.95; // Sieht so schöner aus
 				}
 				else if (Z2 == GrabenZ || Z2 == DammZ)
-                {
-                    Faktor = 0.01;
-                }
+				{
+//					Faktor = 0.01;
+					Faktor = 0.05; // Sieht so schöner aus
+				}
 	    	    long X = (long)(Edge->Node2->X + Dx * Faktor + 0.5);
 		        long Y = (long)(Edge->Node2->Y + Dy * Faktor + 0.5);
 

Modified: trunk/src/tools.h
===================================================================
--- trunk/src/tools.h	2009-11-02 17:55:51 UTC (rev 147)
+++ trunk/src/tools.h	2009-11-09 15:34:43 UTC (rev 148)
@@ -80,7 +80,7 @@
 double 					TwoToWin (double x0, double y0, double x1, double y1);
 double 					ThreeToWin (double x0, double y0, double x1, double y1, double x2, double y2, int turn);
 bool 					Calc2Schnitt (long P0x, long P0y, long P1x, long P1y, long S0x, long S0y, long S1x, long S1y, double *x, double *y);
-bool 					CalcProfilSchnitt (long P0x, long P0y, long P1x, long P1y, TProfilList *ProfilList, double *x, double *y, double *z, double *meter);
+bool 					CalcProfilSchnitt (long P0x, long P0y, long P1x, long P1y, TProfilList *ProfilList, long *x, long *y, int *z);
 void 					InterpolateWsp(TProfilList *ProfilList, TProfilList *WspProfilList, int DebugLevel);
 void 					BuildPolygon(TProfilList *ProfilList, TXYZList *XyList, int DebugLevel);
 void 					EqualizeProfil(TProfil *ProfilOne, TProfil *ProfilTwo);

Modified: trunk/src/wsplgen.h
===================================================================
--- trunk/src/wsplgen.h	2009-11-02 17:55:51 UTC (rev 147)
+++ trunk/src/wsplgen.h	2009-11-09 15:34:43 UTC (rev 148)
@@ -10,7 +10,7 @@
 // Read the file COPYING coming with WSPLGEN for details.
 //
 
-const char Version[] = "1.3.1";
+const char Version[] = "1.3.2";
 
 // In der Datei wsplgen.h wird jetzt keine Historie mehr gespeichert.
 // Diese ist nun in der Datei NEWS zu finden

Modified: trunk/src/xy.cpp
===================================================================
--- trunk/src/xy.cpp	2009-11-02 17:55:51 UTC (rev 147)
+++ trunk/src/xy.cpp	2009-11-09 15:34:43 UTC (rev 148)
@@ -1073,12 +1073,11 @@
 			return (true);
 		}
 
-		double DummyX =	0.0;
-		double DummyY =	0.0;
-		double DummyZ =	0.0;
-		double DummyMeter = 0.0;
+		long DummyX =	0;
+		long DummyY =	0;
+		int DummyZ =	0;
 
-		if (SperrenList	&& SperrenList->size() > 0 && CalcProfilSchnitt(Node->X, Node->Y, X, Y,	SperrenList, &DummyX, &DummyY, &DummyZ, &DummyMeter)) continue;
+		if (SperrenList && SperrenList->size() > 0 && CalcProfilSchnitt(Node->X, Node->Y, X, Y,	SperrenList, &DummyX, &DummyY, &DummyZ)) continue;
 
 		if (Node->X >= X && Node->Y > Y)
 		{
@@ -1547,8 +1546,6 @@
 
 		TElement* NewElement = 0;
 
-		double dummyMeter = 0.0;
-
 		if (Node1->X ==	Node2->X && Node1->Y ==	Node2->Y)
 		{
 			Element->Typ = NO_ELEMENT;
@@ -1567,16 +1564,6 @@
 			continue;
 		}
 
-		double XD12 = 0.0;
-		double YD12 = 0.0;
-		double ZD12 = 0.0;
-		double XD23 = 0.0;
-		double YD23 = 0.0;
-		double ZD23 = 0.0;
-		double XD31 = 0.0;
-		double YD31 = 0.0;
-		double ZD31 = 0.0;
-
 		long X12 = 0;
 		long Y12 = 0;
 		int Z12 = 0;
@@ -1591,18 +1578,12 @@
 		TNode* Node23 =	0;
 		TNode* Node31 =	0;
 
+		bool Schnitt12 = CalcProfilSchnitt(Node1->X, Node1->Y, Node2->X, Node2->Y, LinienList, &X12, &Y12, &Z12);
+		bool Schnitt23 = CalcProfilSchnitt(Node2->X, Node2->Y, Node3->X, Node3->Y, LinienList, &X23, &Y23, &Z23);
+		bool Schnitt31 = CalcProfilSchnitt(Node3->X, Node3->Y, Node1->X, Node1->Y, LinienList, &X31, &Y31, &Z31);
 
-		bool Schnitt12 = CalcProfilSchnitt(Node1->X, Node1->Y, Node2->X, Node2->Y, LinienList, &XD12, &YD12, &ZD12, &dummyMeter);
-		bool Schnitt23 = CalcProfilSchnitt(Node2->X, Node2->Y, Node3->X, Node3->Y, LinienList, &XD23, &YD23, &ZD23, &dummyMeter);
-		bool Schnitt31 = CalcProfilSchnitt(Node3->X, Node3->Y, Node1->X, Node1->Y, LinienList, &XD31, &YD31, &ZD31, &dummyMeter);
-
-
 		if (Schnitt12)
 		{
-			X12 = (long)(XD12 + 0.5);
-			Y12 = (long)(YD12 + 0.5);
-			Z12 = (int)(ZD12 + 0.5);
-
 			TNodeList* FoundNodeList = NodeList->FindAllByXY(X12, Y12, 4);
 
 			if (FoundNodeList->size() > 0)
@@ -1648,10 +1629,6 @@
 
 		if (Schnitt23)
 		{
-			X23 = (long)(XD23 + 0.5);
-			Y23 = (long)(YD23 + 0.5);
-			Z23 = (int)(ZD23 + 0.5);
-
 			TNodeList* FoundNodeList = NodeList->FindAllByXY(X23, Y23, 4);
 
 			if (FoundNodeList->size() > 0)
@@ -1697,10 +1674,6 @@
 
 		if (Schnitt31)
 		{
-			X31 = (long)(XD31 + 0.5);
-			Y31 = (long)(YD31 + 0.5);
-			Z31 = (int)(ZD31 + 0.5);
-
 			TNodeList* FoundNodeList = NodeList->FindAllByXY(X31, Y31, 4);
 
 			if (FoundNodeList->size() > 0)
@@ -1878,7 +1851,7 @@
 //---------------------------------------------------------------------------
 void TElementList::CleanChangedElements(int DebugLevel)
 {
-	write_fortschritt("->Suche nach	entarteten Elementen gestartet\n");
+	write_fortschritt("->Suche nach entarteten Elementen gestartet\n");
 
 	int Count = 0;
 	for (unsigned int i = 0; i < size(); i++)
@@ -1931,7 +1904,7 @@
 	}
 	write_fortschritt("%d von %d Elementen überprüft\n", Count, size());
 
-	write_fortschritt("<-Suche nach	entarteten Elementen beendet\n");
+	write_fortschritt("<-Suche nach entarteten Elementen beendet\n");
 }
 
 //---------------------------------------------------------------------------



More information about the Wsplgen-commits mailing list