|
|
|
|
@ -263,10 +263,10 @@ function getTopDown(edgeIndex: EdgeIndex): number[] {
|
|
|
|
|
this.rbProj = this.line(this.updateProjectionLine(this.cuboidModel.rb.getEquation(),
|
|
|
|
|
this.cuboidModel.rb.points[1], this.cuboidModel.vpr));
|
|
|
|
|
|
|
|
|
|
this.ftProj.stroke({ color: '#C0C0C0' });
|
|
|
|
|
this.fbProj.stroke({ color: '#C0C0C0' });
|
|
|
|
|
this.rtProj.stroke({ color: '#C0C0C0' });
|
|
|
|
|
this.rbProj.stroke({ color: '#C0C0C0' });
|
|
|
|
|
this.ftProj.stroke({ color: '#C0C0C0' }).addClass('cvat_canvas_cuboid_projections');
|
|
|
|
|
this.fbProj.stroke({ color: '#C0C0C0' }).addClass('cvat_canvas_cuboid_projections');
|
|
|
|
|
this.rtProj.stroke({ color: '#C0C0C0' }).addClass('cvat_canvas_cuboid_projections');
|
|
|
|
|
this.rbProj.stroke({ color: '#C0C0C0' }).addClass('cvat_canvas_cuboid_projections');
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
setupEdges() {
|
|
|
|
|
@ -281,7 +281,7 @@ function getTopDown(edgeIndex: EdgeIndex): number[] {
|
|
|
|
|
this.rightBotEdge = this.line(this.cuboidModel.rb.points);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
setupGrabPoints(circleType) {
|
|
|
|
|
setupGrabPoints(circleType: Function | string) {
|
|
|
|
|
const viewModel = this.cuboidModel;
|
|
|
|
|
const circle = typeof circleType === 'function' ? circleType : this.circle;
|
|
|
|
|
|
|
|
|
|
@ -372,7 +372,7 @@ function getTopDown(edgeIndex: EdgeIndex): number[] {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (value === false) {
|
|
|
|
|
this.getGrabPoints().forEach((point) => {point && point.remove()});
|
|
|
|
|
this.getGrabPoints().forEach((point: SVG.Element) => {point && point.remove()});
|
|
|
|
|
} else {
|
|
|
|
|
this.setupGrabPoints(this.face.remember('_selectHandler').drawPoint.bind(
|
|
|
|
|
{nested: this, options: this.face.remember('_selectHandler').options}
|
|
|
|
|
@ -380,21 +380,29 @@ function getTopDown(edgeIndex: EdgeIndex): number[] {
|
|
|
|
|
|
|
|
|
|
// setup proper classes for selection points for proper cursor
|
|
|
|
|
Array.from(this.face.remember('_selectHandler').nested.node.children)
|
|
|
|
|
.forEach((point: SVG.Circle, i: number) => {
|
|
|
|
|
.forEach((point: SVG.LinkedHTMLElement, i: number) => {
|
|
|
|
|
point.classList.add(`svg_select_points_${['lt', 'lb', 'rb', 'rt'][i]}`)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (this.cuboidModel.orientation === Orientation.LEFT) {
|
|
|
|
|
Array.from(this.dorsalRightEdge.remember('_selectHandler').nested.node.children)
|
|
|
|
|
.forEach((point: SVG.Circle, i: number) => {
|
|
|
|
|
.forEach((point: SVG.LinkedHTMLElement, i: number) => {
|
|
|
|
|
point.classList.add(`svg_select_points_${['t', 'b'][i]}`);
|
|
|
|
|
point.ondblclick = this.resetPerspective.bind(this);
|
|
|
|
|
point.ondblclick = (e: MouseEvent) => {
|
|
|
|
|
if (e.shiftKey) {
|
|
|
|
|
this.resetPerspective()
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
Array.from(this.dorsalLeftEdge.remember('_selectHandler').nested.node.children)
|
|
|
|
|
.forEach((point: SVG.Circle, i: number) => {
|
|
|
|
|
.forEach((point: SVG.LinkedHTMLElement, i: number) => {
|
|
|
|
|
point.classList.add(`svg_select_points_${['t', 'b'][i]}`);
|
|
|
|
|
point.ondblclick = this.resetPerspective.bind(this);
|
|
|
|
|
point.ondblclick = (e: MouseEvent) => {
|
|
|
|
|
if (e.shiftKey) {
|
|
|
|
|
this.resetPerspective()
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -584,7 +592,7 @@ function getTopDown(edgeIndex: EdgeIndex): number[] {
|
|
|
|
|
setupDorsalEdge.call(this, this.dorsalLeftEdge, this.cuboidModel.orientation);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function horizontalEdgeControl(updatingFace, midX, midY) {
|
|
|
|
|
function horizontalEdgeControl(updatingFace: any, midX: number, midY: number) {
|
|
|
|
|
const leftPoints = this.updatedEdge(
|
|
|
|
|
this.cuboidModel.fl.points[0],
|
|
|
|
|
{x: midX, y: midY},
|
|
|
|
|
|