Ejemplo n.º 1
0
        /// <summary>
        /// Cloning constructor.
        /// </summary>
        protected CompositeRootModel3D(CompositeRootModel3D source, ICloningContext context)
        {
            context.CloneFields(source, this);

            _graphicCollection3D              = new GraphicCollection3D();
            _graphicCollection3D.ItemAdded   += OnGraphicAdded;
            _graphicCollection3D.ItemRemoved += OnGraphicRemoved;
            _graphicCollection3D.AddRange(source._graphicCollection3D.Select(g => g.Clone()).Where(g => g != null));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of <see cref="CompositeRootModel3D"/> with
        /// the specified dimensions, spacing and aspect ratio.
        /// </summary>
        /// <param name="sceneWidth"></param>
        /// <param name="sceneHeight"></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 CompositeRootModel3D(
            int sceneWidth,
            int sceneHeight,
            float dimensionX,
            float dimensionY,
            float dimensionZ,
            float spacingX,
            float spacingY,
            float spacingZ,
            float aspectRatioX,
            float aspectRatioY,
            float aspectRatioZ)
        {
            _sceneSize   = new Size(sceneWidth, sceneHeight);
            _dimensions  = new Vector3D(dimensionX, dimensionY, dimensionZ);
            _spacing     = new Vector3D(spacingX, spacingY, spacingZ);
            _aspectRatio = new Vector3D(aspectRatioX, aspectRatioY, aspectRatioZ);

            _graphicCollection3D              = new GraphicCollection3D();
            _graphicCollection3D.ItemAdded   += OnGraphicAdded;
            _graphicCollection3D.ItemRemoved += OnGraphicRemoved;
        }