Ejemplo n.º 1
0
 private void ApplyRelativeTransformToElements(IEnumerable targetElements, PropertyReference reference, IApplyRelativeTransform transformModel)
 {
     foreach (SceneNode sceneNode in targetElements)
     {
         SceneElement sceneElement = sceneNode as SceneElement;
         if (sceneElement != null)
         {
             if (sceneElement is BaseFrameworkElement && sceneElement.IsSet(Base2DElement.RenderTransformOriginProperty) == PropertyState.Unset)
             {
                 sceneElement.SetValueAsWpf(Base2DElement.RenderTransformOriginProperty, (object)new Point(0.5, 0.5));
             }
             object             computedValueAsWpf = sceneElement.GetComputedValueAsWpf(reference);
             object             obj = transformModel.ApplyRelativeTransform(computedValueAsWpf);
             CanonicalTransform canonicalTransform = obj as CanonicalTransform;
             if (canonicalTransform != (CanonicalTransform)null)
             {
                 sceneElement.SetValue(reference, canonicalTransform.GetPlatformTransform(sceneElement.Platform.GeometryHelper));
             }
             else
             {
                 CanonicalTransform3D canonicalTransform3D = obj as CanonicalTransform3D;
                 if (canonicalTransform3D != (CanonicalTransform3D)null)
                 {
                     sceneElement.SetValue(reference, (object)canonicalTransform3D.ToTransform());
                 }
             }
         }
     }
 }
 public Orientation?ApplyOrientation(SceneElement container)
 {
     if (this.centers.Count > 0 && container != null)
     {
         IPropertyId orientationProperty = this.GetOrientationProperty(container);
         if (orientationProperty != null)
         {
             Orientation orientation = this.GetOrientation();
             container.SetValueAsWpf(orientationProperty, (object)orientation);
             return(new Orientation?(orientation));
         }
     }
     return(new Orientation?());
 }