diff --git a/CADability.Forms/PaintToOpenGL.cs b/CADability.Forms/PaintToOpenGL.cs index 95bc5a88..445d898b 100644 --- a/CADability.Forms/PaintToOpenGL.cs +++ b/CADability.Forms/PaintToOpenGL.cs @@ -67,7 +67,7 @@ struct state IntPtr deviceContext = IntPtr.Zero, renderContext = IntPtr.Zero; IntPtr controlHandle = IntPtr.Zero; Graphics graphics = null; - byte accumBits = 0, colorBits = 32, depthBits = 16, stencilBits = 0; + byte accumBits = 0, colorBits = 32, depthBits = 16; static IntPtr MainRenderContext = IntPtr.Zero; static IntPtr LastRenderContext = IntPtr.Zero; private static List bitmapList = null; diff --git a/CADability/BSpline2D.cs b/CADability/BSpline2D.cs index 40848ef5..53382255 100644 --- a/CADability/BSpline2D.cs +++ b/CADability/BSpline2D.cs @@ -55,7 +55,6 @@ public class BSpline2D : GeneralCurve2D, ISerializable, IDeserializationCallback //private GeoVector2D[] interdir; // Richtungen an den Stützpunkten //private double[] interparam; // Parameterwerte an den Stützpunkten //private GeoPoint2D[] tringulation; // Dreiecks-Zwischenpunkte (einer weniger als interpol) - private bool extendIsValid; // schon berechnet? private double parameterEpsilon; // ein epsilon, welches sich auf den Parameter bezieht. Abbruch für Iterationen private double distanceEpsilon; // ein epsilon, welches sich auf die Ausdehnung bezieht. Abbruch für Iterationen WeakReference explicitPCurve2D; @@ -67,7 +66,6 @@ private void InvalidateCache() //interdir = null; //interparam = null; //tringulation = null; - extendIsValid = false; nubs = null; nurbs = null; explicitPCurve2D = null; @@ -277,9 +275,7 @@ private void MakeFlat() // } //#endif // } -#if DEBUG - private static int maxTriangleCount = 0; -#endif + private bool FindInflectionPoint(double su, GeoPoint2D pl, GeoVector2D dir1l, GeoVector2D dir2l, double eu, GeoPoint2D pr, GeoVector2D dir1r, GeoVector2D dir2r, out double par) { GeoPoint2D pm; diff --git a/CADability/ConstructAction.cs b/CADability/ConstructAction.cs index ee4d2166..2866f028 100644 --- a/CADability/ConstructAction.cs +++ b/CADability/ConstructAction.cs @@ -7137,7 +7137,7 @@ protected void Finish() * in der Callback Methode ausführen. Dann kann man immer noch Escape drücken, wenns zu lange dauart (Vervielfältigen, Schraffur) */ Thread backgroundTask; - bool finishedBackgroundTask, syncCallBack; + bool finishedBackgroundTask; Delegate CallbackOnDone; private void StartThread(object pars) { // das läuft im background thread @@ -7165,7 +7165,6 @@ protected void StartBackgroundTask(Delegate MethodToInvoke, Delegate CallbackOnD { //System.Diagnostics.Trace.WriteLine("StartBackgroundTask"); backgroundTask = new Thread(new ParameterizedThreadStart(StartThread)); - syncCallBack = true; backgroundTask.Start(new object[] { MethodToInvoke, CallbackOnDone, invokeParameters }); //System.Diagnostics.Trace.WriteLine("StartBackgroundTask-Done"); } @@ -7196,8 +7195,8 @@ protected void WaitForBackgroundTask() bool stop = false; lock (this) { // sind wir schon über den kritischen Punkt in der Ausführung, d.h. ist die Berechnung schon fertig - if (finishedBackgroundTask) stop = true; - else syncCallBack = false; + if (finishedBackgroundTask) + stop = true; } if (stop) { // hier abbrechen, da wir schon über den kritischen Punkt sind und syncCallBack nicht mehr rechtzeitig gesetzt werden konnte diff --git a/CADability/Edge.cs b/CADability/Edge.cs index 70ea9974..e8c479d1 100644 --- a/CADability/Edge.cs +++ b/CADability/Edge.cs @@ -220,7 +220,6 @@ public class Edge : ISerializable, IGeoObjectOwner, IDeserializationCallback, IC private Vertex v1, v2; private bool oriented; // obsolete, if false (forwardOnPrimaryFace, forwardOnSecondaryFace) have not yet been calculated enum EdgeKind { unknown, sameSurface, tangential, sharp } - private EdgeKind edgeKind = EdgeKind.unknown; internal BRepOperation.EdgeInfo edgeInfo; // only used for BRepOperation // TODO: überprüfen, ob isPartOf und startAtOriginal, endAtOriginal noch gebraucht wird (evtl. zu einem Objekt machen) // TODO: ist owner nicht immer primaryFace? @@ -818,7 +817,6 @@ public override int GetHashCode() } internal Edge() { - edgeKind = EdgeKind.unknown; hashCode = hashCodeCounter++; // #if DEBUG if (hashCode == 1214) @@ -1761,7 +1759,6 @@ internal void SetPrimary(Face primaryFace, ICurve2D curveOnPrimaryFace, bool for this.curveOnPrimaryFace = curveOnPrimaryFace; this.forwardOnPrimaryFace = forwardOnPrimaryFace; oriented = true; - edgeKind = EdgeKind.unknown; } internal void SetPrimary(Face fc, bool forward) { @@ -1770,7 +1767,6 @@ internal void SetPrimary(Face fc, bool forward) if (!forward) curveOnPrimaryFace.Reverse(); forwardOnPrimaryFace = forward; oriented = true; - edgeKind = EdgeKind.unknown; } internal void SetSecondary(Face fc, bool forward) { @@ -1779,7 +1775,6 @@ internal void SetSecondary(Face fc, bool forward) if (!forward) curveOnSecondaryFace.Reverse(); forwardOnSecondaryFace = forward; oriented = true; - edgeKind = EdgeKind.unknown; } internal void UpdateInterpolatedDualSurfaceCurve() { diff --git a/CADability/Extensions.cs b/CADability/Extensions.cs index eb029dba..62ff9546 100644 --- a/CADability/Extensions.cs +++ b/CADability/Extensions.cs @@ -81,13 +81,11 @@ void IEnumerator.Reset() public class LookedUpEnumerable : IEnumerable, IEnumerator, IEnumerator { IEnumerable toEnumerate; - int currentIndex; IEnumerator currentEnumerator; Dictionary lookUp; public LookedUpEnumerable(IEnumerable enumerable, Dictionary lookUp) { toEnumerate = enumerable; - currentIndex = 0; currentEnumerator = null; this.lookUp = lookUp; currentEnumerator = enumerable.GetEnumerator(); diff --git a/CADability/Face.cs b/CADability/Face.cs index c1b23741..2e08f4a1 100644 --- a/CADability/Face.cs +++ b/CADability/Face.cs @@ -6737,7 +6737,6 @@ private void TryAssureTriangles(double precision) } } } - static int maxtime = 0; internal void AssureTriangles(double precision) { lock (lockTriangulationRecalc) diff --git a/CADability/GeoVectorProperty.cs b/CADability/GeoVectorProperty.cs index 3e342e52..e64f7254 100644 --- a/CADability/GeoVectorProperty.cs +++ b/CADability/GeoVectorProperty.cs @@ -83,7 +83,6 @@ private enum DisplayCoordinateSystem { local, absolute, both }; private Plane drawingPlane; // spiegelt die aktuelle drawingplane wieder private bool displayZComponent; // true: z-Wert darstellen, false: nur x,y-Werte darstellen private bool alwaysAbsoluteCoordinateSystem; // immer im basoluten Koordinatensystem darstellen - private bool alwaysZComponent; // immer z-Wert darstellen /// /// Delegate definition for the @@ -134,7 +133,6 @@ private void InitFormat(IFrame frame) displayZComponent = true; } alwaysAbsoluteCoordinateSystem = false; - alwaysZComponent = false; displayMode = (DisplayMode)frame.GetIntSetting("Formatting.Vector.Mode", 0); numberFormatInfo = (NumberFormatInfo)CultureInfo.CurrentCulture.NumberFormat.Clone(); int decsym = Settings.GlobalSettings.GetIntValue("Formatting.Decimal", 0); // Systemeinstellung | Punkt | Komma diff --git a/CADability/IntegerProperty.cs b/CADability/IntegerProperty.cs index c4641772..cfb342a8 100644 --- a/CADability/IntegerProperty.cs +++ b/CADability/IntegerProperty.cs @@ -18,7 +18,6 @@ public class IntegerProperty : EditableProperty, ISerializable, ISettingCha private string text; private bool readOnly; private bool IsSetting; - private bool settingChanged; private bool highlight; private int minValue; // Grenzen für die Eingabe private int maxValue; @@ -51,7 +50,6 @@ private void Initialize(object ObjectWithInt, string PropertyName, string resour } } IntChanged(); - settingChanged = false; } public IntegerProperty(object ObjectWithInt, string PropertyName, string resourceId) { @@ -169,7 +167,6 @@ public void SetInt(int d) { if (d == internalValue) return; - settingChanged = true; internalValue = d; if (SetIntEvent != null) { diff --git a/CADability/MultipleChoiceProperty.cs b/CADability/MultipleChoiceProperty.cs index 7622df79..fcd8cdce 100644 --- a/CADability/MultipleChoiceProperty.cs +++ b/CADability/MultipleChoiceProperty.cs @@ -27,7 +27,6 @@ public class MultipleChoiceProperty : PropertyEntryImpl //protected ImageList images; // die ImageList (kann fehlen) protected string selectedText; // der ausgewählte Text protected string unselectedText; // der Text, wenn nichts ausgewählt ist (wenn null, dann ganz leer) - private bool popup; /// /// Back reference to any user item. Not used by the MultipleChoiceProperty object itself. /// @@ -59,7 +58,6 @@ public MultipleChoiceProperty(string resourceId, int InitialSelection) /// public MultipleChoiceProperty() { - popup = true; } //private int ImageIndex(int Index) //{ diff --git a/CADability/NameProperty.cs b/CADability/NameProperty.cs index 163c8dbb..a1bacb8d 100644 --- a/CADability/NameProperty.cs +++ b/CADability/NameProperty.cs @@ -12,17 +12,15 @@ public class NameProperty : IShowPropertyImpl { private object ObjectWithName; private PropertyInfo TheProperty; - private bool IsSetting; public NameProperty(object ObjectWithName, string PropertyName, string resourceId) { - IsSetting = false; this.ObjectWithName = ObjectWithName; base.resourceId = resourceId; TheProperty = ObjectWithName.GetType().GetProperty(PropertyName); if (TheProperty == null) TheProperty = ObjectWithName.GetType().BaseType.GetProperty(PropertyName); // besser rekursiv } - + private void SetName(string s) { MethodInfo mi = TheProperty.GetSetMethod(); @@ -30,13 +28,13 @@ private void SetName(string s) prm[0] = s; try { - IsSetting = true; mi.Invoke(ObjectWithName, prm); } finally { - IsSetting = false; + } + } private string GetName() { diff --git a/CADability/ParallelHelper.cs b/CADability/ParallelHelper.cs index b4e03442..094328d2 100644 --- a/CADability/ParallelHelper.cs +++ b/CADability/ParallelHelper.cs @@ -8,8 +8,8 @@ namespace CADability public class ParallelHelper { #if DEBUG - private static string lmfa = ""; // to have an object to lock access to maxFailedAttempts - static int maxFailedAttempts = 0; + //private static string lmfa = ""; // to have an object to lock access to maxFailedAttempts + //static int maxFailedAttempts = 0; static HashSet debug = new HashSet(); #endif class LockMultiple : IDisposable diff --git a/CADability/ProjectedModel.cs b/CADability/ProjectedModel.cs index 498f58c6..d685bee6 100644 --- a/CADability/ProjectedModel.cs +++ b/CADability/ProjectedModel.cs @@ -65,7 +65,6 @@ public enum Kind { HardEdge, SoftEdge, ContourEdge } [Serializable] public class ProjectedModel : ISerializable, IDeserializationCallback, IJsonSerialize { - static bool DoBackgroundPaint = false; // immer false, keine Hidden lines mehr! #region Konzept: /* Konzept zum ProjectedModel: * Die Klasse ProjectedModel hält einen QuadTree, der die Objekte für die 2D Darstellung enthält.