-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat: Add selection filters and multiple types of choices
Multiple shape types can be selected when selecting, and filter conditions can be added to the target shape at the same time
- Loading branch information
1 parent
71561c7
commit 952e2cd
Showing
22 changed files
with
261 additions
and
81 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,40 @@ | ||
// Copyright 2022-2023 the Chili authors. All rights reserved. AGPL-3.0 license. | ||
|
||
export enum ShapeType { | ||
Compound, | ||
CompoundSolid, | ||
Solid, | ||
Shell, | ||
Face, | ||
Wire, | ||
Edge, | ||
Vertex, | ||
Shape, | ||
Shape = 0b0, | ||
Compound = 0b1, | ||
CompoundSolid = 0b10, | ||
Solid = 0b100, | ||
Shell = 0b1000, | ||
Face = 0b10000, | ||
Wire = 0b100000, | ||
Edge = 0b1000000, | ||
Vertex = 0b10000000, | ||
} | ||
|
||
export namespace ShapeType { | ||
export function hasCompound(type: ShapeType): boolean { | ||
return (type & ShapeType.Compound) !== 0; | ||
} | ||
export function hasCompoundSolid(type: ShapeType): boolean { | ||
return (type & ShapeType.CompoundSolid) !== 0; | ||
} | ||
export function hasSolid(type: ShapeType): boolean { | ||
return (type & ShapeType.Solid) !== 0; | ||
} | ||
export function hasShell(type: ShapeType): boolean { | ||
return (type & ShapeType.Shell) !== 0; | ||
} | ||
export function hasFace(type: ShapeType): boolean { | ||
return (type & ShapeType.Face) !== 0; | ||
} | ||
export function hasWire(type: ShapeType): boolean { | ||
return (type & ShapeType.Wire) !== 0; | ||
} | ||
export function hasEdge(type: ShapeType): boolean { | ||
return (type & ShapeType.Edge) !== 0; | ||
} | ||
export function hasVertex(type: ShapeType): boolean { | ||
return (type & ShapeType.Vertex) !== 0; | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Copyright 2022-2023 the Chili authors. All rights reserved. AGPL-3.0 license. | ||
|
||
import { IShape } from "../geometry"; | ||
|
||
export interface IShapeFilter { | ||
allow(shape: IShape): boolean; | ||
} |
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
Oops, something went wrong.