Ejemplo n.º 1
0
        public static bool GetIsGroup(SceneElement element)
        {
            ModelVisual3DElement modelVisual3Delement = element as ModelVisual3DElement;

            if (modelVisual3Delement != null)
            {
                if (modelVisual3Delement.ParentElement is Viewport3DElement)
                {
                    if (modelVisual3Delement.Children.Count > 0)
                    {
                        return(modelVisual3Delement.Content == null);
                    }
                    return(false);
                }
                if (modelVisual3Delement.ParentElement is ModelVisual3DElement && modelVisual3Delement.Children.Count > 0)
                {
                    if (modelVisual3Delement.Content != null)
                    {
                        return(modelVisual3Delement.Model3DContent != null);
                    }
                    return(true);
                }
            }
            return(false);
        }
        public static Visual3DElement CoerceToVisual3D(SceneViewModel sceneView, SceneElement sceneElement)
        {
            Model3DElement model3Delement = sceneElement as Model3DElement;

            if (model3Delement != null)
            {
                ModelVisual3DElement modelVisual3Delement = ModelVisual3DElement.Factory.Instantiate(sceneView);
                modelVisual3Delement.Content = (SceneNode)model3Delement;
                return((Visual3DElement)modelVisual3Delement);
            }
            Visual3DElement visual3Delement;

            if ((visual3Delement = sceneElement as Visual3DElement) != null)
            {
                return(visual3Delement);
            }
            Viewport3DElement viewport3Delement = sceneElement as Viewport3DElement;

            return((Visual3DElement)null);
        }