Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of <see cref="RootSpatialTransform3D"/> with
 /// the specified owner <see cref="IGraphic"/>, dimensions, spacing
 /// and aspect ratio.
 /// </summary>
 /// <param name="parentTransform"></param>
 /// <param name="dimensionX"></param>
 /// <param name="dimensionY"></param>
 /// <param name="dimensionZ"></param>
 /// <param name="spacingX"></param>
 /// <param name="spacingY"></param>
 /// <param name="spacingZ"></param>
 /// <param name="aspectRatioX"></param>
 /// <param name="aspectRatioY"></param>
 /// <param name="aspectRatioZ"></param>
 public RootSpatialTransform3D(RootModelSpatialTransform parentTransform,
                               float dimensionX, float dimensionY, float dimensionZ,
                               float spacingX, float spacingY, float spacingZ,
                               float aspectRatioX, float aspectRatioY, float aspectRatioZ)
     : this(parentTransform, new Vector3D(dimensionX, dimensionY, dimensionZ), new Vector3D(spacingX, spacingY, spacingZ), new Vector3D(aspectRatioX, aspectRatioY, aspectRatioZ))
 {
 }
		/// <summary>
		/// Cloning constructor.
		/// </summary>
		/// <param name="source">The source object from which to clone.</param>
		/// <param name="context">The cloning context object.</param>
		protected RootModelSpatialTransform(RootModelSpatialTransform source, ICloningContext context)
			: base(source, context)
		{
			context.CloneFields(source, this);

			_rootTransform3D.ParentTransform = this;

			if (source._cumulativeTransform3D != null)
				_cumulativeTransform3D = source._cumulativeTransform3D.Clone();
		}
Beispiel #3
0
        /// <summary>
        /// Cloning constructor.
        /// </summary>
        /// <param name="source">The source object from which to clone.</param>
        /// <param name="context">The cloning context object.</param>
        protected RootModelSpatialTransform(RootModelSpatialTransform source, ICloningContext context)
            : base(source, context)
        {
            context.CloneFields(source, this);

            _rootTransform3D.ParentTransform = this;

            if (source._cumulativeTransform3D != null)
            {
                _cumulativeTransform3D = source._cumulativeTransform3D.Clone();
            }
        }
Beispiel #4
0
            /// <summary>
            /// Initializes a new instance of <see cref="RootSpatialTransform3D"/> with
            /// the specified owner <see cref="IGraphic"/>, dimensions, spacing
            /// and aspect ratio.
            /// </summary>
            /// <param name="parentTransform"></param>
            /// <param name="dimensions"></param>
            /// <param name="spacing"></param>
            /// <param name="aspectRatio"></param>
            public RootSpatialTransform3D(RootModelSpatialTransform parentTransform, Vector3D dimensions, Vector3D spacing, Vector3D aspectRatio)
                : base(null)
            {
                Platform.CheckForNullReference(dimensions, "dimensions");

                if (spacing != null && (FloatComparer.AreEqual(0, spacing.X) || FloatComparer.AreEqual(0, spacing.Y) || FloatComparer.AreEqual(0, spacing.Z)))
                {
                    spacing = null;
                }

                if (aspectRatio != null && (FloatComparer.AreEqual(0, aspectRatio.X) || FloatComparer.AreEqual(0, aspectRatio.Y) || FloatComparer.AreEqual(0, aspectRatio.Z)))
                {
                    aspectRatio = null;
                }

                _parentTransform    = parentTransform;
                _dimensions         = dimensions;
                _spacing            = spacing;
                _adjustedDimensions = ComputeAdjustedDimensions(dimensions, spacing, aspectRatio);
            }
			/// <summary>
			/// Initializes a new instance of <see cref="RootSpatialTransform3D"/> with
			/// the specified owner <see cref="IGraphic"/>, dimensions, spacing
			/// and aspect ratio.
			/// </summary>
			/// <param name="parentTransform"></param>
			/// <param name="dimensions"></param>
			/// <param name="spacing"></param>
			/// <param name="aspectRatio"></param>
			public RootSpatialTransform3D(RootModelSpatialTransform parentTransform, Vector3D dimensions, Vector3D spacing, Vector3D aspectRatio)
				: base(null)
			{
				Platform.CheckForNullReference(dimensions, "dimensions");

				if (spacing != null && (FloatComparer.AreEqual(0, spacing.X) || FloatComparer.AreEqual(0, spacing.Y) || FloatComparer.AreEqual(0, spacing.Z)))
					spacing = null;

				if (aspectRatio != null && (FloatComparer.AreEqual(0, aspectRatio.X) || FloatComparer.AreEqual(0, aspectRatio.Y) || FloatComparer.AreEqual(0, aspectRatio.Z)))
					aspectRatio = null;

				_parentTransform = parentTransform;
				_dimensions = dimensions;
				_spacing = spacing;
				_adjustedDimensions = ComputeAdjustedDimensions(dimensions, spacing, aspectRatio);
			}
			/// <summary>
			/// Initializes a new instance of <see cref="RootSpatialTransform3D"/> with
			/// the specified owner <see cref="IGraphic"/>, dimensions, spacing
			/// and aspect ratio.
			/// </summary>
			/// <param name="parentTransform"></param>
			/// <param name="dimensionX"></param>
			/// <param name="dimensionY"></param>
			/// <param name="dimensionZ"></param>
			/// <param name="spacingX"></param>
			/// <param name="spacingY"></param>
			/// <param name="spacingZ"></param>
			/// <param name="aspectRatioX"></param>
			/// <param name="aspectRatioY"></param>
			/// <param name="aspectRatioZ"></param>
			public RootSpatialTransform3D(RootModelSpatialTransform parentTransform,
			                              float dimensionX, float dimensionY, float dimensionZ,
			                              float spacingX, float spacingY, float spacingZ,
			                              float aspectRatioX, float aspectRatioY, float aspectRatioZ)
				: this(parentTransform, new Vector3D(dimensionX, dimensionY, dimensionZ), new Vector3D(spacingX, spacingY, spacingZ), new Vector3D(aspectRatioX, aspectRatioY, aspectRatioZ)) {}