Пример #1
0
 private void Initialize(CompositeGraphic3D source, ICloningContext context)
 {
     foreach (var graphic in source.Graphics)
     {
         var clone = graphic.Clone();
         if (clone != null)
         {
             Graphics.Add(clone);
         }
     }
 }
Пример #2
0
		private void Initialize(CompositeGraphic3D source, ICloningContext context)
		{
			foreach (var graphic in source.Graphics)
			{
				var clone = graphic.Clone();
				if (clone != null)
					Graphics.Add(clone);
			}
		}
		private void OnCloneComplete()
		{
			_compositeImageGraphic = (CompositeRootModel3D) CollectionUtils.SelectFirst(SceneGraph.Graphics, test => test is CompositeRootModel3D);

			Platform.CheckForNullReference(_compositeImageGraphic, "_compositeImageGraphic");

			_applicationGraphics = (CompositeGraphic) CollectionUtils.SelectFirst(_compositeImageGraphic.Graphics, test => test.Name == "Application2D");
			_overlayGraphics = (CompositeGraphic) CollectionUtils.SelectFirst(_compositeImageGraphic.Graphics, test => test.Name == "Overlay2D");
			_overlayGraphics3D = (CompositeGraphic3D) CollectionUtils.SelectFirst(_compositeImageGraphic.Graphics3D, test => test.Name == "Overlay3D");

			Platform.CheckForNullReference(_applicationGraphics, "_applicationGraphics");
			Platform.CheckForNullReference(_overlayGraphics, "_overlayGraphics");
			Platform.CheckForNullReference(_overlayGraphics3D, "_overlayGraphics3D");
		}
		private void InitializeSceneGraph(
			int sceneWidth,
			int sceneHeight,
			float dimensionX,
			float dimensionY,
			float dimensionZ,
			float pixelSpacingX,
			float pixelSpacingY,
			float pixelSpacingZ)
		{
			_compositeImageGraphic = new CompositeRootModel3D(sceneWidth, sceneHeight, dimensionX, dimensionY, dimensionZ, pixelSpacingX, pixelSpacingY, pixelSpacingZ)
			                         	{
			                         		Origin = new Vector3D(-dimensionX/2, -dimensionY/2, -dimensionZ/2)
			                         	};

			_applicationGraphics = new CompositeGraphic();
			_applicationGraphics.Name = "Application2D";

			_overlayGraphics = new CompositeGraphic();
			_overlayGraphics.Name = "Overlay2D";

			_overlayGraphics3D = new CompositeGraphic3D();
			_overlayGraphics3D.Name = "Overlay3D";

			_compositeImageGraphic.Graphics.Add(_applicationGraphics);
			_compositeImageGraphic.Graphics.Add(_overlayGraphics);
			_compositeImageGraphic.Graphics3D.Add(_overlayGraphics3D);

			SceneGraph.Graphics.Add(_compositeImageGraphic);
		}