ducjs
Version:
The duc 2D CAD file format is a cornerstone of our advanced design system, conceived to cater to professionals seeking precision and efficiency in their design work.
50 lines (49 loc) • 1.89 kB
JavaScript
// automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
import * as flatbuffers from 'flatbuffers';
export class SnapMarkerStyle {
constructor() {
this.bb = null;
this.bb_pos = 0;
}
__init(i, bb) {
this.bb_pos = i;
this.bb = bb;
return this;
}
static getRootAsSnapMarkerStyle(bb, obj) {
return (obj || new SnapMarkerStyle()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}
static getSizePrefixedRootAsSnapMarkerStyle(bb, obj) {
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
return (obj || new SnapMarkerStyle()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}
shape() {
const offset = this.bb.__offset(this.bb_pos, 4);
return offset ? this.bb.readUint8(this.bb_pos + offset) : null;
}
color(optionalEncoding) {
const offset = this.bb.__offset(this.bb_pos, 6);
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
}
static startSnapMarkerStyle(builder) {
builder.startObject(2);
}
static addShape(builder, shape) {
builder.addFieldInt8(0, shape, null);
}
static addColor(builder, colorOffset) {
builder.addFieldOffset(1, colorOffset, 0);
}
static endSnapMarkerStyle(builder) {
const offset = builder.endObject();
return offset;
}
static createSnapMarkerStyle(builder, shape, colorOffset) {
SnapMarkerStyle.startSnapMarkerStyle(builder);
if (shape !== null)
SnapMarkerStyle.addShape(builder, shape);
SnapMarkerStyle.addColor(builder, colorOffset);
return SnapMarkerStyle.endSnapMarkerStyle(builder);
}
}