Documentation
¶
Overview ¶
Package relpos defines a position relationship among layers, in terms of X,Y width and height of layer and associated position within a given X-Y plane, and Z vertical stacking of layers above and below each other.
Index ¶
- type Rel
- type Relations
- func (i Relations) Desc() string
- func (i Relations) Int64() int64
- func (i Relations) IsValid() bool
- func (i Relations) MarshalText() ([]byte, error)
- func (i *Relations) SetInt64(in int64)
- func (i *Relations) SetString(s string) error
- func (i Relations) String() string
- func (i *Relations) UnmarshalText(text []byte) error
- func (i Relations) Values() []enums.Enum
- type XAligns
- func (i XAligns) Desc() string
- func (i XAligns) Int64() int64
- func (i XAligns) IsValid() bool
- func (i XAligns) MarshalText() ([]byte, error)
- func (i *XAligns) SetInt64(in int64)
- func (i *XAligns) SetString(s string) error
- func (i XAligns) String() string
- func (i *XAligns) UnmarshalText(text []byte) error
- func (i XAligns) Values() []enums.Enum
- type YAligns
- func (i YAligns) Desc() string
- func (i YAligns) Int64() int64
- func (i YAligns) IsValid() bool
- func (i YAligns) MarshalText() ([]byte, error)
- func (i *YAligns) SetInt64(in int64)
- func (i *YAligns) SetString(s string) error
- func (i YAligns) String() string
- func (i *YAligns) UnmarshalText(text []byte) error
- func (i YAligns) Values() []enums.Enum
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Rel ¶
type Rel struct { // spatial relationship between this layer and the other layer Rel Relations // ] horizontal (x-axis) alignment relative to other XAlign XAligns `viewif:"Rel=[FrontOf,Behind,Above,Below]"` // ] vertical (y-axis) alignment relative to other YAlign YAligns `viewif:"Rel=[LeftOf,RightOf,Above,Below]"` // name of the other layer we are in relationship to Other string // scaling factor applied to layer size for displaying Scale float32 // number of unit-spaces between us Space float32 // for vertical (y-axis) alignment, amount we are offset relative to perfect alignment XOffset float32 // for horizontial (x-axis) alignment, amount we are offset relative to perfect alignment YOffset float32 }
Rel defines a position relationship among layers, in terms of X,Y width and height of layer and associated position within a given X-Y plane, and Z vertical stacking of layers above and below each other.
func NewAbove ¶
NewAbove returns an Above relationship with default XAlign: Left, YAlign: Front alignment
func NewBehind ¶
NewBehind returns a Behind relationship with default XAlign: Left alignment and given spacing
func NewRightOf ¶
NewRightOf returns a RightOf relationship with default YAlign: Front alignment and given spacing
func (*Rel) AlignXPos ¶
AlignXPos returns the X-axis (within-plane horizontal or width) position according to alignment factors
func (*Rel) AlignYPos ¶
AlignYPos returns the Y-axis (within-plane vertical or height) position according to alignment factors
type Relations ¶
type Relations int32 //enums:enum
Relations are different spatial relationships (of layers)
const RelationsN Relations = 7
RelationsN is the highest valid value for type Relations, plus one.
func RelationsValues ¶
func RelationsValues() []Relations
RelationsValues returns all possible values for the type Relations.
func (Relations) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (*Relations) SetString ¶
SetString sets the Relations value from its string representation, and returns an error if the string is invalid.
func (*Relations) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.
type XAligns ¶
type XAligns int32 //enums:enum
XAligns are different horizontal alignments
const XAlignsN XAligns = 3
XAlignsN is the highest valid value for type XAligns, plus one.
func XAlignsValues ¶
func XAlignsValues() []XAligns
XAlignsValues returns all possible values for the type XAligns.
func (XAligns) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (*XAligns) SetString ¶
SetString sets the XAligns value from its string representation, and returns an error if the string is invalid.
func (*XAligns) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.
type YAligns ¶
type YAligns int32 //enums:enum
YAligns are different vertical alignments
const YAlignsN YAligns = 3
YAlignsN is the highest valid value for type YAligns, plus one.
func YAlignsValues ¶
func YAlignsValues() []YAligns
YAlignsValues returns all possible values for the type YAligns.
func (YAligns) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (*YAligns) SetString ¶
SetString sets the YAligns value from its string representation, and returns an error if the string is invalid.
func (*YAligns) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.