nodeGeometryBuildState.d.ts 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. import type { Nullable } from "../../types";
  2. import type { VertexData } from "../mesh.vertexData";
  3. import type { NodeGeometryConnectionPoint } from "./nodeGeometryBlockConnectionPoint";
  4. import { NodeGeometryContextualSources } from "./Enums/nodeGeometryContextualSources";
  5. import { Matrix, Vector3 } from "../../Maths/math.vector";
  6. import type { INodeGeometryExecutionContext } from "./Interfaces/nodeGeometryExecutionContext";
  7. import { NodeGeometryBlockConnectionPointTypes } from "./Enums/nodeGeometryConnectionPointTypes";
  8. import type { INodeGeometryInstancingContext } from "./Interfaces/nodeGeometryInstancingContext";
  9. /**
  10. * Class used to store node based geometry build state
  11. */
  12. export declare class NodeGeometryBuildState {
  13. private _rotationMatrix;
  14. private _scalingMatrix;
  15. private _positionMatrix;
  16. private _scalingRotationMatrix;
  17. private _transformMatrix;
  18. private _tempVector3;
  19. /** Gets or sets the list of non connected mandatory inputs */
  20. notConnectedNonOptionalInputs: NodeGeometryConnectionPoint[];
  21. /** Gets or sets the list of non contextual inputs having no contextudal data */
  22. noContextualData: NodeGeometryContextualSources[];
  23. /** Gets or sets the build identifier */
  24. buildId: number;
  25. /** Gets or sets a boolean indicating that verbose mode is on */
  26. verbose: boolean;
  27. /** Gets or sets the vertex data */
  28. vertexData: Nullable<VertexData>;
  29. private _geometryContext;
  30. private _executionContext;
  31. private _instancingContext;
  32. private _geometryContextStack;
  33. private _executionContextStack;
  34. private _instancingContextStack;
  35. /** Gets or sets the geometry context */
  36. get geometryContext(): Nullable<VertexData>;
  37. /** Gets or sets the execution context */
  38. get executionContext(): Nullable<INodeGeometryExecutionContext>;
  39. /** Gets or sets the instancing context */
  40. get instancingContext(): Nullable<INodeGeometryInstancingContext>;
  41. /**
  42. * Push the new active geometry context
  43. * @param geometryContext defines the geometry context
  44. */
  45. pushGeometryContext(geometryContext: VertexData): void;
  46. /**
  47. * Push the new active execution context
  48. * @param executionContext defines the execution context
  49. */
  50. pushExecutionContext(executionContext: INodeGeometryExecutionContext): void;
  51. /**
  52. * Push the new active instancing context
  53. * @param instancingContext defines the instancing context
  54. */
  55. pushInstancingContext(instancingContext: INodeGeometryInstancingContext): void;
  56. /**
  57. * Remove current geometry context and restore the previous one
  58. */
  59. restoreGeometryContext(): void;
  60. /**
  61. * Remove current execution context and restore the previous one
  62. */
  63. restoreExecutionContext(): void;
  64. /**
  65. * Remove current isntancing context and restore the previous one
  66. */
  67. restoreInstancingContext(): void;
  68. /**
  69. * Gets the value associated with a contextual source
  70. * @param source Source of the contextual value
  71. * @param skipWarning Do not store the warning for reporting if true
  72. * @returns the value associated with the source
  73. */
  74. getContextualValue(source: NodeGeometryContextualSources, skipWarning?: boolean): any;
  75. /**
  76. * Adapt a value to a target type
  77. * @param source defines the value to adapt
  78. * @param targetType defines the target type
  79. * @returns the adapted value
  80. */
  81. adapt(source: NodeGeometryConnectionPoint, targetType: NodeGeometryBlockConnectionPointTypes): any;
  82. /**
  83. * Adapt an input value to a target type
  84. * @param source defines the value to adapt
  85. * @param targetType defines the target type
  86. * @param defaultValue defines the default value to use if not connected
  87. * @returns the adapted value
  88. */
  89. adaptInput(source: NodeGeometryConnectionPoint, targetType: NodeGeometryBlockConnectionPointTypes, defaultValue: any): any;
  90. /**
  91. * Emits console errors and exceptions if there is a failing check
  92. */
  93. emitErrors(): void;
  94. /** @internal */
  95. _instantiate(clone: VertexData, currentPosition: Vector3, rotation: Vector3, scaling: Vector3, additionalVertexData: VertexData[]): void;
  96. /** @internal */
  97. _instantiateWithMatrix(clone: VertexData, transform: Matrix, additionalVertexData: VertexData[]): void;
  98. /** @internal */
  99. _instantiateWithPositionAndMatrix(clone: VertexData, currentPosition: Vector3, transform: Matrix, additionalVertexData: VertexData[]): void;
  100. }