Skip to content

Commit bde2cae

Browse files
committed
typed ignore
1 parent c6d1b03 commit bde2cae

23 files changed

+531
-542
lines changed

Src/AutoGeneratedCode/AllScriptingFilesCombinedIntoOne_DontEditThisFile.fs

Lines changed: 265 additions & 269 deletions
Large diffs are not rendered by default.

Src/Pretty.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ module AutoOpenPrettyExtensions =
6565
|> Array.max
6666
|]
6767
let b = Text.StringBuilder()
68-
b.AppendLine "Rhino.Geometry.Transform:" |> ignore
68+
b.AppendLine "Rhino.Geometry.Transform:" |> ignore<Text.StringBuilder>
6969
for i,s in Seq.indexed vs do
7070
let coli = i%4
7171
let len = cols.[coli]
72-
b.Append("| ") |> ignore
73-
b.Append(s.PadLeft(len,' ')) |> ignore
72+
b.Append("| ") |> ignore<Text.StringBuilder>
73+
b.Append(s.PadLeft(len,' ')) |> ignore<Text.StringBuilder>
7474
if coli = 3 then
75-
b.AppendLine() |> ignore
75+
b.AppendLine() |> ignore<Text.StringBuilder>
7676
b.ToString()
7777

7878

Src/Scripting_Application.fs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
namespace Rhino.Scripting
22

33
open Rhino
4-
54
open System
6-
75
open Rhino.Geometry
86
open Rhino.ApplicationSettings
97

10-
11-
12-
138
[<AutoOpen>]
149
module AutoOpenApplication =
1510
type RhinoScriptSyntax with
@@ -65,7 +60,7 @@ module AutoOpenApplication =
6560
static member AliasMacro(alias:string, macro:string) : unit = //SET
6661
RhinoSync.DoSync (fun () ->
6762
ApplicationSettings.CommandAliasList.SetMacro(alias, macro)
68-
|> ignore)
63+
|> ignore<bool>)
6964
///<summary>Returns an array of command alias names.</summary>
7065
///<returns>(string array) an array of command alias names.</returns>
7166
static member AliasNames() : array<string> =
@@ -777,7 +772,8 @@ module AutoOpenApplication =
777772
static member StatusBarProgressMeterUpdate(position:int, [<OPT;DEF(true)>]absolute:bool) : unit =
778773
RhinoSync.DoSync (fun () ->
779774
UI.StatusBar.UpdateProgressMeter(position, absolute)
780-
|> ignore)
775+
|> ignore<int>
776+
)
781777

782778

783779
///<summary>Hide the progress meter.</summary>

Src/Scripting_Block.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ module AutoOpenBlock =
5656
rc <- State.Doc.InstanceDefinitions.Add(name, "", basePoint, geometry, attrs)
5757
if rc >= 0 then
5858
if deleteInput then
59-
for obj in objects do State.Doc.Objects.Delete(obj, quiet=true) |>ignore
59+
for obj in objects do State.Doc.Objects.Delete(obj, quiet=true) |> ignore<bool>
6060
State.Doc.Views.Redraw()
6161
name
6262

@@ -103,7 +103,7 @@ module AutoOpenBlock =
103103
static member BlockDescription(blockName:string, description:string) : unit = //SET
104104
let instDef = State.Doc.InstanceDefinitions.Find(blockName)
105105
if isNull instDef then RhinoScriptingException.Raise "RhinoScriptSyntax.BlockDescription:'%s' does not exist in InstanceDefinitionsTable" blockName
106-
State.Doc.InstanceDefinitions.Modify( instDef, instDef.Name, description, true ) |>ignore
106+
State.Doc.InstanceDefinitions.Modify( instDef, instDef.Name, description, true ) |> ignore<bool>
107107

108108

109109
///<summary>Counts number of instances of the block in the document.

Src/Scripting_Curve.fs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -337,10 +337,10 @@ module AutoOpenCurve =
337337
if Seq.length(weights)<>cvcount then
338338
RhinoScriptingException.Raise "RhinoScriptSyntax.CreateNurbsCurve:Number of elements in weights should equal the number of elements in points. points:'%A' knots:'%A' degree:'%A' weights:'%A'" points knots degree weights
339339
for i,(p, w) in Seq.indexed (Seq.zip points weights) do
340-
nc.Points.SetPoint(i, p, w) |> ignore
340+
nc.Points.SetPoint(i, p, w) |> ignore<bool>
341341
else
342342
for i, p in Seq.indexed points do
343-
nc.Points.SetPoint(i, p) |> ignore
343+
nc.Points.SetPoint(i, p) |> ignore<bool>
344344
if not nc.IsValid then RhinoScriptingException.Raise "RhinoScriptSyntax.CreateNurbsCurve:Unable to create curve. points:'%A' knots:'%A' degree:'%A' weights:'%A'" points knots degree weights
345345
nc
346346

@@ -367,7 +367,7 @@ module AutoOpenCurve =
367367
///<returns>(Guid) objectId of the new Curve object.</returns>
368368
static member AddPolyline(points:Point3d seq) : Guid =
369369
let pl = Polyline(points)
370-
//pl.DeleteShortSegments(State.Doc.ModelAbsoluteTolerance) |>ignore
370+
//pl.DeleteShortSegments(State.Doc.ModelAbsoluteTolerance) |> ignore<bool>
371371
let rc = State.Doc.Objects.AddPolyline(pl)
372372
if rc = Guid.Empty then
373373
for i,pt in Seq.indexed(points) do
@@ -390,7 +390,7 @@ module AutoOpenCurve =
390390
pl.[pl.Count-1] <- pl.First
391391
else
392392
pl.Add pl.First
393-
//pl.DeleteShortSegments(State.Doc.ModelAbsoluteTolerance) |>ignore
393+
//pl.DeleteShortSegments(State.Doc.ModelAbsoluteTolerance) |> ignore<bool>
394394
let rc = State.Doc.Objects.AddPolyline(pl)
395395
if rc = Guid.Empty then
396396
for i,pt in Seq.indexed(points) do
@@ -645,7 +645,7 @@ module AutoOpenCurve =
645645
else s <- length / curveLength
646646
let dupe = if not fromStart then curve.Duplicate() :?> Curve else curve
647647
if notNull dupe then
648-
if not fromStart then dupe.Reverse() |> ignore
648+
if not fromStart then dupe.Reverse() |> ignore<bool>
649649
let rc, t = dupe.NormalizedLengthParameter(s)
650650
if rc then
651651
let pt = dupe.PointAt(t)
@@ -1488,7 +1488,7 @@ module AutoOpenCurve =
14881488
static member CurveStartPoint(curveId:Guid, point:Point3d) : unit =
14891489
let curve = RhinoScriptSyntax.CoerceCurve(curveId)
14901490
if not <|curve.SetStartPoint(point) then RhinoScriptingException.Raise "RhinoScriptSyntax.CurveStartPoint failed on '%A' and '%A'" point curveId
1491-
State.Doc.Objects.Replace(curveId, curve) |> ignore
1491+
State.Doc.Objects.Replace(curveId, curve) |> ignore<bool>
14921492
State.Doc.Views.Redraw()
14931493

14941494

@@ -1769,7 +1769,7 @@ module AutoOpenCurve =
17691769
for piece in pieces do
17701770
rc.Add(State.Doc.Objects.AddCurve(piece))
17711771
if deleteInput then
1772-
State.Doc.Objects.Delete(curveId, quiet=true) |>ignore
1772+
State.Doc.Objects.Delete(curveId, quiet=true) |> ignore<bool>
17731773
if rc.Count>0 then State.Doc.Views.Redraw()
17741774
rc
17751775

@@ -1789,7 +1789,7 @@ module AutoOpenCurve =
17891789
for piece in pieces do
17901790
rc.Add(State.Doc.Objects.AddCurve(piece))
17911791
if deleteInput then
1792-
State.Doc.Objects.Delete(curveId, quiet=true) |>ignore
1792+
State.Doc.Objects.Delete(curveId, quiet=true) |> ignore<bool>
17931793
if rc.Count>0 then State.Doc.Views.Redraw()
17941794
rc
17951795

@@ -2240,7 +2240,7 @@ module AutoOpenCurve =
22402240
let rc = newCurves |> RArr.mapSeq State.Doc.Objects.AddCurve
22412241
if deleteInput then
22422242
for objectId in curveIds do
2243-
State.Doc.Objects.Delete(objectId, quiet=false) |> ignore
2243+
State.Doc.Objects.Delete(objectId, quiet=false) |> ignore<bool>
22442244
State.Doc.Views.Redraw()
22452245
rc
22462246

@@ -2502,7 +2502,7 @@ module AutoOpenCurve =
25022502
let newCurve = curve.Rebuild(pointCount, degree, preserveTangents=false)
25032503
if isNull newCurve then false
25042504
else
2505-
State.Doc.Objects.Replace(curveId, newCurve) |> ignore
2505+
State.Doc.Objects.Replace(curveId, newCurve) |> ignore<bool>
25062506
State.Doc.Views.Redraw()
25072507
true
25082508

@@ -2524,7 +2524,7 @@ module AutoOpenCurve =
25242524
let success = nCurve.Knots.RemoveKnotAt(nParam)
25252525
if not <| success then false
25262526
else
2527-
State.Doc.Objects.Replace(curve, nCurve)|> ignore
2527+
State.Doc.Objects.Replace(curve, nCurve)|> ignore<bool>
25282528
State.Doc.Views.Redraw()
25292529
true
25302530

@@ -2535,7 +2535,7 @@ module AutoOpenCurve =
25352535
static member ReverseCurve(curveId:Guid) : bool =
25362536
let curve = RhinoScriptSyntax.CoerceCurve(curveId)
25372537
if curve.Reverse() then
2538-
State.Doc.Objects.Replace(curveId, curve)|> ignore
2538+
State.Doc.Objects.Replace(curveId, curve)|> ignore<bool>
25392539
true
25402540
else
25412541
false
@@ -2577,7 +2577,7 @@ module AutoOpenCurve =
25772577
let angTol = State.Doc.ModelAngleToleranceRadians
25782578
let newCurve = curve.Simplify(flags0, tol, angTol)
25792579
if notNull newCurve then
2580-
State.Doc.Objects.Replace(curveId, newCurve)|> ignore
2580+
State.Doc.Objects.Replace(curveId, newCurve)|> ignore<bool>
25812581
State.Doc.Views.Redraw()
25822582
true
25832583
else
@@ -2598,7 +2598,7 @@ module AutoOpenCurve =
25982598
let rhobj = RhinoScriptSyntax.CoerceRhinoObject(curveId)
25992599
let rc = newcurves |> RArr.mapArr (fun crv -> State.Doc.Objects.AddCurve(crv, rhobj.Attributes) )
26002600
if deleteInput then
2601-
State.Doc.Objects.Delete(curveId, quiet=true)|> ignore
2601+
State.Doc.Objects.Delete(curveId, quiet=true)|> ignore<bool>
26022602
State.Doc.Views.Redraw()
26032603
rc
26042604

@@ -2620,7 +2620,7 @@ module AutoOpenCurve =
26202620
let rhobj = RhinoScriptSyntax.CoerceRhinoObject(curveId)
26212621
let rc = State.Doc.Objects.AddCurve(newCurve, rhobj.Attributes)
26222622
if deleteInput then
2623-
State.Doc.Objects.Delete(curveId, quiet=true)|> ignore
2623+
State.Doc.Objects.Delete(curveId, quiet=true)|> ignore<bool>
26242624
State.Doc.Views.Redraw()
26252625
rc
26262626

Src/Scripting_Dimension.fs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ module AutoOpenDimension =
184184
if isNull ds then RhinoScriptingException.Raise "RhinoScriptSyntax.DimensionStyle set failed. objectId:'%s' dimStyleName:'%s'" (Pretty.str objectId) dimStyleName
185185
let mutable annotation = annotationObject.Geometry:?> AnnotationBase
186186
annotation.DimensionStyleId <- ds.Id
187-
annotationObject.CommitChanges() |> ignore
187+
annotationObject.CommitChanges() |> ignore<bool>
188188
State.Doc.Views.Redraw()
189189

190190
///<summary>Modifies the dimension style of multiple dimension objects.</summary>
@@ -198,7 +198,7 @@ module AutoOpenDimension =
198198
let annotationObject = RhinoScriptSyntax.CoerceAnnotation(objectId)
199199
let mutable annotation = annotationObject.Geometry:?> AnnotationBase
200200
annotation.DimensionStyleId <- ds.Id
201-
annotationObject.CommitChanges() |> ignore
201+
annotationObject.CommitChanges() |> ignore<bool>
202202
State.Doc.Views.Redraw()
203203

204204
///<summary>Returns the text displayed by a dimension object.</summary>
@@ -227,7 +227,7 @@ module AutoOpenDimension =
227227
let annotationObject = RhinoScriptSyntax.CoerceAnnotation(objectId)
228228
let geo = annotationObject.Geometry :?> AnnotationBase
229229
geo.PlainText <- usertext
230-
annotationObject.CommitChanges() |> ignore
230+
annotationObject.CommitChanges() |> ignore<bool>
231231
State.Doc.Views.Redraw()
232232

233233
///<summary>Modifies the user text string of multiple dimension objects. The user
@@ -240,7 +240,7 @@ module AutoOpenDimension =
240240
let annotationObject = RhinoScriptSyntax.CoerceAnnotation(objectId)
241241
let geo = annotationObject.Geometry :?> AnnotationBase
242242
geo.PlainText <- usertext
243-
annotationObject.CommitChanges() |> ignore
243+
annotationObject.CommitChanges() |> ignore<bool>
244244
State.Doc.Views.Redraw()
245245

246246
///<summary>Returns the value of a dimension object.</summary>
@@ -764,7 +764,7 @@ module AutoOpenDimension =
764764
let annotationObject = RhinoScriptSyntax.CoerceAnnotation(objectId)
765765
g.PlainText <- text // TODO or use rich text?
766766
if not <| State.Doc.Objects.Replace(objectId,g) then RhinoScriptingException.Raise "RhinoScriptSyntax.LeaderText: Objects.Replace(objectId,g) get failed. objectId:'%s'" (Pretty.str objectId)
767-
annotationObject.CommitChanges() |> ignore
767+
annotationObject.CommitChanges() |> ignore<bool>
768768
State.Doc.Views.Redraw()
769769
| _ -> RhinoScriptingException.Raise "RhinoScriptSyntax.LeaderText set failed for %s" (Pretty.str objectId)
770770

Src/Scripting_Geometry.fs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,12 @@ module AutoOpenGeometry =
183183
if DocObjects.Font.FromQuartetProperties(qn, bold, false) |> isNull then
184184
RhinoScriptingException.Raise "RhinoScriptSyntax.AddText failed. text:'%s' plane:'%s' height:'%g' font:'%A' fontStyle:'%A' horizontalAlignment '%A' verticalAlignment:'%A'" text plane.Pretty height font fontStyle horizontalAlignment verticalAlignment
185185
else
186-
te.SetBold(bold)|> ignore
186+
te.SetBold(bold)|> ignore<bool>
187187
if italic <> quartetItalicProp then
188188
if DocObjects.Font.FromQuartetProperties(qn, false, italic) |> isNull then
189189
RhinoScriptingException.Raise "RhinoScriptSyntax.AddText failed. text:'%s' plane:'%s' height:'%g' font:'%A' fontStyle:'%A' horizontalAlignment '%A' verticalAlignment:'%A'" text plane.Pretty height font fontStyle horizontalAlignment verticalAlignment
190190
else
191-
te.SetItalic(italic)|> ignore
191+
te.SetItalic(italic)|> ignore<bool>
192192

193193
te.TextHorizontalAlignment <- LanguagePrimitives.EnumOfValue horizontalAlignment
194194
te.TextVerticalAlignment <- LanguagePrimitives.EnumOfValue verticalAlignment
@@ -432,7 +432,7 @@ module AutoOpenGeometry =
432432
let curves = (rhobj.Geometry:?>TextEntity).Explode()
433433
let attr = rhobj.Attributes
434434
let rc = curves |> RArr.mapArr ( fun curve -> State.Doc.Objects.AddCurve(curve, attr) )
435-
if delete then State.Doc.Objects.Delete(rhobj, quiet=true) |>ignore
435+
if delete then State.Doc.Objects.Delete(rhobj, quiet=true) |> ignore<bool>
436436
State.Doc.Views.Redraw()
437437
rc
438438

@@ -521,7 +521,7 @@ module AutoOpenGeometry =
521521
else
522522
RhinoScriptingException.Raise "RhinoScriptSyntax.PointCloudHidePoints length of hidden values does not match point cloud point count"
523523

524-
(RhinoScriptSyntax.CoerceRhinoObject objectId).CommitChanges() |> ignore
524+
(RhinoScriptSyntax.CoerceRhinoObject objectId).CommitChanges() |> ignore<bool>
525525
State.Doc.Views.Redraw()
526526

527527

@@ -548,7 +548,7 @@ module AutoOpenGeometry =
548548
for i, c in Seq.indexed colors do pc.[i].Color <- c
549549
else
550550
RhinoScriptingException.Raise "RhinoScriptSyntax.PointCloudPointColors length of color values does not match PointCloud point count"
551-
(RhinoScriptSyntax.CoerceRhinoObject objectId).CommitChanges() |> ignore
551+
(RhinoScriptSyntax.CoerceRhinoObject objectId).CommitChanges() |> ignore<bool>
552552
State.Doc.Views.Redraw()
553553

554554

Src/Scripting_Grips.fs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22
namespace Rhino.Scripting
33

44
open Rhino
5-
65
open System
7-
86
open Rhino.Geometry
97
open Rhino.Scripting.RhinoScriptingUtils
108

119

1210
[<AutoOpen>]
1311
module AutoOpenGrips =
12+
1413
type RhinoScriptSyntax with
1514
//---The members below are in this file only for development. This brings acceptable tooling performance (e.g. autocomplete)
1615
//---Before compiling the script combineIntoOneFile.fsx is run to combine them all into one file.
@@ -49,7 +48,7 @@ module AutoOpenGrips =
4948
[<OPT;DEF(false)>]select:bool) : Guid * int * Point3d =
5049
let get () =
5150
if not preselect then
52-
State.Doc.Objects.UnselectAll() |> ignore
51+
State.Doc.Objects.UnselectAll() |> ignore<int>
5352
State.Doc.Views.Redraw()
5453
let grip = ref null
5554
let rc = Input.RhinoGet.GetGrip(grip, message)
@@ -58,7 +57,7 @@ module AutoOpenGrips =
5857
RhinoScriptingException.Raise "RhinoScriptSyntax.GetObjectGrip User failed to select a Grip for : %s " message
5958
else
6059
if select then
61-
grip.Select(true, true)|> ignore
60+
grip.Select(true, true)|> ignore<int>
6261
State.Doc.Views.Redraw()
6362
(grip.OwnerId, grip.Index, grip.CurrentLocation)
6463
RhinoSync.DoSyncRedrawHideEditor get
@@ -80,7 +79,7 @@ module AutoOpenGrips =
8079
[<OPT;DEF(false)>]select:bool) : ResizeArray<Guid * int * Point3d> =
8180
let get () =
8281
if not preselect then
83-
State.Doc.Objects.UnselectAll() |> ignore
82+
State.Doc.Objects.UnselectAll() |> ignore<int>
8483
State.Doc.Views.Redraw()
8584
let grips = ref null
8685
let re = Input.RhinoGet.GetGrips(grips, message)
@@ -92,7 +91,7 @@ module AutoOpenGrips =
9291
let index = grip.Index
9392
let location = grip.CurrentLocation
9493
rc.Add((objectId, index, location))
95-
if select then grip.Select(true, true)|>ignore
94+
if select then grip.Select(true, true)|> ignore<int>
9695
if select then State.Doc.Views.Redraw()
9796
rc
9897
RhinoSync.DoSyncRedrawHideEditor get
@@ -114,7 +113,7 @@ module AutoOpenGrips =
114113
else
115114
grip.NeighborGrip(0, i, 0, wrap=false)
116115
if notNull ng && enable then
117-
ng.Select(true) |> ignore // TODO needs sync ? apparently not needed!
116+
ng.Select(true) |> ignore<int> // TODO needs sync ? apparently not needed!
118117
State.Doc.Views.Redraw()
119118
Ok ng
120119

@@ -172,7 +171,7 @@ module AutoOpenGrips =
172171
RhinoScriptingException.Raise "RhinoScriptSyntax.ObjectGripLocation failed. objectId:'%s' index:'%A' point:'%A'" (Pretty.str objectId) index point
173172
let grip = grips.[index]
174173
grip.CurrentLocation <- point
175-
State.Doc.Objects.GripUpdate(rhobj, true)|> ignore
174+
State.Doc.Objects.GripUpdate(rhobj, true)|> ignore<DocObjects.RhinoObject>
176175
State.Doc.Views.Redraw()
177176

178177

@@ -207,7 +206,7 @@ module AutoOpenGrips =
207206
if Seq.length(points) = Seq.length(grips) then
208207
for pt, grip in Seq.zip points grips do
209208
grip.CurrentLocation <- pt
210-
State.Doc.Objects.GripUpdate(rhobj, true)|> ignore
209+
State.Doc.Objects.GripUpdate(rhobj, true)|> ignore<DocObjects.RhinoObject>
211210
State.Doc.Views.Redraw()
212211

213212

0 commit comments

Comments
 (0)