diff --git a/react-components/src/components/RevealToolbar/LayersButton.tsx b/react-components/src/components/RevealToolbar/LayersButton.tsx index 0818674351e..185d31ca562 100644 --- a/react-components/src/components/RevealToolbar/LayersButton.tsx +++ b/react-components/src/components/RevealToolbar/LayersButton.tsx @@ -20,7 +20,6 @@ import { useRevealContainerElement } from '../RevealContainer/RevealContainerEle export const LayersButton = (): ReactElement => { const viewer = useReveal(); const revealContainerElement = useRevealContainerElement(); - const [layersEnabled, setLayersEnabled] = useState(false); const [visible, setVisible] = useState(false); const [cadModelIds, setCadModelIds] = useState([]); @@ -38,7 +37,6 @@ export const LayersButton = (): ReactElement => { const pointCloudModelName = use3DModelName(pointCloudModelIds); const showLayers = (): void => { - setLayersEnabled(!layersEnabled); setVisible((prevState) => !prevState); }; diff --git a/react-components/src/components/RevealToolbar/RevealToolbar.tsx b/react-components/src/components/RevealToolbar/RevealToolbar.tsx index ae064bc0019..78cd66095ee 100644 --- a/react-components/src/components/RevealToolbar/RevealToolbar.tsx +++ b/react-components/src/components/RevealToolbar/RevealToolbar.tsx @@ -7,9 +7,11 @@ import { Button, ToolBar, type ToolBarProps } from '@cognite/cogs.js'; import { FitModelsButton } from './FitModelsButton'; import { LayersButton } from './LayersButton'; import { SlicerButton } from './SlicerButton'; +import { SettingsButton } from './SettingsButton'; import { withSuppressRevealEvents } from '../../higher-order-components/withSuppressRevealEvents'; import { MeasurementButton } from './MeasurementButton'; import { HelpButton } from './HelpButton'; +import { type QualitySettings } from './SettingsContainer/types'; const defaultStyle: ToolBarProps = { style: { @@ -19,32 +21,45 @@ const defaultStyle: ToolBarProps = { } }; -const defaultContent = ( - <> - +type RevealToolbarProps = ToolBarProps & { + customSettingsContent?: JSX.Element; + lowFidelitySettings?: Partial; + highFidelitySettings?: Partial; +}; - - + + ); +}; + +const exampleHighQualitySettings: QualitySettings = { + cadBudget: { + maximumRenderCost: 95000000, + highDetailProximityThreshold: 100 + }, + pointCloudBudget: { + numberOfPoints: 12000000 + }, + resolutionOptions: { + maxRenderResolution: Infinity, + movingCameraResolutionFactor: 1 + } +}; + +const exampleLowQualitySettings: QualitySettings = { + cadBudget: { + maximumRenderCost: 95000000, + highDetailProximityThreshold: 100 + }, + pointCloudBudget: { + numberOfPoints: 12000000 + }, + resolutionOptions: { + maxRenderResolution: 1e5, + movingCameraResolutionFactor: 1 + } +}; + export const Main: Story = { args: { addModelOptions: { @@ -56,7 +104,11 @@ export const Main: Story = { render: ({ addModelOptions }) => ( - +