public override IPropertyEntry GetPropertyEntry(IFrame frame) { List <IPropertyEntry> se = new List <IPropertyEntry>(); GeoPointProperty location = new GeoPointProperty(frame, "PlanarSurface.Location"); location.ReadOnly = true; location.OnGetValue = new EditableProperty <GeoPoint> .GetValueDelegate(delegate() { return(fromUnitPlane *GeoPoint.Origin); }); se.Add(location); GeoVectorProperty dirx = new GeoVectorProperty(frame, "PlanarSurface.DirectionX"); dirx.ReadOnly = true; dirx.IsAngle = false; dirx.OnGetValue = new EditableProperty <GeoVector> .GetValueDelegate(delegate() { return(fromUnitPlane *GeoVector.XAxis); }); se.Add(dirx); GeoVectorProperty diry = new GeoVectorProperty(frame, "PlanarSurface.DirectionY"); diry.ReadOnly = true; diry.IsAngle = false; diry.OnGetValue = new EditableProperty <GeoVector> .GetValueDelegate(delegate() { return(fromUnitPlane *GeoVector.YAxis); }); se.Add(diry); return(new GroupProperty("PlanarSurface", se.ToArray())); }
public override IPropertyEntry GetPropertyEntry(IFrame frame) { List <IPropertyEntry> se = new List <IPropertyEntry>(); GeoPointProperty location = new GeoPointProperty("ConicalSurface.Location", frame, false); location.ReadOnly = true; location.GetGeoPointEvent += delegate(GeoPointProperty sender) { return(this.location); }; se.Add(location); GeoVectorProperty dirx = new GeoVectorProperty("ConicalSurface.DirectionX", frame, false); dirx.ReadOnly = true; dirx.IsAngle = false; dirx.GetGeoVectorEvent += delegate(GeoVectorProperty sender) { return(xAxis); }; se.Add(dirx); GeoVectorProperty diry = new GeoVectorProperty("ConicalSurface.DirectionY", frame, false); diry.ReadOnly = true; diry.IsAngle = false; diry.GetGeoVectorEvent += delegate(GeoVectorProperty sender) { return(yAxis); }; se.Add(diry); AngleProperty openingAngle = new AngleProperty("ConicalSurface.OpeningAngle", frame, false); openingAngle.ReadOnly = true; openingAngle.GetAngleEvent += delegate() { return(OpeningAngle); }; se.Add(openingAngle); return(new GroupProperty("ConicalSurface", se.ToArray())); }
public GeneralGeoPointAction(GeoPointProperty GeoPointProperty, IGeoObject ignoreSnap) : this(GeoPointProperty) { if (ignoreSnap != null) { base.IgnoreForSnap = new GeoObjectList(ignoreSnap); } }
public ConstructIntersectPoint(GeoPointProperty geoPointProperty) { this.geoPointProperty = geoPointProperty; if (geoPointProperty != null) { cancelPoint = geoPointProperty.GetGeoPoint(); } measure = (geoPointProperty == null); succeeded = false; }
public ConstructVectorPoint(GeoPointProperty geoPointProperty) { this.geoPointProperty = geoPointProperty; if (geoPointProperty != null) { currentPoint = geoPointProperty.GetGeoPoint(); } measure = (geoPointProperty == null); succeeded = false; }
public ConstructMidPoint(GeoPointProperty geoPointProperty) { this.geoPointProperty = geoPointProperty; if (geoPointProperty != null) { originalPoint = firstPoint = geoPointProperty.GetGeoPoint(); } secondPoint = firstPoint; firstPointIsValid = false; secondPointIsValid = false; measure = (geoPointProperty == null); succeeded = false; }
/// <summary> /// Overrides <see cref="IShowPropertyImpl.Added"/> /// </summary> /// <param name="propertyTreeView"></param> public override void Added(IPropertyPage propertyTreeView) { base.Added(propertyTreeView); if (positionProp == null) { positionProp = new GeoPointProperty("BlockRef.Position", frame, true); } positionProp.GetGeoPointEvent += new GeoPointProperty.GetGeoPointDelegate(OnGetLocation); positionProp.SetGeoPointEvent += new GeoPointProperty.SetGeoPointDelegate(OnSetLocation); positionProp.ModifyWithMouseEvent += new ModifyWithMouseDelegate(OnPositionModifyWithMouse); blockRef.UserData.UserDataAddedEvent += new UserData.UserDataAddedDelegate(OnUserDataAdded); blockRef.UserData.UserDataRemovedEvent += new UserData.UserDataRemovedDelegate(OnUserDataAdded); }
public override IPropertyEntry GetPropertyEntry(IFrame frame) { List <IPropertyEntry> se = new List <IPropertyEntry>(); GeoPointProperty centerprop = new GeoPointProperty(frame, "SphericalSurface.Center"); centerprop.ReadOnly = true; centerprop.OnGetValue = new EditableProperty <GeoPoint> .GetValueDelegate(delegate() { return(center); }); se.Add(centerprop); DoubleProperty radius = new DoubleProperty(frame, "SphericalSurface.Radius"); radius.ReadOnly = true; radius.OnGetValue = new EditableProperty <double> .GetValueDelegate(delegate() { return(xAxis.Length); }); radius.Refresh(); se.Add(radius); return(new GroupProperty("SphericalSurface", se.ToArray())); }
private GeoVectorHotSpot dirWidthHotSpot, dirHeightHotSpot; // Hotspot für Richtung public ShowPropertyPicture(Picture picture, IFrame Frame) : base(Frame) { this.picture = picture; attributeProperties = picture.GetAttributeProperties(Frame); base.resourceId = "Picture.Object"; location = new GeoPointProperty("Picture.Location", Frame, true); location.GetGeoPointEvent += new CADability.UserInterface.GeoPointProperty.GetGeoPointDelegate(OnGetRefPoint); location.SetGeoPointEvent += new CADability.UserInterface.GeoPointProperty.SetGeoPointDelegate(OnSetRefPoint); location.ModifyWithMouseEvent += new ModifyWithMouseDelegate(OnModifyLocationWithMouse); width = new LengthProperty("Picture.Width", Frame, true); width.GetLengthEvent += new LengthProperty.GetLengthDelegate(OnGetWidth); width.SetLengthEvent += new LengthProperty.SetLengthDelegate(OnSetWidth); height = new LengthProperty("Picture.Height", Frame, true); height.GetLengthEvent += new LengthProperty.GetLengthDelegate(OnGetHeight); height.SetLengthEvent += new LengthProperty.SetLengthDelegate(OnSetHeight); dirWidth = new GeoVectorProperty("Picture.DirWidth", Frame, true); dirWidth.GetGeoVectorEvent += new GeoVectorProperty.GetGeoVectorDelegate(OnGetDirWidth); dirWidth.SetGeoVectorEvent += new GeoVectorProperty.SetGeoVectorDelegate(OnSetDirWidth); dirWidth.ModifyWithMouseEvent += new ModifyWithMouseDelegate(OnModifyDirWidthWithMouse); dirHeight = new GeoVectorProperty("Picture.DirHeight", Frame, true); dirHeight.GetGeoVectorEvent += new GeoVectorProperty.GetGeoVectorDelegate(OnGetDirHeight); dirHeight.SetGeoVectorEvent += new GeoVectorProperty.SetGeoVectorDelegate(OnSetDirHeight); dirHeight.ModifyWithMouseEvent += new ModifyWithMouseDelegate(OnModifyDirHeightWithMouse); path = new StringProperty(picture.Path, "Picture.Path"); path.GetStringEvent += new StringProperty.GetStringDelegate(OnGetPath); path.SetStringEvent += new StringProperty.SetStringDelegate(OnSetPath); path.SetContextMenu("MenuId.Picture.Path", this); keepAspectRatio = new BooleanProperty("Picture.KeepAspectRatio", "YesNo.Values"); double p = picture.DirectionWidth.Length / picture.Bitmap.Width * picture.Bitmap.Height / picture.DirectionHeight.Length; keepAspectRatio.BooleanValue = Math.Abs(1.0 - p) < 1e-6; keepAspectRatio.BooleanChangedEvent += new BooleanChangedDelegate(OnKeepAspectRatioChanged); rectangular = new BooleanProperty("Picture.Rectangular", "YesNo.Values"); rectangular.BooleanValue = Precision.IsPerpendicular(picture.DirectionWidth, picture.DirectionHeight, false); rectangular.BooleanChangedEvent += new BooleanChangedDelegate(OnRectangularChanged); dirWidthHotSpot = new GeoVectorHotSpot(dirWidth); dirWidthHotSpot.Position = picture.Location + picture.DirectionWidth; dirHeightHotSpot = new GeoVectorHotSpot(dirHeight); dirHeightHotSpot.Position = picture.Location + picture.DirectionHeight; }
private void OnSetRefPoint(GeoPointProperty sender, GeoPoint p) { unscaledGeoObject.Location = p; }
private GeoPoint OnGetRefPoint(GeoPointProperty sender) { return(unscaledGeoObject.Location); }
private void OnSetLocation(GeoPointProperty sender, GeoPoint p) { blockRef.RefPoint = p; }
public GeneralGeoPointAction(GeoPointProperty GeoPointProperty) { this.GeoPointProperty = GeoPointProperty; basePoint = GeoPointProperty.GetGeoPoint(); }
public void Visit(GeoPointProperty mapping) { Increment("geo_point"); }
private void OnSetRefPoint(GeoPointProperty sender, GeoPoint p) { picture.Location = p; }
private GeoPoint OnGetLocation(GeoPointProperty sender) { return(blockRef.RefPoint); }
public virtual void Visit(GeoPointProperty mapping) { }
private void OnSetGeoPoint(GeoPointProperty sender, GeoPoint p) { string name = sender.UserData.GetData("Name") as string; namedValues[name] = p; }
private GeoPoint OnGetGeoPoint(GeoPointProperty sender) { string name = sender.UserData.GetData("Name") as string; return (GeoPoint)namedValues[name]; }
private void OnSetRefPoint(GeoPointProperty sender, GeoPoint p) { icon.Location = p; }
public virtual void Visit(GeoPointProperty property) { }
private GeoPoint OnGetRefPoint(GeoPointProperty sender) { return(picture.Location); }