Пример #1
0
        /// <summary>
        /// Set the parent of this node, and transform the node in such a way that it
        /// doesn't move in global coordinates.
        /// </summary>
        /// <param name="newParent">The new parent of this node.</param>
        public virtual void Reparent(PNode newParent)
        {
            PMatrix originalTransform = GlobalToLocalMatrix;
            PMatrix newTransform = newParent.GlobalToLocalMatrix;
            newTransform.Multiply(originalTransform);

            RemoveFromParent();
            Matrix = newTransform;
            newParent.AddChild(this);
            fullBoundsCache = ComputeFullBounds();
        }
Пример #2
0
 /// <summary>
 /// Adds bounds handles to the given node.
 /// </summary>
 /// <param name="aNode">The node to add bounds handles to.</param>
 public static void AddBoundsHandlesTo(PNode aNode)
 {
     //aNode.AddChild(new PBoundsHandle(PBoundsLocator.CreateEastLocator(aNode)));
     //aNode.AddChild(new PBoundsHandle(PBoundsLocator.CreateWestLocator(aNode)));
     //aNode.AddChild(new PBoundsHandle(PBoundsLocator.CreateNorthLocator(aNode)));
     //aNode.AddChild(new PBoundsHandle(PBoundsLocator.CreateSouthLocator(aNode)));
     aNode.AddChild(new PBoundsHandle(PBoundsLocator.CreateNorthEastLocator(aNode)));
     aNode.AddChild(new PBoundsHandle(PBoundsLocator.CreateNorthWestLocator(aNode)));
     aNode.AddChild(new PBoundsHandle(PBoundsLocator.CreateSouthEastLocator(aNode)));
     aNode.AddChild(new PBoundsHandle(PBoundsLocator.CreateSouthWestLocator(aNode)));
 }