@buerli.io/react-cad 0.2.0 → 0.3.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/build/components/UI/CAD/Drawing.d.ts +1 -22
  2. package/build/components/UI/CAD/ViewOptionsBar/useOptionCommands.d.ts +1 -0
  3. package/build/components/UI/CAD/index.d.ts +0 -1
  4. package/build/components/UI/editors/RefsEditors/RefEditor.d.ts +1 -0
  5. package/build/components/graphics/CSysDisplay.d.ts +1 -0
  6. package/build/components/graphics/HoveredConstraintDisplay.d.ts +1 -2
  7. package/build/components/graphics/Outlines/IDPass.d.ts +11 -0
  8. package/build/components/graphics/Outlines/Outline.d.ts +25 -0
  9. package/build/components/graphics/Outlines/OutlineEffect.d.ts +32 -0
  10. package/build/components/graphics/Outlines/OutlineMaterial.d.ts +7 -0
  11. package/build/components/graphics/SelectedMateObj.d.ts +12 -0
  12. package/build/components/graphics/WorkAxisObj.d.ts +10 -0
  13. package/build/components/graphics/WorkCoordSystemObj.d.ts +10 -0
  14. package/build/components/graphics/WorkPlaneObj.d.ts +10 -0
  15. package/build/components/graphics/WorkPointObj.d.ts +10 -0
  16. package/build/components/graphics/graphics.d.ts +7 -7
  17. package/build/components/graphics/utils/MatePathTransform.d.ts +9 -0
  18. package/build/components/graphics/utils/useCsysMatrix.d.ts +4 -0
  19. package/build/components/utils/CompValidation/ErrorBoundary.d.ts +1 -1
  20. package/build/index.cjs.js +1349 -677
  21. package/build/index.d.ts +9 -1
  22. package/build/index.js +1302 -637
  23. package/build/plugins/BoundingBoxInfo/Root.d.ts +1 -0
  24. package/build/plugins/BoundingBoxInfo/View.d.ts +1 -0
  25. package/build/plugins/Dimensions/index.d.ts +6 -6
  26. package/build/plugins/Sketch/View/graphics/hooks.d.ts +4 -0
  27. package/build/plugins/Sketch/View/handlers/HandlersConstructors.d.ts +0 -1
  28. package/build/utils/getMateRefIds.d.ts +2 -0
  29. package/build/utils/helpers.d.ts +3 -3
  30. package/build/utils/selection/filters.d.ts +0 -10
  31. package/package.json +15 -14
@@ -1,18 +1,6 @@
1
- import { DrawingID, ObjectID } from '@buerli.io/core';
1
+ import { DrawingID } from '@buerli.io/core';
2
2
  import 'antd/dist/antd.css';
3
3
  import React from 'react';
4
- declare type ObjType = 'Feature' | 'AssemblyNode' | 'Solid' | 'Constraint';
5
- export declare type InteractionInfo = {
6
- objectId: ObjectID;
7
- highlightedIds?: ObjectID[];
8
- type: ObjType;
9
- } | null;
10
- export declare const InteractionContext: React.Context<{
11
- hoveredId?: number | undefined;
12
- selectedId?: number | undefined;
13
- onHover?: ((objData: InteractionInfo) => void) | undefined;
14
- onClick?: ((objData: InteractionInfo) => void) | undefined;
15
- }>;
16
4
  /**
17
5
  * Component which provides convenient UI for working with models which is loaded to existing drawing.
18
6
  * It includes ModelTree, Constraints and Solids components and toolbar for creating new features/3dconstraints
@@ -20,18 +8,9 @@ export declare const InteractionContext: React.Context<{
20
8
  *
21
9
  * @param drawingId - id of an existing drawing.
22
10
  * @param Menu - you can pass custom file menu which will be shown at the left top corner.
23
- * @param hoveredId - id of a currently hovered object.
24
- * @param selectedId - id of a currently selected object.
25
- * @param onHover - callback for hovering features / assembly nodes / solids / constraints.
26
- * @param onClick - callback for clicking on assembly nodes / solids.
27
11
  */
28
12
  export declare const Drawing: React.FC<{
29
13
  drawingId: DrawingID;
30
14
  Menu?: JSX.Element;
31
15
  children?: React.ReactNode;
32
- hoveredId?: ObjectID;
33
- selectedId?: ObjectID;
34
- onHover?: (objData: InteractionInfo) => void;
35
- onClick?: (objData: InteractionInfo) => void;
36
16
  }>;
37
- export {};
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const useOptionCommands: () => ({
2
3
  label: string;
3
4
  icon: JSX.Element;
@@ -10,5 +10,4 @@ export { ViewOptionButtons } from './ViewOptionsBar/ViewOptionButtons';
10
10
  export { ViewPlugButtons } from './ViewPlugButtons';
11
11
  export { Menu } from './common/Menu';
12
12
  export type { MenuItem, MenuItems } from './common/Menu';
13
- export type { InteractionInfo } from './Drawing';
14
13
  export * from './store/CADStore';
@@ -3,6 +3,7 @@ import { DrawingID, IStructureTree, ObjectID, SelectorID, SelectedItem } from '@
3
3
  import { MemberParam } from '../../../../types';
4
4
  import { SelectorsOrderT } from '../../../../utils/selection/useSelectorsOrder';
5
5
  export declare const isGeometry: (tree: IStructureTree, objId: ObjectID) => boolean;
6
+ export declare const getInteractionInfo: (drawingId: DrawingID, item: SelectedItem | null) => import("@buerli.io/core").InteractionInfo<any> | null;
6
7
  export declare const RefEditor: React.FC<{
7
8
  param: MemberParam<ObjectID[]> | MemberParam<ObjectID>;
8
9
  drawingId: DrawingID;
@@ -17,6 +17,7 @@ export declare type CSysUserData = {
17
17
  reoriented?: ReorientedType;
18
18
  isSelected?: boolean;
19
19
  isActive?: boolean;
20
+ onHUD?: boolean;
20
21
  };
21
22
  export declare const CSysWrapper: React.FC<{
22
23
  drawingId: DrawingID;
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
- import { DrawingID, ObjectID } from '@buerli.io/core';
2
+ import { DrawingID } from '@buerli.io/core';
3
3
  export declare const HoveredConstraintDisplay: React.FC<{
4
4
  drawingId: DrawingID;
5
- hoveredId: ObjectID;
6
5
  }>;
@@ -0,0 +1,11 @@
1
+ import * as THREE from 'three';
2
+ import { Pass, Selection } from 'postprocessing';
3
+ export declare class IDPass extends Pass {
4
+ material: THREE.RawShaderMaterial;
5
+ oldMaterials: Map<THREE.Mesh, THREE.Material>;
6
+ selection: Selection;
7
+ id: number;
8
+ channel: number;
9
+ constructor(scene: THREE.Scene, camera: THREE.Camera);
10
+ render(renderer: THREE.WebGLRenderer, inputBuffer: THREE.WebGLRenderTarget): void;
11
+ }
@@ -0,0 +1,25 @@
1
+ /// <reference types="postprocessing" />
2
+ import React from 'react';
3
+ import { Object3D } from 'three';
4
+ import { OutlineEffect } from './OutlineEffect';
5
+ export declare type OutlineProps = ConstructorParameters<typeof OutlineEffect>[2] & Partial<{
6
+ selections1: Object3D[][];
7
+ selections2: Object3D[][];
8
+ selections3: Object3D[][];
9
+ selectionLayer: number;
10
+ }>;
11
+ export declare const Outline: React.ForwardRefExoticComponent<{
12
+ edgeStrength?: number | undefined;
13
+ edgeColor1?: number | undefined;
14
+ edgeColor2?: number | undefined;
15
+ edgeColor3?: number | undefined;
16
+ resolutionScale?: number | undefined;
17
+ width?: number | undefined;
18
+ height?: number | undefined;
19
+ kernelSize?: import("postprocessing").KernelSize | undefined;
20
+ } & Partial<{
21
+ selections1: Object3D[][];
22
+ selections2: Object3D[][];
23
+ selections3: Object3D[][];
24
+ selectionLayer: number;
25
+ }> & React.RefAttributes<OutlineEffect>>;
@@ -0,0 +1,32 @@
1
+ import * as THREE from 'three';
2
+ import { Effect, ClearPass, KawaseBlurPass, ShaderPass, Selection, KernelSize } from 'postprocessing';
3
+ import { IDPass } from './IDPass';
4
+ export declare class OutlineEffect extends Effect {
5
+ scene: THREE.Scene;
6
+ camera: THREE.Camera;
7
+ idRT: THREE.WebGLRenderTarget;
8
+ outlineRT: THREE.WebGLRenderTarget;
9
+ clearPass: ClearPass;
10
+ idPass: IDPass;
11
+ outlinePass: ShaderPass;
12
+ blurPass: KawaseBlurPass;
13
+ selections1: Selection[];
14
+ selections2: Selection[];
15
+ selections3: Selection[];
16
+ time: number;
17
+ processSelection: (renderer: THREE.WebGLRenderer, selection: Selection, id: number) => void;
18
+ constructor(scene: THREE.Scene, camera: THREE.Camera, { edgeStrength, edgeColor1, edgeColor2, edgeColor3, resolutionScale, width, height, kernelSize, }?: {
19
+ edgeStrength?: number | undefined;
20
+ edgeColor1?: number | undefined;
21
+ edgeColor2?: number | undefined;
22
+ edgeColor3?: number | undefined;
23
+ resolutionScale?: number | undefined;
24
+ width?: number | undefined;
25
+ height?: number | undefined;
26
+ kernelSize?: KernelSize | undefined;
27
+ });
28
+ set selectionLayer(value: number);
29
+ update(renderer: THREE.WebGLRenderer, inputBuffer: THREE.WebGLRenderTarget, deltaTime: number): void;
30
+ setSize(width: number, height: number): void;
31
+ initialize(renderer: THREE.WebGLRenderer, alpha: boolean, frameBufferType?: number): void;
32
+ }
@@ -0,0 +1,7 @@
1
+ import * as THREE from "three";
2
+ export declare class OutlineMaterial extends THREE.ShaderMaterial {
3
+ constructor(texelSize?: THREE.Vector2);
4
+ set inputBuffer(value: THREE.Texture);
5
+ setTexelSize(x: number, y: number): void;
6
+ setSize(width: number, height: number): void;
7
+ }
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { DrawingID, ObjectID } from '@buerli.io/core';
3
+ import { FlipType, ReorientedType } from '@buerli.io/classcad';
4
+ export declare const SelectedMateObj: React.FC<{
5
+ drawingId: DrawingID;
6
+ csysId: ObjectID;
7
+ matePath: ObjectID[];
8
+ flip: FlipType;
9
+ reoriented: ReorientedType;
10
+ color?: string | number;
11
+ opacity?: number;
12
+ }>;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { DrawingID, ObjectID } from '@buerli.io/core';
3
+ export declare const WorkAxisObj: React.FC<{
4
+ drawingId: DrawingID;
5
+ objectId: ObjectID;
6
+ color?: number | string;
7
+ opacity?: number;
8
+ userData?: any;
9
+ handlers?: any;
10
+ }>;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { DrawingID, ObjectID } from '@buerli.io/core';
3
+ export declare const WorkCoordSystemObj: React.FC<{
4
+ drawingId: DrawingID;
5
+ objectId: ObjectID;
6
+ color?: number | string;
7
+ opacity?: number;
8
+ userData?: any;
9
+ handlers?: any;
10
+ }>;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { DrawingID, ObjectID } from '@buerli.io/core';
3
+ export declare const WorkPlaneObj: React.FC<{
4
+ drawingId: DrawingID;
5
+ objectId: ObjectID;
6
+ color?: number | string;
7
+ opacity?: number;
8
+ userData?: any;
9
+ handlers?: any;
10
+ }>;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { DrawingID, ObjectID } from '@buerli.io/core';
3
+ export declare const WorkPointObj: React.FC<{
4
+ drawingId: DrawingID;
5
+ objectId: ObjectID;
6
+ color?: number | string;
7
+ opacity?: number;
8
+ userData?: any;
9
+ handlers?: any;
10
+ }>;
@@ -3,7 +3,7 @@ import * as THREE from 'three';
3
3
  export declare const Point: React.FC<{
4
4
  position: THREE.Vector3;
5
5
  radius: number;
6
- color: number;
6
+ color: string | number;
7
7
  opacity?: number;
8
8
  handlers?: any;
9
9
  userData?: any;
@@ -13,7 +13,7 @@ export declare const Arrow: React.FC<{
13
13
  direction: THREE.Vector3;
14
14
  length: number;
15
15
  width: number;
16
- color: number;
16
+ color: string | number;
17
17
  opacity?: number;
18
18
  handlers?: any;
19
19
  userData?: any;
@@ -21,7 +21,7 @@ export declare const Arrow: React.FC<{
21
21
  }>;
22
22
  export declare const OriginPoint: React.FC<{
23
23
  position?: THREE.Vector3;
24
- color: number;
24
+ color: string | number;
25
25
  opacity?: number;
26
26
  handlers?: any;
27
27
  userData?: any;
@@ -31,7 +31,7 @@ export declare const AxisArrow: React.FC<{
31
31
  direction: THREE.Vector3;
32
32
  length?: number;
33
33
  width?: number;
34
- color: number;
34
+ color: string | number;
35
35
  opacity?: number;
36
36
  handlers?: any;
37
37
  userData?: any;
@@ -41,14 +41,14 @@ export declare const Csys: React.FC<{
41
41
  matrix: THREE.Matrix4;
42
42
  opacity: number;
43
43
  handlers?: any;
44
- color?: number;
44
+ color?: string | number;
45
45
  userData?: any;
46
46
  }>;
47
47
  export declare const SelectedCsys: React.FC<{
48
48
  matrix: THREE.Matrix4;
49
- opacity: number;
49
+ opacity?: number;
50
50
  handlers?: any;
51
- color?: number;
51
+ color?: string | number;
52
52
  userData?: any;
53
53
  }>;
54
54
  export declare const Caption: React.FC<{
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import * as THREE from 'three';
3
+ import { DrawingID, ObjectID } from '@buerli.io/core';
4
+ export declare const MatePathTransform: React.FC<{
5
+ drawingId: DrawingID;
6
+ matePath: ObjectID[];
7
+ currentDepth?: number;
8
+ matrix?: THREE.Matrix4;
9
+ }>;
@@ -0,0 +1,4 @@
1
+ import * as THREE from 'three';
2
+ import { DrawingID, ObjectID } from '@buerli.io/core';
3
+ import { FlipType, ReorientedType } from '@buerli.io/classcad';
4
+ export declare const useCsysMatrix: (drawingId: DrawingID, csysId: ObjectID, flip: FlipType | undefined, reoriented: ReorientedType | undefined) => THREE.Matrix4;
@@ -22,6 +22,6 @@ export declare class ErrorBoundary extends React.Component<Props, State> {
22
22
  hasError: boolean;
23
23
  };
24
24
  componentDidCatch(error: any, errorInfo: any): void;
25
- render(): {} | null | undefined;
25
+ render(): React.ReactNode;
26
26
  }
27
27
  export {};