Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | 1122x 1122x 1122x 12x 1110x 651x 459x 1x 458x 172x 286x 5x 281x 201x 80x 80x 80x 1122x 232x 232x 227x 5x 1x 4x 1x 3x 1x 2x 1x 1x 232x 158x 158x 44x 114x 72x 42x 41x 1x 158x 85x 2x 83x 78x 5x 2x 3x 2x 1x 14x 4x 10x 1x 9x 1x 8x 1x 7x 1x 6x 1x 5x 1x 4x 1x 3x 1x 2x 1x 1x | import {
GccEnt_Position, GeomFill_Trihedron, OpenCascadeInstance, TopAbs_State, TopoDS_Shape
} from "../../../bitbybit-dev-occt/bitbybit-dev-occt";
import * as Inputs from "../../api/inputs/inputs";
export class EnumService {
constructor(
private readonly occ: OpenCascadeInstance,
) { }
getShapeTypeEnum(shape: TopoDS_Shape): Inputs.OCCT.shapeTypeEnum {
let result = Inputs.OCCT.shapeTypeEnum.unknown;
const st = shape.ShapeType();
if (st === this.occ.TopAbs_ShapeEnum.TopAbs_EDGE) {
result = Inputs.OCCT.shapeTypeEnum.edge;
} else if (st === this.occ.TopAbs_ShapeEnum.TopAbs_WIRE) {
result = Inputs.OCCT.shapeTypeEnum.wire;
} else if (st === this.occ.TopAbs_ShapeEnum.TopAbs_VERTEX) {
result = Inputs.OCCT.shapeTypeEnum.vertex;
} else if (st === this.occ.TopAbs_ShapeEnum.TopAbs_SOLID) {
result = Inputs.OCCT.shapeTypeEnum.solid;
} else if (st === this.occ.TopAbs_ShapeEnum.TopAbs_SHELL) {
result = Inputs.OCCT.shapeTypeEnum.shell;
} else if (st === this.occ.TopAbs_ShapeEnum.TopAbs_FACE) {
result = Inputs.OCCT.shapeTypeEnum.face;
} else Iif (st === this.occ.TopAbs_ShapeEnum.TopAbs_COMPSOLID) {
result = Inputs.OCCT.shapeTypeEnum.compSolid;
} else if (st === this.occ.TopAbs_ShapeEnum.TopAbs_COMPOUND) {
result = Inputs.OCCT.shapeTypeEnum.compound;
} else E{
result = Inputs.OCCT.shapeTypeEnum.shape;
}
return result;
}
getGccEntPositionFromEnum(position: Inputs.OCCT.gccEntPositionEnum): GccEnt_Position {
let result = this.occ.GccEnt_Position.GccEnt_noqualifier;
if (position === Inputs.OCCT.gccEntPositionEnum.unqualified) {
result = this.occ.GccEnt_Position.GccEnt_unqualified;
} else if (position === Inputs.OCCT.gccEntPositionEnum.enclosed) {
result = this.occ.GccEnt_Position.GccEnt_enclosed;
} else if (position === Inputs.OCCT.gccEntPositionEnum.enclosing) {
result = this.occ.GccEnt_Position.GccEnt_enclosing;
} else if (position === Inputs.OCCT.gccEntPositionEnum.outside) {
result = this.occ.GccEnt_Position.GccEnt_outside;
} else if (position === Inputs.OCCT.gccEntPositionEnum.noqualifier) {
result = this.occ.GccEnt_Position.GccEnt_noqualifier;
} else {
result = this.occ.GccEnt_Position.GccEnt_noqualifier;
}
return result as GccEnt_Position;
}
getTopAbsStateEnum(state: TopAbs_State): Inputs.OCCT.topAbsStateEnum {
let result = Inputs.OCCT.topAbsStateEnum.unknown;
if (state === this.occ.TopAbs_State.TopAbs_IN) {
result = Inputs.OCCT.topAbsStateEnum.in;
} else if (state === this.occ.TopAbs_State.TopAbs_OUT) {
result = Inputs.OCCT.topAbsStateEnum.out;
} else if (state === this.occ.TopAbs_State.TopAbs_ON) {
result = Inputs.OCCT.topAbsStateEnum.on;
} else {
result = Inputs.OCCT.topAbsStateEnum.unknown;
}
return result;
}
convertFourSidesStrictEnumToTwoCircleInclusionEnum(value: Inputs.OCCT.fourSidesStrictEnum) {
if (value === Inputs.OCCT.fourSidesStrictEnum.inside) {
return Inputs.OCCT.twoCircleInclusionEnum.inside;
} else if (value === Inputs.OCCT.fourSidesStrictEnum.outside) {
return Inputs.OCCT.twoCircleInclusionEnum.outside;
} else if (value === Inputs.OCCT.fourSidesStrictEnum.insideOutside) {
return Inputs.OCCT.twoCircleInclusionEnum.insideOutside;
} else if (value === Inputs.OCCT.fourSidesStrictEnum.outsideInside) {
return Inputs.OCCT.twoCircleInclusionEnum.outsideInside;
} else {
return Inputs.OCCT.twoCircleInclusionEnum.none;
}
}
getGeomFillTrihedronEnumOCCTValue(value: Inputs.OCCT.geomFillTrihedronEnum): GeomFill_Trihedron {
if (value === Inputs.OCCT.geomFillTrihedronEnum.isConstantNormal) {
return this.occ.GeomFill_Trihedron.GeomFill_IsConstantNormal as GeomFill_Trihedron;
} else if (value === Inputs.OCCT.geomFillTrihedronEnum.isCorrectedFrenet) {
return this.occ.GeomFill_Trihedron.GeomFill_IsCorrectedFrenet as GeomFill_Trihedron;
} else if (value === Inputs.OCCT.geomFillTrihedronEnum.isDarboux) {
return this.occ.GeomFill_Trihedron.GeomFill_IsDarboux as GeomFill_Trihedron;
} else if (value === Inputs.OCCT.geomFillTrihedronEnum.isDiscreteTrihedron) {
return this.occ.GeomFill_Trihedron.GeomFill_IsDiscreteTrihedron as GeomFill_Trihedron;
} else if (value === Inputs.OCCT.geomFillTrihedronEnum.isFixed) {
return this.occ.GeomFill_Trihedron.GeomFill_IsFixed as GeomFill_Trihedron;
} else if (value === Inputs.OCCT.geomFillTrihedronEnum.isFrenet) {
return this.occ.GeomFill_Trihedron.GeomFill_IsFrenet as GeomFill_Trihedron;
} else if (value === Inputs.OCCT.geomFillTrihedronEnum.isGuideAC) {
return this.occ.GeomFill_Trihedron.GeomFill_IsGuideAC as GeomFill_Trihedron;
} else if (value === Inputs.OCCT.geomFillTrihedronEnum.isGuideACWithContact) {
return this.occ.GeomFill_Trihedron.GeomFill_IsGuideACWithContact as GeomFill_Trihedron;
} else if (value === Inputs.OCCT.geomFillTrihedronEnum.isGuidePlan) {
return this.occ.GeomFill_Trihedron.GeomFill_IsGuidePlan as GeomFill_Trihedron;
} else if (value === Inputs.OCCT.geomFillTrihedronEnum.isGuidePlanWithContact) {
return this.occ.GeomFill_Trihedron.GeomFill_IsGuidePlanWithContact as GeomFill_Trihedron;
} else {
return this.occ.GeomFill_Trihedron.GeomFill_IsConstantNormal as GeomFill_Trihedron;
}
}
}
|