Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Gizmo widget and example for it #897

Merged
merged 26 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
42fe9f8
gizmos: add basic widget and api design
gucio321 Oct 29, 2024
e4814bb
examples: add gizmo example
gucio321 Oct 29, 2024
5369a08
update gizmo things - add CubeGizmo and GridGizmo
gucio321 Oct 29, 2024
fb155e9
gizmo: add manipulate gizmo
gucio321 Oct 29, 2024
549ff8a
Gizmo: add comments
gucio321 Oct 29, 2024
3c8da73
gizmos: add grid thickness
gucio321 Oct 29, 2024
f45cf38
Gizmos: handle positions/sizes correctly
gucio321 Oct 29, 2024
9af76db
update example
gucio321 Oct 29, 2024
d59df04
gizmo: add mode and operation
gucio321 Oct 29, 2024
cfb8ed7
gizmo: add ViewManipulate
gucio321 Oct 29, 2024
b0a2a50
examples/gizmo: update exmple
gucio321 Oct 29, 2024
2201520
gizmos: implement projection matrix
gucio321 Oct 29, 2024
9793833
update example
gucio321 Oct 29, 2024
dba7bfb
gizmo: rename HumanReadableMatrix -> ViewMatrix
gucio321 Oct 30, 2024
fcc0bb4
gizmo: update example
gucio321 Oct 30, 2024
0efc5d6
Gizmo: update matrices api
gucio321 Oct 30, 2024
be881f0
gizmo: implement imguizmo ID mechanism
gucio321 Oct 30, 2024
da0b8d2
examples/gizmo: remove unused globals
gucio321 Oct 30, 2024
82d6fc9
examples/gizmo: final updates
gucio321 Oct 30, 2024
0ba6bb4
gizmo: add Disabled
gucio321 Oct 30, 2024
2d77525
examples/gizmo: implement disabled
gucio321 Oct 30, 2024
62ea34f
gizmo: add orthographic method
gucio321 Oct 30, 2024
de8e1b9
gizmo: add possibility to set gird matrix
gucio321 Oct 30, 2024
c24ac3b
golangci-lin run --fix
gucio321 Oct 30, 2024
5700c60
linting(Gizmo)
gucio321 Oct 30, 2024
9099cfd
lint(examples/gizmo)
gucio321 Oct 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion ExtraWidgets.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,11 @@ func (h *SplitterWidget) Build() {
canvas.AddRectFilled(pt.Add(ptMin), pt.Add(ptMax), c, 0, 0)
}

var _ Widget = &CustomWidget{}
var (
_ Widget = &CustomWidget{}
_ PlotWidget = &CustomWidget{}
_ GizmoI = &CustomWidget{}
)

// CustomWidget allows you to do whatever you want.
// This includes:
Expand Down Expand Up @@ -142,6 +146,11 @@ func (c *CustomWidget) Plot() {
c.Build()
}

// Gizmo implements GizmoI interface.
func (c *CustomWidget) Gizmo(_ *ViewMatrix, _ *ProjectionMatrix) {
c.Build()
}

var _ Widget = &ConditionWidget{}

// ConditionWidget allows to build if a condition is met
Expand Down
Loading
Loading