Documentation ¶
Overview ¶
Package xyzcore provides a GUI view for a 3D xyz scene.
Index ¶
- Constants
- type ManipPoint
- type MeshButton
- type Scene
- func (sw *Scene) Destroy()
- func (sw *Scene) Init()
- func (sw *Scene) ManipBox()
- func (sw *Scene) OnAdd()
- func (sw *Scene) Render()
- func (sw *Scene) RenderDraw(drw system.Drawer, op draw.Op)
- func (sw *Scene) SceneXYZ() *xyz.Scene
- func (sw *Scene) SelectBox()
- func (t *Scene) SetCurrentManipPoint(v *ManipPoint) *Scene
- func (t *Scene) SetCurrentSelected(v xyz.Node) *Scene
- func (sw *Scene) SetSelected(nd xyz.Node)
- func (t *Scene) SetSelectionMode(v SelectionModes) *Scene
- func (t *Scene) SetSelectionParams(v SelectionParams) *Scene
- type SceneEditor
- type SelectionModes
- func (i SelectionModes) Desc() string
- func (i SelectionModes) Int64() int64
- func (i SelectionModes) MarshalText() ([]byte, error)
- func (i *SelectionModes) SetInt64(in int64)
- func (i *SelectionModes) SetString(s string) error
- func (i SelectionModes) String() string
- func (i *SelectionModes) UnmarshalText(text []byte) error
- func (i SelectionModes) Values() []enums.Enum
- type SelectionParams
Constants ¶
const ( // SelectedBoxName 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. SelectedBoxName = "__SelectedBox" // ManipBoxName is the reserved top-level name for meshes // representing the manipulation box. ManipBoxName = "__ManipBox" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ManipPoint ¶
ManipPoint is a manipulation control point.
type MeshButton ¶
MeshButton represents an xyz.MeshName value with a button.
func NewMeshButton ¶
func NewMeshButton(parent ...tree.Node) *MeshButton
NewMeshButton returns a new MeshButton with the given optional parent: MeshButton represents an xyz.MeshName value with a button.
func (*MeshButton) Init ¶
func (mb *MeshButton) Init()
func (*MeshButton) SetMeshName ¶
func (t *MeshButton) SetMeshName(v string) *MeshButton
SetMeshName sets the [MeshButton.MeshName]
func (*MeshButton) WidgetValue ¶
func (mb *MeshButton) WidgetValue() any
type Scene ¶
type Scene struct { core.WidgetBase // XYZ is the 3D xyz.Scene XYZ *xyz.Scene `set:"-"` // how to deal with selection / manipulation events SelectionMode SelectionModes // currently selected node CurrentSelected xyz.Node `copier:"-" json:"-" xml:"-" display:"-"` // currently selected manipulation control point CurrentManipPoint *ManipPoint `copier:"-" json:"-" xml:"-" display:"-"` // parameters for selection / manipulation box SelectionParams SelectionParams `display:"inline"` }
Scene is a core.Widget that manages a xyz.Scene, providing the basic rendering logic for the 3D scene in the 2D core GUI context.
func NewScene ¶
NewScene returns a new Scene with the given optional parent: Scene is a core.Widget that manages a xyz.Scene, providing the basic rendering logic for the 3D scene in the 2D core GUI context.
func (*Scene) ManipBox ¶
func (sw *Scene) ManipBox()
ManipBox draws a manipulation box around selected node
func (*Scene) RenderDraw ¶ added in v0.3.2
RenderDraw draws the current image to RenderWindow drawer
func (*Scene) SelectBox ¶
func (sw *Scene) SelectBox()
SelectBox draws a selection box around selected node
func (*Scene) SetCurrentManipPoint ¶
func (t *Scene) SetCurrentManipPoint(v *ManipPoint) *Scene
SetCurrentManipPoint sets the [Scene.CurrentManipPoint]: currently selected manipulation control point
func (*Scene) SetCurrentSelected ¶
SetCurrentSelected sets the [Scene.CurrentSelected]: currently selected node
func (*Scene) SetSelected ¶
SetSelected -- if Selectable is true, then given object is selected if node is nil then selection is reset.
func (*Scene) SetSelectionMode ¶
func (t *Scene) SetSelectionMode(v SelectionModes) *Scene
SetSelectionMode sets the [Scene.SelectionMode]: how to deal with selection / manipulation events
func (*Scene) SetSelectionParams ¶
func (t *Scene) SetSelectionParams(v SelectionParams) *Scene
SetSelectionParams sets the [Scene.SelectionParams]: parameters for selection / manipulation box
type SceneEditor ¶
SceneEditor provides a toolbar controller and manipulation abilities for a Scene.
func NewSceneEditor ¶
func NewSceneEditor(parent ...tree.Node) *SceneEditor
NewSceneEditor returns a new SceneEditor with the given optional parent: SceneEditor provides a toolbar controller and manipulation abilities for a Scene.
func (*SceneEditor) Init ¶
func (sv *SceneEditor) Init()
func (*SceneEditor) MakeToolbar ¶
func (sv *SceneEditor) MakeToolbar(p *tree.Plan)
func (*SceneEditor) SceneWidget ¶
func (sv *SceneEditor) SceneWidget() *Scene
SceneWidget returns the Scene widget.
type SelectionModes ¶
type SelectionModes int32 //enums:enum
SelectionModes are selection modes for Scene
const ( // NotSelectable means that selection events are ignored entirely NotSelectable SelectionModes = 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 SelectionModesN SelectionModes = 4
SelectionModesN is the highest valid value for type SelectionModes, plus one.
func SelectionModesValues ¶
func SelectionModesValues() []SelectionModes
SelectionModesValues returns all possible values for the type SelectionModes.
func (SelectionModes) Desc ¶
func (i SelectionModes) Desc() string
Desc returns the description of the SelectionModes value.
func (SelectionModes) Int64 ¶
func (i SelectionModes) Int64() int64
Int64 returns the SelectionModes value as an int64.
func (SelectionModes) MarshalText ¶
func (i SelectionModes) MarshalText() ([]byte, error)
MarshalText implements the encoding.TextMarshaler interface.
func (*SelectionModes) SetInt64 ¶
func (i *SelectionModes) SetInt64(in int64)
SetInt64 sets the SelectionModes value from an int64.
func (*SelectionModes) SetString ¶
func (i *SelectionModes) SetString(s string) error
SetString sets the SelectionModes value from its string representation, and returns an error if the string is invalid.
func (SelectionModes) String ¶
func (i SelectionModes) String() string
String returns the string representation of this SelectionModes value.
func (*SelectionModes) UnmarshalText ¶
func (i *SelectionModes) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
func (SelectionModes) Values ¶
func (i SelectionModes) Values() []enums.Enum
Values returns all possible values for the type SelectionModes.
type SelectionParams ¶
type SelectionParams 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"` }
SelectionParams are parameters for selection / manipulation box
func (*SelectionParams) Defaults ¶
func (sp *SelectionParams) Defaults()