コード例 #1
0
 private void CenterPoint(GeoPoint p)
 {
     sphereCenterPoint = p;
     radius.SetDistanceFromPoint(p);
     sphere = Make3D.MakeSphere(sphereCenterPoint, sphereRadius);
     sphere.CopyAttributes(base.ActiveObject);
     base.ActiveObject = sphere;
 }
コード例 #2
0
 private bool Radius(double length)
 {
     if (length > Precision.eps)
     {
         sphereRadius = length;
         sphere       = Make3D.MakeSphere(sphereCenterPoint, sphereRadius);
         if (sphere == null)
         {
             return(false);
         }
         sphere.CopyAttributes(base.ActiveObject);
         base.ActiveObject = sphere;
         return(true);
     }
     return(false);
 }
コード例 #3
0
        public override void OnSetAction()
        {
            sphere            = Solid.Construct();
            base.BasePoint    = ConstrDefaults.DefaultStartPoint;
            sphereCenterPoint = base.BasePoint;
            sphereRadius      = ConstrDefaults.DefaultArcRadius;
            sphere            = Make3D.MakeSphere(sphereCenterPoint, sphereRadius);

            base.ActiveObject = sphere;
            base.TitleId      = "Constr.Sphere";

            centerPointInput = new GeoPointInput("Constr.Sphere.Center");
            centerPointInput.DefaultGeoPoint   = ConstrDefaults.DefaultStartPoint;
            centerPointInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(CenterPoint);

            radius = new LengthInput("Constr.Sphere.Radius");
            radius.DefaultLength   = ConstrDefaults.DefaultArcRadius;
            radius.SetLengthEvent += new ConstructAction.LengthInput.SetLengthDelegate(Radius);

            base.SetInput(centerPointInput, radius);
            base.ShowAttributes = true;

            base.OnSetAction();
        }