示例#1
0
 public static PropertyReference PropertyReferenceFromVisual3D(Base3DElement item, PropertyReference propertyReference)
 {
     for (Base3DElement base3Delement = item.ParentElement as Base3DElement; base3Delement != null; base3Delement = item.ParentElement as Base3DElement)
     {
         if (base3Delement is ModelVisual3DElement)
         {
             if (item is Model3DElement)
             {
                 propertyReference = new PropertyReference((ReferenceStep)item.ProjectContext.ResolveProperty(ModelVisual3DElement.ContentProperty)).Append(propertyReference);
                 break;
             }
             break;
         }
         if (base3Delement is ModelUIElement3DElement)
         {
             if (item is Model3DElement)
             {
                 propertyReference = new PropertyReference((ReferenceStep)item.ProjectContext.ResolveProperty(ModelUIElement3DElement.ModelProperty)).Append(propertyReference);
                 break;
             }
             break;
         }
         int siteChildIndex = item.DocumentNode.SiteChildIndex;
         PropertyReference propertyReference1 = new PropertyReference((ReferenceStep)IndexedClrPropertyReferenceStep.GetReferenceStep((ITypeResolver)item.ProjectContext, typeof(Model3DCollection), siteChildIndex));
         propertyReference = new PropertyReference((ReferenceStep)item.ProjectContext.ResolveProperty(Model3DGroupElement.ChildrenProperty)).Append(propertyReference1).Append(propertyReference);
         item = base3Delement;
     }
     return(propertyReference);
 }
示例#2
0
        public SceneElement AddChild(SceneViewModel sceneView, Base3DElement child)
        {
            Model3DElement model3Delement = BaseElement3DCoercionHelper.CoerceToModel3D(sceneView, (SceneElement)child);

            if (model3Delement != null)
            {
                this.Children.Add(model3Delement);
            }
            return((SceneElement)model3Delement);
        }
示例#3
0
        public Matrix3D GetComputedTransformFromRoot3DElementToElement()
        {
            Base3DElement base3Delement = this;
            Matrix3D      identity      = Matrix3D.Identity;

            for (; base3Delement != null; base3Delement = base3Delement.ParentElement as Base3DElement)
            {
                Matrix3D matrix3D = base3Delement.Transform.Value;
                identity *= matrix3D;
            }
            return(identity);
        }