Documentation ¶
Index ¶
- Constants
- Variables
- type ManipPt
- type MeshValue
- type Scene
- func (sw *Scene) Config()
- func (sw *Scene) ConfigFrame()
- func (sw *Scene) Destroy()
- func (sw *Scene) DirectRenderDraw(drw goosi.Drawer, idx int, flipY bool)
- func (sw *Scene) DirectRenderImage(drw goosi.Drawer, idx int)
- func (sw *Scene) DrawIntoScene()
- func (sw *Scene) HandleEvents()
- func (sw *Scene) HandleSelectEvents()
- func (sw *Scene) HandleSelectEventsImpl(e events.Event)
- func (sw *Scene) HandleSlideEvents()
- func (t *Scene) KiType() *gti.Type
- func (sw *Scene) ManipBox()
- func (t *Scene) New() ki.Ki
- func (sw *Scene) OnAdd()
- func (sw *Scene) OnInit()
- func (sw *Scene) Render()
- func (sw *Scene) Render3D()
- func (sw *Scene) SceneXYZ() *xyz.Scene
- func (sw *Scene) SelectBox()
- func (t *Scene) SetCurManipPt(v *ManipPt) *Scene
- func (t *Scene) SetCurSel(v xyz.Node) *Scene
- func (sw *Scene) SetManipPt(pt *ManipPt)
- func (sw *Scene) SetSel(nd xyz.Node)
- func (t *Scene) SetSelMode(v SelModes) *Scene
- func (t *Scene) SetSelParams(v SelParams) *Scene
- func (sw *Scene) SetStyles()
- func (t *Scene) SetTooltip(v string) *Scene
- type SceneView
- func (sv *SceneView) Config()
- func (sv *SceneView) ConfigSceneView()
- func (sv *SceneView) ConfigToolbar(tb *gi.Toolbar)
- func (t *SceneView) KiType() *gti.Type
- func (t *SceneView) New() ki.Ki
- func (sv *SceneView) OnInit()
- func (sv *SceneView) SceneWidget() *Scene
- func (sv *SceneView) SceneXYZ() *xyz.Scene
- func (t *SceneView) SetStackTop(v int) *SceneView
- func (t *SceneView) SetTooltip(v string) *SceneView
- func (sv *SceneView) Toolbar() *gi.Toolbar
- func (sv *SceneView) UpdateToolbar()
- type SelModes
- func (i SelModes) Desc() string
- func (i SelModes) Int64() int64
- func (i SelModes) MarshalText() ([]byte, error)
- func (i *SelModes) SetInt64(in int64)
- func (i *SelModes) SetString(s string) error
- func (i SelModes) String() string
- func (i *SelModes) UnmarshalText(text []byte) error
- func (i SelModes) Values() []enums.Enum
- type SelParams
Constants ¶
const ( // SelBoxName is the reserved top-level Group name for holding // a bounding box or manipulator for currently selected object. // also used for meshes representing the box. SelBoxName = "__SelectedBox" // ManipBoxName is the reserved top-level name for meshes // representing the manipulation box. ManipBoxName = "__ManipBox" )
Variables ¶
var ManipPtType = gti.AddType(>i.Type{Name: "cogentcore.org/core/xyzv.ManipPt", IDName: "manip-pt", Doc: "ManipPt is a manipulation control point", Directives: []gti.Directive{{Tool: "core", Directive: "no-new"}}, Embeds: []gti.Field{{Name: "Solid"}}, Instance: &ManipPt{}})
ManipPtType is the gti.Type for ManipPt
var SceneType = gti.AddType(>i.Type{Name: "cogentcore.org/core/xyzv.Scene", IDName: "scene", Doc: "Scene is a gi.Widget that manages a xyz.Scene,\nproviding the basic rendering logic for the 3D scene\nin the 2D gi gui context.", Embeds: []gti.Field{{Name: "WidgetBase"}}, Fields: []gti.Field{{Name: "XYZ", Doc: "XYZ is the 3D xyz.Scene"}, {Name: "SelMode", Doc: "how to deal with selection / manipulation events"}, {Name: "CurSel", Doc: "currently selected node"}, {Name: "CurManipPt", Doc: "currently selected manipulation control point"}, {Name: "SelParams", Doc: "parameters for selection / manipulation box"}}, Instance: &Scene{}})
Functions ¶
This section is empty.
Types ¶
type ManipPt ¶
ManipPt is a manipulation control point
func NewManipPt ¶
NewManipPt adds a new manipulation point
type MeshValue ¶
MeshValue represents an xyz.MeshName with a button.
type Scene ¶
type Scene struct { gi.WidgetBase // XYZ is the 3D xyz.Scene XYZ *xyz.Scene `set:"-"` // how to deal with selection / manipulation events SelMode SelModes // currently selected node CurSel xyz.Node `copier:"-" json:"-" xml:"-" view:"-"` // currently selected manipulation control point CurManipPt *ManipPt `copier:"-" json:"-" xml:"-" view:"-"` // parameters for selection / manipulation box SelParams SelParams `view:"inline"` }
Scene is a gi.Widget that manages a xyz.Scene, providing the basic rendering logic for the 3D scene in the 2D gi gui context.
func NewScene ¶
NewScene adds a new Scene with the given name to the given parent: Scene is a gi.Widget that manages a xyz.Scene, providing the basic rendering logic for the 3D scene in the 2D gi gui context.
func (*Scene) ConfigFrame ¶
func (sw *Scene) ConfigFrame()
ConfigFrame configures the framebuffer for GPU rendering, using the RenderWin GPU and Device.
func (*Scene) DirectRenderDraw ¶ added in v0.0.9
DirectRenderDraw draws the current image to RenderWin drawer
func (*Scene) DirectRenderImage ¶ added in v0.0.9
DirectRenderImage uploads framebuffer image
func (*Scene) DrawIntoScene ¶
func (sw *Scene) DrawIntoScene()
DrawIntoScene is the slower path for rendering, by grabbing the image down from the GPU and drawing it into the Scene image. This is retained for the time being in case it is needed for another case.
func (*Scene) HandleEvents ¶
func (sw *Scene) HandleEvents()
func (*Scene) HandleSelectEvents ¶
func (sw *Scene) HandleSelectEvents()
func (*Scene) HandleSelectEventsImpl ¶
func (*Scene) HandleSlideEvents ¶
func (sw *Scene) HandleSlideEvents()
func (*Scene) ManipBox ¶
func (sw *Scene) ManipBox()
ManipBox draws a manipulation box around selected node
func (*Scene) SelectBox ¶
func (sw *Scene) SelectBox()
SelectBox draws a selection box around selected node
func (*Scene) SetCurManipPt ¶
SetCurManipPt sets the [Scene.CurManipPt]: currently selected manipulation control point
func (*Scene) SetSel ¶
SetSel -- if Selectable is true, then given object is selected if node is nil then selection is reset.
func (*Scene) SetSelMode ¶
SetSelMode sets the [Scene.SelMode]: how to deal with selection / manipulation events
func (*Scene) SetSelParams ¶
SetSelParams sets the [Scene.SelParams]: parameters for selection / manipulation box
func (*Scene) SetTooltip ¶
SetTooltip sets the [Scene.Tooltip]
type SceneView ¶
SceneView provides a toolbar controller for an xyz.Scene, and manipulation abilities.
func NewSceneView ¶
NewSceneView adds a new SceneView with the given name to the given parent: SceneView provides a toolbar controller for an xyz.Scene, and manipulation abilities.
func (*SceneView) ConfigSceneView ¶
func (sv *SceneView) ConfigSceneView()
func (*SceneView) ConfigToolbar ¶
func (*SceneView) SceneWidget ¶
SceneWidget returns the gi.Widget Scene (xyzv.Scene)
func (*SceneView) SetStackTop ¶
SetStackTop sets the [SceneView.StackTop]
func (*SceneView) SetTooltip ¶
SetTooltip sets the [SceneView.Tooltip]
func (*SceneView) UpdateToolbar ¶
func (sv *SceneView) UpdateToolbar()
type SelModes ¶
type SelModes int32 //enums:enum
SelModes are selection modes for Scene
const ( // NotSelectable means that selection events are ignored entirely NotSelectable SelModes = iota // Selectable means that nodes can be selected but no visible consequence occurs Selectable // SelectionBox means that a selection bounding box is drawn around selected nodes SelectionBox // Manipulable means that a manipulation box will be created for selected nodes, // which can update the Pose parameters dynamically. Manipulable )
const SelModesN SelModes = 4
SelModesN is the highest valid value for type SelModes, plus one.
func SelModesValues ¶
func SelModesValues() []SelModes
SelModesValues returns all possible values for the type SelModes.
func (SelModes) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (*SelModes) SetString ¶
SetString sets the SelModes value from its string representation, and returns an error if the string is invalid.
func (*SelModes) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.
type SelParams ¶
type SelParams struct { // color for selection box (default yellow) Color color.RGBA // width of the box lines, scaled by view distance Width float32 `default:"0.001"` // radius of the manipulation control point spheres, scaled by view distance Radius float32 `default:"0.005"` }
SelParams are parameters for selection / manipulation box