Example #1
0
 bool SetReflectPlane(Plane val)
 {  // erstmal den Urprungszustand herstellen, "block" ist ja schon gespiegelt
     for (int i = 0; i < originals.Count; ++i)
     {
         block.Item(i).CopyGeometry(originals[i]);
     }
     // jetzt berechnen
     reflectModOp = ModOp.ReflectPlane(val);
     block.Modify(reflectModOp);
     reflectLine.Optional = true;
     // er liefert immer true zurück, da es ja immer eine Lösung gibt
     return(true);
 }
Example #2
0
        public override void OnSetAction()
        {
            base.ActiveObject = block;
            base.TitleId      = "ReflectObjects";
            copyObject        = ConstrDefaults.DefaultCopyObjects;

            GeoPointInput reflectPoint = new GeoPointInput("ReflectObjects.Point");

            //           reflectPoint.GetGeoPointEvent += new GeoPointInput.GetGeoPointDelegate(GetReflectPoint);
            reflectPoint.SetGeoPointEvent += new GeoPointInput.SetGeoPointDelegate(SetReflectPoint);
            reflectPoint.Optional          = true;

            reflectLine                             = new CurveInput("ReflectObjects.Line");
            reflectLine.Decomposed                  = true; // nur Einzelelemente, auch bei Polyline und Pfad
            reflectLine.MouseOverCurvesEvent       += new CurveInput.MouseOverCurvesDelegate(ReflectLine);
            reflectLine.CurveSelectionChangedEvent += new CurveInput.CurveSelectionChangedDelegate(ReflectLineChanged);

            PlaneInput reflectPlane = new PlaneInput("ReflectObjects.Plane");

            reflectPlane.SetPlaneEvent += new PlaneInput.SetPlaneDelegate(SetReflectPlane);
            //            reflectPlane.GetPlaneEvent += new PlaneInput.GetPlaneDelegate(GetReflectPlane);
            reflectPlane.Optional = true;

            BooleanInput copy = new BooleanInput("Modify.CopyObjects", "YesNo.Values");

            copy.DefaultBoolean   = ConstrDefaults.DefaultCopyObjects;
            copy.SetBooleanEvent += new CADability.Actions.ConstructAction.BooleanInput.SetBooleanDelegate(SetCopy);


            base.SetInput(reflectPoint, reflectLine, reflectPlane, copy);
            BoundingCube result = BoundingCube.EmptyBoundingCube;

            foreach (IGeoObject go in originals)
            {
                result.MinMax(go.GetBoundingCube());
            }
            GeoPoint blockCenter = result.GetCenter();

            block.RefPoint    = blockCenter;
            base.BasePoint    = blockCenter;
            reflectModOp      = ModOp.ReflectPlane(new Plane(base.BasePoint, base.ActiveDrawingPlane.Normal, base.ActiveDrawingPlane.DirectionY));
            reflectModOpStart = reflectModOp;
            block.Modify(reflectModOp);
            base.OnSetAction();
        }