groups

package
v0.0.0-...-804368d Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NamedIndex        GroupIndex = 80
	NamedListIndex               = 100
	NodeSupportsIndex            = 1000
	MetaIndex                    = 10000
	CopyIndex                    = 10100
)

Variables

This section is empty.

Functions

func Change

func Change(m Mesh,
	nb, eb bool,
	nodes, elements *[]uint,
	update func(),
) (
	w vl.Widget,
)

func FixMesh

func FixMesh(mesh Mesh)

func NewGroupTree

func NewGroupTree(mesh Mesh, closedApp *bool, actions *chan ds.Action) (gt vl.Widget, initialization func(), err error)

func SaveGroup

func SaveGroup(gr Group) (bs []byte, err error)

SaveGroup return stored information at json format

Types

type Copy

type Copy struct {
	Idable

	Link int
	// contains filtered or unexported fields
}

func (Copy) GetGroupIndex

func (c Copy) GetGroupIndex() GroupIndex

func (*Copy) GetWidget

func (c *Copy) GetWidget(updateTree func(detail Group)) (w vl.Widget)

func (*Copy) SetRoot

func (r *Copy) SetRoot(root Mesh)

func (Copy) String

func (c Copy) String() string

func (Copy) Update

func (c Copy) Update(updating func(nodes, elements *[]uint))

type Group

type Group interface {
	// UniqueId of group, only for save/parse of group
	SetUniqueId(id int)
	GetUniqueId() int

	// update root group
	SetRoot(root Mesh)

	// operations with group
	GetGroupIndex() GroupIndex
	String() string
	Update(updating func(nodes, elements *[]uint))         // update nodes, elements indexes
	GetWidget(updateTree func(detail Group)) (_ vl.Widget) // return gui widget
}

func ParseGroup

func ParseGroup(bs []byte) (gr Group, err error)

ParseGroup return group from json

type GroupIndex

type GroupIndex uint16

max uint16: 65535

func (GroupIndex) String

func (gi GroupIndex) String() string

type GroupTest

type GroupTest struct {
	// contains filtered or unexported fields
}

func (GroupTest) GetRootGroup

func (g GroupTest) GetRootGroup() Group

func (GroupTest) GetSelected

func (g GroupTest) GetSelected() (nodes, elements []uint)

func (GroupTest) Select

func (g GroupTest) Select(nodes, elements []uint)

func (GroupTest) Update

func (g GroupTest) Update(nodes, elements *uint)

type Idable

type Idable struct{ ID int }

func (Idable) GetUniqueId

func (id Idable) GetUniqueId() int

func (*Idable) SetUniqueId

func (id *Idable) SetUniqueId(v int)

type Mesh

type Mesh interface {
	GetRootGroup() Group
	Update(nodes, elements *uint)

	Select(nodes, elements []uint)
	GetSelected() (nodes, elements []uint)
}

type Meta

type Meta struct {
	Idable
	Named
	Groups []Group
}

func (Meta) GetGroupIndex

func (m Meta) GetGroupIndex() GroupIndex

func (*Meta) GetWidget

func (m *Meta) GetWidget(updateTree func(gr Group)) (w vl.Widget)

func (*Meta) SetRoot

func (r *Meta) SetRoot(root Mesh)

func (*Meta) Update

func (m *Meta) Update(updating func(nodes, elements *[]uint))

type Named

type Named struct {
	Idable

	Name string
	// contains filtered or unexported fields
}

func (Named) GetGroupIndex

func (m Named) GetGroupIndex() GroupIndex

func (*Named) GetWidget

func (m *Named) GetWidget(updateTree func(gr Group)) (w vl.Widget)

func (*Named) SetRoot

func (r *Named) SetRoot(root Mesh)

func (Named) String

func (m Named) String() (name string)

func (*Named) Update

func (m *Named) Update(updating func(nodes, elements *[]uint))

type NamedList

type NamedList struct {
	Idable
	Named
	Nodes, Elements []uint
}

func (NamedList) GetGroupIndex

func (m NamedList) GetGroupIndex() GroupIndex

func (*NamedList) GetWidget

func (m *NamedList) GetWidget(updateTree func(gr Group)) (w vl.Widget)

func (*NamedList) SetRoot

func (r *NamedList) SetRoot(root Mesh)

func (NamedList) String

func (m NamedList) String() (name string)

func (*NamedList) Update

func (m *NamedList) Update(updating func(nodes, elements *[]uint))

type NodeSupports

type NodeSupports struct {
	Idable
	Named
	Direction [6]bool
	Nodes     []uint
}

func (NodeSupports) GetGroupIndex

func (m NodeSupports) GetGroupIndex() GroupIndex

func (*NodeSupports) GetWidget

func (m *NodeSupports) GetWidget(updateTree func(gr Group)) (w vl.Widget)

func (*NodeSupports) SetRoot

func (r *NodeSupports) SetRoot(root Mesh)

func (NodeSupports) String

func (m NodeSupports) String() (name string)

func (*NodeSupports) Update

func (m *NodeSupports) Update(updating func(nodes, elements *[]uint))

Jump to

Keyboard shortcuts

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