コード例 #1
0
ファイル: FormSphere.cs プロジェクト: xinfushe/CSharpGL
        public FormSphere()
        {
            InitializeComponent();

            //if (CameraDictionary.Instance.ContainsKey(this.GetType().Name))
            //{
            //    this.camera = CameraDictionary.Instance[this.GetType().Name];
            //}
            //else
            {
                this.camera = new Camera(CameraType.Ortho, this.glCanvas1.Width, this.glCanvas1.Height);
                //CameraDictionary.Instance.Add(this.GetType().Name, this.camera);
            }

            satelliteRoration = new SatelliteRotator(camera);

            Padding padding = new System.Windows.Forms.Padding(40, 40, 40, 40);
            Size size = new Size(100, 100);
            //Size size = new Size(5, 5);
            IUILayoutParam param;
            param = new IUILayoutParam(AnchorStyles.Left | AnchorStyles.Bottom, padding, size);
            uiLeftBottomAxis = new SimpleUIAxis(param);
            //param = new IUILayoutParam(AnchorStyles.Left | AnchorStyles.Top, padding, size);
            //uiLeftTopAxis = new SimpleUIAxis(param);
            //param = new IUILayoutParam(AnchorStyles.Right | AnchorStyles.Bottom, padding, size);
            //uiRightBottomAxis = new SimpleUIAxis(param);
            //param = new IUILayoutParam(AnchorStyles.Right | AnchorStyles.Top, padding, size);
            //uiRightTopAxis = new SimpleUIAxis(param);

            uiLeftBottomAxis.Initialize();
            //uiLeftTopAxis.Initialize();
            //uiRightBottomAxis.Initialize();
            //uiRightTopAxis.Initialize();

            param = new IUILayoutParam(AnchorStyles.Left | AnchorStyles.Bottom, padding, size);
            //uiLeftBottomRect = new SimpleUIRect(param);
            //param = new IUILayoutParam(AnchorStyles.Left | AnchorStyles.Top, padding, size);
            //uiLeftTopRect = new SimpleUIRect(param);
            //param = new IUILayoutParam(AnchorStyles.Right | AnchorStyles.Bottom, padding, size);
            //uiRightBottomRect = new SimpleUIRect(param);
            //param = new IUILayoutParam(AnchorStyles.Right | AnchorStyles.Top, padding, size);
            //uiRightTopRect = new SimpleUIRect(param);

            //uiLeftBottomRect.Initialize();
            //uiLeftTopRect.Initialize();
            //uiRightBottomRect.Initialize();
            //uiRightTopRect.Initialize();

            sphereElement = new SphereElement();
            sphereElement.Initialize();
            sphereElement.BeforeRendering += sphereElement_BeforeRendering;
            sphereElement.AfterRendering += sphereElement_AfterRendering;

            lightElement = new PointLightElement();
            lightElement.Initialize();
            lightElement.BeforeRendering += pointLightElement_BeforeRendering;
            lightElement.AfterRendering += pointLightElement_AfterRendering;

            this.glCanvas1.MouseWheel += glCanvas1_MouseWheel;
            this.glCanvas1.KeyPress += glCanvas1_KeyPress;
            this.glCanvas1.MouseDown += glCanvas1_MouseDown;
            this.glCanvas1.MouseMove += glCanvas1_MouseMove;
            this.glCanvas1.MouseUp += glCanvas1_MouseUp;
            this.glCanvas1.OpenGLDraw += glCanvas1_OpenGLDraw;
            this.glCanvas1.Resize += glCanvas1_Resize;
        }
コード例 #2
0
            public override IDeepCopyable CopyTo(IDeepCopyable other)
            {
                var dest = other as DispenseComponent;

                if (dest != null)
                {
                    base.CopyTo(dest);
                    if (Product != null)
                    {
                        dest.Product = (Hl7.Fhir.Model.Coding)Product.DeepCopy();
                    }
                    if (EyeElement != null)
                    {
                        dest.EyeElement = (Code <Hl7.Fhir.Model.VisionPrescription.VisionEyes>)EyeElement.DeepCopy();
                    }
                    if (SphereElement != null)
                    {
                        dest.SphereElement = (Hl7.Fhir.Model.FhirDecimal)SphereElement.DeepCopy();
                    }
                    if (CylinderElement != null)
                    {
                        dest.CylinderElement = (Hl7.Fhir.Model.FhirDecimal)CylinderElement.DeepCopy();
                    }
                    if (AxisElement != null)
                    {
                        dest.AxisElement = (Hl7.Fhir.Model.Integer)AxisElement.DeepCopy();
                    }
                    if (PrismElement != null)
                    {
                        dest.PrismElement = (Hl7.Fhir.Model.FhirDecimal)PrismElement.DeepCopy();
                    }
                    if (BaseElement != null)
                    {
                        dest.BaseElement = (Code <Hl7.Fhir.Model.VisionPrescription.VisionBase>)BaseElement.DeepCopy();
                    }
                    if (AddElement != null)
                    {
                        dest.AddElement = (Hl7.Fhir.Model.FhirDecimal)AddElement.DeepCopy();
                    }
                    if (PowerElement != null)
                    {
                        dest.PowerElement = (Hl7.Fhir.Model.FhirDecimal)PowerElement.DeepCopy();
                    }
                    if (BackCurveElement != null)
                    {
                        dest.BackCurveElement = (Hl7.Fhir.Model.FhirDecimal)BackCurveElement.DeepCopy();
                    }
                    if (DiameterElement != null)
                    {
                        dest.DiameterElement = (Hl7.Fhir.Model.FhirDecimal)DiameterElement.DeepCopy();
                    }
                    if (Duration != null)
                    {
                        dest.Duration = (Hl7.Fhir.Model.SimpleQuantity)Duration.DeepCopy();
                    }
                    if (ColorElement != null)
                    {
                        dest.ColorElement = (Hl7.Fhir.Model.FhirString)ColorElement.DeepCopy();
                    }
                    if (BrandElement != null)
                    {
                        dest.BrandElement = (Hl7.Fhir.Model.FhirString)BrandElement.DeepCopy();
                    }
                    if (NotesElement != null)
                    {
                        dest.NotesElement = (Hl7.Fhir.Model.FhirString)NotesElement.DeepCopy();
                    }
                    return(dest);
                }
                else
                {
                    throw new ArgumentException("Can only copy to an object of the same type", "other");
                }
            }
コード例 #3
0
ファイル: FormSphere.cs プロジェクト: benlanaaa/CSharpGL
        public FormSphere()
        {
            InitializeComponent();

            //if (CameraDictionary.Instance.ContainsKey(this.GetType().Name))
            //{
            //    this.camera = CameraDictionary.Instance[this.GetType().Name];
            //}
            //else
            {
                this.camera = new Camera(CameraType.Ortho, this.glCanvas1.Width, this.glCanvas1.Height);
                //CameraDictionary.Instance.Add(this.GetType().Name, this.camera);
            }

            satelliteRoration = new SatelliteRotator(camera);

            Padding padding = new System.Windows.Forms.Padding(40, 40, 40, 40);
            Size    size    = new Size(100, 100);
            //Size size = new Size(5, 5);
            IUILayoutParam param;

            param            = new IUILayoutParam(AnchorStyles.Left | AnchorStyles.Bottom, padding, size);
            uiLeftBottomAxis = new SimpleUIAxis(param);
            //param = new IUILayoutParam(AnchorStyles.Left | AnchorStyles.Top, padding, size);
            //uiLeftTopAxis = new SimpleUIAxis(param);
            //param = new IUILayoutParam(AnchorStyles.Right | AnchorStyles.Bottom, padding, size);
            //uiRightBottomAxis = new SimpleUIAxis(param);
            //param = new IUILayoutParam(AnchorStyles.Right | AnchorStyles.Top, padding, size);
            //uiRightTopAxis = new SimpleUIAxis(param);

            uiLeftBottomAxis.Initialize();
            //uiLeftTopAxis.Initialize();
            //uiRightBottomAxis.Initialize();
            //uiRightTopAxis.Initialize();

            param = new IUILayoutParam(AnchorStyles.Left | AnchorStyles.Bottom, padding, size);
            //uiLeftBottomRect = new SimpleUIRect(param);
            //param = new IUILayoutParam(AnchorStyles.Left | AnchorStyles.Top, padding, size);
            //uiLeftTopRect = new SimpleUIRect(param);
            //param = new IUILayoutParam(AnchorStyles.Right | AnchorStyles.Bottom, padding, size);
            //uiRightBottomRect = new SimpleUIRect(param);
            //param = new IUILayoutParam(AnchorStyles.Right | AnchorStyles.Top, padding, size);
            //uiRightTopRect = new SimpleUIRect(param);

            //uiLeftBottomRect.Initialize();
            //uiLeftTopRect.Initialize();
            //uiRightBottomRect.Initialize();
            //uiRightTopRect.Initialize();

            sphereElement = new SphereElement();
            sphereElement.Initialize();
            sphereElement.BeforeRendering += sphereElement_BeforeRendering;
            sphereElement.AfterRendering  += sphereElement_AfterRendering;

            lightElement = new PointLightElement();
            lightElement.Initialize();
            lightElement.BeforeRendering += pointLightElement_BeforeRendering;
            lightElement.AfterRendering  += pointLightElement_AfterRendering;

            this.glCanvas1.MouseWheel += glCanvas1_MouseWheel;
            this.glCanvas1.KeyPress   += glCanvas1_KeyPress;
            this.glCanvas1.MouseDown  += glCanvas1_MouseDown;
            this.glCanvas1.MouseMove  += glCanvas1_MouseMove;
            this.glCanvas1.MouseUp    += glCanvas1_MouseUp;
            this.glCanvas1.OpenGLDraw += glCanvas1_OpenGLDraw;
            this.glCanvas1.Resize     += glCanvas1_Resize;
        }