Beispiel #1
0
 internal Adorner3D GetHitAdorner3D(AdornerSet3DContainer layer, Point point)
 {
     this.hitTestParameters3D = new PointHitTestParameters(point);
     this.hitObject           = (RectangleHitTestResult)null;
     VisualTreeHelper.HitTest((Visual)layer, new HitTestFilterCallback(this.FilterPotentialHit), new HitTestResultCallback(this.ProcessHitTestResult3D), (HitTestParameters)this.hitTestParameters3D);
     if (this.hitObject != null)
     {
         ModelVisual3D modelVisual3D1 = (ModelVisual3D)null;
         foreach (DependencyObject dependencyObject in this.hitObject.HitPath)
         {
             ModelVisual3D modelVisual3D2 = dependencyObject as ModelVisual3D;
             if (modelVisual3D2 != null)
             {
                 modelVisual3D1 = modelVisual3D2;
                 break;
             }
         }
         Adorner3D associatedAdorner = layer.GetAssociatedAdorner(modelVisual3D1);
         if (associatedAdorner != null)
         {
             return(associatedAdorner);
         }
     }
     return((Adorner3D)null);
 }
Beispiel #2
0
 public void RemoveAdorner(Adorner3D adorner)
 {
     if (this.adornerList == null)
     {
         throw new InvalidOperationException(ExceptionStringTable.AdornerSetAddAdornerCalledWithNullList);
     }
     this.adornerList.Remove(adorner);
     this.adornerSetVisual.Children.Remove((Visual3D)adorner.AdornerVisual);
 }
 public Adorner3D GetAssociatedAdorner(ModelVisual3D modelVisual3D)
 {
     foreach (AdornerSet3D adornerSet3D in this.adornerSets)
     {
         Adorner3D associatedAdorner = adornerSet3D.GetAssociatedAdorner(modelVisual3D);
         if (associatedAdorner != null)
         {
             return(associatedAdorner);
         }
     }
     return((Adorner3D)null);
 }
Beispiel #4
0
 protected void AddAdorner(Adorner3D adorner)
 {
     if (adorner == null)
     {
         throw new ArgumentNullException("adorner");
     }
     if (this.adornerList == null)
     {
         throw new InvalidOperationException(ExceptionStringTable.AdornerSetAddAdornerCalledWithNullList);
     }
     if (adorner.AdornerModel == null)
     {
         return;
     }
     this.adornerList.Add(adorner);
     this.adornerSetVisual.Children.Add((Visual3D)adorner.AdornerVisual);
 }
Beispiel #5
0
        public static bool DoesContain(Model3D tree, Model3D item)
        {
            if (item == tree)
            {
                return(true);
            }
            Model3DGroup model3Dgroup = tree as Model3DGroup;

            if (model3Dgroup != null && model3Dgroup.Children != null)
            {
                foreach (Model3D tree1 in model3Dgroup.Children)
                {
                    if (Adorner3D.DoesContain(tree1, item))
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
Beispiel #6
0
 public bool DoesIncludeModel3D(Model3D item)
 {
     return(Adorner3D.DoesContain((Model3D)this.AdornerModel, item));
 }