当前位置: 首页>>代码示例>>Golang>>正文


Golang Formatter.WriteFloat方法代码示例

本文整理汇总了Golang中github.com/yofu/dxf/format.Formatter.WriteFloat方法的典型用法代码示例。如果您正苦于以下问题:Golang Formatter.WriteFloat方法的具体用法?Golang Formatter.WriteFloat怎么用?Golang Formatter.WriteFloat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/yofu/dxf/format.Formatter的用法示例。


在下文中一共展示了Formatter.WriteFloat方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

示例3: 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

示例4: 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

示例5: 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

示例6: Format

// Format writes data to formatter.
func (lt *LineType) Format(f format.Formatter) {
	f.WriteString(0, "LTYPE")
	f.WriteHex(5, lt.handle)
	if lt.owner != nil {
		f.WriteHex(330, lt.owner.Handle())
	}
	f.WriteString(100, "AcDbSymbolTableRecord")
	f.WriteString(100, "AcDbLinetypeTableRecord")
	f.WriteString(2, lt.name)
	f.WriteInt(70, 0)
	f.WriteString(3, lt.Description)
	f.WriteInt(72, 65)
	f.WriteInt(73, len(lt.lengths))
	f.WriteFloat(40, lt.TotalLength())
	for _, l := range lt.lengths {
		f.WriteFloat(49, l)
		f.WriteInt(74, 0)
	}
}
开发者ID:spyle,项目名称:dxf,代码行数:20,代码来源:linetype.go

示例7: Format

// Format writes data to formatter.
func (b *Block) Format(f format.Formatter) {
	f.WriteString(0, "BLOCK")
	f.WriteHex(5, b.handle)
	f.WriteString(100, "AcDbEntity")
	f.WriteString(8, b.layer.Name())
	f.WriteString(100, "AcDbBlockBegin")
	f.WriteString(2, b.Name)
	f.WriteInt(70, b.Flag)
	for i := 0; i < 3; i++ {
		f.WriteFloat((i+1)*10, b.Coord[i])
	}
	f.WriteString(3, b.Name)
	f.WriteString(1, b.Description)
	f.WriteString(0, "ENDBLK")
	f.WriteHex(5, b.endhandle)
	f.WriteString(100, "AcDbEntity")
	f.WriteString(8, b.layer.Name())
	f.WriteString(100, "AcDbBlockEnd")
}
开发者ID:spyle,项目名称:dxf,代码行数:20,代码来源:block.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 (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

示例10: WriteTo

// WriteTo writes HEADER information to formatter.
func (h *Header) WriteTo(f format.Formatter) {
	f.WriteString(0, "SECTION")
	f.WriteString(2, "HEADER")
	f.WriteString(9, "$ACADVER")
	f.WriteString(1, h.Version)
	f.WriteString(9, "$INSBASE")
	for i := 0; i < 3; i++ {
		f.WriteFloat((i+1)*10, h.InsBase[i])
	}
	f.WriteString(9, "$EXTMIN")
	for i := 0; i < 3; i++ {
		f.WriteFloat((i+1)*10, h.ExtMin[i])
	}
	f.WriteString(9, "$EXTMAX")
	for i := 0; i < 3; i++ {
		f.WriteFloat((i+1)*10, h.ExtMax[i])
	}
	f.WriteString(9, "$LTSCALE")
	f.WriteFloat(40, h.LtScale)
	f.WriteString(9, "$HANDSEED")
	f.WriteHex(5, h.handseed)
	f.WriteString(0, "ENDSEC")
}
开发者ID:spyle,项目名称:dxf,代码行数:24,代码来源:header.go

示例11: Format

// Format writes data to formatter.
func (v *Viewport) Format(f format.Formatter) {
	f.WriteString(0, "VPORT")
	f.WriteHex(5, v.handle)
	if v.owner != nil {
		f.WriteHex(330, v.owner.Handle())
	}
	f.WriteString(100, "AcDbSymbolTableRecord")
	f.WriteString(100, "AcDbViewportTableRecord")
	f.WriteString(2, v.name)
	f.WriteInt(70, 0)
	for i := 0; i < 2; i++ {
		f.WriteFloat((i+1)*10, v.LowerLeft[i])
	}
	for i := 0; i < 2; i++ {
		f.WriteFloat((i+1)*10+1, v.UpperRight[i])
	}
	for i := 0; i < 2; i++ {
		f.WriteFloat((i+1)*10+2, v.ViewCenter[i])
	}
	for i := 0; i < 2; i++ {
		f.WriteFloat((i+1)*10+3, v.SnapBase[i])
	}
	for i := 0; i < 2; i++ {
		f.WriteFloat((i+1)*10+4, v.SnapSpacing[i])
	}
	for i := 0; i < 2; i++ {
		f.WriteFloat((i+1)*10+5, v.GridSpacing[i])
	}
	for i := 0; i < 3; i++ {
		f.WriteFloat((i+1)*10+6, v.ViewDirection[i])
	}
	for i := 0; i < 3; i++ {
		f.WriteFloat((i+1)*10+7, v.ViewTarget[i])
	}
	f.WriteFloat(40, v.Height)
	f.WriteFloat(41, v.AspectRatio)
	f.WriteFloat(42, v.LensLength)
	f.WriteFloat(43, v.FrontClip)
	f.WriteFloat(44, v.BackClip)
	f.WriteFloat(50, v.SnapAngle)
	f.WriteFloat(51, v.TwistAngle)
}
开发者ID:spyle,项目名称:dxf,代码行数:43,代码来源:viewport.go


注:本文中的github.com/yofu/dxf/format.Formatter.WriteFloat方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。