Skip to content

Commit

Permalink
Add clip sector functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jheinen committed Sep 2, 2024
1 parent 17c4707 commit 4591cef
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/GR.jl
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ export
inqmathfont,
setclipregion,
inqclipregion,
setclipsector,
inqclipsector,
getformat,
ftoa,
# Convenience functions
Expand Down Expand Up @@ -4453,6 +4455,23 @@ function inqclipregion()
return _region[1]
end

function setclipsector(start_angle::Real, end_angle::Real)
ccall( libGR_ptr(:gr_setclipsector),
Nothing,
(Cdouble, Cdouble),
start_angle, end_angle)
end

function inqclipsector()
_start_angle = Cdouble[0]
_end_angle = Cdouble[0]
ccall( libGR_ptr(:gr_inqclipsector),
Nothing,
(Ptr{Cdouble}, Ptr{Cdouble}),
_start_angle, _end_angle)
return _start_angle[1], _end_angle[1]
end

function getformat(origin::Real, amin::Real, amax::Real, tick::Real, major::Int)
_format = Cint[0, 0]
ccall( libGR_ptr(:gr_getformat),
Expand Down
2 changes: 2 additions & 0 deletions src/libgr_syms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@
:gr_inqmathfont
:gr_setclipregion
:gr_inqclipregion
:gr_setclipsector
:gr_inqclipsector
:gr_getformat
:gr_ftoa
:gr_axis
Expand Down

0 comments on commit 4591cef

Please sign in to comment.