Isometric Drawing Toolkit
    Preparing search index...

    Type Alias DrawingStore

    DrawingStore: DrawingDefinition & DrawingPreference & {
        deleteCuboidValue: (index: number) => void;
        hasDefinitionChanged: boolean;
        highlightCubeFace: (cubeLocation: CubeLocation, axis: PositiveAxis) => void;
        highlightedTarget: VisibleCubeFaceLocation | null;
        isInteractive: boolean;
        newCuboidValue: (cuboidValue?: CuboidValue) => void;
        resetRotation: () => void;
        rotateXAnticlockwise: () => void;
        rotateXClockwise: () => void;
        rotateYAnticlockwise: () => void;
        rotateYClockwise: () => void;
        rotateZAnticlockwise: () => void;
        rotateZClockwise: () => void;
        setCuboidValue: (index: number, cuboidValue: CuboidValue) => void;
        setCuboidValues: (cuboidValues: CuboidValue[]) => void;
        setDefinitionIndex: (definitionIndex: number | null) => void;
        setName: (name: string) => void;
        setRotation: (rotation: Quaternion) => void;
        setShouldCropIsometricViewport: (
            shouldCropIsometricViewport: boolean,
        ) => void;
        setShouldShowAxisArrows: (shouldShowAxisArrows: boolean) => void;
        setShouldShowCodedPlanNumbers: (
            shouldShowCodedPlanNumbers: boolean,
        ) => void;
        setshouldShowIsometricGrid: (shouldShowIsometricGrid: boolean) => void;
        setshouldShowIsometricStructure: (
            shouldShowIsometricStructure: boolean,
        ) => void;
        setShouldShowOrthographicStructure: (
            shouldShowOrthographicStructure: boolean,
        ) => void;
        setShouldShowOrthographicViewsGrid: (
            shouldShowOrthographicViewsGrid: boolean,
        ) => void;
        setShouldSplitOrthographicViewsAsThree: (
            shouldSplitOrthographicViewsAsThree: boolean,
        ) => void;
        unhighlightCubeFace: (
            highlightKind: HighlightKind,
            cubeLocation: CubeLocation,
        ) => void;
    }

    Store that manages states belonging to a structure. If components share the same store, then they refer to the same structure. Defining attributes for drawings are in DrawingDefinition. Persistent preference attributes that are stored as a part of preset are in DrawingPreference.

    Type Declaration

    • deleteCuboidValue: (index: number) => void

      Deletes a cuboid value at the given index.

    • hasDefinitionChanged: boolean

      Flag to indicate whether attributes that are in the definition has changed. This will be set to zero when setDefinitionIndex, which is when a drawing is loaded or saved.

    • highlightCubeFace: (cubeLocation: CubeLocation, axis: PositiveAxis) => void

      Request highlight for a face, highlight kind determines the final highlight area.

    • highlightedTarget: VisibleCubeFaceLocation | null

      Detail required for every highlight kinds to allow switching between them, null for no current highlight.

    • isInteractive: boolean

      Whether to generate interactive faces in the isometric drawing. Exported SVG can avoid large file size due to transparent triangles by setting this to false.

    • newCuboidValue: (cuboidValue?: CuboidValue) => void

      Creates a new cuboid value at the end of the cuboid values array.

    • resetRotation: () => void

      Resets the rotation such that the rendering coordinates matches the ones denoted in the cuboid values.

    • rotateXAnticlockwise: () => void

      Rotates 90 degrees anticlockwise around x-axis (negative x), origin perspective.

    • rotateXClockwise: () => void

      Rotates 90 degrees clockwise around x-axis (positive x), origin perspective.

    • rotateYAnticlockwise: () => void

      Rotates 90 degrees anticlockwise around y-axis (negative y), origin perspective.

    • rotateYClockwise: () => void

      Rotates 90 degrees clockwise around y-axis (positive y), origin perspective.

    • rotateZAnticlockwise: () => void

      Rotates 90 degrees anticlockwise around z-axis (negative z), origin perspective.

    • rotateZClockwise: () => void

      Rotates 90 degrees clockwise around z-axis (positive z), origin perspective.

    • setCuboidValue: (index: number, cuboidValue: CuboidValue) => void

      Sets the cuboid value at the given index to the given value.

    • setCuboidValues: (cuboidValues: CuboidValue[]) => void

      Sets all cuboid values wholesale, use this in provider and prefer other functions in other components.

    • setDefinitionIndex: (definitionIndex: number | null) => void

      Sets the index of the current drawing in the global storage, null if the current drawing is not saved at all. This will reset hasDefinitionChanged to false since this is called when a drawing is loaded or saved.

    • setName: (name: string) => void

      Sets the name of the drawing.

    • setRotation: (rotation: Quaternion) => void

      Sets the rotation directly, use this in provider and prefer other functions in other components.

    • setShouldCropIsometricViewport: (shouldCropIsometricViewport: boolean) => void

      Set whether the isometric viewport is cropped to fit the axes and structure tightly.

    • setShouldShowAxisArrows: (shouldShowAxisArrows: boolean) => void

      Sets whether the background axis arrows are shown on the isometric drawing.

    • setShouldShowCodedPlanNumbers: (shouldShowCodedPlanNumbers: boolean) => void

      Sets whether the numbers are shown on the coded plan.

    • setshouldShowIsometricGrid: (shouldShowIsometricGrid: boolean) => void

      Sets whether the background grid is shown on the isometric drawing.

    • setshouldShowIsometricStructure: (shouldShowIsometricStructure: boolean) => void

      Sets whether the foreground structure is shown on the isometric drawing.

    • setShouldShowOrthographicStructure: (shouldShowOrthographicStructure: boolean) => void

      Sets whether the foreground structure is shown on the orthographic views.

    • setShouldShowOrthographicViewsGrid: (shouldShowOrthographicViewsGrid: boolean) => void

      Sets whether the background grid is shown on the orthographic views.

    • setShouldSplitOrthographicViewsAsThree: (shouldSplitOrthographicViewsAsThree: boolean) => void

      Sets whether the orthographic views should be split into three images.

    • unhighlightCubeFace: (highlightKind: HighlightKind, cubeLocation: CubeLocation) => void

      Unhighlights if the isCubeFaceHighlighted function determines that the given attributes match the current highlighting. This is to prevent stale request if the highlight changes before the request is received.