Exemplo n.º 1
0
        private void InitSubEntries()
        {
            subEntries = null; // damit nicht noch die alten verwendet werden
            if (polesProperty != null)
            {
                polesProperty.ModifyWithMouseEvent           -= new CADability.UserInterface.MultiGeoPointProperty.ModifyWithMouseIndexDelegate(OnModifyPolesWithMouse);
                polesProperty.GeoPointSelectionChangedEvent  -= new CADability.UserInterface.GeoPointProperty.SelectionChangedDelegate(OnPointsSelectionChanged);
                polesProperty.PropertyEntryChangedStateEvent -= new PropertyEntryChangedStateDelegate(OnPolesPropertyStateChanged);
            }
            polesProperty = new MultiGeoPointProperty(new PolesIndexedGeoPoint(this), "BSpline.Poles", this.Frame);
            polesProperty.ModifyWithMouseEvent           += new CADability.UserInterface.MultiGeoPointProperty.ModifyWithMouseIndexDelegate(OnModifyPolesWithMouse);
            polesProperty.GeoPointSelectionChangedEvent  += new CADability.UserInterface.GeoPointProperty.SelectionChangedDelegate(OnPointsSelectionChanged);
            polesProperty.PropertyEntryChangedStateEvent += new PropertyEntryChangedStateDelegate(OnPolesPropertyStateChanged);

            if (bSpline.ThroughPoints3dExist)
            {
                if (throughPointsProperty != null)
                {       // es nach einem Refresh wird er neu gemacht, der alte muss die Events hergeben
                    throughPointsProperty.ModifyWithMouseEvent           -= new CADability.UserInterface.MultiGeoPointProperty.ModifyWithMouseIndexDelegate(OnModifyThroughPointsWithMouse);
                    throughPointsProperty.GeoPointSelectionChangedEvent  -= new CADability.UserInterface.GeoPointProperty.SelectionChangedDelegate(OnPointsSelectionChanged);
                    throughPointsProperty.PropertyEntryChangedStateEvent -= new PropertyEntryChangedStateDelegate(OnThroughPointsPropertyStateChanged);
                }
                throughPointsProperty = new MultiGeoPointProperty(new ThroughPointsIndexedGeoPoint(this), "BSpline.ThroughPoints", this.Frame);
                throughPointsProperty.ModifyWithMouseEvent           += new CADability.UserInterface.MultiGeoPointProperty.ModifyWithMouseIndexDelegate(OnModifyThroughPointsWithMouse);
                throughPointsProperty.GeoPointSelectionChangedEvent  += new CADability.UserInterface.GeoPointProperty.SelectionChangedDelegate(OnPointsSelectionChanged);
                throughPointsProperty.PropertyEntryChangedStateEvent += new PropertyEntryChangedStateDelegate(OnThroughPointsPropertyStateChanged);
                throughPointsProperty.GetInsertionPointEvent         += new MultiGeoPointProperty.GetInsertionPointDelegate(OnThroughPointsGetInsertionPoint);
            }
            else
            {
                throughPointsProperty = null;
            }

            if (closedProperty != null)
            {
                closedProperty.GetBooleanEvent -= new CADability.UserInterface.BooleanProperty.GetBooleanDelegate(OnGetClosed);
                closedProperty.SetBooleanEvent -= new CADability.UserInterface.BooleanProperty.SetBooleanDelegate(OnSetClosed);
            }
            closedProperty = new BooleanProperty("Constr.BSpline.Mode", "Constr.BSpline.Mode.Values");
            closedProperty.GetBooleanEvent += new CADability.UserInterface.BooleanProperty.GetBooleanDelegate(OnGetClosed);
            closedProperty.SetBooleanEvent += new CADability.UserInterface.BooleanProperty.SetBooleanDelegate(OnSetClosed);
            closedProperty.BooleanValue     = bSpline.IsClosed;
            attributeProperties             = bSpline.GetAttributeProperties(Frame);
        }
Exemplo n.º 2
0
        private void Init()
        {
            // Initialisiert den gesammten Inhalt des TreeViews
            // danach sollte meist propertyPage.Refresh(this); aufgerufen werden
            subProperties = null;

            if (dimension.DimType == Dimension.EDimType.DimPoints || dimension.DimType == Dimension.EDimType.DimCoord)
            {
                points = new MultiGeoPointProperty(this, "Dimension.Points", this.Frame);
                points.ModifyWithMouseEvent           += new CADability.UserInterface.MultiGeoPointProperty.ModifyWithMouseIndexDelegate(OnModifyPointWithMouse);
                points.PropertyEntryChangedStateEvent += new PropertyEntryChangedStateDelegate(OnPointsStateChanged);
                points.GeoPointSelectionChangedEvent  += new CADability.UserInterface.GeoPointProperty.SelectionChangedDelegate(OnPointsSelectionChanged);
                direction = new GeoVectorProperty("Dimension.Direction", Frame, true);
                direction.GetGeoVectorEvent += new CADability.UserInterface.GeoVectorProperty.GetGeoVectorDelegate(OnGetDirection);
                direction.SetGeoVectorEvent += new CADability.UserInterface.GeoVectorProperty.SetGeoVectorDelegate(OnSetDirection);
            }
            if (dimension.DimType == Dimension.EDimType.DimRadius)
            {
                radiusProperty = new DoubleProperty("Dimension.Radius", Frame);
                radiusProperty.SetDoubleEvent       += new CADability.UserInterface.DoubleProperty.SetDoubleDelegate(OnSetRadius);
                radiusProperty.GetDoubleEvent       += new CADability.UserInterface.DoubleProperty.GetDoubleDelegate(OnGetRadius);
                radiusProperty.ModifyWithMouseEvent += new ModifyWithMouseDelegate(ModifyRadiusWithMouse);
                radiusProperty.DoubleChanged();
            }
            if (dimension.DimType == Dimension.EDimType.DimDiameter)
            {
                radiusProperty = new DoubleProperty("Dimension.Diameter", Frame);
                radiusProperty.SetDoubleEvent       += new CADability.UserInterface.DoubleProperty.SetDoubleDelegate(OnSetRadius);
                radiusProperty.GetDoubleEvent       += new CADability.UserInterface.DoubleProperty.GetDoubleDelegate(OnGetRadius);
                radiusProperty.ModifyWithMouseEvent += new ModifyWithMouseDelegate(ModifyRadiusWithMouse);
                radiusProperty.DoubleChanged();
            }
            if (dimension.DimType == Dimension.EDimType.DimDiameter ||
                dimension.DimType == Dimension.EDimType.DimRadius ||
                dimension.DimType == Dimension.EDimType.DimLocation ||
                dimension.DimType == Dimension.EDimType.DimAngle)
            {   // haben alle einen Mittelpunkt als Punkt 0
                centerProperty = new GeoPointProperty("Dimension.Center", Frame, true);
                centerProperty.GetGeoPointEvent     += new CADability.UserInterface.GeoPointProperty.GetGeoPointDelegate(OnGetCenter);
                centerProperty.SetGeoPointEvent     += new CADability.UserInterface.GeoPointProperty.SetGeoPointDelegate(OnSetCenter);
                centerProperty.ModifyWithMouseEvent += new ModifyWithMouseDelegate(ModifyCenterWithMouse);
            }
            if (dimension.DimType == Dimension.EDimType.DimAngle)
            {   // start- und Endwinkel
                startAngle = new GeoVectorProperty("Dimension.Startangle", Frame, true);
                startAngle.GetGeoVectorEvent    += new CADability.UserInterface.GeoVectorProperty.GetGeoVectorDelegate(OnGetStartAngle);
                startAngle.SetGeoVectorEvent    += new CADability.UserInterface.GeoVectorProperty.SetGeoVectorDelegate(OnSetStartAngle);
                startAngle.ModifyWithMouseEvent += new ModifyWithMouseDelegate(ModifyStartAngleWithMouse);
                startAngle.SetHotspotPosition(dimension.GetPoint(1));

                endAngle = new GeoVectorProperty("Dimension.Endangle", Frame, true);
                endAngle.GetGeoVectorEvent    += new CADability.UserInterface.GeoVectorProperty.GetGeoVectorDelegate(OnGetEndAngle);
                endAngle.SetGeoVectorEvent    += new CADability.UserInterface.GeoVectorProperty.SetGeoVectorDelegate(OnSetEndAngle);
                endAngle.ModifyWithMouseEvent += new ModifyWithMouseDelegate(ModifyEndAngleWithMouse);
                endAngle.SetHotspotPosition(dimension.GetPoint(2));
                startAngleHotSpot = new GeoVectorHotSpot(startAngle);
                endAngleHotSpot   = new GeoVectorHotSpot(endAngle);
            }
            dimLineRef = new GeoPointProperty("Dimension.DimLineRef", Frame, true);
            dimLineRef.GetGeoPointEvent               += new CADability.UserInterface.GeoPointProperty.GetGeoPointDelegate(OnGetDimLineRef);
            dimLineRef.SetGeoPointEvent               += new CADability.UserInterface.GeoPointProperty.SetGeoPointDelegate(OnSetDimLineRef);
            dimLineRef.ModifyWithMouseEvent           += new ModifyWithMouseDelegate(ModifyDimLineRef);
            dimLineRef.PropertyEntryChangedStateEvent += new PropertyEntryChangedStateDelegate(OnStateChanged);

            // die String Eingabefelder:
            int numprop = 1;

            if (dimension.DimType == Dimension.EDimType.DimPoints || dimension.DimType == Dimension.EDimType.DimCoord)
            {
                numprop = dimension.PointCount - 1;
            }
            textPosHotSpot = new DoubleHotSpot[numprop];
            textPos        = new DoubleProperty[numprop];
            dimText        = new StringProperty[numprop];
            tolPlusText    = new StringProperty[numprop];
            tolMinusText   = new StringProperty[numprop];
            prefix         = new StringProperty[numprop];
            postfix        = new StringProperty[numprop];
            postfixAlt     = new StringProperty[numprop];
            for (int i = 0; i < numprop; ++i)
            {
                textPos[i] = new DoubleProperty("Dimension.TextPos", Frame);
                textPos[i].UserData.Add("Index", i);
                textPos[i].GetDoubleEvent += new CADability.UserInterface.DoubleProperty.GetDoubleDelegate(OnGetTextPos);
                textPos[i].SetDoubleEvent += new CADability.UserInterface.DoubleProperty.SetDoubleDelegate(OnSetTextPos);
                textPos[i].DoubleChanged();
                textPos[i].ModifyWithMouseEvent           += new ModifyWithMouseDelegate(ModifyTextPosWithMouse);
                textPos[i].PropertyEntryChangedStateEvent += new PropertyEntryChangedStateDelegate(OnStateChanged);

                textPosHotSpot[i]          = new DoubleHotSpot(textPos[i]);
                textPosHotSpot[i].Position = dimension.GetTextPosCoordinate(i, Frame.ActiveView.Projection);

                dimText[i] = new StringProperty(dimension.GetDimText(i), "Dimension.DimText");
                dimText[i].UserData.Add("Index", i);
                dimText[i].SetStringEvent += new CADability.UserInterface.StringProperty.SetStringDelegate(OnSetDimText);
                dimText[i].GetStringEvent += new CADability.UserInterface.StringProperty.GetStringDelegate(OnGetDimText);

                tolPlusText[i] = new StringProperty(dimension.GetTolPlusText(i), "Dimension.TolPlusText");
                tolPlusText[i].UserData.Add("Index", i);
                tolPlusText[i].SetStringEvent += new CADability.UserInterface.StringProperty.SetStringDelegate(OnSetTolPlusText);
                tolPlusText[i].GetStringEvent += new CADability.UserInterface.StringProperty.GetStringDelegate(OnGetTolPlusText);

                tolMinusText[i] = new StringProperty(dimension.GetTolMinusText(i), "Dimension.TolMinusText");
                tolMinusText[i].UserData.Add("Index", i);
                tolMinusText[i].SetStringEvent += new CADability.UserInterface.StringProperty.SetStringDelegate(OnSetTolMinusText);
                tolMinusText[i].GetStringEvent += new CADability.UserInterface.StringProperty.GetStringDelegate(OnGetTolMinusText);

                prefix[i] = new StringProperty(dimension.GetPrefix(i), "Dimension.Prefix");
                prefix[i].UserData.Add("Index", i);
                prefix[i].SetStringEvent += new CADability.UserInterface.StringProperty.SetStringDelegate(OnSetPrefix);
                prefix[i].GetStringEvent += new CADability.UserInterface.StringProperty.GetStringDelegate(OnGetPrefix);

                postfix[i] = new StringProperty(dimension.GetPostfix(i), "Dimension.Postfix");
                postfix[i].UserData.Add("Index", i);
                postfix[i].SetStringEvent += new CADability.UserInterface.StringProperty.SetStringDelegate(OnSetPostfix);
                postfix[i].GetStringEvent += new CADability.UserInterface.StringProperty.GetStringDelegate(OnGetPostfix);

                postfixAlt[i] = new StringProperty(dimension.GetPostfixAlt(i), "Dimension.PostfixAlt");
                postfixAlt[i].UserData.Add("Index", i);
                postfixAlt[i].SetStringEvent += new CADability.UserInterface.StringProperty.SetStringDelegate(OnSetPostfixAlt);
                postfixAlt[i].GetStringEvent += new CADability.UserInterface.StringProperty.GetStringDelegate(OnGetPostfixAlt);
            }
        }
Exemplo n.º 3
0
        private void InitSubEntries()
        {
            vertexProperty = new MultiGeoPointProperty(new VertexIndexedGeoPoint(this), "Polyline.Vertex", this.Frame);
            vertexProperty.ModifyWithMouseEvent          += new CADability.UserInterface.MultiGeoPointProperty.ModifyWithMouseIndexDelegate(OnModifyVertexWithMouse);
            vertexProperty.GeoPointSelectionChangedEvent += new CADability.UserInterface.GeoPointProperty.SelectionChangedDelegate(OnPointsSelectionChanged);
            (vertexProperty as IPropertyEntry).PropertyEntryChangedStateEvent += OnVertexPropertyStateChanged;
            vertexProperty.PrependContextMenue = MenuResource.LoadMenuDefinition("MenuId.Path.Vertex", false, this);

            if (polyline.IsRectangle)
            {
                subEntries       = new IPropertyEntry[2];
                locationProperty = new GeoPointProperty("Rectangle.Location", Frame, true);
                locationProperty.GetGeoPointEvent     += new CADability.UserInterface.GeoPointProperty.GetGeoPointDelegate(OnGetLocation);
                locationProperty.SetGeoPointEvent     += new CADability.UserInterface.GeoPointProperty.SetGeoPointDelegate(OnSetLocation);
                locationProperty.ModifyWithMouseEvent += new ModifyWithMouseDelegate(ModifyLocationWithMouse);

                LengthProperty width = new LengthProperty("Rectangle.Width", Frame, true);
                width.GetLengthEvent       += new CADability.UserInterface.LengthProperty.GetLengthDelegate(OnGetWidth);
                width.SetLengthEvent       += new CADability.UserInterface.LengthProperty.SetLengthDelegate(OnSetWidth);
                width.ModifyWithMouseEvent += new ModifyWithMouseDelegate(ModifyWidthWithMouse);
                widthHotSpot                       = new ShowPropertyHotSpot(width, Frame);
                widthHotSpot.Position              = polyline.RectangleLocation + 0.5 * polyline.ParallelogramSecondaryDirection + polyline.ParallelogramMainDirection;
                widthHotSpot.PositionChangedEvent += new CADability.UserInterface.ShowPropertyHotSpot.PositionChangedDelegate(OnWidthPositionChanged);

                LengthProperty height = new LengthProperty("Rectangle.Height", Frame, true);
                height.GetLengthEvent       += new CADability.UserInterface.LengthProperty.GetLengthDelegate(OnGetHeight);
                height.SetLengthEvent       += new CADability.UserInterface.LengthProperty.SetLengthDelegate(OnSetHeight);
                height.ModifyWithMouseEvent += new ModifyWithMouseDelegate(ModifyHeightWithMouse);
                heightHotSpot                       = new ShowPropertyHotSpot(height, Frame);
                heightHotSpot.Position              = polyline.RectangleLocation + polyline.ParallelogramSecondaryDirection + 0.5 * polyline.ParallelogramMainDirection;
                heightHotSpot.PositionChangedEvent += new CADability.UserInterface.ShowPropertyHotSpot.PositionChangedDelegate(OnHeightPositionChanged);

                GeoVectorProperty direction = new GeoVectorProperty("Rectangle.Direction", Frame, true);
                direction.GetGeoVectorEvent    += new CADability.UserInterface.GeoVectorProperty.GetGeoVectorDelegate(OnGetDirectionX);
                direction.SetGeoVectorEvent    += new CADability.UserInterface.GeoVectorProperty.SetGeoVectorDelegate(OnSetDirectionX);
                direction.ModifyWithMouseEvent += new ModifyWithMouseDelegate(ModifyDirectionXWithMouse);
                directionHotSpot          = new GeoVectorHotSpot(direction);
                directionHotSpot.Position = polyline.RectangleLocation + polyline.ParallelogramMainDirection;

                sizeHotSpot = new GeoPointHotSpot(polyline.RectangleLocation + polyline.ParallelogramSecondaryDirection + polyline.ParallelogramMainDirection);
                sizeHotSpot.StartDragHotspotEvent += new GeoPointHotSpot.StartDragHotspotDelegate(OnSizeHotSpotStartDragHotspot);

                rectangleProperty = new GroupProperty("Polyline.Rectangle", new IPropertyEntry[] { locationProperty, width, height, direction });
                subEntries[0]     = rectangleProperty;
                (rectangleProperty as IPropertyEntry).PropertyEntryChangedStateEvent += OnRectanglePropertyStateChanged;

                subEntries[1] = vertexProperty;
            }
            else

            if (polyline.IsParallelogram)
            {
                subEntries = new IPropertyEntry[2];
                locationParallelProperty = new GeoPointProperty("Rectangle.Location", Frame, true);
                locationParallelProperty.GetGeoPointEvent     += new CADability.UserInterface.GeoPointProperty.GetGeoPointDelegate(OnGetParallelLocation);
                locationParallelProperty.SetGeoPointEvent     += new CADability.UserInterface.GeoPointProperty.SetGeoPointDelegate(OnSetParallelLocation);
                locationParallelProperty.ModifyWithMouseEvent += new ModifyWithMouseDelegate(ModifyLocationWithMouse);

                /*
                 *              LengthProperty widthParallel = new LengthProperty("Rectangle.Width",Frame,true);
                 *              widthParallel.OnGetLength += new Condor.LengthProperty.GetLengthDelegate(OnGetWidthParallel);
                 *              widthParallel.OnSetLength += new Condor.LengthProperty.SetLengthDelegate(OnSetWidthParallel);
                 *              widthParallel.ModifyWithMouse += new ModifyWithMouseDelegate(ModifyWidthWithMouse);
                 *              widthParallelHotSpot = new ShowPropertyHotSpot(widthParallel,Frame);
                 *              widthParallelHotSpot.Position = polyline.ParallelogramLocation+0.5*polyline.ParallelogramSecondaryDirection+polyline.ParallelogramMainDirection;
                 *              widthParallelHotSpot.PositionChanged += new Condor.ShowPropertyHotSpot.PositionChangedDelegate(OnWidthParallelPositionChanged);
                 *
                 *              LengthProperty heightParallel = new LengthProperty("Rectangle.Height",Frame,true);
                 *              heightParallel.OnGetLength += new Condor.LengthProperty.GetLengthDelegate(OnGetHeightParallel);
                 *              heightParallel.OnSetLength += new Condor.LengthProperty.SetLengthDelegate(OnSetHeightParallel);
                 *              heightParallel.ModifyWithMouse += new ModifyWithMouseDelegate(ModifyHeightParallelWithMouse);
                 *              heightParallelHotSpot = new ShowPropertyHotSpot(height,Frame);
                 *              heightParallelHotSpot.Position = polyline.ParallelogramLocation+polyline.ParallelogramSecondaryDirection+0.5*polyline.ParallelogramMainDirection;
                 *              heightParallelHotSpot.PositionChanged += new Condor.ShowPropertyHotSpot.PositionChangedDelegate(OnHeightPositionChanged);
                 *
                 */
                GeoVectorProperty directionXParallel = new GeoVectorProperty("Parallelogram.DirectionX", Frame, true);
                directionXParallel.GetGeoVectorEvent    += new CADability.UserInterface.GeoVectorProperty.GetGeoVectorDelegate(OnGetDirectionXParallel);
                directionXParallel.SetGeoVectorEvent    += new CADability.UserInterface.GeoVectorProperty.SetGeoVectorDelegate(OnSetDirectionXParallel);
                directionXParallel.ModifyWithMouseEvent += new ModifyWithMouseDelegate(ModifyDirectionXParallelWithMouse);
                directionXParallelHotSpot          = new GeoVectorHotSpot(directionXParallel);
                directionXParallelHotSpot.Position = polyline.ParallelogramLocation + polyline.ParallelogramMainDirection;

                GeoVectorProperty directionYParallel = new GeoVectorProperty("Parallelogram.DirectionY", Frame, true);
                directionYParallel.GetGeoVectorEvent    += new CADability.UserInterface.GeoVectorProperty.GetGeoVectorDelegate(OnGetDirectionYParallel);
                directionYParallel.SetGeoVectorEvent    += new CADability.UserInterface.GeoVectorProperty.SetGeoVectorDelegate(OnSetDirectionYParallel);
                directionYParallel.ModifyWithMouseEvent += new ModifyWithMouseDelegate(ModifyDirectionXParallelWithMouse);
                directionYParallelHotSpot          = new GeoVectorHotSpot(directionYParallel);
                directionYParallelHotSpot.Position = polyline.ParallelogramLocation + polyline.ParallelogramSecondaryDirection;

                //				parallelProperty = new GroupProperty("Polyline.Parallel", new IPropertyEntry [] {locationParallelProperty,widthParallel,heightParallel,directionParallel});

                sizeHotSpot = new GeoPointHotSpot(polyline.ParallelogramLocation + polyline.ParallelogramSecondaryDirection + polyline.ParallelogramMainDirection);
                sizeHotSpot.StartDragHotspotEvent += new GeoPointHotSpot.StartDragHotspotDelegate(OnSizeHotSpotStartDragHotspot);

                parallelProperty = new GroupProperty("Polyline.Parallel", new IPropertyEntry[] { locationParallelProperty, directionXParallel, directionYParallel });
                subEntries[0]    = parallelProperty;
                (parallelProperty as IPropertyEntry).PropertyEntryChangedStateEvent += OnParallelPropertyStateChanged;

                subEntries[1] = vertexProperty;
            }


            else
            {
                subEntries    = new IPropertyEntry[1];
                subEntries[0] = vertexProperty;
            }
            attributeProperties = polyline.GetAttributeProperties(Frame);
        }