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(); 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.Face.PathExtrude"; curveInput = new CurveInput("Constr.Face.PathExtrude.Path"); curveInput.MouseOverCurvesEvent += new CurveInput.MouseOverCurvesDelegate(curveInputPath); curveInput.CurveSelectionChangedEvent += new CurveInput.CurveSelectionChangedDelegate(curveInputPathChanged); if (selectedMode) { curveInput.Fixed = true; } heightInput = new LengthInput("Constr.Face.PathExtrude.Height"); heightInput.SetLengthEvent += new LengthInput.SetLengthDelegate(SetHeight); heightInput.GetLengthEvent += new LengthInput.GetLengthDelegate(GetHeight); heightInput.ForwardMouseInputTo = curveInput; if (selectedMode) { extrudeOrg(); //schonmal berechnen und markieren! } 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 = curveInput; heightOffsetInput = new LengthInput("Constr.Face.PathExtrude.HeightOffset"); heightOffsetInput.SetLengthEvent += new LengthInput.SetLengthDelegate(SetHeightOffset); heightOffsetInput.GetLengthEvent += new LengthInput.GetLengthDelegate(GetHeightOffset); heightOffsetInput.ForwardMouseInputTo = curveInput; 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 = curveInput; vectorOffsetInput.Optional = true; pipeInput = new CurveInput("Constr.Face.PathExtrude.Pipe"); pipeInput.MouseOverCurvesEvent += new CurveInput.MouseOverCurvesDelegate(pipeInputCurves); pipeInput.CurveSelectionChangedEvent += new CurveInput.CurveSelectionChangedDelegate(pipeInputCurveChanged); optionalOrg(); SeparatorInput separatorHeight = new SeparatorInput("Constr.Face.PathExtrude.SeparatorHeight"); SeparatorInput separatorVector = new SeparatorInput("Constr.Face.PathExtrude.SeparatorVector"); SeparatorInput separatorPipe = new SeparatorInput("Constr.Face.PathExtrude.SeparatorPipe"); // if (selectedMode) // base.SetInput( heightInput, heightOffsetInput, separatorVector, vectorInput, vectorOffsetInput, separatorPipe, pipeInput, planeInput); // else base.SetInput(curveInput,separatorHeight, heightInput, heightOffsetInput,separatorVector,vectorInput, vectorOffsetInput,separatorPipe,pipeInput, planeInput); base.SetInput(curveInput, separatorHeight, heightInput, heightOffsetInput, planeInput, separatorVector, vectorInput, vectorOffsetInput, separatorPipe, pipeInput); base.ShowAttributes = true; base.OnSetAction(); }
public override void OnSetAction() { box = Solid.Construct(); base.BasePoint = ConstrDefaults.DefaultStartPoint; boxLengthX = ConstrDefaults.DefaultRectWidth; boxLengthY = ConstrDefaults.DefaultRectHeight; boxLengthZ = ConstrDefaults.DefaultBoxHeight; boxDirX = boxLengthX * base.ActiveDrawingPlane.DirectionX; boxDirY = boxLengthY * base.ActiveDrawingPlane.DirectionY; boxDirZ = boxLengthZ * (base.ActiveDrawingPlane.DirectionX ^ base.ActiveDrawingPlane.DirectionY); box = Make3D.MakeBox(ConstrDefaults.DefaultStartPoint, boxDirX, boxDirY, boxDirZ); base.ActiveObject = box; base.TitleId = "Constr.Box"; GeoPointInput startPointInput = new GeoPointInput("Constr.Box.StartPoint"); startPointInput.DefaultGeoPoint = ConstrDefaults.DefaultStartPoint; startPointInput.DefinesBasePoint = true; startPointInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(StartPoint); length = new LengthInput("Constr.Box.Length"); length.DefaultLength = ConstrDefaults.DefaultRectWidth; length.SetLengthEvent += new ConstructAction.LengthInput.SetLengthDelegate(Length); length.GetLengthEvent += new LengthInput.GetLengthDelegate(GetLength); length.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(LengthCalculate); length.ForwardMouseInputTo = startPointInput; width = new LengthInput("Constr.Box.Width"); width.DefaultLength = ConstrDefaults.DefaultRectHeight; width.SetLengthEvent += new ConstructAction.LengthInput.SetLengthDelegate(Width); width.GetLengthEvent += new LengthInput.GetLengthDelegate(GetWidth); width.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(WidthCalculate); width.ForwardMouseInputTo = startPointInput; height = new LengthInput("Constr.Box.Height"); height.DefaultLength = ConstrDefaults.DefaultBoxHeight; height.SetLengthEvent += new ConstructAction.LengthInput.SetLengthDelegate(Height); height.GetLengthEvent += new LengthInput.GetLengthDelegate(GetHeight); height.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(HeightCalculate); height.ForwardMouseInputTo = startPointInput; xVectorInput = new GeoVectorInput("Constr.Box.X-Direction"); xVectorInput.SetGeoVectorEvent += new ConstructAction.GeoVectorInput.SetGeoVectorDelegate(XVector); xVectorInput.GetGeoVectorEvent += new GeoVectorInput.GetGeoVectorDelegate(GetXVector); xVectorInput.ForwardMouseInputTo = startPointInput; xVectorInput.Optional = true; yVectorInput = new GeoVectorInput("Constr.Box.Y-Direction"); yVectorInput.SetGeoVectorEvent += new ConstructAction.GeoVectorInput.SetGeoVectorDelegate(YVector); yVectorInput.GetGeoVectorEvent += new GeoVectorInput.GetGeoVectorDelegate(GetYVector); yVectorInput.ForwardMouseInputTo = startPointInput; yVectorInput.Optional = true; zVectorInput = new GeoVectorInput("Constr.Box.Z-Direction"); zVectorInput.SetGeoVectorEvent += new ConstructAction.GeoVectorInput.SetGeoVectorDelegate(ZVector); zVectorInput.GetGeoVectorEvent += new GeoVectorInput.GetGeoVectorDelegate(GetZVector); zVectorInput.ForwardMouseInputTo = startPointInput; zVectorInput.Optional = true; SeparatorInput separatorLengths = new SeparatorInput("Constr.Box.SeparatorLengths"); SeparatorInput separatorDirections = new SeparatorInput("Constr.Box.SeparatorDirections"); base.SetInput(startPointInput, separatorLengths, length, width, height, separatorDirections, xVectorInput, yVectorInput, zVectorInput); base.ShowAttributes = true; base.OnSetAction(); }
/// <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! } }