table

package
v0.0.0-...-5a6d1e8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2019 License: MIT Imports: 6 Imported by: 48

Documentation

Overview

TABLES section

Index

Constants

This section is empty.

Variables

View Source
var (
	LT_CONTINUOUS = NewLineType("Continuous", "Solid Line")
	LT_BYLAYER    = NewLineType("ByLayer", "")
	LT_BYBLOCK    = NewLineType("ByBlock", "")
	LT_HIDDEN     = NewLineType("HIDDEN", "Hidden __ __ __ __ __ __ __ __ __ __ __ __ __ _", 0.25, -0.125)
	LT_DASHDOT    = NewLineType("DASHDOT", "Dash dot __ . __ . __ . __ . __ . __ . __ . __", 0.5, -0.25, 0.0, -0.25)
)

Default LineTypes.

View Source
var (
	LY_0 = NewLayer("0", color.White, LT_CONTINUOUS)
)

Default layers.

View Source
var LineWidth = map[int]float64{
	5:   0.05,
	9:   0.09,
	13:  0.13,
	15:  0.15,
	18:  0.18,
	20:  0.20,
	25:  0.25,
	30:  0.30,
	35:  0.35,
	40:  0.40,
	50:  0.50,
	53:  0.53,
	60:  0.60,
	70:  0.70,
	80:  0.80,
	90:  0.90,
	100: 1.00,
	106: 1.06,
	120: 1.20,
	140: 1.40,
	158: 1.58,
	200: 2.00,
	211: 2.11,
}

LineWeight enum value (code 370)

View Source
var (
	ST_STANDARD = NewStyle("Standard")
)

Default Styles.

Functions

func TableTypeString

func TableTypeString(t TableType) string

TableTypeString converts TableType to string. If TableType is out of range, it returns empty string.

Types

type AppID

type AppID struct {
	// contains filtered or unexported fields
}

AppID represents APPID SymbolTable.

func NewAppID

func NewAppID(name string) *AppID

NewAppID create a new AppID.

func (*AppID) Format

func (a *AppID) Format(f format.Formatter)

Format writes data to formatter.

func (*AppID) FormatString

func (a *AppID) FormatString(f format.Formatter) string

FormatString outputs data using given formatter.

func (*AppID) Handle

func (a *AppID) Handle() int

Handle returns a handle value.

func (*AppID) IsSymbolTable

func (a *AppID) IsSymbolTable() bool

IsSymbolTable is for SymbolTable interface.

func (*AppID) Name

func (a *AppID) Name() string

Name returns a name of APPID (code 2).

func (*AppID) SetHandle

func (a *AppID) SetHandle(v *int)

SetHandle sets a handle.

func (*AppID) SetOwner

func (a *AppID) SetOwner(h handle.Handler)

SetOwner sets an owner.

func (*AppID) String

func (a *AppID) String() string

String outputs data using default formatter.

type BlockRecord

type BlockRecord struct {
	// contains filtered or unexported fields
}

BlockRecord represents BLOCK_RECORD SymbolTable.

func NewBlockRecord

func NewBlockRecord(name string) *BlockRecord

NewBlockRecord creates a new BlockRecord.

func (*BlockRecord) Format

func (b *BlockRecord) Format(f format.Formatter)

Format writes data to formatter.

func (*BlockRecord) FormatString

func (b *BlockRecord) FormatString(f format.Formatter) string

FormatString outputs data using given formatter.

func (*BlockRecord) Handle

func (b *BlockRecord) Handle() int

Handle returns a handle value.

func (*BlockRecord) IsSymbolTable

func (b *BlockRecord) IsSymbolTable() bool

IsSymbolTable is for SymbolTable interface.

func (*BlockRecord) Name

func (b *BlockRecord) Name() string

Name returns a name of BLOCK_RECORD (code 2).

func (*BlockRecord) SetHandle

func (b *BlockRecord) SetHandle(v *int)

SetHandle sets a handle.

func (*BlockRecord) SetOwner

func (b *BlockRecord) SetOwner(h handle.Handler)

SetOwner sets an owner.

func (*BlockRecord) String

func (b *BlockRecord) String() string

String outputs data using default formatter.

type DimStyle

type DimStyle struct {
	// contains filtered or unexported fields
}

DimStyle represents DIMSTYLE SymbolTable.

func NewDimStyle

func NewDimStyle(name string) *DimStyle

NewDimStyle creates a new DimStyle.

func (*DimStyle) Format

func (d *DimStyle) Format(f format.Formatter)

Format writes data to formatter.

func (*DimStyle) FormatString

func (d *DimStyle) FormatString(f format.Formatter) string

FormatString outputs data using given formatter.

func (*DimStyle) Handle

func (d *DimStyle) Handle() int

Handle returns a handle value.

func (*DimStyle) IsSymbolTable

func (d *DimStyle) IsSymbolTable() bool

IsSymbolTable is for SymbolTable interface.

func (*DimStyle) Name

func (d *DimStyle) Name() string

Name returns a name of DIMSTYLE (code 2).

func (*DimStyle) SetHandle

func (d *DimStyle) SetHandle(v *int)

SetHandle sets a handle.

func (*DimStyle) SetOwner

func (d *DimStyle) SetOwner(h handle.Handler)

SetOwner sets an owner.

func (*DimStyle) String

func (d *DimStyle) String() string

String outputs data using default formatter.

type Layer

type Layer struct {
	Color    color.ColorNumber
	LineType *LineType

	PlotStyle handle.Handler
	// contains filtered or unexported fields
}

Layer represents LAYER SymbolTable.

func NewLayer

func NewLayer(name string, color color.ColorNumber, lt *LineType) *Layer

NewLayer creates a new Layer.

func (*Layer) Format

func (l *Layer) Format(f format.Formatter)

Format writes data to formatter.

func (*Layer) FormatString

func (l *Layer) FormatString(f format.Formatter) string

FormatString outputs data using given formatter.

func (*Layer) Freeze

func (l *Layer) Freeze()

Freeze freezes Layer.

func (*Layer) Handle

func (l *Layer) Handle() int

Handle returns a handle value.

func (*Layer) IsSymbolTable

func (l *Layer) IsSymbolTable() bool

IsSymbolTable is for SymbolTable interface.

func (*Layer) Lock

func (l *Layer) Lock()

Lock locks Layer.

func (*Layer) Name

func (l *Layer) Name() string

Name returns a name of LAYER (code 2).

func (*Layer) SetFlag

func (l *Layer) SetFlag(val int)

SetFlag sets standard flags.

1  = Layer is frozen; otherwise layer is thawed.
2  = Layer is frozen by default in new viewports.
4  = Layer is locked.
16 = If set, table entry is externally dependent on an xref.
32 = If this bit and bit 16 are both set, the externally dependent xref has been successfully resolved.
64 = If set, the table entry was referenced by at least one entity in the drawing the last time the drawing was edited. (This flag is for the benefit of AutoCAD commands. It can be ignored by most programs that read DXF files and need not be set by programs that write DXF files.)

func (*Layer) SetHandle

func (l *Layer) SetHandle(v *int)

SetHandle sets a handle.

func (*Layer) SetLineWidth

func (l *Layer) SetLineWidth(w int) int

SetLineWidth sets line width. As DXF has limitation in line width, it returns the actual value set to Layer.

func (*Layer) SetOwner

func (l *Layer) SetOwner(h handle.Handler)

SetOwner sets an owner.

func (*Layer) SetPlotStyle

func (l *Layer) SetPlotStyle(ps handle.Handler)

SetPlotStyle sets plot style by a handle.

func (*Layer) String

func (l *Layer) String() string

String outputs data using default formatter.

func (*Layer) UnFreeze

func (l *Layer) UnFreeze()

UnFreeze unfreezes Layer.

func (*Layer) UnLock

func (l *Layer) UnLock()

UnLock unlocks Layer.

type LineType

type LineType struct {
	Description string // 3
	// contains filtered or unexported fields
}

LineType represents LTYPE SymbolTable.

func NewLineType

func NewLineType(name, desc string, ls ...float64) *LineType

NewLineType creates a new LineType.

func (*LineType) Format

func (lt *LineType) Format(f format.Formatter)

Format writes data to formatter.

func (*LineType) FormatString

func (lt *LineType) FormatString(f format.Formatter) string

FormatString outputs data using given formatter.

func (*LineType) Handle

func (lt *LineType) Handle() int

Handle returns a handle value.

func (*LineType) IsSymbolTable

func (lt *LineType) IsSymbolTable() bool

IsSymbolTable is for SymbolTable interface.

func (*LineType) Name

func (lt *LineType) Name() string

Name returns a name of LAYER (code 2).

func (*LineType) SetHandle

func (lt *LineType) SetHandle(v *int)

SetHandle sets a handle.

func (*LineType) SetLength

func (lt *LineType) SetLength(ls []float64)

SetLength sets pattern length (code 49).

positive value: Dash
0.0: Dot
negative value: Space

func (*LineType) SetOwner

func (lt *LineType) SetOwner(h handle.Handler)

SetOwner sets an owner.

func (*LineType) String

func (lt *LineType) String() string

String outputs data using default formatter.

func (*LineType) TotalLength

func (lt *LineType) TotalLength() float64

TotalLength returns total pattern length (code 40).

type Style

type Style struct {
	FontName        string  // 3
	BigFontName     string  // 4
	FixedTextHeight float64 // 40
	WidthFactor     float64 // 41
	LastHeightUsed  float64 // 42
	ObliqueAngle    float64 // 50
	// contains filtered or unexported fields
}

Style represents STYLE SymbolTable.

func NewStyle

func NewStyle(name string) *Style

NewStyle create a new Style.

func (*Style) Format

func (st *Style) Format(f format.Formatter)

Format writes data to formatter.

func (*Style) FormatString

func (st *Style) FormatString(f format.Formatter) string

FormatString outputs data using given formatter.

func (*Style) Handle

func (st *Style) Handle() int

Handle returns a handle value.

func (*Style) IsSymbolTable

func (st *Style) IsSymbolTable() bool

IsSymbolTable is for SymbolTable interface.

func (*Style) Name

func (st *Style) Name() string

Name returns a name of STYLE (code 2).

func (*Style) SetHandle

func (st *Style) SetHandle(v *int)

SetHandle sets a handle.

func (*Style) SetOwner

func (st *Style) SetOwner(h handle.Handler)

SetOwner sets an owner.

func (*Style) String

func (st *Style) String() string

String outputs data using default formatter.

type SymbolTable

type SymbolTable interface {
	IsSymbolTable() bool
	Format(format.Formatter)
	Handle() int
	SetHandle(*int)
	SetOwner(handle.Handler)
	Name() string
}

SymbolTable is interface for AcDbSymbolTableRecord.

type Table

type Table struct {
	// contains filtered or unexported fields
}

Table represents each TABLE.

func NewTable

func NewTable(name string) *Table

NewTable creates a new Table.

func (*Table) Add

func (t *Table) Add(st SymbolTable)

Add adds a new SymbolTable to TABLE.

func (*Table) Clear

func (t *Table) Clear()

Clear deletes existing SymbolTables.

func (*Table) Contains

func (t *Table) Contains(name string) (SymbolTable, error)

Contains reports if TABLE has the named SymbolTable.

func (*Table) Format

func (t *Table) Format(f format.Formatter)

Format writes data to formatter.

func (*Table) FormatString

func (t *Table) FormatString(f format.Formatter) string

FormatString outputs data using given formatter.

func (*Table) Handle

func (t *Table) Handle() int

Handle returns a handle value of TABLE.

func (*Table) SetHandle

func (t *Table) SetHandle(v *int)

SetHandle sets handles to TABLE itself and each SymbolTable.

func (*Table) String

func (t *Table) String() string

String outputs data using default formatter.

type TableType

type TableType int

TableType represents Table names (code 2)

const (
	VPORT TableType = iota
	LTYPE
	LAYER
	STYLE
	VIEW
	UCS
	APPID
	DIMSTYLE
	BLOCK_RECORD
)

Table name: code 2

func TableTypeValue

func TableTypeValue(t string) TableType

TableTypeValue converts string to TableType. If string is unknown TableType, it returns -1.

type Tables

type Tables []*Table

Tables represents TABLES section.

func New

func New() Tables

New creates a new Tables.

func (Tables) Add

func (ts Tables) Add(t *Table) Tables

Add adds a new table to TABLES section.

func (Tables) AddLayer

func (ts Tables) AddLayer(l *Layer)

AddLayer adds a new layer to LAYER table.

func (Tables) Format

func (ts Tables) Format(f format.Formatter)

Format writes TABLES data to formatter.

func (Tables) SetHandle

func (ts Tables) SetHandle(h *int)

SetHandle sets handles to each table.

type Ucs

type Ucs struct {
	// contains filtered or unexported fields
}

UCS represents UCS SymbolTable.

func NewUCS

func NewUCS(name string) *Ucs

NewUCS creates a new Ucs.

func (*Ucs) Format

func (u *Ucs) Format(f format.Formatter)

Format writes data to formatter.

func (*Ucs) FormatString

func (u *Ucs) FormatString(f format.Formatter) string

FormatString outputs data using given formatter.

func (*Ucs) Handle

func (u *Ucs) Handle() int

Handle returns a handle value.

func (*Ucs) IsSymbolTable

func (u *Ucs) IsSymbolTable() bool

IsSymbolTable is for SymbolTable interface.

func (*Ucs) Name

func (u *Ucs) Name() string

Name returns a name of UCS (code 2).

func (*Ucs) SetHandle

func (u *Ucs) SetHandle(h *int)

SetHandle sets a handle.

func (*Ucs) SetOwner

func (u *Ucs) SetOwner(h handle.Handler)

SetOwner sets an owner.

func (*Ucs) String

func (u *Ucs) String() string

String outputs data using default formatter.

type View

type View struct {
	// contains filtered or unexported fields
}

View represents VIEW SymbolTable.

func NewView

func NewView(name string) *View

NewView creates a new View.

func (*View) Format

func (v *View) Format(f format.Formatter)

Format writes data to formatter.

func (*View) FormatString

func (v *View) FormatString(f format.Formatter) string

FormatString outputs data using given formatter.

func (*View) Handle

func (v *View) Handle() int

Handle returns a handle value.

func (*View) IsSymbolTable

func (v *View) IsSymbolTable() bool

IsSymbolTable is for SymbolTable interface.

func (*View) Name

func (v *View) Name() string

Name returns a name of VIEW (code 2).

func (*View) SetHandle

func (v *View) SetHandle(h *int)

SetHandle sets a handle.

func (*View) SetOwner

func (v *View) SetOwner(h handle.Handler)

SetOwner sets an owner.

func (*View) String

func (v *View) String() string

String outputs data using default formatter.

type Viewport

type Viewport struct {
	LowerLeft     []float64
	UpperRight    []float64
	ViewCenter    []float64
	SnapBase      []float64
	SnapSpacing   []float64
	GridSpacing   []float64
	ViewDirection []float64
	ViewTarget    []float64
	Height        float64
	AspectRatio   float64
	LensLength    float64
	FrontClip     float64
	BackClip      float64
	SnapAngle     float64
	TwistAngle    float64
	// contains filtered or unexported fields
}

Viewport represents VPORT SymbolTable.

func NewViewport

func NewViewport(name string) *Viewport

NewViewport creates a new Viewport.

func (*Viewport) Format

func (v *Viewport) Format(f format.Formatter)

Format writes data to formatter.

func (*Viewport) FormatString

func (v *Viewport) FormatString(f format.Formatter) string

FormatString outputs data using given formatter.

func (*Viewport) Handle

func (v *Viewport) Handle() int

Handle returns a handle value.

func (*Viewport) IsSymbolTable

func (v *Viewport) IsSymbolTable() bool

IsSymbolTable is for SymbolTable interface.

func (*Viewport) Name

func (v *Viewport) Name() string

Name returns a name of VPORT (code 2).

func (*Viewport) SetHandle

func (v *Viewport) SetHandle(h *int)

SetHandle sets a handle.

func (*Viewport) SetName

func (v *Viewport) SetName(name string)

SetName sets a name to VPORT (code 2).

func (*Viewport) SetOwner

func (v *Viewport) SetOwner(h handle.Handler)

SetOwner sets an owner.

func (*Viewport) String

func (v *Viewport) String() string

String outputs data using default formatter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL