Skip to content

Commit

Permalink
Merge bd698c7 into 78530d9
Browse files Browse the repository at this point in the history
  • Loading branch information
KeyMaster- committed Jul 7, 2019
2 parents 78530d9 + bd698c7 commit 243495b
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
@@ -1,4 +1,4 @@
[![completion](https://img.shields.io/badge/completion-72%25%20%28326%20of%20450%29-blue.svg)](https://github.com/swistakm/pyimgui)
[![completion](https://img.shields.io/badge/completion-73%25%20%28330%20of%20452%29-blue.svg)](https://github.com/swistakm/pyimgui)
[![Coverage Status](https://coveralls.io/repos/github/swistakm/pyimgui/badge.svg?branch=master)](https://coveralls.io/github/swistakm/pyimgui?branch=master)
[![Documentation Status](https://readthedocs.org/projects/pyimgui/badge/?version=latest)](https://pyimgui.readthedocs.io/en/latest/?badge=latest)

Expand Down
21 changes: 19 additions & 2 deletions imgui/cimgui.pxd
Expand Up @@ -237,6 +237,23 @@ cdef extern from "imgui.h":
float rounding, # = 0.0f
int rounding_corners_flags # = ImDrawCornerFlags_All
) except + #

void AddCircle(
const ImVec2& centre,
float radius,
ImU32 col,
# note: optional
int num_segments, # = 12
float thickness # = 1.0f
) except + #

void AddCircleFilled(
const ImVec2& centre,
float radius,
ImU32 col,
# note: optional
int num_segments # = 12
) except + #


void ChannelsSplit(int channels_count) except + #
Expand Down Expand Up @@ -550,11 +567,11 @@ cdef extern from "imgui.h" namespace "ImGui":

# ====
# ID scopes
void PushID(const char* str_id) except + #
void PushID(const char* str_id) except + #
void PushID(const char* str_id_begin, const char* str_id_end) except + #
void PushID(const void* ptr_id) except + #
void PushID(int int_id) except + #
void PopID() except + #
void PopID() except + #
ImGuiID GetID(const char* str_id) except + #
ImGuiID GetID(const char* str_id_begin, const char* str_id_end) except + #
ImGuiID GetID(const void* ptr_id) except + #
Expand Down
89 changes: 89 additions & 0 deletions imgui/core.pyx
Expand Up @@ -494,6 +494,76 @@ cdef class _DrawList(object):
thickness,
)

def add_circle(
self,
float center_x, float center_y,
float radius,
cimgui.ImU32 col,
# note: optional
int num_segments = 12,
float thickness = 1.0
):
"""Add a circle outline to the draw list.
Args:
center_x (float): X coordinate of center
center_y (float): Y coordinate of center
radius (float): radius
col (ImU32): RGBA color specification
# note: optional
num_segments (int): Number of line segments used to draw the circle, defaults to 12
thickness (float): Line thickness, defaults to 1.0
.. wraps::
void ImDrawList::AddCircle(
const ImVec2& center,
float radius,
ImU32 col,
int num_segments = 12,
float thickness = 1.0f
)
"""
self._ptr.AddCircle(
_cast_args_ImVec2(center_x, center_y),
radius,
col,
num_segments,
thickness
)

def add_circle_filled(
self,
float center_x, float center_y,
float radius,
cimgui.ImU32 col,
# note: optional
int num_segments = 12
):
"""Add a circle outline to the draw list.
Args:
center_x (float): X coordinate of center
center_y (float): Y coordinate of center
radius (float): radius
col (ImU32): RGBA color specification
# note: optional
num_segments (int): Number of line segments used to draw the circle, defaults to 12
.. wraps::
void ImDrawList::AddCircleFilled(
const ImVec2& center,
float radius,
ImU32 col,
int num_segments = 12
)
"""
self._ptr.AddCircleFilled(
_cast_args_ImVec2(center_x, center_y),
radius,
col,
num_segments
)



# channels
Expand Down Expand Up @@ -6715,6 +6785,25 @@ def set_current_context(_ImGuiContext ctx):
"""
cimgui.SetCurrentContext(ctx._ptr)

def push_id(str str_id):
"""Push an ID into the ID stack
Args:
id (str): ID to push
wraps::
PushID(const char* str_id)
"""
cimgui.PushID(_bytes(str_id))

def pop_id():
"""Pop from the ID stack
wraps::
PopID()
"""
cimgui.PopID()


# === Python/C++ cross API for error handling ===
from cpython.exc cimport PyErr_NewException
Expand Down

0 comments on commit 243495b

Please sign in to comment.