本文整理汇总了Golang中github.com/yofu/dxf/format.Formatter类的典型用法代码示例。如果您正苦于以下问题:Golang Formatter类的具体用法?Golang Formatter怎么用?Golang Formatter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Formatter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Format
// Format writes data to formatter.
func (p *Point) Format(f format.Formatter) {
p.entity.Format(f)
f.WriteString(100, "AcDbPoint")
for i := 0; i < 3; i++ {
f.WriteFloat((i+1)*10, p.Coord[i])
}
}
示例2: WriteTo
// WriteTo writes CLASSES data to formatter.
func (cs Classes) WriteTo(f format.Formatter) {
f.WriteString(0, "SECTION")
f.WriteString(2, "CLASSES")
for _, c := range cs {
c.Format(f)
}
f.WriteString(0, "ENDSEC")
}
示例3: WriteTo
// WriteTo writes OBJECTS data to formatter.
func (os Objects) WriteTo(f format.Formatter) {
f.WriteString(0, "SECTION")
f.WriteString(2, "OBJECTS")
for _, o := range os {
o.Format(f)
}
f.WriteString(0, "ENDSEC")
}
示例4: Format
// Format writes data to formatter.
func (l *LwPolyline) Format(f format.Formatter) {
l.entity.Format(f)
f.WriteString(100, "AcDbPolyline")
f.WriteInt(90, l.Num)
if l.Closed {
f.WriteInt(70, 1)
} else {
f.WriteInt(70, 0)
}
for i := 0; i < l.Num; i++ {
for j := 0; j < 2; j++ {
f.WriteFloat((j+1)*10, l.Vertices[i][j])
}
}
}
示例5: Format
// Format writes data to formatter.
func (v *Vertex) Format(f format.Formatter) {
v.entity.Format(f)
f.WriteString(100, "AcDbVertex")
f.WriteString(100, "AcDb3dPolylineVertex")
for i := 0; i < 3; i++ {
f.WriteFloat((i+1)*10, v.Coord[i])
}
f.WriteInt(70, v.Flag)
}
示例6: Format
// Format writes data to formatter.
func (c *Circle) Format(f format.Formatter) {
c.entity.Format(f)
f.WriteString(100, "AcDbCircle")
for i := 0; i < 3; i++ {
f.WriteFloat((i+1)*10, c.Center[i])
}
f.WriteFloat(40, c.Radius)
for i := 0; i < 3; i++ {
f.WriteFloat(200+(i+1)*10, c.Direction[i])
}
}
示例7: WriteTo
// WriteTo writes TABLES data to formatter.
func (ts Tables) WriteTo(f format.Formatter) {
f.WriteString(0, "SECTION")
f.WriteString(2, "TABLES")
for _, t := range ts {
t.Format(f)
}
f.WriteString(0, "ENDSEC")
}
示例8: WriteTo
// WriteTo writes BLOCKS data to formatter.
func (bs Blocks) WriteTo(f format.Formatter) {
f.WriteString(0, "SECTION")
f.WriteString(2, "BLOCKS")
for _, b := range bs {
b.Format(f)
}
f.WriteString(0, "ENDSEC")
}
示例9: WriteTo
// WriteTo writes ENTITIES data to formatter.
func (es Entities) WriteTo(f format.Formatter) {
f.WriteString(0, "SECTION")
f.WriteString(2, "ENTITIES")
for _, e := range es {
e.Format(f)
}
f.WriteString(0, "ENDSEC")
}
示例10: Format
// Format writes data to formatter.
func (l *Line) Format(f format.Formatter) {
l.entity.Format(f)
f.WriteString(100, "AcDbLine")
for i := 0; i < 3; i++ {
f.WriteFloat((i+1)*10, l.Start[i])
}
for i := 0; i < 3; i++ {
f.WriteFloat((i+1)*10+1, l.End[i])
}
}
示例11: Format
// Format writes data to formatter.
func (f *ThreeDFace) Format(fm format.Formatter) {
f.entity.Format(fm)
fm.WriteString(100, "AcDbFace")
for i := 0; i < 4; i++ {
for j := 0; j < 3; j++ {
fm.WriteFloat((j+1)*10+i, f.Points[i][j])
}
}
if f.Flag != 0 {
fm.WriteInt(70, f.Flag)
}
}
示例12: Format
// Format writes data to formatter.
func (c *Class) Format(f format.Formatter) {
f.WriteString(0, "CLASS")
}
示例13: FormatString
// FormatString outputs data using given formatter.
func (t *Text) FormatString(f format.Formatter) string {
t.Format(f)
return f.Output()
}
示例14: Format
// Format writes data to formatter.
func (t *Text) Format(f format.Formatter) {
t.entity.Format(f)
f.WriteString(100, "AcDbText")
for i := 0; i < 3; i++ {
f.WriteFloat((i+1)*10, t.Coord1[i])
}
f.WriteFloat(40, t.Height)
f.WriteString(1, t.Value)
f.WriteString(7, t.Style.Name())
if t.genflag != 0 {
f.WriteInt(71, t.genflag)
}
if t.horizontalflag != 0 {
f.WriteInt(72, t.horizontalflag)
if t.verticalflag != 0 {
for i := 0; i < 3; i++ {
f.WriteFloat((i+1)*11, t.Coord1[i])
}
}
}
f.WriteString(100, "AcDbText")
if t.verticalflag != 0 {
f.WriteInt(73, t.verticalflag)
}
}
示例15: FormatString
// FormatString outputs data using given formatter.
func (f *ThreeDFace) FormatString(fm format.Formatter) string {
f.Format(fm)
return fm.Output()
}