Skip to content

Commit

Permalink
ISSUE #5125 - updated colours for top and bottom selected planes
Browse files Browse the repository at this point in the history
  • Loading branch information
sanmont3drepo committed Sep 16, 2024
1 parent c854ccc commit 8397b3a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
8 changes: 7 additions & 1 deletion frontend/src/v4/services/viewer/viewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
import { uuid as UUID } from '../../helpers/uuid';
import { clientConfigService } from '../clientConfig';
import { MultiSelect } from './multiSelect';
import { COLOR, hexToOpacity } from '@/v5/ui/themes/theme';

declare const Module;

Expand Down Expand Up @@ -1343,6 +1344,11 @@ export class ViewerService {
}

public selectCalibrationToolPlane(plane) {
const unselectedPlane = plane !== 'lower' ? 'lower' : 'upper';

Viewer.setCalibrationToolVerticalPlaneColours(plane, hexToOpacity(COLOR.PRIMARY_MAIN_CONTRAST, 44), COLOR.PRIMARY_MAIN, COLOR.PRIMARY_MAIN_CONTRAST);
Viewer.setCalibrationToolVerticalPlaneColours(unselectedPlane, hexToOpacity(COLOR.PRIMARY_MAIN_CONTRAST, 0), COLOR.PRIMARY_MAIN, hexToOpacity(COLOR.PRIMARY_MAIN_CONTRAST, 0));

UnityUtil.selectCalibrationToolVerticalPlane(plane);
}

Expand All @@ -1358,7 +1364,7 @@ export class ViewerService {
UnityUtil.setCalibrationToolFloorToObject(teamspace, modelId, meshId);
}

public setCalibrationToolSelectedColors(plane, fill, border, drawing) {
public setCalibrationToolVerticalPlaneColours(plane, fill, border, drawing) {
UnityUtil.setCalibrationToolVerticalPlaneColours(plane, fill, border, drawing);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ export type Vector3D = Vector<Coord3D>;
export enum PlaneType {
UPPER = 'upper',
LOWER = 'lower',
NONE = 'none',
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ export const VerticalSpatialBoundariesHandler = () => {
[bottomLeft, bottomRight, topLeft].map((corner) => corner.applyMatrix3(tMatrix));

Viewer.setCalibrationToolDrawing(i, [...bottomLeft, ...bottomRight, ...topLeft]);
Viewer.setCalibrationToolSelectedColors(hexToOpacity(COLOR.PRIMARY_MAIN_CONTRAST, 40), COLOR.PRIMARY_MAIN);
Viewer.setCalibrationToolUnselectedColors(hexToOpacity(COLOR.PRIMARY_MAIN_CONTRAST, 10), COLOR.PRIMARY_MAIN_CONTRAST);
Viewer.setCalibrationToolOcclusionOpacity(0.5);
};
};

Expand All @@ -74,15 +71,8 @@ export const VerticalSpatialBoundariesHandler = () => {
}, [planesAreSet, isCalibratingPlanes]);

useEffect(() => {
Viewer.setCalibrationToolMode(planesAreSet ? 'Vertical' : 'None');

if (!isCalibratingPlanes && planesAreSet) {
Viewer.selectCalibrationToolPlane('none');
}

if (isCalibratingPlanes) {
setSelectedPlane(PlaneType.UPPER);
}
Viewer.setCalibrationToolMode(planesAreSet ? 'Vertical' : 'None');
setSelectedPlane(isCalibratingPlanes ? PlaneType.UPPER : PlaneType.NONE);

if (!planesAreSet && isCalibratingPlanes) {
const onClickFloorToObject = ({ account, model, id }) => {
Expand Down

0 comments on commit 8397b3a

Please sign in to comment.