當前位置: 首頁>>代碼示例>>Golang>>正文


Golang Formatter.WriteString方法代碼示例

本文整理匯總了Golang中github.com/yofu/dxf/format.Formatter.WriteString方法的典型用法代碼示例。如果您正苦於以下問題:Golang Formatter.WriteString方法的具體用法?Golang Formatter.WriteString怎麽用?Golang Formatter.WriteString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/yofu/dxf/format.Formatter的用法示例。


在下文中一共展示了Formatter.WriteString方法的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])
	}
}
開發者ID:yofu,項目名稱:dxf,代碼行數:8,代碼來源:point.go

示例2: 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")
}
開發者ID:spyle,項目名稱:dxf,代碼行數:9,代碼來源:objects.go

示例3: 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")
}
開發者ID:spyle,項目名稱:dxf,代碼行數:9,代碼來源:classes.go

示例4: 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)
}
開發者ID:spyle,項目名稱:dxf,代碼行數:10,代碼來源:vertex.go

示例5: 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])
	}
}
開發者ID:spyle,項目名稱:dxf,代碼行數:11,代碼來源:line.go

示例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])
	}
}
開發者ID:spyle,項目名稱:dxf,代碼行數:12,代碼來源:circle.go

示例7: 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)
	}
}
開發者ID:spyle,項目名稱:dxf,代碼行數:13,代碼來源:3dface.go

示例8: 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)
	}
}
開發者ID:spyle,項目名稱:dxf,代碼行數:26,代碼來源:text.go

示例9: Format

// Format writes data to formatter.
func (l *Layer) Format(f format.Formatter) {
	f.WriteString(0, "LAYER")
	f.WriteHex(5, l.handle)
	if l.owner != nil {
		f.WriteHex(330, l.owner.Handle())
	}
	f.WriteString(100, "AcDbSymbolTableRecord")
	f.WriteString(100, "AcDbLayerTableRecord")
	f.WriteString(2, l.name)
	f.WriteInt(70, l.flag)
	f.WriteInt(62, int(l.Color))
	f.WriteString(6, l.LineType.Name())
	f.WriteInt(370, l.lineWidth)
	f.WriteHex(390, l.PlotStyle.Handle())
}
開發者ID:spyle,項目名稱:dxf,代碼行數:16,代碼來源:layer.go

示例10: 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])
		}
	}
}
開發者ID:spyle,項目名稱:dxf,代碼行數:16,代碼來源:lwpolyline.go

示例11: Format

// Format writes data to formatter.
func (v *View) Format(f format.Formatter) {
	f.WriteString(0, "VIEW")
	f.WriteHex(5, v.handle)
	if v.owner != nil {
		f.WriteHex(330, v.owner.Handle())
	}
	f.WriteString(100, "AcDbSymbolTableRecord")
	f.WriteString(100, "AcDbViewTableRecord")
	f.WriteString(2, v.name)
}
開發者ID:spyle,項目名稱:dxf,代碼行數:11,代碼來源:view.go

示例12: Format

// Format writes data to formatter.
func (u *Ucs) Format(f format.Formatter) {
	f.WriteString(0, "UCS")
	f.WriteHex(5, u.handle)
	if u.owner != nil {
		f.WriteHex(330, u.owner.Handle())
	}
	f.WriteString(100, "AcDbSymbolTableRecord")
	f.WriteString(100, "AcDbUCSTableRecord")
	f.WriteString(2, u.name)
}
開發者ID:spyle,項目名稱:dxf,代碼行數:11,代碼來源:ucs.go

示例13: Format

// Format writes data to formatter.
func (t *Table) Format(f format.Formatter) {
	f.WriteString(0, "TABLE")
	f.WriteString(2, t.name)
	f.WriteHex(5, t.handle)
	f.WriteString(100, "AcDbSymbolTable")
	f.WriteInt(70, t.size)
	if t.name == "DIMSTYLE" {
		f.WriteString(100, "AcDbDimStyleTable")
		f.WriteInt(71, t.size)
		for i := 0; i < t.size; i++ {
			f.WriteHex(340, t.tables[i].Handle())
		}
	}
	for i := 0; i < t.size; i++ {
		t.tables[i].Format(f)
	}
	f.WriteString(0, "ENDTAB")
}
開發者ID:spyle,項目名稱:dxf,代碼行數:19,代碼來源:table.go

示例14: Format

// Format writes data to formatter.
func (d *DimStyle) Format(f format.Formatter) {
	f.WriteString(0, "DIMSTYLE")
	f.WriteHex(105, d.handle)
	if d.owner != nil {
		f.WriteHex(330, d.owner.Handle())
	}
	f.WriteString(100, "AcDbSymbolTableRecord")
	f.WriteString(100, "AcDbDimStyleTableRecord")
	f.WriteString(2, d.name)
	f.WriteInt(70, 0)
}
開發者ID:spyle,項目名稱:dxf,代碼行數:12,代碼來源:dimstyle.go

示例15: Format

// Format writes data to formatter.
func (g *Group) Format(f format.Formatter) {
	f.WriteString(0, "GROUP")
	f.WriteHex(5, g.handle)
	f.WriteString(102, "{ACAD_REACTORS")
	f.WriteHex(330, g.owner.Handle())
	f.WriteString(102, "}")
	f.WriteHex(330, g.owner.Handle())
	f.WriteString(100, "AcDbGroup")
	f.WriteString(300, g.Description)
	f.WriteInt(70, 0)
	if g.selectable {
		f.WriteInt(71, 1)
	} else {
		f.WriteInt(71, 0)
	}
	for _, e := range g.entities {
		f.WriteHex(340, e.Handle())
	}
}
開發者ID:spyle,項目名稱:dxf,代碼行數:20,代碼來源:group.go


注:本文中的github.com/yofu/dxf/format.Formatter.WriteString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。