Skip to content

Commit

Permalink
Minor docs update; hopefully fix deepcopying of segments and styles o…
Browse files Browse the repository at this point in the history
…n julia 0.4
  • Loading branch information
ajkeller34 committed Jul 27, 2016
1 parent edc9cb6 commit b793b0d
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/build/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ We use a custom version of the Clipper package, which we will need for making po
* `Pkg.checkout("Clipper", "pointinpoly")`


You will need to build the package to compile shared library / DLL files. This should just work on Mac OS X, and should also work on Windows provided you install Visual Studio and ensure that `vcvarsall.bat` and `cl.exe` are in your account's PATH variable.
You will need to build the package to compile shared library / DLL files. This should just work on Mac OS X, and should also work on Windows provided you install [Visual Studio](https://www.visualstudio.com/en-us/visual-studio-homepage-vs.aspx) and ensure that `vcvarsall.bat` and `cl.exe` are in your account's PATH variable. Probably these are located in: `C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC` and `C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin`, respectively.


* `Pkg.build("Clipper")`
Expand Down
2 changes: 1 addition & 1 deletion docs/build/paths.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ type CompoundSegment{T<:Real} <: Segment{T}
end
```

Consider an array of segments as one contiguous segment. Useful e.g. for applying styles, uninterrupted over segment changes. The array of segments given to the constructor is deep-copied and retained by the compound segment.
Consider an array of segments as one contiguous segment. Useful e.g. for applying styles, uninterrupted over segment changes. The array of segments given to the constructor is copied and retained by the compound segment.


<a id='Styles-1'></a>
Expand Down
7 changes: 5 additions & 2 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ compatible with GDS files.

You will need to build the package to compile shared library / DLL files.
This should just work on Mac OS X, and should also work on Windows provided you
install Visual Studio and ensure that `vcvarsall.bat` and `cl.exe` are in your
account's PATH variable.
install [Visual Studio](https://www.visualstudio.com/en-us/visual-studio-homepage-vs.aspx)
and ensure that `vcvarsall.bat` and `cl.exe` are in your
account's PATH variable. Probably these are located in:
`C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC` and
`C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin`, respectively.

+ `Pkg.build("Clipper")`

Expand Down
1 change: 1 addition & 0 deletions src/paths/Paths.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ using ..Cells
import Base:
convert,
copy,
deepcopy_internal,
start,
done,
next,
Expand Down
14 changes: 11 additions & 3 deletions src/paths/Segments.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,16 @@ function length(s::Segment, verbose::Bool=false)
val
end

show(io::IO, s::Segment) =
print(io, summary(s))
show(io::IO, s::Segment) = print(io, summary(s))

function deepcopy_internal(x::Segment, stackdict::ObjectIdDict)
if haskey(stackdict, x)
return stackdict[x]
end
y = copy(x)
stackdict[x] = y
return y
end

"""
```
Expand Down Expand Up @@ -215,7 +223,7 @@ end
Consider an array of segments as one contiguous segment.
Useful e.g. for applying styles, uninterrupted over segment changes.
The array of segments given to the constructor is deep-copied and retained
The array of segments given to the constructor is copied and retained
by the compound segment.
"""
type CompoundSegment{T<:Real} <: Segment{T}
Expand Down
10 changes: 9 additions & 1 deletion src/paths/Styles.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
function deepcopy_internal(x::Style, stackdict::ObjectIdDict)
if haskey(stackdict, x)
return stackdict[x]
end
y = copy(x)
stackdict[x] = y
return y
end
"""
```
type Trace <: Style
Expand Down Expand Up @@ -131,7 +139,7 @@ Returns the function needed for a `CompoundStyle`. The segments array is
shallow-copied for use in the function.
"""
function param{T<:Real}(seg::AbstractArray{Segment{T},1})
segments = copy(Array(seg))
segments = deepcopy(Array(seg))
isempty(segments) && error("Cannot parameterize with zero segments.")

# Build up our piecewise parametric function
Expand Down

0 comments on commit b793b0d

Please sign in to comment.