コード例 #1
0
 /// <summary>
 /// Updates from a particular setting state.
 /// </summary>
 /// <param name="state">The new states that will be set.</param>
 public static void UpdateFromState(ModelAidSettingsState state)
 {
   GridSnap = state.GridSnap;
   Ortho = state.Ortho;
   Planar = state.Planar;
   ProjectSnapToCPlane = state.ProjectSnapToCPlane;
   UseHorizontalDialog = state.UseHorizontalDialog;
   ExtendTrimLines = state.ExtendTrimLines;
   ExtendToApparentIntersection = state.ExtendToApparentIntersection;
   AltPlusArrow = state.AltPlusArrow;
   DisplayControlPolygon = state.DisplayControlPolygon;
   HighlightControlPolygon = state.HighlightControlPolygon;
   Osnap = state.Osnap;
   SnapToLocked = state.SnapToLocked;
   UniversalConstructionPlaneMode = state.UniversalConstructionPlaneMode;
   OrthoAngle = state.OrthoAngle;
   NudgeKeyStep = state.NudgeKeyStep;
   CtrlNudgeKeyStep = state.CtrlNudgeKeyStep;
   ShiftNudgeKeyStep = state.ShiftNudgeKeyStep;
   OsnapPickboxRadius = state.OsnapPickboxRadius;
   NudgeMode = state.NudgeMode;
   ControlPolygonDisplayDensity = state.ControlPolygonDisplayDensity;
   OsnapCursorMode = state.OsnapCursorMode;
   OsnapModes = state.OsnapModes;
   MousePickboxRadius = state.MousePickboxRadius;
   PointDisplay = state.PointDisplay;
 }
コード例 #2
0
    static ModelAidSettingsState CreateState(bool current)
    {
      IntPtr pSettings = UnsafeNativeMethods.CRhinoAppModelAidSettings_New(current);
      ModelAidSettingsState rc = new ModelAidSettingsState();
      rc.GridSnap = GetBool(idxGridSnap, pSettings);
      rc.Ortho = GetBool(idxOrtho, pSettings);
      rc.Planar = GetBool(idxPlanar, pSettings);
      rc.ProjectSnapToCPlane = GetBool(idxProjectSnapToCPlane, pSettings);
      rc.UseHorizontalDialog = GetBool(idxUseHorizontalDialog, pSettings);
      rc.ExtendTrimLines = GetBool(idxExtendTrimLines, pSettings);
      rc.ExtendToApparentIntersection = GetBool(idxExtendToApparentIntersection, pSettings);
      rc.AltPlusArrow = GetBool(idxAltPlusArrow, pSettings);
      rc.DisplayControlPolygon = GetBool(idxDisplayControlPolygon, pSettings);
      rc.HighlightControlPolygon = GetBool(idxHighlightControlPolygon, pSettings);
      rc.Osnap = !GetBool(idxOsnap, pSettings);
      rc.SnapToLocked = GetBool(idxSnapToLocked, pSettings);
      rc.UniversalConstructionPlaneMode = GetBool(idxUniversalConstructionPlaneMode, pSettings);
      rc.OrthoAngle = GetDouble(idxOrthoAngle, pSettings);
      rc.NudgeKeyStep = GetDouble(idxNudgeKeyStep, pSettings);
      rc.CtrlNudgeKeyStep = GetDouble(idxCtrlNudgeKeyStep, pSettings);
      rc.ShiftNudgeKeyStep = GetDouble(idxShiftNudgeKeyStep, pSettings);
      rc.OsnapPickboxRadius = GetInt(idxOsnapPickboxRadius, pSettings);
      rc.NudgeMode = GetInt(idxNudgeMode, pSettings);
      rc.ControlPolygonDisplayDensity = GetInt(idxControlPolygonDisplayDensity, pSettings);
      rc.OsnapCursorMode = (CursorMode)GetInt(idxOSnapCursorMode, pSettings);
      rc.OsnapModes = (OsnapModes)GetInt(idxOSnapModes, pSettings);
      rc.MousePickboxRadius = GetInt(idxMousePickboxRadius, pSettings);
      rc.PointDisplay = (PointDisplayMode)GetInt(idxPointDisplay, pSettings);

      UnsafeNativeMethods.CRhinoAppModelAidSettings_Delete(pSettings);
      return rc;
    }