Documentation ¶
Index ¶
- Variables
- func ComponentsToDynMap(c []Component) []*dynmap.DynMap
- func EvalExpression(expression string, element Element) (interface{}, error)
- func InchToMM(inch float64) float64
- func MMToInch(mm float64) float64
- func ParseToHFDMap(raw string, logger *util.HfdLog) (*dynmap.DynMap, error)
- type Attr
- func (b *Attr) Bool(param string) (bool, bool)
- func (b *Attr) Float64(param string) (float64, bool)
- func (b *Attr) Handle(param string) (path.PathAttr, bool)
- func (b *Attr) Int(param string) (int, bool)
- func (b *Attr) MustBool(param string, def bool) bool
- func (b *Attr) MustFloat64(param string, def float64) float64
- func (b *Attr) MustHandle(param string, def path.PathAttr) path.PathAttr
- func (b *Attr) MustInt(param string, def int) int
- func (b *Attr) MustPoint(param string, def path.Point) path.Point
- func (b *Attr) MustPoint2(param string, from path.Point, def path.Point) path.Point
- func (b *Attr) MustString(param string, def string) string
- func (b *Attr) Point(param string) (path.Point, bool)
- func (b *Attr) Point2(param string, from path.Point) (path.Point, bool)
- func (b *Attr) String(param string) (string, bool)
- func (b *Attr) SvgString(param string) (string, bool)
- func (b *Attr) ToPoint(v interface{}) (path.Point, bool)
- type BasicComponent
- func (b *BasicComponent) Attr() *Attr
- func (b *BasicComponent) Children() []Element
- func (b *BasicComponent) Defaults() *dynmap.DynMap
- func (b *BasicComponent) DmAttr(mp *dynmap.DynMap) *Attr
- func (b *BasicComponent) ElementType() string
- func (b *BasicComponent) HandleTransforms(self Component, pth path.Path, ctx RenderContext) (path.Path, RenderContext, error)
- func (b *BasicComponent) Id() string
- func (b *BasicComponent) Measure() (float64, float64, error)
- func (b *BasicComponent) ParamLookerUpper() ParamLookerUpper
- func (b *BasicComponent) Params() *dynmap.DynMap
- func (b *BasicComponent) Parent() Element
- func (b *BasicComponent) Render(ctx RenderContext) (path.Path, RenderContext, error)
- func (b *BasicComponent) RenderContext() (RenderContext, bool)
- func (b *BasicComponent) RenderStart(ctx RenderContext)
- func (b *BasicComponent) SetChildren(c []Element)
- func (b *BasicComponent) SetComponents(c []Component)
- func (b *BasicComponent) SetGlobalVariable(key string, val interface{})
- func (b *BasicComponent) SetLocalVariable(key string, val interface{})
- func (b *BasicComponent) SetParent(p Element)
- func (b *BasicComponent) ToDynMap() *dynmap.DynMap
- func (b *BasicComponent) Transforms() []*dynmap.DynMap
- type BasicElement
- func (b *BasicElement) Attr() *Attr
- func (b *BasicElement) Defaults() *dynmap.DynMap
- func (b *BasicElement) DmAttr(mp *dynmap.DynMap) *Attr
- func (b *BasicElement) ElementType() string
- func (b *BasicElement) Id() string
- func (b *BasicElement) ParamLookerUpper() ParamLookerUpper
- func (b *BasicElement) Params() *dynmap.DynMap
- func (b *BasicElement) SetGlobalVariable(key string, val interface{})
- func (b *BasicElement) SetLocalVariable(key string, val interface{})
- func (b *BasicElement) ToDynMap() *dynmap.DynMap
- type BasicParamLookerUpper
- func (p *BasicParamLookerUpper) Float64(param string) (float64, bool)
- func (p *BasicParamLookerUpper) Lookup(param string) (interface{}, bool)
- func (p *BasicParamLookerUpper) MustFloat64(param string, def float64) float64
- func (p *BasicParamLookerUpper) MustString(param string, def string) string
- func (p *BasicParamLookerUpper) String(param string) (string, bool)
- func (p *BasicParamLookerUpper) ToFloat64(obj interface{}) (float64, error)
- type CleanupTransformFactory
- type Component
- type ComponentFactory
- type Document
- type DocumentContext
- type DocumentParser
- type DrawComponent
- type DrawComponentFactory
- type DynMapParamLookerUpper
- type Element
- type Factories
- func (c *Factories) AddComponentFactory(cf ComponentFactory)
- func (c *Factories) AddPartTransformerFactory(tf PartTransformerFactory)
- func (c *Factories) AddTransformFactory(tf TransformFactory)
- func (c *Factories) DocumentParser() DocumentParser
- func (c *Factories) FileLoader() FileLoader
- func (c *Factories) Init(componentFactories []ComponentFactory, transformFactories []TransformFactory, ...)
- func (c *Factories) MakeBasicComponent(dm *dynmap.DynMap) *BasicComponent
- func (c *Factories) MakeBasicElement(dm *dynmap.DynMap) *BasicElement
- func (c *Factories) MakeComponent(dm *dynmap.DynMap, dc *DocumentContext) (Component, error)
- func (c *Factories) MakeComponents(dm []*dynmap.DynMap, dc *DocumentContext) ([]Component, error)
- func (c *Factories) MakePartTransformer(transformType string, dm *dynmap.DynMap, part *Part) (PartTransformer, error)
- func (c *Factories) MakePartTransformers(dm []*dynmap.DynMap, part *Part) ([]PartTransformer, error)
- func (c *Factories) MakeTransform(transformType string, dm *dynmap.DynMap, element Element) (path.PathTransform, error)
- func (c *Factories) MakeTransforms(dm []*dynmap.DynMap, element Element) ([]path.PathTransform, error)
- func (c *Factories) ParseSVG(svg string, logger *util.HfdLog) (path.Path, error)
- func (c *Factories) Precision() int
- func (c *Factories) SegmentOperators() path.SegmentOperators
- func (c *Factories) SetFileLoader(fl FileLoader)
- type FileLoader
- type GroupComponent
- type GroupComponentFactory
- type JoinTransformFactory
- type Label
- type LathePartTransform
- type MatrixTransformFactory
- type MirrorTransformFactory
- type MoveTransformFactory
- type OffsetTransformFactory
- type OversizeStrategy
- type ParamLookerUpper
- type Part
- type PartFactory
- type PartLatheTransformerFactory
- type PartSplitter
- type PartSplitterTransformerFactory
- type PartTransformer
- type PartTransformerFactory
- type PlanSet
- type RenderContext
- type RenderStrategy
- type RenderedPart
- type ReorderTransformFactory
- type RepeatComponent
- type RepeatComponentFactory
- type ReverseTransformFactory
- type RotateScaleTransformFactory
- type RotateTransformFactory
- type SVGDocument
- type SVGParser
- type ScaleTransformFactory
- type SliceTransformFactory
- type TransformFactory
- type TrimTransformFactory
- type Units
Constants ¶
This section is empty.
Variables ¶
var Inches = Units{
"Inches", "in",
}
Functions ¶
func ComponentsToDynMap ¶
Converts a list of components to the list of DynMaps
func EvalExpression ¶
Types ¶
type Attr ¶
type Attr struct {
// contains filtered or unexported fields
}
Attributes should be local to the component Referenced params will get looked up through the stack, but it is expected that the attributes are available at the component level.
func NewAttrElement ¶
func (*Attr) MustPoint2 ¶
type BasicComponent ¶
type BasicComponent struct {
// contains filtered or unexported fields
}
provides most of the component functionality Note we copy pasta the BAsicElement here because embedding does not work for the param lookup pieces
func (*BasicComponent) Attr ¶
func (b *BasicComponent) Attr() *Attr
returns an attribute finder based on the the original map of this element
func (*BasicComponent) Children ¶
func (b *BasicComponent) Children() []Element
func (*BasicComponent) Defaults ¶
func (b *BasicComponent) Defaults() *dynmap.DynMap
func (*BasicComponent) DmAttr ¶
func (b *BasicComponent) DmAttr(mp *dynmap.DynMap) *Attr
returns an attribute finder based on the passed in dynmap
func (*BasicComponent) ElementType ¶
func (b *BasicComponent) ElementType() string
func (*BasicComponent) HandleTransforms ¶
func (b *BasicComponent) HandleTransforms(self Component, pth path.Path, ctx RenderContext) (path.Path, RenderContext, error)
internal method to handle the transforms
func (*BasicComponent) Id ¶
func (b *BasicComponent) Id() string
func (*BasicComponent) Measure ¶
func (b *BasicComponent) Measure() (float64, float64, error)
measure this component returns w, h Note: this typical calls render, so care should be taken when calling this
func (*BasicComponent) ParamLookerUpper ¶
func (b *BasicComponent) ParamLookerUpper() ParamLookerUpper
func (*BasicComponent) Params ¶
func (b *BasicComponent) Params() *dynmap.DynMap
func (*BasicComponent) Parent ¶
func (b *BasicComponent) Parent() Element
func (*BasicComponent) Render ¶
func (b *BasicComponent) Render(ctx RenderContext) (path.Path, RenderContext, error)
Render the path. This is typically called by the owning element, which handles the transforms
func (*BasicComponent) RenderContext ¶
func (b *BasicComponent) RenderContext() (RenderContext, bool)
func (*BasicComponent) RenderStart ¶
func (b *BasicComponent) RenderStart(ctx RenderContext)
func (*BasicComponent) SetChildren ¶
func (b *BasicComponent) SetChildren(c []Element)
func (*BasicComponent) SetComponents ¶
func (b *BasicComponent) SetComponents(c []Component)
sets the children componenets
func (*BasicComponent) SetGlobalVariable ¶
func (b *BasicComponent) SetGlobalVariable(key string, val interface{})
Sets a global variable available to all components rendered after this
func (*BasicComponent) SetLocalVariable ¶
func (b *BasicComponent) SetLocalVariable(key string, val interface{})
sets a parameter available to this component and all of its children
func (*BasicComponent) SetParent ¶
func (b *BasicComponent) SetParent(p Element)
func (*BasicComponent) ToDynMap ¶
func (b *BasicComponent) ToDynMap() *dynmap.DynMap
func (*BasicComponent) Transforms ¶
func (b *BasicComponent) Transforms() []*dynmap.DynMap
type BasicElement ¶
type BasicElement struct {
// contains filtered or unexported fields
}
func (*BasicElement) Attr ¶
func (b *BasicElement) Attr() *Attr
returns an attribute finder based on the the original map of this element
func (*BasicElement) Defaults ¶
func (b *BasicElement) Defaults() *dynmap.DynMap
func (*BasicElement) DmAttr ¶
func (b *BasicElement) DmAttr(mp *dynmap.DynMap) *Attr
returns an attribute finder based on the passed in dynmap
func (*BasicElement) ElementType ¶
func (b *BasicElement) ElementType() string
func (*BasicElement) Id ¶
func (b *BasicElement) Id() string
func (*BasicElement) ParamLookerUpper ¶
func (b *BasicElement) ParamLookerUpper() ParamLookerUpper
func (*BasicElement) Params ¶
func (b *BasicElement) Params() *dynmap.DynMap
func (*BasicElement) SetGlobalVariable ¶
func (b *BasicElement) SetGlobalVariable(key string, val interface{})
Sets a global variable available to all components rendered after this
func (*BasicElement) SetLocalVariable ¶
func (b *BasicElement) SetLocalVariable(key string, val interface{})
sets a parameter available to this component and all of its children
func (*BasicElement) ToDynMap ¶
func (b *BasicElement) ToDynMap() *dynmap.DynMap
type BasicParamLookerUpper ¶
type BasicParamLookerUpper struct {
// contains filtered or unexported fields
}
func (*BasicParamLookerUpper) Float64 ¶
func (p *BasicParamLookerUpper) Float64(param string) (float64, bool)
func (*BasicParamLookerUpper) Lookup ¶
func (p *BasicParamLookerUpper) Lookup(param string) (interface{}, bool)
func (*BasicParamLookerUpper) MustFloat64 ¶
func (p *BasicParamLookerUpper) MustFloat64(param string, def float64) float64
func (*BasicParamLookerUpper) MustString ¶
func (p *BasicParamLookerUpper) MustString(param string, def string) string
func (*BasicParamLookerUpper) String ¶
func (p *BasicParamLookerUpper) String(param string) (string, bool)
func (*BasicParamLookerUpper) ToFloat64 ¶
func (p *BasicParamLookerUpper) ToFloat64(obj interface{}) (float64, error)
converts the given object
type CleanupTransformFactory ¶
type CleanupTransformFactory struct { }
func (CleanupTransformFactory) CreateTransform ¶
func (cf CleanupTransformFactory) CreateTransform(transformType string, dm *dynmap.DynMap, element Element) (path.PathTransform, error)
func (CleanupTransformFactory) TransformTypes ¶
func (cf CleanupTransformFactory) TransformTypes() []string
// The list of component types this Factory should be used for
type Component ¶
type Component interface { Element // Render the path. This is typically called by the // owning element, which handles the transforms // Note that Render should not be ever considered threadsafe // and should never be called concurrently Render(ctx RenderContext) (path.Path, RenderContext, error) // If rendering is currently in progress, this should return the // current context RenderContext() (RenderContext, bool) Transforms() []*dynmap.DynMap Parent() Element SetParent(element Element) // measure this component // returns w, h // Note: this typical calls render, so care should be taken when calling this Measure() (float64, float64, error) Children() []Element }
type ComponentFactory ¶
type Document ¶
type Document struct { *BasicElement ElementsByID map[string]Element Parts []*Part Context *DocumentContext }
top level document, has multiple parts
func ParseDocumentFromJson ¶
func ParseDocumentFromPath ¶
func (*Document) AllElements ¶
all the elements that this document contains.
type DocumentContext ¶
func FindDocumentContext ¶
func FindDocumentContext(c Element) *DocumentContext
returns the document context of the owning document. or nil
func (*DocumentContext) CreateCustomComponent ¶
func (dc *DocumentContext) CreateCustomComponent(componentType string, dm *dynmap.DynMap) (Component, bool, error)
Creates a custom component if possible returns nil, false, nil if there is no custom component available with that type
type DocumentParser ¶
type DrawComponent ¶
type DrawComponent struct { *BasicComponent // contains filtered or unexported fields }
func (*DrawComponent) Render ¶
func (dc *DrawComponent) Render(ctx RenderContext) (path.Path, RenderContext, error)
type DrawComponentFactory ¶
type DrawComponentFactory struct{}
func (DrawComponentFactory) ComponentTypes ¶
func (dcf DrawComponentFactory) ComponentTypes() []string
The list of component types this Factory should be used for
func (DrawComponentFactory) CreateComponent ¶
func (dcf DrawComponentFactory) CreateComponent(componentType string, dm *dynmap.DynMap, dc *DocumentContext) (Component, error)
type DynMapParamLookerUpper ¶
a lookerupper based on a single dynmap. mostly useful for tests
func (*DynMapParamLookerUpper) Float64 ¶
func (p *DynMapParamLookerUpper) Float64(param string) (float64, bool)
func (*DynMapParamLookerUpper) Lookup ¶
func (p *DynMapParamLookerUpper) Lookup(param string) (interface{}, bool)
func (*DynMapParamLookerUpper) String ¶
func (p *DynMapParamLookerUpper) String(param string) (string, bool)
func (*DynMapParamLookerUpper) ToFloat64 ¶
func (p *DynMapParamLookerUpper) ToFloat64(value interface{}) (float64, error)
type Element ¶
type Element interface { // The id of this element. // note: this should be guarenteed to be set Id() string ElementType() string ToDynMap() *dynmap.DynMap // The defaults for this element. // Defaults should be accessed LAST, after the entire // graph has been searched for the value. // Note - defaults currently have limited use, since they // are not used when evaluating expressions Defaults() *dynmap.DynMap // @Deprecated Params() *dynmap.DynMap SetLocalVariable(key string, val interface{}) SetGlobalVariable(key string, val interface{}) // Looks up values in the params map, if no value is found // this should recursively search parent elements until // it is found ParamLookerUpper() ParamLookerUpper }
type Factories ¶
type Factories struct {
// contains filtered or unexported fields
}
func AppContext ¶
func AppContext() *Factories
Constructs a Factories instance with the components and transforms we know about..
func (*Factories) AddComponentFactory ¶
func (c *Factories) AddComponentFactory(cf ComponentFactory)
func (*Factories) AddPartTransformerFactory ¶
func (c *Factories) AddPartTransformerFactory(tf PartTransformerFactory)
func (*Factories) AddTransformFactory ¶
func (c *Factories) AddTransformFactory(tf TransformFactory)
func (*Factories) DocumentParser ¶
func (c *Factories) DocumentParser() DocumentParser
func (*Factories) FileLoader ¶
func (c *Factories) FileLoader() FileLoader
func (*Factories) Init ¶
func (c *Factories) Init(componentFactories []ComponentFactory, transformFactories []TransformFactory, partTransformerFactories []PartTransformerFactory, segOps path.SegmentOperators, documentParser DocumentParser, fileLoader FileLoader, svgParser SVGParser, )
func (*Factories) MakeBasicComponent ¶
func (c *Factories) MakeBasicComponent(dm *dynmap.DynMap) *BasicComponent
func (*Factories) MakeBasicElement ¶
func (c *Factories) MakeBasicElement(dm *dynmap.DynMap) *BasicElement
func (*Factories) MakeComponent ¶
Makes a component from the DynMap, there must be a field called "type"
func (*Factories) MakeComponents ¶
func (*Factories) MakePartTransformer ¶
func (*Factories) MakePartTransformers ¶
func (*Factories) MakeTransform ¶
func (*Factories) MakeTransforms ¶
func (c *Factories) MakeTransforms(dm []*dynmap.DynMap, element Element) ([]path.PathTransform, error)
finds the transforms under the given key
func (*Factories) SegmentOperators ¶
func (c *Factories) SegmentOperators() path.SegmentOperators
func (*Factories) SetFileLoader ¶
func (c *Factories) SetFileLoader(fl FileLoader)
type FileLoader ¶
type GroupComponent ¶
type GroupComponent struct { *BasicComponent // contains filtered or unexported fields }
func (*GroupComponent) Children ¶
func (cc *GroupComponent) Children() []Element
func (*GroupComponent) Render ¶
func (cc *GroupComponent) Render(ctx RenderContext) (path.Path, RenderContext, error)
type GroupComponentFactory ¶
type GroupComponentFactory struct{}
func (GroupComponentFactory) ComponentTypes ¶
func (ccf GroupComponentFactory) ComponentTypes() []string
The list of component types this Factory should be used for
func (GroupComponentFactory) CreateComponent ¶
func (ccf GroupComponentFactory) CreateComponent(componentType string, mp *dynmap.DynMap, dc *DocumentContext) (Component, error)
type JoinTransformFactory ¶
type JoinTransformFactory struct { }
func (JoinTransformFactory) CreateTransform ¶
func (tf JoinTransformFactory) CreateTransform(transformType string, dm *dynmap.DynMap, element Element) (path.PathTransform, error)
func (JoinTransformFactory) TransformTypes ¶
func (cf JoinTransformFactory) TransformTypes() []string
// The list of component types this Factory should be used for
type LathePartTransform ¶
type LathePartTransform struct {
// contains filtered or unexported fields
}
func (*LathePartTransform) TransformPart ¶
func (lpt *LathePartTransform) TransformPart(part *RenderedPart, ctx RenderContext) ([]*RenderedPart, error)
type MatrixTransformFactory ¶
type MatrixTransformFactory struct {
Values []float64
}
func (MatrixTransformFactory) CreateTransform ¶
func (tf MatrixTransformFactory) CreateTransform(transformType string, dm *dynmap.DynMap, element Element) (path.PathTransform, error)
func (MatrixTransformFactory) TransformTypes ¶
func (tf MatrixTransformFactory) TransformTypes() []string
// The list of component types this Factory should be used for
type MirrorTransformFactory ¶
type MirrorTransformFactory struct {
Axis transforms.Axis
}
func (MirrorTransformFactory) CreateTransform ¶
func (tf MirrorTransformFactory) CreateTransform(transformType string, dm *dynmap.DynMap, element Element) (path.PathTransform, error)
func (MirrorTransformFactory) TransformTypes ¶
func (tf MirrorTransformFactory) TransformTypes() []string
// The list of component types this Factory should be used for
type MoveTransformFactory ¶
type MoveTransformFactory struct { }
func (MoveTransformFactory) CreateTransform ¶
func (tf MoveTransformFactory) CreateTransform(transformType string, dm *dynmap.DynMap, element Element) (path.PathTransform, error)
func (MoveTransformFactory) TransformTypes ¶
func (tf MoveTransformFactory) TransformTypes() []string
// The list of component types this Factory should be used for
type OffsetTransformFactory ¶
type OffsetTransformFactory struct { }
func (OffsetTransformFactory) CreateTransform ¶
func (tf OffsetTransformFactory) CreateTransform(transformType string, dm *dynmap.DynMap, element Element) (path.PathTransform, error)
func (OffsetTransformFactory) TransformTypes ¶
func (tf OffsetTransformFactory) TransformTypes() []string
// The list of component types this Factory should be used for
type OversizeStrategy ¶
type OversizeStrategy int32
What to do when a rendered piece is too big for the document?
const ( // break the piece using the specified CutLine Split OversizeStrategy = 0 // leave the document the same size but spill off the edge Spill OversizeStrategy = 1 )
type ParamLookerUpper ¶
type ParamLookerUpper interface { Lookup(param string) (interface{}, bool) // attempt to convert the given object to a float. // if this is a number than that will be returned // if it is a string, the string will be evaluated ToFloat64(value interface{}) (float64, error) MustString(param string, def string) string String(param string) (string, bool) MustFloat64(param string, def float64) float64 Float64(param string) (float64, bool) }
type Part ¶
type Part struct { *BasicComponent PartTransformers []PartTransformer }
individual part (like a box face) Each part should have its own 0,0 base coordinate system.
func (*Part) Render ¶
func (p *Part) Render(ctx RenderContext) (path.Path, RenderContext, error)
render a single part. This satisfies the Component interface, typically RenderPart should be used instead as that will honor the repeats or splits
func (*Part) RenderPart ¶
func (p *Part) RenderPart(ctx RenderContext) ([]*RenderedPart, error)
type PartFactory ¶
type PartFactory struct{}
since Part is also a component we use a factory for it
func (PartFactory) ComponentTypes ¶
func (pf PartFactory) ComponentTypes() []string
The list of component types this Factory should be used for
func (PartFactory) CreateComponent ¶
func (pf PartFactory) CreateComponent(componentType string, mp *dynmap.DynMap, dc *DocumentContext) (Component, error)
type PartLatheTransformerFactory ¶
type PartLatheTransformerFactory struct{}
func (PartLatheTransformerFactory) CreateTransformer ¶
func (pf PartLatheTransformerFactory) CreateTransformer(transformType string, dm *dynmap.DynMap, part *Part) (PartTransformer, error)
func (PartLatheTransformerFactory) TransformerTypes ¶
func (cf PartLatheTransformerFactory) TransformerTypes() []string
// The list of component types this Factory should be used for
type PartSplitter ¶
type PartSplitter struct {
// contains filtered or unexported fields
}
func (*PartSplitter) TransformPart ¶
func (ps *PartSplitter) TransformPart(part *RenderedPart, ctx RenderContext) ([]*RenderedPart, error)
type PartSplitterTransformerFactory ¶
type PartSplitterTransformerFactory struct{}
func (PartSplitterTransformerFactory) CreateTransformer ¶
func (pf PartSplitterTransformerFactory) CreateTransformer(transformType string, dm *dynmap.DynMap, part *Part) (PartTransformer, error)
func (PartSplitterTransformerFactory) TransformerTypes ¶
func (cf PartSplitterTransformerFactory) TransformerTypes() []string
// The list of component types this Factory should be used for
type PartTransformer ¶
type PartTransformer interface {
TransformPart(part *RenderedPart, ctx RenderContext) ([]*RenderedPart, error)
}
type PartTransformerFactory ¶
type PlanSet ¶
type PlanSet struct {
// contains filtered or unexported fields
}
a collection of documents as you add items this will create more documents potentially splitting items when they wont fit.
func NewPlanSet ¶
func (*PlanSet) Init ¶
func (p *PlanSet) Init(ctx RenderContext) error
func (*PlanSet) SVGDocuments ¶
func (p *PlanSet) SVGDocuments() []*SVGDocument
type RenderContext ¶
func RepeatRender ¶
func RepeatRender(ctx RenderContext, component Component, maxX, maxY float64) (path.Path, RenderContext, error)
func (RenderContext) Clone ¶
func (c RenderContext) Clone() RenderContext
type RenderStrategy ¶
type RenderStrategy int32
What is the strategy when all the pieces don't fit in the Document?
const ( // Render into multiple documents MultiDocument RenderStrategy = 0 // Resize a single document // THis will scale the document in both directions ResizeDocument RenderStrategy = 1 )
type RenderedPart ¶
type ReorderTransformFactory ¶
type ReorderTransformFactory struct { }
func (ReorderTransformFactory) CreateTransform ¶
func (tf ReorderTransformFactory) CreateTransform(transformType string, dm *dynmap.DynMap, element Element) (path.PathTransform, error)
func (ReorderTransformFactory) TransformTypes ¶
func (cf ReorderTransformFactory) TransformTypes() []string
// The list of component types this Factory should be used for
type RepeatComponent ¶
type RepeatComponent struct { *BasicComponent // contains filtered or unexported fields }
func (*RepeatComponent) Render ¶
func (rc *RepeatComponent) Render(ctx RenderContext) (path.Path, RenderContext, error)
type RepeatComponentFactory ¶
type RepeatComponentFactory struct{}
func (RepeatComponentFactory) ComponentTypes ¶
func (rcf RepeatComponentFactory) ComponentTypes() []string
The list of component types this Factory should be used for
func (RepeatComponentFactory) CreateComponent ¶
func (rcf RepeatComponentFactory) CreateComponent(componentType string, dm *dynmap.DynMap, dc *DocumentContext) (Component, error)
type ReverseTransformFactory ¶
type ReverseTransformFactory struct { }
func (ReverseTransformFactory) CreateTransform ¶
func (tf ReverseTransformFactory) CreateTransform(transformType string, dm *dynmap.DynMap, element Element) (path.PathTransform, error)
func (ReverseTransformFactory) TransformTypes ¶
func (cf ReverseTransformFactory) TransformTypes() []string
// The list of component types this Factory should be used for
type RotateScaleTransformFactory ¶
type RotateScaleTransformFactory struct { }
func (RotateScaleTransformFactory) CreateTransform ¶
func (tf RotateScaleTransformFactory) CreateTransform(transformType string, dm *dynmap.DynMap, element Element) (path.PathTransform, error)
func (RotateScaleTransformFactory) TransformTypes ¶
func (tf RotateScaleTransformFactory) TransformTypes() []string
// The list of component types this Factory should be used for
type RotateTransformFactory ¶
type RotateTransformFactory struct { }
func (RotateTransformFactory) CreateTransform ¶
func (tf RotateTransformFactory) CreateTransform(transformType string, dm *dynmap.DynMap, element Element) (path.PathTransform, error)
func (RotateTransformFactory) TransformTypes ¶
func (tf RotateTransformFactory) TransformTypes() []string
// The list of component types this Factory should be used for
type SVGDocument ¶
type SVGDocument struct { Name string // document width Width float64 // document height Height float64 Units Units // how much padding between things in the document? Padding float64 // render the size into the document? // most cases this should be true, // false is useful for resizable in a browser window RenderSize bool // how many decimal places to render Precision int SegmentOperators path.SegmentOperators CutStyle string LabelStyle string // contains filtered or unexported fields }
a standard document
func NewSVGDocument ¶
func NewSVGDocument(w float64, h float64, unit Units) *SVGDocument
Creates a new document defaults to settings for .2" Lowes style plywood
func (*SVGDocument) Add ¶
func (d *SVGDocument) Add(p *RenderedPart, ctx RenderContext) (bool, error)
adds a renderable creator into this document. Returns true if it was able to fit, false otherwise.
func (*SVGDocument) Clone ¶
func (d *SVGDocument) Clone() *SVGDocument
clones this document meta data, minus any items in it TODO: do we want to clone the renderables as well?
func (*SVGDocument) Parts ¶
func (d *SVGDocument) Parts() []*Part
func (*SVGDocument) WriteSVG ¶
func (d *SVGDocument) WriteSVG(ctx RenderContext, writer io.Writer)
writes the whole svg document
type ScaleTransformFactory ¶
type ScaleTransformFactory struct { }
func (ScaleTransformFactory) CreateTransform ¶
func (tf ScaleTransformFactory) CreateTransform(transformType string, dm *dynmap.DynMap, element Element) (path.PathTransform, error)
func (ScaleTransformFactory) TransformTypes ¶
func (tf ScaleTransformFactory) TransformTypes() []string
// The list of component types this Factory should be used for
type SliceTransformFactory ¶
type SliceTransformFactory struct { }
func (SliceTransformFactory) CreateTransform ¶
func (tf SliceTransformFactory) CreateTransform(transformType string, dm *dynmap.DynMap, element Element) (path.PathTransform, error)
func (SliceTransformFactory) TransformTypes ¶
func (tf SliceTransformFactory) TransformTypes() []string
The list of component types this Factory should be used for
type TransformFactory ¶
type TrimTransformFactory ¶
type TrimTransformFactory struct { }
func (TrimTransformFactory) CreateTransform ¶
func (tf TrimTransformFactory) CreateTransform(transformType string, dm *dynmap.DynMap, element Element) (path.PathTransform, error)
func (TrimTransformFactory) TransformTypes ¶
func (tf TrimTransformFactory) TransformTypes() []string
The list of component types this Factory should be used for