private void RemoveAdornerSet3D(AdornerSet3D adornerSet3D) { Viewport3DElement adornedViewport = adornerSet3D.AdornerSet3DContainer.AdornedViewport; if (adornedViewport == null) { throw new InvalidOperationException(ExceptionStringTable.AdornedViewport3DElementMayNotBeNull); } IList <AdornerElementSet> containingElement = this.GetAdornerElementSetsContainingElement((SceneElement)adornedViewport); if (containingElement.Count <= 0) { return; } foreach (AdornerElementSet adornerElementSet in (IEnumerable <AdornerElementSet>)containingElement) { AdornerLayer.ElementInfo elementInfo = this.GetElementInfo(adornerElementSet); if (elementInfo.AdornerSet3DContainer != null && elementInfo.AdornerSet3DContainer.AdornerSets.Contains(adornerSet3D) && (elementInfo != null && elementInfo.RemoveAdornerSet(adornerSet3D))) { AdornerSet3DContainer adornerSet3Dcontainer = elementInfo.AdornerSet3DContainer; if (adornerSet3Dcontainer.AdornerSetCount == 0) { elementInfo.AdornerSet3DContainer = (AdornerSet3DContainer)null; this.children.Remove((Visual)adornerSet3Dcontainer); this.adornerSet3DContainers.Remove(adornerSet3Dcontainer); } if (elementInfo.IsEmpty) { this.elementMap.Remove(adornerElementSet); } } } }
private void AddAdornerSet3D(AdornerSet3D adornerSet3D) { Base3DElement element = adornerSet3D.Element; if (element == null) { throw new InvalidOperationException(ExceptionStringTable.AdornedBase3DElementMayNotBeNull); } Viewport3DElement viewport = element.Viewport; if (viewport == null) { throw new InvalidOperationException(ExceptionStringTable.AdornedViewport3DElementMayNotBeNull); } AdornerLayer.ElementInfo createElementInfo = this.GetOrCreateElementInfo(this.CreateOrGetAdornerElementSetForElement((SceneElement)viewport)); if (createElementInfo.AdornerSet3DContainer == null) { createElementInfo.AdornerSet3DContainer = new AdornerSet3DContainer(viewport); this.adornerSet3DContainers.Add(createElementInfo.AdornerSet3DContainer); } createElementInfo.Update((SceneElement)viewport, this, AdornerLayer.ElementInfoUpdateSource.Explicit); createElementInfo.AddAdornerSet(adornerSet3D); if (createElementInfo.AdornerSet3DContainer.Parent == this) { return; } this.children.Add((Visual)createElementInfo.AdornerSet3DContainer); }
public bool RemoveAdornerSet(AdornerSet3D adornerSet) { if (!this.adornerSets.Remove(adornerSet)) { return(false); } adornerSet.AdornerSet3DContainer = (AdornerSet3DContainer)null; this.GetCorrespondingVisual3DCollection(adornerSet.Placement).Remove((Visual3D)adornerSet.AdornerVisual); return(true); }
protected Adorner3D(AdornerSet3D adornerSet, Adorner3D.TransformVia direction) : this(adornerSet) { this.axis = direction; }
protected Adorner3D(AdornerSet3D adornerSet) { this.adornerSet = adornerSet; }
public bool RemoveAdornerSet(AdornerSet3D adornerSet) { return(this.adornerSet3DContainer.RemoveAdornerSet(adornerSet)); }
public void AddAdornerSet(AdornerSet3D adornerSet) { this.adornerSet3DContainer.AddAdornerSet(adornerSet); this.adornerSet3DContainer.SetMatrix(this.matrix); }
public void AddAdornerSet(AdornerSet3D adornerSet) { adornerSet.AdornerSet3DContainer = this; this.adornerSets.Add(adornerSet); this.GetCorrespondingVisual3DCollection(adornerSet.Placement).Add((Visual3D)adornerSet.AdornerVisual); }