gi3dv

package
v0.5.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2023 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Scene3DType = gti.AddType(&gti.Type{
	Name:       "goki.dev/gi3d/gi3dv.Scene3D",
	ShortName:  "gi3dv.Scene3D",
	IDName:     "scene-3-d",
	Doc:        "Scene3D contains a svg.SVG element.\nThe rendered version is cached for a given size.",
	Directives: gti.Directives{},
	Fields: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{
		{"Scene", &gti.Field{Name: "Scene", Type: "goki.dev/gi3d.Scene", LocalType: "gi3d.Scene", Doc: "Scene is the 3D Scene", Directives: gti.Directives{}, Tag: ""}},
	}),
	Embeds: ordmap.Make([]ordmap.KeyVal[string, *gti.Field]{
		{"WidgetBase", &gti.Field{Name: "WidgetBase", Type: "goki.dev/gi/v2/gi.WidgetBase", LocalType: "gi.WidgetBase", Doc: "", Directives: gti.Directives{}, Tag: ""}},
	}),
	Methods:  ordmap.Make([]ordmap.KeyVal[string, *gti.Method]{}),
	Instance: &Scene3D{},
})

Scene3DType is the gti.Type for Scene3D

Functions

This section is empty.

Types

type MeshValue

type MeshValue struct {
	giv.ValueBase
}

MeshValue presents an action for displaying a MeshName and selecting meshes from a ChooserDialog

func (*MeshValue) ConfigWidget

func (vv *MeshValue) ConfigWidget(widg gi.Widget, sc *gi.Scene)

func (*MeshValue) HasDialog

func (vv *MeshValue) HasDialog() bool

func (*MeshValue) OpenDialog

func (vv *MeshValue) OpenDialog(ctx gi.Widget, fun func(dlg *gi.Dialog))

func (*MeshValue) UpdateWidget

func (vv *MeshValue) UpdateWidget()

func (*MeshValue) WidgetType

func (vv *MeshValue) WidgetType() *gti.Type

type Scene3D

type Scene3D struct {
	gi.WidgetBase

	// Scene is the 3D Scene
	Scene gi3d.Scene
}

Scene3D contains a svg.SVG element. The rendered version is cached for a given size.

func NewScene3D

func NewScene3D(par ki.Ki, name ...string) *Scene3D

NewScene3D adds a new Scene3D with the given name to the given parent. If the name is unspecified, it defaults to the ID (kebab-case) name of the type, plus the ki.Ki.NumLifetimeChildren of the given parent.

func (*Scene3D) ApplyStyle

func (se *Scene3D) ApplyStyle(sc *gi.Scene)

func (*Scene3D) ConfigFrame

func (se *Scene3D) ConfigFrame(sc *gi.Scene)

ConfigFrame configures the framebuffer for GPU rendering, using the RenderWin GPU and Device.

func (*Scene3D) ConfigWidget

func (se *Scene3D) ConfigWidget(sc *gi.Scene)

func (*Scene3D) CopyFieldsFrom

func (se *Scene3D) CopyFieldsFrom(frm any)

func (*Scene3D) DoLayout

func (se *Scene3D) DoLayout(sc *gi.Scene, parBBox image.Rectangle, iter int) bool

func (*Scene3D) DrawIntoScene

func (se *Scene3D) DrawIntoScene(sc *gi.Scene)

func (*Scene3D) GetSize

func (se *Scene3D) GetSize(sc *gi.Scene, iter int)

func (*Scene3D) HandleScene3DEvents

func (se *Scene3D) HandleScene3DEvents()

func (*Scene3D) KiType

func (t *Scene3D) KiType() *gti.Type

KiType returns the *gti.Type of Scene3D

func (*Scene3D) New

func (t *Scene3D) New() ki.Ki

New returns a new *Scene3D value

func (*Scene3D) OnInit

func (se *Scene3D) OnInit()

func (*Scene3D) Render

func (se *Scene3D) Render(sc *gi.Scene)

func (*Scene3D) Render3D

func (se *Scene3D) Render3D(sc *gi.Scene)

Render3D renders the Frame Image

func (*Scene3D) Scene3DStyles

func (se *Scene3D) Scene3DStyles()

func (*Scene3D) SetClass

func (t *Scene3D) SetClass(v string) *Scene3D

SetClass sets the [Scene3D.Class]

func (*Scene3D) SetCustomContextMenu

func (t *Scene3D) SetCustomContextMenu(v func(m *gi.Scene)) *Scene3D

SetCustomContextMenu sets the [Scene3D.CustomContextMenu]

func (*Scene3D) SetScene

func (t *Scene3D) SetScene(v gi3d.Scene) *Scene3D

SetScene sets the [Scene3D.Scene]: Scene is the 3D Scene

func (*Scene3D) SetTooltip

func (t *Scene3D) SetTooltip(v string) *Scene3D

SetTooltip sets the [Scene3D.Tooltip]

func (*Scene3D) UpdateEnd3D

func (se *Scene3D) UpdateEnd3D(updt bool)

UpdateEnd3D calls UpdateEnd on the 3D Scene: resets the scene ScUpdating flag if updt = true

func (*Scene3D) UpdateEndConfig3D

func (se *Scene3D) UpdateEndConfig3D(updt bool)

UpdateEndConfig3D calls UpdateEndConfig on the 3D Scene and calls gi SetNeedsRender. UpdateEndConfig resets the scene ScUpdating flag if updt = true and sets the ScNeedsConfig flag; updt is from UpdateStart(). Config is for Texture, Lighting Meshes or more complex nodes).

func (*Scene3D) UpdateEndRender3D

func (se *Scene3D) UpdateEndRender3D(updt bool)

UpdateEndRender3D calls UpdateEndRender on the 3D Scene and calls gi SetNeedsRender. resets the scene ScUpdating flag if updt = true and sets the ScNeedsRender flag; updt is from UpdateStart(). Render only updates based on camera changes, not any node-level changes. See [UpdateEndUpdate].

func (*Scene3D) UpdateEndUpdate3D

func (se *Scene3D) UpdateEndUpdate3D(updt bool)

UpdateEndUpdate3D calls UpdateEndUpdate on the 3D Scene and calls gi SetNeedsRender. UpdateEndUpdate resets the scene ScUpdating flag if updt = true and sets the ScNeedsUpdate flag; updt is from UpdateStart(). Update is for when any node Pose or material changes happen. See [UpdateEndConfig] for major changes.

func (*Scene3D) UpdateStart3D

func (se *Scene3D) UpdateStart3D() bool

UpdateStart3D calls UpdateStart on the 3D Scene: sets the scene ScUpdating flag to prevent render updates during construction on a scene. if already updating, returns false. Pass the result to UpdateEnd* methods.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL