-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #479 from lihqi/lhq-alpha-0607
feat: add RectRotateSensitivitySlider to siderbar
- Loading branch information
Showing
11 changed files
with
89 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,6 @@ | |
.content { | ||
display: flex; | ||
justify-content: space-between; | ||
margin-top: 4px; | ||
margin-top: 16px; | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
...ew/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.rectRotateSensitivitySlider { | ||
padding: 12px 20px; | ||
.title{ | ||
margin-bottom: 16px; | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
...s/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* @file Provides a slider component for adjusting the rotation angle sensitivity in a point cloud context. | ||
* The slider allows values between 1 and 5, with marks at 0.5, 1, 2, 3, and 4. | ||
* The current sensitivity value is managed via the PointCloudContext. | ||
* @author Vincent He <[email protected]> | ||
* @date 2024-06-05 | ||
*/ | ||
import React from 'react'; | ||
import { Slider } from 'antd'; | ||
import { PointCloudContext } from '@/components/pointCloudView/PointCloudContext'; | ||
import { i18n } from '@labelbee/lb-utils'; | ||
import styles from './index.module.scss'; | ||
|
||
const marks = { | ||
0.5: 0.5, | ||
1: 1, | ||
2: 2, | ||
3: 3, | ||
4: 4, | ||
}; | ||
|
||
const RectRotateSensitivitySlider = () => { | ||
const ptCtx = React.useContext(PointCloudContext); | ||
|
||
const handleSliderChange = (value: number) => { | ||
ptCtx.setRectRotateSensitivity(value); | ||
}; | ||
|
||
return ( | ||
<div className={styles.rectRotateSensitivitySlider}> | ||
<div className={styles.title}>{i18n.t('RotationAngleSensitivity')}</div> | ||
<div className='toolStyle'> | ||
<div id='style-rectRotateSensitivity'> | ||
<Slider | ||
min={0.5} | ||
max={4} | ||
step={null} | ||
value={ptCtx.rectRotateSensitivity} | ||
onChange={handleSliderChange} | ||
marks={marks} | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default RectRotateSensitivitySlider; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters