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.
91 lines (90 loc) • 3.91 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 PolarTrackingSettings {
constructor() {
this.bb = null;
this.bb_pos = 0;
}
__init(i, bb) {
this.bb_pos = i;
this.bb = bb;
return this;
}
static getRootAsPolarTrackingSettings(bb, obj) {
return (obj || new PolarTrackingSettings()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}
static getSizePrefixedRootAsPolarTrackingSettings(bb, obj) {
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
return (obj || new PolarTrackingSettings()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}
enabled() {
const offset = this.bb.__offset(this.bb_pos, 4);
return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
}
angles(index) {
const offset = this.bb.__offset(this.bb_pos, 6);
return offset ? this.bb.readFloat64(this.bb.__vector(this.bb_pos + offset) + index * 8) : 0;
}
anglesLength() {
const offset = this.bb.__offset(this.bb_pos, 6);
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
}
anglesArray() {
const offset = this.bb.__offset(this.bb_pos, 6);
return offset ? new Float64Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
}
incrementAngle() {
const offset = this.bb.__offset(this.bb_pos, 8);
return offset ? this.bb.readFloat64(this.bb_pos + offset) : 0.0;
}
trackFromLastPoint() {
const offset = this.bb.__offset(this.bb_pos, 10);
return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
}
showPolarCoordinates() {
const offset = this.bb.__offset(this.bb_pos, 12);
return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
}
static startPolarTrackingSettings(builder) {
builder.startObject(5);
}
static addEnabled(builder, enabled) {
builder.addFieldInt8(0, +enabled, +false);
}
static addAngles(builder, anglesOffset) {
builder.addFieldOffset(1, anglesOffset, 0);
}
static createAnglesVector(builder, data) {
builder.startVector(8, data.length, 8);
for (let i = data.length - 1; i >= 0; i--) {
builder.addFloat64(data[i]);
}
return builder.endVector();
}
static startAnglesVector(builder, numElems) {
builder.startVector(8, numElems, 8);
}
static addIncrementAngle(builder, incrementAngle) {
builder.addFieldFloat64(2, incrementAngle, 0.0);
}
static addTrackFromLastPoint(builder, trackFromLastPoint) {
builder.addFieldInt8(3, +trackFromLastPoint, +false);
}
static addShowPolarCoordinates(builder, showPolarCoordinates) {
builder.addFieldInt8(4, +showPolarCoordinates, +false);
}
static endPolarTrackingSettings(builder) {
const offset = builder.endObject();
return offset;
}
static createPolarTrackingSettings(builder, enabled, anglesOffset, incrementAngle, trackFromLastPoint, showPolarCoordinates) {
PolarTrackingSettings.startPolarTrackingSettings(builder);
PolarTrackingSettings.addEnabled(builder, enabled);
PolarTrackingSettings.addAngles(builder, anglesOffset);
PolarTrackingSettings.addIncrementAngle(builder, incrementAngle);
PolarTrackingSettings.addTrackFromLastPoint(builder, trackFromLastPoint);
PolarTrackingSettings.addShowPolarCoordinates(builder, showPolarCoordinates);
return PolarTrackingSettings.endPolarTrackingSettings(builder);
}
}