private void OnDrawingPlaneDone(ConstructAction ca, bool success) { if (!success) { return; } frame.ShowPropertyDisplay("View"); if (propertyTreeView != null) { propertyTreeView.SelectEntry(this); } Plane pln = Plane.XYPlane; ConstructPlane cp = ca as ConstructPlane; if (ca is ConstructPlane) { pln = (ca as ConstructPlane).ConstructedPlane; } else if (ca is ConstructTangentialPlane) { pln = (ca as ConstructTangentialPlane).ConstructedPlane; } else { return; } try { if (!Precision.IsPerpendicular(projection.Direction, pln.Normal, false)) { projection.DrawingPlane = pln; } else { Frame.UIService.ShowMessageBox(StringTable.GetString("Error.DrawingPlane.Impossible"), StringTable.GetString("Errormessage.Title.InvalidInput"), MessageBoxButtons.OK); } } catch (ConstructPlane.ConstructPlaneException) { // hat aus irgend einem Grund nicht geklappt Frame.UIService.ShowMessageBox(StringTable.GetString("Error.DrawingPlane.Impossible"), StringTable.GetString("Errormessage.Title.InvalidInput"), MessageBoxButtons.OK); } planeOrigin.Refresh(); planeDirectionX.Refresh(); planeDirectionY.Refresh(); frame.ActiveView.InvalidateAll(); frame.SetControlCenterFocus("View", null, false, false); }
private void OnGeoObjectDidChange(IGeoObject Sender, GeoObjectChange Change) { // wird bei Ă„nderungen von der Linie aufgerufen, Abgleich der Anzeigen startPointProperty.Refresh(); endPointProperty.Refresh(); lengthProperty.Refresh(); lengthHotSpot.Position = line.PointAt(2.0 / 3.0); // sitzt bei 2/3 der Linie directionProperty.Refresh(); directionHotSpot.Position = line.PointAt(1.0 / 3.0); // sitzt bei 1/3 der Linie if (HotspotChangedEvent != null) { HotspotChangedEvent(startPointProperty, HotspotChangeMode.Moved); HotspotChangedEvent(endPointProperty, HotspotChangeMode.Moved); HotspotChangedEvent(lengthHotSpot, HotspotChangeMode.Moved); HotspotChangedEvent(directionHotSpot, HotspotChangeMode.Moved); } }