nmwsharp / nmwsharp/polyscope

Addition to callbacks & custom UIs - Python

オープン
#279 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
C++
スター
2.2k
フォーク
242
平均マージ
11分
マージ済み PR(30日)
1

説明

https://polyscope.run/py/features/callbacks_and_UIs/#creating-custom-uis

#If we want to use local variables & assign to them in the UI code below, 
# we need to mark them as nonlocal. This is because of how Python scoping 
# rules work, not anything particular about Polyscope or ImGui.
# Of course, you can also use any other kind of python variable as a controllable 
# value in the UI, such as a value from a dictionary, or a class member. Just be 
# sure to assign the result of the ImGui call to the value, as in the examples below.
# 
# If these variables are defined at the top level of a Python script file (i.e., not
# inside any method), you will need to use the `global` keyword instead of nonlocal`.

If you want to avoid using declarations global or nonlocal,
you can also use different module to store these values and call it on main module as below

variables.py
is_true: bool = False

main.py

import variables as vr

def callback()
        change, vr.is_true = psim.Checkbox("Selection box", vr.is_true)

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

リンクされている callbacks とカスタム UIs のドキュメントページから始め、周辺の例を確認してください。UI で制御される値を保存する、示されている Python モジュールベースのアプローチを、global と nonlocal に関する既存の説明に加えてください。例には variables.py と main.py を使用します。ページでこの代替方法が明確に説明され、例が callback API と一貫していれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
documentation
issue の種類
ドキュメント
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。