public override void OnSetAction() { base.ActiveObject = null; // line = new Line(); base.TitleId = "ToolsCutOffMultiple"; iCurve1 = null; iCurve2 = null; cutOffLen = ConstrDefaults.DefaultCutOffLength; cutOffAng = ConstrDefaults.DefaultCutOffAngle; methodSelect = ConstrDefaults.DefaultCutOffMethod; cutOffObject = new CurveInput("ToolsCutOff.Object"); cutOffObject.MouseOverCurvesEvent += new CurveInput.MouseOverCurvesDelegate(CutOffObject); cutOffObject.CurveSelectionChangedEvent += new CurveInput.CurveSelectionChangedDelegate(CutOffObjectChanged); cutOffObject.HitCursor = CursorTable.GetCursor("CutOff.cur"); cutOffObject.ModifiableOnly = true; cutOffLength = new LengthInput("ToolsCutOff.Length"); // cutOffLength.Optional = true; cutOffLength.ForwardMouseInputTo = cutOffObject; cutOffLength.DefaultLength = ConstrDefaults.DefaultCutOffLength; cutOffLength.SetLengthEvent += new CADability.Actions.ConstructAction.LengthInput.SetLengthDelegate(CutOffLength); cutOffAngle = new AngleInput("ToolsCutOff.Angle"); cutOffAngle.DefaultAngle = ConstrDefaults.DefaultCutOffAngle; // cutOffAngle.Optional = true; cutOffAngle.ForwardMouseInputTo = cutOffObject; cutOffAngle.SetAngleEvent += new CADability.Actions.ConstructAction.AngleInput.SetAngleDelegate(cutOffSetAngle); cutOffMethod = new MultipleChoiceInput("ToolsCutOff.Method", "ToolsCutOff.Method.Values"); cutOffMethod.DefaultChoice = ConstrDefaults.DefaultCutOffMethod; cutOffMethod.ForwardMouseInputTo = cutOffObject; cutOffMethod.SetChoiceEvent += new CADability.Actions.ConstructAction.MultipleChoiceInput.SetChoiceDelegate(SetMethod); base.SetInput(cutOffObject, cutOffLength, cutOffAngle, cutOffMethod); base.ShowActiveObject = false; base.OnSetAction(); }
public override void OnSetAction() { base.TitleId = "Construct.DirectionOfSurface"; dirOffsetSelect = ConstrDefaults.DefaultDirectionOffset; GeoPointInput facePoint = new GeoPointInput("Construct.DirectionOfSurface.Object"); facePoint.SetGeoPointExEvent += new GeoPointInput.SetGeoPointExDelegate(SetFacePoint); MultipleChoiceInput dirOffset = new MultipleChoiceInput("Construct.DirectionOfSurface.DirOffset", "Construct.DirectionOfSurface.DirOffset.Values"); dirOffset.DefaultChoice = ConstrDefaults.DefaultDirectionOffset; dirOffset.SetChoiceEvent += new CADability.Actions.ConstructAction.MultipleChoiceInput.SetChoiceDelegate(SetDirOffset); GeoVectorInput measureText = new GeoVectorInput("MeasureDirection"); measureText.CalculateGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.CalculateGeoVectorDelegate(CalculateMeasureText); measureText.GetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.GetGeoVectorDelegate(GetMeasureText); measureText.IsAngle = true; if (measure) { base.SetInput(facePoint, dirOffset, measureText); } else { base.SetInput(facePoint, dirOffset); } base.OnSetAction(); snapModeSav = base.Frame.SnapMode; base.Frame.SnapMode = SnapPointFinder.SnapModes.SnapToFaceSurface; }
public override void OnSetAction() { base.TitleId = "Constr.Parametrics.DistanceTo"; FeedBack.AddSelected(frontSide); FeedBack.AddSelected(backSide); base.ActiveObject = shell.Clone(); if (shell.Layer != null) { shell.Layer.Transparency = 128; } distanceInput = new LengthInput("DistanceTo.Distance"); distanceInput.GetLengthEvent += DistanceInput_GetLengthEvent; distanceInput.SetLengthEvent += DistanceInput_SetLengthEvent; modeInput = new MultipleChoiceInput("DistanceTo.Mode", "DistanceTo.Mode.Values", 0); modeInput.SetChoiceEvent += ModeInput_SetChoiceEvent; //modeInput.GetChoiceEvent += ModeInput_GetChoiceEvent; SetInput(distanceInput, modeInput); base.OnSetAction(); FeedBack.SelectOutline = false; validResult = false; }
public override void OnSetAction() { base.ActiveObject = Face.Construct(); base.TitleId = "Constr.Solid.RuledSolid"; geoObjectInput1 = null; geoObjectInput1 = new GeoObjectInput("Constr.Solid.RuledSolid.Path1"); geoObjectInput1.MouseOverGeoObjectsEvent += new GeoObjectInput.MouseOverGeoObjectsDelegate(geoObjectInputPath1); geoObjectInput1.GeoObjectSelectionChangedEvent += new GeoObjectInput.GeoObjectSelectionChangedDelegate(geoObjectInputPath1Changed); if (selectedMode == 1) { geoObjectInput1.Fixed = true; } geoObjectInput2 = new GeoObjectInput("Constr.Solid.RuledSolid.Path2"); geoObjectInput2.MouseOverGeoObjectsEvent += new GeoObjectInput.MouseOverGeoObjectsDelegate(geoObjectInputPath2); geoObjectInput2.GeoObjectSelectionChangedEvent += new GeoObjectInput.GeoObjectSelectionChangedDelegate(geoObjectInputPath2Changed); MultipleChoiceInput insertMode = new MultipleChoiceInput("Constr.Solid.SolidInsertMode", "Constr.Solid.SolidInsertMode.Values"); insertMode.GetChoiceEvent += new MultipleChoiceInput.GetChoiceDelegate(GetInsertMode); insertMode.SetChoiceEvent += new CADability.Actions.ConstructAction.MultipleChoiceInput.SetChoiceDelegate(SetInsertMode); base.SetInput(geoObjectInput1, geoObjectInput2, insertMode); base.ShowAttributes = true; base.OnSetAction(); }
public override void OnSetAction() { base.TitleId = "Constr.Parametrics.DistanceTo"; if (offsetFeedBack != null) { FeedBack.AddSelected(offsetFeedBack); } if (forwardFaces != null) { FeedBack.AddSelected(forwardFaces); } base.ActiveObject = shell.Clone(); if (shell.Layer != null) { shell.Layer.Transparency = 128; } List <InputObject> actionInputs = new List <InputObject>(); distance = point1 | point2; distanceInput = new LengthInput("DistanceTo.Distance"); distanceInput.GetLengthEvent += DistanceInput_GetLengthEvent; distanceInput.SetLengthEvent += DistanceInput_SetLengthEvent; actionInputs.Add(distanceInput); forwardFacesInput = new GeoObjectInput("DistanceTo.MoreForwardObjects"); forwardFacesInput.MultipleInput = true; forwardFacesInput.FacesOnly = true; forwardFacesInput.Optional = true; forwardFacesInput.MouseOverGeoObjectsEvent += new GeoObjectInput.MouseOverGeoObjectsDelegate(OnMouseOverForwardFaces); actionInputs.Add(forwardFacesInput); backwardFacesInput = new GeoObjectInput("DistanceTo.MoreBackwardObjects"); backwardFacesInput.MultipleInput = true; backwardFacesInput.FacesOnly = true; backwardFacesInput.Optional = true; backwardFacesInput.MouseOverGeoObjectsEvent += new GeoObjectInput.MouseOverGeoObjectsDelegate(OnMouseOverBackwardFaces); actionInputs.Add(backwardFacesInput); modeInput = new MultipleChoiceInput("DistanceTo.Mode", "DistanceTo.Mode.Values", 0); modeInput.SetChoiceEvent += ModeInput_SetChoiceEvent; actionInputs.Add(modeInput); //modeInput.GetChoiceEvent += ModeInput_GetChoiceEvent; SeparatorInput separator = new SeparatorInput("DistanceTo.AssociateParametric"); actionInputs.Add(separator); nameInput = new StringInput("DistanceTo.ParametricsName"); nameInput.SetStringEvent += NameInput_SetStringEvent; nameInput.GetStringEvent += NameInput_GetStringEvent; nameInput.Optional = true; actionInputs.Add(nameInput); SetInput(actionInputs.ToArray()); base.OnSetAction(); FeedBack.SelectOutline = false; validResult = false; }
public override void OnSetAction() { base.ActiveObject = Face.Construct(); handed = true; if (axisVector.IsNullVector()) { axisVector = GeoVector.XAxis; } if (angleRotation == 0.0) { angleRotation = Math.PI; } base.TitleId = "Constr.Face.ScrewPath"; pathInput = new CurveInput("Constr.Face.ScrewPath.Path"); //curveInput.MouseOverCurvesEvent += new CurveInput.MouseOverCurvesDelegate(curveInputPath); //curveInput.CurveSelectionChangedEvent += new CurveInput.CurveSelectionChangedDelegate(curveInputPathChanged); if (path != null || shape != null) { pathInput.Fixed = true; } rotateLineInput = new CurveInput("Constr.Face.ScrewPath.AxisLine"); rotateLineInput.Decomposed = true; // nur Einzelelemente, auch bei Polyline und Pfad rotateLineInput.MouseOverCurvesEvent += new CurveInput.MouseOverCurvesDelegate(mouseOverAxis); //rotateLineInput.CurveSelectionChangedEvent += new CurveInput.CurveSelectionChangedDelegate(RotateLineChanged); orientation = new MultipleChoiceInput("Constr.Face.ScrewPath.Orientation", "Constr.Face.ScrewPath.Orientation.Values", 0); orientation.SetChoiceEvent += Orientation_SetChoiceEvent; orientation.GetChoiceEvent += Orientation_GetChoiceEvent; numTurns = new DoubleInput("Constr.Face.ScrewPath.NumTurns", 2.5); turns = 2.5; numTurns.GetDoubleEvent += NumTurns_GetDoubleEvent; numTurns.SetDoubleEvent += NumTurns_SetDoubleEvent; base.SetInput(pathInput, rotateLineInput, orientation, numTurns); // , axisPointInput, axisVectorInput); base.ShowAttributes = true; base.OnSetAction(); }
public override void OnSetAction() { // The title appears in the control center base.TitleId = "Constr.SplitCurve"; CurveInput curveInput = null; if (theCurve == null) { curveInput = new CurveInput("Constr.SplitCurve.Curve"); curveInput.MouseOverCurvesEvent += new CurveInput.MouseOverCurvesDelegate(OnMouseOverCurves); } IntInput numberInput = new IntInput("Constr.SplitCurve.Count"); numberInput.SetIntEvent += new IntInput.SetIntDelegate(OnSetNumber); numberInput.SetMinMax(2, 100, false); numberInput.GetIntEvent += new IntInput.GetIntDelegate(OnGetNumber); MultipleChoiceInput modeInput = new MultipleChoiceInput("Constr.SplitCurve.Mode", "Constr.SplitCurve.Mode.Values"); // |prozentual|Längen modeInput.SetChoiceEvent += new MultipleChoiceInput.SetChoiceDelegate(OnSetMode); distances = new InputContainer("Constr.SplitCurve.Distances"); RefreshDistances(); if (theCurve == null) { base.SetInput(curveInput, numberInput, modeInput, distances); } else { base.SetInput(numberInput, modeInput, distances); } base.OnSetAction(); Recalc(); }
/// <summary> /// Overrides <see cref="CADability.Actions.ConstructAction.OnSetAction ()"/> /// </summary> public override void OnSetAction() { base.TitleId = "Construct.DirectionOfCurve"; dirPointSelect = ConstrDefaults.DefaultDirectionPoint; dirOffsetSelect = ConstrDefaults.DefaultDirectionOffset; curveInput = new CurveInput("Construct.DirectionOfCurve.Object"); curveInput.Decomposed = true; // nur Einzelelemente, auch bei Polyline und Pfad curveInput.MouseOverCurvesEvent += new CADability.Actions.ConstructAction.CurveInput.MouseOverCurvesDelegate(DirCurve); curveInput.CurveSelectionChangedEvent += new CADability.Actions.ConstructAction.CurveInput.CurveSelectionChangedDelegate(DirCurveChanged); MultipleChoiceInput dirPoint = new MultipleChoiceInput("Construct.DirectionOfCurve.DirPoint", "Construct.DirectionOfCurve.DirPoint.Values"); dirPoint.DefaultChoice = ConstrDefaults.DefaultDirectionPoint; dirPoint.SetChoiceEvent += new CADability.Actions.ConstructAction.MultipleChoiceInput.SetChoiceDelegate(SetDirPoint); MultipleChoiceInput dirOffset = new MultipleChoiceInput("Construct.DirectionOfCurve.DirOffset", "Construct.DirectionOfCurve.DirOffset.Values"); dirOffset.DefaultChoice = ConstrDefaults.DefaultDirectionOffset; dirOffset.SetChoiceEvent += new CADability.Actions.ConstructAction.MultipleChoiceInput.SetChoiceDelegate(SetDirOffset); GeoVectorInput measureText = new GeoVectorInput("MeasureDirection"); measureText.CalculateGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.CalculateGeoVectorDelegate(CalculateMeasureText); measureText.GetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.GetGeoVectorDelegate(GetMeasureText); measureText.IsAngle = true; if (measure) { base.SetInput(curveInput, dirPoint, dirOffset, measureText); } else { base.SetInput(curveInput, dirPoint, dirOffset); } base.OnSetAction(); }
public override void OnSetAction() { dim = Dimension.Construct(); switch (dimDir) { case DimDirection.Horizontal: idString = "Constr.Dimension.Horizontal"; dim.DimLineDirection = base.ActiveDrawingPlane.DirectionX; break; case DimDirection.Vertical: idString = "Constr.Dimension.Vertical"; dim.DimLineDirection = base.ActiveDrawingPlane.DirectionY; break; case DimDirection.Sloping: idString = "Constr.Dimension.Sloping"; dim.DimLineDirection = base.ActiveDrawingPlane.DirectionX; break; } dim.DimLineRef = ConstrDefaults.DefaultDimPoint; dim.Normal = base.ActiveDrawingPlane.Normal; methodSelect = ConstrDefaults.DefaultDimensionMethod; if (methodSelect == 2) // Kordinatenbem. bezgl eines Punktes { dim.DimType = Dimension.EDimType.DimCoord; } else { dim.DimType = Dimension.EDimType.DimPoints; } base.ActiveObject = dim; base.TitleId = idString; mi = new MultiPointInput(this); mi.ResourceId = "Constr.Dimension.Point"; dimLocationInput = new GeoPointInput("Constr.Dimension.Location"); dimLocationInput.DefaultGeoPoint = ConstrDefaults.DefaultDimPoint; dimLocationInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(SetDimLocation); dimLocationInput.GetGeoPointEvent += new ConstructAction.GeoPointInput.GetGeoPointDelegate(GetDimLocation); dimDirInput = new GeoVectorInput("Constr.Dimension.Direction"); dimDirInput.Optional = true; dimDirInput.SetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.SetGeoVectorDelegate(DimDirectionInput); dimDirInput.IsAngle = true; dimMethod = new MultipleChoiceInput("Constr.Dimension.Points.Method", "Constr.Dimension.Points.Method.Values"); dimMethod.Optional = true; dimMethod.DefaultChoice = ConstrDefaults.DefaultDimensionMethod; dimMethod.SetChoiceEvent += new CADability.Actions.ConstructAction.MultipleChoiceInput.SetChoiceDelegate(SetMethod); if (dimDir == DimDirection.Sloping) { base.SetInput(mi, dimLocationInput, dimDirInput, dimMethod); } else { base.SetInput(mi, dimLocationInput, dimMethod); } base.ShowAttributes = true; base.OnSetAction(); }
// Start is called before the first frame update void Start() { target = GetComponent <MultipleChoiceInput>(); }
public override void OnSetAction() { // base.ActiveObject = block; base.TitleId = "RotateObjects"; copyObject = ConstrDefaults.DefaultCopyObjects; axisVector = base.ActiveDrawingPlane.Normal; feedBackEllipse = Ellipse.Construct(); feedBackEllipse.SetEllipseCenterAxis(GeoPoint.Origin, GeoVector.XAxis, GeoVector.YAxis); // damit nicht alles 0 Color backColor = base.Frame.GetColorSetting("Colors.Feedback", Color.DarkGray); feedBackEllipse.ColorDef = new ColorDef("", backColor); base.FeedBack.Add(feedBackEllipse); base.SetCursor(SnapPointFinder.DidSnapModes.DidNotSnap, "RotateSmall"); //--> diese Inputs werden gebraucht GeoPointInput refPointInput = new GeoPointInput("Objects.RefPoint"); refPointInput.Optional = true; refPointInput.SetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.SetGeoPointDelegate(SetRefPoint); refPointInput.GetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.GetGeoPointDelegate(GetRefPoint); refPointInput.DefinesHotSpot = true; refPointInput.HotSpotSource = "Hotspots.png:0"; rotAngleInput = new AngleInput("RotateObjects.Angle"); rotAngleInput.SetAngleEvent += new CADability.Actions.ConstructAction.AngleInput.SetAngleDelegate(OnSetRotationAngle); rotAngleInput.GetAngleEvent += new CADability.Actions.ConstructAction.AngleInput.GetAngleDelegate(OnGetRotationAngle); rotAngleInput.CalculateAngleEvent += new CADability.Actions.ConstructAction.AngleInput.CalculateAngleDelegate(OnCalculateRotationAngle); rotAngleInput.MouseClickEvent += new MouseClickDelegate(OnMouseClickRotationAngle); startPointInput = new GeoPointInput("Objects.StartPoint"); startPointInput.Optional = true; startPointInput.SetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.SetGeoPointDelegate(OnSetStartPoint); startPointInput.GetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.GetGeoPointDelegate(OnGetStartPoint); endPointInput = new GeoPointInput("Objects.EndPoint"); endPointInput.Optional = true; endPointInput.SetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.SetGeoPointDelegate(OnSetEndPoint); endPointInput.GetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.GetGeoPointDelegate(OnGetEndPoint); rotateLineInput = new CurveInput("Constr.Rotate.AxisLine"); rotateLineInput.Decomposed = true; // nur Einzelelemente, auch bei Polyline und Pfad rotateLineInput.MouseOverCurvesEvent += new CurveInput.MouseOverCurvesDelegate(RotateLine); rotateLineInput.CurveSelectionChangedEvent += new CurveInput.CurveSelectionChangedDelegate(RotateLineChanged); rotateLineInput.Optional = true; srcPlane = new PlaneInput("Constr.Rotate.SourcePlane"); srcPlane.SetPlaneEvent += SrcPlane_OnSetPlane; srcPlane.GetPlaneEvent += SrcPlane_OnGetPlane; srcPlane.Optional = true; trgPlane = new PlaneInput("Constr.Rotate.TargetPlane"); trgPlane.SetPlaneEvent += TrgPlane_OnSetPlane; trgPlane.GetPlaneEvent += TrgPlane_OnGetPlane; trgPlane.Optional = true; offset = new MultipleChoiceInput("Constr.Rotate.Offset", "Constr.Rotate.Offset.Values"); offset.Optional = true; offsetVal = 0; offset.GetChoiceEvent += OnGetOffset; offset.SetChoiceEvent += OnSetOffset; BooleanInput copy = new BooleanInput("Modify.CopyObjects", "YesNo.Values"); copy.DefaultBoolean = ConstrDefaults.DefaultCopyObjects; copy.SetBooleanEvent += new CADability.Actions.ConstructAction.BooleanInput.SetBooleanDelegate(SetCopy); base.SetInput(refPointInput, rotAngleInput, startPointInput, endPointInput, rotateLineInput, srcPlane, trgPlane, offset, copy); BoundingCube result = BoundingCube.EmptyBoundingCube; foreach (IGeoObject go in originals) { result.MinMax(go.GetBoundingCube()); } GeoPoint blockCenter = result.GetCenter(); block.RefPoint = blockCenter; refPoint = blockCenter; base.BasePoint = blockCenter; // für die Winkelberechnung base.OnSetAction(); rotateLineInput.SetContextMenu("MenuId.Axis", this); // kann man erst hier machen, zuvor gibts die Property noch nicht }
public override void OnSetAction() { base.ActiveObject = Face.Construct(); if (axisVector.IsNullVector()) { axisVector = GeoVector.YAxis; } if (angleRotation == 0.0) { angleRotation = Math.PI; } base.TitleId = "Constr.Solid.FaceRotate"; geoObjectInput = new GeoObjectInput("Constr.Solid.FaceRotate.Path"); geoObjectInput.MouseOverGeoObjectsEvent += new GeoObjectInput.MouseOverGeoObjectsDelegate(geoObjectInputFace); geoObjectInput.GeoObjectSelectionChangedEvent += new GeoObjectInput.GeoObjectSelectionChangedDelegate(geoObjectInputFaceChanged); if (selectedMode) { geoObjectInput.Fixed = true; } innerPointInput = new GeoPointInput("Constr.Solid.FaceRotate.InnerPoint"); innerPointInput.SetGeoPointEvent += new GeoPointInput.SetGeoPointDelegate(SetInnerPointInput); innerPointInput.MouseClickEvent += new MouseClickDelegate(innerPointInputMouseClickEvent); innerPointInput.Optional = true; rotateLineInput = new CurveInput("Constr.Face.PathRotate.AxisLine"); rotateLineInput.Decomposed = true; // nur Einzelelemente, auch bei Polyline und Pfad rotateLineInput.MouseOverCurvesEvent += new CurveInput.MouseOverCurvesDelegate(RotateAxis); rotateLineInput.CurveSelectionChangedEvent += new CurveInput.CurveSelectionChangedDelegate(RotateAxisChanged); axisPointInput = new GeoPointInput("Constr.Face.PathRotate.AxisPoint", axisPoint); axisPointInput.SetGeoPointEvent += new GeoPointInput.SetGeoPointDelegate(SetAxisPoint); axisPointInput.GetGeoPointEvent += new GeoPointInput.GetGeoPointDelegate(GetAxisPoint); axisPointInput.ForwardMouseInputTo = geoObjectInput; axisPointInput.DefinesBasePoint = true; axisVectorInput = new GeoVectorInput("Constr.Face.PathRotate.AxisVector", axisVector); axisVectorInput.SetGeoVectorEvent += new GeoVectorInput.SetGeoVectorDelegate(SetAxisVector); axisVectorInput.GetGeoVectorEvent += new GeoVectorInput.GetGeoVectorDelegate(GetAxisVector); // vectorInput.DefaultGeoVector = ConstrDefaults.DefaultExtrudeDirection; axisVectorInput.ForwardMouseInputTo = geoObjectInput; updateOptional(); AngleInput angleInput = new AngleInput("Constr.Face.PathRotate.Angle", angleRotation); angleInput.SetAngleEvent += new AngleInput.SetAngleDelegate(SetAngleInput); angleInput.GetAngleEvent += new AngleInput.GetAngleDelegate(GetAngleInput); AngleInput angleOffsetInput = new AngleInput("Constr.Face.PathRotate.AngleOffset", angleOffsetRotation); angleOffsetInput.SetAngleEvent += new AngleInput.SetAngleDelegate(SetAngleOffsetInput); angleOffsetInput.GetAngleEvent += new AngleInput.GetAngleDelegate(GetAngleOffsetInput); angleOffsetInput.Optional = true; MultipleChoiceInput insertMode = new MultipleChoiceInput("Constr.Solid.SolidInsertMode", "Constr.Solid.SolidInsertMode.Values"); insertMode.GetChoiceEvent += new MultipleChoiceInput.GetChoiceDelegate(GetInsertMode); insertMode.SetChoiceEvent += new CADability.Actions.ConstructAction.MultipleChoiceInput.SetChoiceDelegate(SetInsertMode); base.SetInput(geoObjectInput, innerPointInput, rotateLineInput, axisPointInput, axisVectorInput, angleInput, angleOffsetInput, insertMode); base.ShowAttributes = true; base.ShowActiveObject = false; base.OnSetAction(); if (selectedMode) { rotateOrg(false); // zum Zeichnen und organisieren } }
/// <summary> /// Overrides <see cref="CADability.Actions.ConstructAction.OnSetAction ()"/> /// </summary> public override void OnSetAction() { base.ActiveObject = Face.Construct(); DefaultLength l = new DefaultLength(ConstructAction.DefaultLength.StartValue.ViewWidth8); if (vector.IsNullVector()) { vector = l * base.ActiveDrawingPlane.Normal; } if (height == 0.0) { height = l; } ; // if (!VectorOrHeight) if (extrudeMode < 2) { vector = height * base.ActiveDrawingPlane.Normal; } base.TitleId = "Constr.Solid.FaceExtrude"; geoObjectInput = new GeoObjectInput("Constr.Solid.FaceExtrude.Path"); geoObjectInput.MouseOverGeoObjectsEvent += new GeoObjectInput.MouseOverGeoObjectsDelegate(geoObjectInputFace); geoObjectInput.GeoObjectSelectionChangedEvent += new GeoObjectInput.GeoObjectSelectionChangedDelegate(geoObjectInputFaceChanged); if (selectedMode) { geoObjectInput.Fixed = true; // schon fertig, da Werte reingekommen sind } //geoObjectInput.MultipleInput = true; //geoObjectInput.Optional = true; innerPointInput = new GeoPointInput("Constr.Solid.FaceExtrude.InnerPoint"); innerPointInput.SetGeoPointEvent += new GeoPointInput.SetGeoPointDelegate(SetInnerPointInput); innerPointInput.MouseClickEvent += new MouseClickDelegate(innerPointInputMouseClickEvent); innerPointInput.Optional = true; heightInput = new LengthInput("Constr.Face.PathExtrude.Height"); heightInput.SetLengthEvent += new LengthInput.SetLengthDelegate(SetHeight); heightInput.GetLengthEvent += new LengthInput.GetLengthDelegate(GetHeight); heightInput.CalculateLengthEvent += new LengthInput.CalculateLengthDelegate(CalculateHeight); heightInput.ForwardMouseInputTo = geoObjectInput; planeInput = new BooleanInput("Constr.Face.PathExtrude.Plane", "Constr.Face.PathExtrude.Plane.Values", planeMode); planeInput.SetBooleanEvent += new BooleanInput.SetBooleanDelegate(SetPlaneMode); vectorInput = new GeoVectorInput("Constr.Face.PathExtrude.Vector", vector); vectorInput.SetGeoVectorEvent += new GeoVectorInput.SetGeoVectorDelegate(SetVector); vectorInput.GetGeoVectorEvent += new GeoVectorInput.GetGeoVectorDelegate(GetVector); // vectorInput.DefaultGeoVector = ConstrDefaults.DefaultExtrudeDirection; vectorInput.ForwardMouseInputTo = geoObjectInput; heightOffsetInput = new LengthInput("Constr.Face.PathExtrude.HeightOffset"); heightOffsetInput.SetLengthEvent += new LengthInput.SetLengthDelegate(SetHeightOffset); heightOffsetInput.GetLengthEvent += new LengthInput.GetLengthDelegate(GetHeightOffset); heightOffsetInput.ForwardMouseInputTo = geoObjectInput; heightOffsetInput.Optional = true; vectorOffsetInput = new GeoVectorInput("Constr.Face.PathExtrude.VectorOffset", vectorOffset); vectorOffsetInput.SetGeoVectorEvent += new GeoVectorInput.SetGeoVectorDelegate(SetVectorOffset); vectorOffsetInput.GetGeoVectorEvent += new GeoVectorInput.GetGeoVectorDelegate(GetVectorOffset); vectorOffsetInput.ForwardMouseInputTo = geoObjectInput; vectorOffsetInput.Optional = true; pipeInput = new CurveInput("Constr.Face.PathExtrude.Pipe"); pipeInput.MouseOverCurvesEvent += new CurveInput.MouseOverCurvesDelegate(pipeInputCurves); pipeInput.CurveSelectionChangedEvent += new CurveInput.CurveSelectionChangedDelegate(pipeInputCurveChanged); optionalOrg(); MultipleChoiceInput insertMode = new MultipleChoiceInput("Constr.Solid.SolidInsertMode", "Constr.Solid.SolidInsertMode.Values"); insertMode.GetChoiceEvent += new MultipleChoiceInput.GetChoiceDelegate(GetInsertMode); insertMode.SetChoiceEvent += new CADability.Actions.ConstructAction.MultipleChoiceInput.SetChoiceDelegate(SetInsertMode); SeparatorInput separatorHeight = new SeparatorInput("Constr.Face.PathExtrude.SeparatorHeight"); SeparatorInput separatorVector = new SeparatorInput("Constr.Face.PathExtrude.SeparatorVector"); SeparatorInput separatorPipe = new SeparatorInput("Constr.Face.PathExtrude.SeparatorPipe"); SeparatorInput separatorInsert = new SeparatorInput("Constr.Face.PathExtrude.SeparatorInsert"); base.SetInput(geoObjectInput, innerPointInput, separatorHeight, heightInput, heightOffsetInput, planeInput, separatorVector, vectorInput, vectorOffsetInput, separatorPipe, pipeInput, separatorInsert, insertMode); base.ShowAttributes = true; base.ShowActiveObject = false; base.OnSetAction(); if (selectedMode) { extrudeOrg(); //schonmal berechnen und markieren! } }