Beispiel #1
0
Datei: point.go Projekt: yofu/dxf
// 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])
	}
}
Beispiel #2
0
// 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")
}
Beispiel #3
0
// 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")
}
Beispiel #4
0
// 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])
		}
	}
}
Beispiel #5
0
// 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)
}
Beispiel #6
0
// 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])
	}
}
Beispiel #7
0
// 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")
}
Beispiel #8
0
// 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")
}
Beispiel #9
0
// 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")
}
Beispiel #10
0
Datei: line.go Projekt: spyle/dxf
// 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])
	}
}
Beispiel #11
0
// 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)
	}
}
Beispiel #12
0
// Format writes data to formatter.
func (c *Class) Format(f format.Formatter) {
	f.WriteString(0, "CLASS")
}
Beispiel #13
0
Datei: text.go Projekt: spyle/dxf
// FormatString outputs data using given formatter.
func (t *Text) FormatString(f format.Formatter) string {
	t.Format(f)
	return f.Output()
}
Beispiel #14
0
Datei: text.go Projekt: spyle/dxf
// 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)
	}
}
Beispiel #15
0
// FormatString outputs data using given formatter.
func (f *ThreeDFace) FormatString(fm format.Formatter) string {
	f.Format(fm)
	return fm.Output()
}
Beispiel #16
0
// 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)
}
Beispiel #17
0
// FormatString outputs data using given formatter.
func (g *Group) FormatString(f format.Formatter) string {
	g.Format(f)
	return f.Output()
}
Beispiel #18
0
// 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)
}
Beispiel #19
0
// FormatString outputs data using given formatter.
func (st *Style) FormatString(f format.Formatter) string {
	st.Format(f)
	return f.Output()
}
Beispiel #20
0
// FormatString outputs data using given formatter.
func (lt *LineType) FormatString(f format.Formatter) string {
	lt.Format(f)
	return f.Output()
}
Beispiel #21
0
// 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)
	}
}
Beispiel #22
0
// FormatString outputs data using given formatter.
func (d *DimStyle) FormatString(f format.Formatter) string {
	d.Format(f)
	return f.Output()
}
Beispiel #23
0
// FormatString outputs data using given formatter.
func (c *Class) FormatString(f format.Formatter) string {
	c.Format(f)
	return f.Output()
}
Beispiel #24
0
// Format writes data to formatter.
func (e *entity) Format(f format.Formatter) {
	f.WriteString(0, EntityTypeString(e.Type))
	f.WriteHex(5, e.handle)
	if e.blockRecord != nil {
		f.WriteString(102, "{ACAD_REACTORS")
		f.WriteHex(330, e.blockRecord.Handle())
		f.WriteString(102, "}")
	}
	if e.owner != nil {
		f.WriteHex(330, e.owner.Handle())
	}
	f.WriteString(100, "AcDbEntity")
	f.WriteString(8, e.layer.Name())
}
Beispiel #25
0
// Format writes data to formatter.
func (st *Style) Format(f format.Formatter) {
	f.WriteString(0, "STYLE")
	f.WriteHex(5, st.handle)
	if st.owner != nil {
		f.WriteHex(330, st.owner.Handle())
	}
	f.WriteString(100, "AcDbSymbolTableRecord")
	f.WriteString(100, "AcDbTextStyleTableRecord")
	f.WriteString(2, st.name)
	f.WriteInt(70, 0)
	f.WriteString(40, "0.0")
	f.WriteString(41, "1.0")
	f.WriteString(50, "0.0")
	f.WriteInt(71, 0)
	f.WriteString(42, "0.2")
	f.WriteString(3, st.FontName)
	f.WriteString(4, st.BigFontName)
}
Beispiel #26
0
// FormatString outputs data using given formatter.
func (e *entity) FormatString(f format.Formatter) string {
	e.Format(f)
	return f.Output()
}
Beispiel #27
0
Datei: point.go Projekt: yofu/dxf
// FormatString outputs data using given formatter.
func (p *Point) FormatString(f format.Formatter) string {
	p.Format(f)
	return f.Output()
}
Beispiel #28
0
// Format writes data to formatter.
func (p *Polyline) Format(f format.Formatter) {
	p.entity.Format(f)
	f.WriteString(100, "AcDb3dPolyline")
	f.WriteInt(66, 1)
	f.WriteString(10, "0.0")
	f.WriteString(20, "0.0")
	f.WriteString(30, "0.0")
	f.WriteInt(70, p.Flag)
	for _, v := range p.Vertices {
		v.Format(f)
	}
	f.WriteString(0, "SEQEND")
	f.WriteHex(5, p.endhandle)
	f.WriteString(100, "AcDbEntity")
	f.WriteString(8, p.Layer().Name())
}
Beispiel #29
0
// FormatString outputs data using given formatter.
func (l *LwPolyline) FormatString(f format.Formatter) string {
	l.Format(f)
	return f.Output()
}
Beispiel #30
0
// FormatString outputs data using given formatter.
func (v *Viewport) FormatString(f format.Formatter) string {
	v.Format(f)
	return f.Output()
}