示例#1
0
 /// <summary>
 /// This method is called to respond to a gizmo transform operation redone message.
 /// </summary>
 private void RespondToMessage(GizmoTransformOperationWasRedoneMessage message)
 {
     // When the transform operation is redone, it means the objects position/rotation/scale
     // has changed, so we have to recalculate the position and orientation of the active gizmo.
     EstablishActiveGizmoPosition();
     UpdateActiveGizmoRotation();
 }
示例#2
0
        /// <summary>
        /// This method can be called to redo the action.
        /// </summary>
        public void Redo()
        {
            // In order to redo this kind of action, we will loop through all post transform object snapshots
            // and apply them to the corresponding objects.
            foreach (ObjectTransformSnapshot snapshot in _postTransformObjectSnapshot)
            {
                snapshot.ApplySnapshot();
            }

            // Send a gizmo transform operation redone message
            GizmoTransformOperationWasRedoneMessage.SendToInterestedListeners(_gizmoWhichTransformedObjects);
        }
        /// <summary>
        /// Convenience function for sending a gizmo transform operation redone message to
        /// all interested listeners.
        /// </summary>
        /// <param name="gizmoInvolvedInTransformOperation">
        /// This is the gizmo which is involved in the transform operation which was redone.
        /// </param>
        public static void SendToInterestedListeners(Gizmo gizmoInvolvedInTransformOperation)
        {
            var message = new GizmoTransformOperationWasRedoneMessage(gizmoInvolvedInTransformOperation);

            MessageListenerDatabase.Instance.SendMessageToInterestedListeners(message);
        }