UNPKG

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.

56 lines (55 loc) 2.21 kB
// 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'; import { FeatureControlFrameSegment } from '../duc/feature-control-frame-segment'; export class FCFSegmentRow { constructor() { this.bb = null; this.bb_pos = 0; } __init(i, bb) { this.bb_pos = i; this.bb = bb; return this; } static getRootAsFCFSegmentRow(bb, obj) { return (obj || new FCFSegmentRow()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } static getSizePrefixedRootAsFCFSegmentRow(bb, obj) { bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); return (obj || new FCFSegmentRow()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } segments(index, obj) { const offset = this.bb.__offset(this.bb_pos, 4); return offset ? (obj || new FeatureControlFrameSegment()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null; } segmentsLength() { const offset = this.bb.__offset(this.bb_pos, 4); return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; } static startFCFSegmentRow(builder) { builder.startObject(1); } static addSegments(builder, segmentsOffset) { builder.addFieldOffset(0, segmentsOffset, 0); } static createSegmentsVector(builder, data) { builder.startVector(4, data.length, 4); for (let i = data.length - 1; i >= 0; i--) { builder.addOffset(data[i]); } return builder.endVector(); } static startSegmentsVector(builder, numElems) { builder.startVector(4, numElems, 4); } static endFCFSegmentRow(builder) { const offset = builder.endObject(); return offset; } static createFCFSegmentRow(builder, segmentsOffset) { FCFSegmentRow.startFCFSegmentRow(builder); FCFSegmentRow.addSegments(builder, segmentsOffset); return FCFSegmentRow.endFCFSegmentRow(builder); } }