Пример #1
0
 //public override void ChildSelected(IPropertyEntry theSelectedChild)
 //{
 //    base.ChildSelected(theSelectedChild);
 //    if (throughPointsProperty != null && !bSpline.ThroughPoints3dExist)
 //    {   // wenn man poles editiert, dann wird throupoints ungültig
 //        // hier werden die subentries neu berechnet, die poles wieder aufgemacht und der richtige Eintrag selektiert
 //        bool isopen = propertyPage.IsOpen(polesProperty);
 //        IPropertyEntry cs = propertyPage.GetCurrentSelection();
 //        int selindex = -1;
 //        if (cs is GeoPointProperty)
 //        {
 //            if ((cs as GeoPointProperty).UserData.Contains("Index"))
 //            {
 //                selindex = (int)(cs as GeoPointProperty).UserData.GetData("Index");
 //            }
 //        }
 //        InitSubEntries();
 //        propertyPage.Refresh(this);
 //        if (isopen)
 //        {
 //            propertyPage.OpenSubEntries(polesProperty, true);
 //            if (selindex >= 0 && polesProperty.SubEntries != null && selindex < polesProperty.SubEntriesCount)
 //            {
 //                propertyPage.SelectEntry(polesProperty.SubEntries[selindex] as IPropertyEntry);
 //            }
 //        }
 //    }
 //}
 #endregion
 private GeoPoint OnThroughPointsGetInsertionPoint(IPropertyEntry sender, int index, bool after)
 {
     if (index == 0 && !after)
     {
         return(bSpline.ThroughPoint[0]);
     }
     else if (index == -1 && after)
     {
         return(bSpline.ThroughPoint[bSpline.ThroughPoint.Length - 1]);
     }
     else
     {
         double par;
         if (after)
         {
             par = (bSpline.ThroughPointsParam[index - 1] + bSpline.ThroughPointsParam[index]) / 2.0;
         }
         else
         {
             par = (bSpline.ThroughPointsParam[index - 1] + bSpline.ThroughPointsParam[index]) / 2.0;
         }
         return(bSpline.PointAtParam(par));
     }
 }