diff --git a/api/@ohos.graphics.scene.d.ts b/api/@ohos.graphics.scene.d.ts index 2d6b1d45679241d77858fcc109a881ef0d0d6c5c..2a9c9c6af18a971ed6a579762d86bbe26393dece 100644 --- a/api/@ohos.graphics.scene.d.ts +++ b/api/@ohos.graphics.scene.d.ts @@ -18,40 +18,10 @@ * @kit ArkGraphics3D */ -/** - * Export post processing settings - * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 - */ -export { ToneMappingType, ToneMappingSettings, PostProcessSettings, BloomSettings } from './graphics3d/ScenePostProcessSettings'; - -/** - * Export scene types - * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 - */ -export { Vec2, Vec3, Vec4, Color, Rect, Quaternion, Aabb, Position3, Rotation3, Scale3, GeometryType, GeometryDefinition, - PrimitiveTopology, CustomGeometry, CubeGeometry, PlaneGeometry, SphereGeometry } from './graphics3d/SceneTypes'; - -/** - * Export scene resources - * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 - */ -export { SceneResourceType, SceneResource, Shader, MaterialType, Material, ShaderMaterial, - SubMesh, Mesh, Animation, EnvironmentBackgroundType, Environment, Image, MeshResource } from './graphics3d/SceneResources'; - -/** - * Export scene nodes - * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 - */ -export { LayerMask, NodeType, Container, Node, Geometry, LightType, Light, SpotLight, DirectionalLight, - Camera } from './graphics3d/SceneNodes'; /** * Export scene * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts {'1.1':'7', '1.2':'20'} */ -export { SceneResourceParameters, SceneNodeParameters, SceneResourceFactory, Scene, RenderParameters } from './graphics3d/Scene'; +export { Scene } from './graphics3d/Scene'; diff --git a/api/graphics3d/Scene.d.ts b/api/graphics3d/Scene.d.ts index bf83d915fba6e2b3bdfccd51b1a99bba8c94fdf6..339858e32f65fb63e4a485cd5bc2283f06f0063d 100644 --- a/api/graphics3d/Scene.d.ts +++ b/api/graphics3d/Scene.d.ts @@ -18,201 +18,11 @@ * @kit ArkGraphics3D */ -import { Shader, MaterialType, Material, Animation, Environment, Image, MeshResource } from './SceneResources'; -import { Camera, LightType, Light, Node, NodeType, Geometry } from './SceneNodes'; -import { Position3, Color, GeometryDefinition } from './SceneTypes'; - -/** - * The scene resource parameters type. - * - * @typedef SceneResourceParameters - * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 - */ -export interface SceneResourceParameters { - /** - * The name of the scene resource parameters. - * - * @type { string } - * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 - */ - name: string; - - /** - * The resource uri of the scene resource parameters. - * - * @type { ?ResourceStr } - * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 - */ - uri?: ResourceStr; -} - -/** - * The scene node parameters type. - * - * @typedef SceneNodeParameters - * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 - */ -export interface SceneNodeParameters { - /** - * The name of the scene node parameters. - * - * @type { string } - * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 - */ - name: string; - - /** - * The path of the scene node parameters. - * - * @type { ?string } - * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 - */ - path?: string; -} - -/** - * The scene resource factory. - * - * @interface SceneResourceFactory - * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 - */ -export interface SceneResourceFactory { - /** - * Create a camera. - * - * @param { SceneNodeParameters } params - the param of creating a camera - * @returns { Promise } promise a camera - * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 - */ - createCamera(params: SceneNodeParameters): Promise; - - /** - * Create a light. - * - * @param { SceneNodeParameters } params - the param of creating a light - * @param { LightType } lightType - the type of the light - * @returns { Promise } promise a light - * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 - */ - createLight(params: SceneNodeParameters, lightType: LightType): Promise; - - /** - * Create a node. - * - * @param { SceneNodeParameters } params - the param of creating a node - * @returns { Promise } promise a node - * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 - */ - createNode(params: SceneNodeParameters): Promise; - - /** - * Create a material. - * - * @param { SceneResourceParameters } params - the param of creating a material - * @param { MaterialType } materialType - the type of the material - * @returns { Promise } promise a material - * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 - */ - createMaterial(params: SceneResourceParameters, materialType: MaterialType): Promise; - - /** - * Create a shader. - * - * @param { SceneResourceParameters } params - the param of creating a shader - * @returns { Promise } promise a shader - * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 - */ - createShader(params: SceneResourceParameters): Promise; - - /** - * Create a image. - * - * @param { SceneResourceParameters } params - the param of creating a image - * @returns { Promise } promise a image - * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 - */ - createImage(params: SceneResourceParameters): Promise; - - /** - * Create a environment. - * - * @param { SceneResourceParameters } params - the param of creating a Environment object - * @returns { Promise } promise a Environment - * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 - */ - createEnvironment(params: SceneResourceParameters): Promise; - - /** - * Create a geometry node. - * - * @param { SceneNodeParameters } params - the param of creating a geometry - * @param { MeshResource } mesh resource - The mesh data for the geometry - * @returns { Promise } promise a geometry - * @syscap SystemCapability.ArkUi.Graphics3D - * @since 18 - */ - createGeometry(params: SceneNodeParameters, mesh:MeshResource): Promise; - - /** - * Create a Mesh from an array of vertices. - * - * @param { SceneResourceParameters } params - the param of creating a Mesh object - * @param { GeometryDefinition } geometry - what sort of a geometric shape to create - * @returns { Promise } promise a Mesh - * @syscap SystemCapability.ArkUi.Graphics3D - * @since 18 - */ - createMesh(params: SceneResourceParameters, geometry: GeometryDefinition): Promise; - - /** - * Create a new scene from a Resource. - * - * @param { Resource } uri - the resource of creating a scene - * @returns { Promise } promise a scene - * @syscap SystemCapability.ArkUi.Graphics3D - * @since 18 - */ - createScene(uri?: ResourceStr): Promise; -} - -/** - * Defines parameters for manual rendering. - * - * @interface RenderParameters - * @syscap SystemCapability.ArkUi.Graphics3D - * @since 15 - */ -export interface RenderParameters { - /** - * If true, the renderer should always render even if there have been no changes in the scene - * since the previous frame. If false, renderer may omit rendering if no changes have been made. - * - * @type { ?boolean } - * @syscap SystemCapability.ArkUi.Graphics3D - * @since 15 - */ - alwaysRender?: boolean; -} - /** * Defines the 3d scene. * * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts {'1.1':'7', '1.2':'20'} */ export class Scene { /** @@ -222,100 +32,7 @@ export class Scene { * @returns { Promise } promise a scene * @static * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts {'1.1':'7', '1.2':'20'} */ static load(uri? : ResourceStr): Promise; - - /** - * The environment of the scene. - * - * @type { Environment } - * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 - */ - environment: Environment; - - /** - * The animations of the scene. - * - * @type { Animation[] } - * @readonly - * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 - */ - readonly animations: Animation[]; - - /** - * The root node of the scene. - * - * @type { Node | null } - * @readonly - * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 - */ - readonly root: Node | null; - - /** - * Get a node by path. - * - * @param { string } path - the path of the node - * @param { NodeType } type - verify the type of node, if it does not match, return null - * @returns { Node | null } if the node is found by it's path - * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 - */ - getNodeByPath(path: string, type?: NodeType): Node | null; - - /** - * Get resource factory. - * - * @returns { SceneResourceFactory } if the node is found by it's path - * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 - */ - getResourceFactory(): SceneResourceFactory; - - /** - * Release all native scene resources. All TS references will be undefined. - * - * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 - */ - destroy(): void; - - /** - * Import node into the scene. The original node may come from separate Scene. - * The node will be cloned and any modifications to the old node will not be visible after the import. - * - * @param { string } name - The name of the newly created node. - * @param { Node } node - The node to be imported. - * @param { Node | null} parent - The parent node or null for root - * @returns { Node } The newly created node. - * @syscap SystemCapability.ArkUi.Graphics3D - * @since 18 - */ - importNode(name: string, node: Node, parent: Node | null): Node; - - /** - * Import scene into the scene as a node. The node hierarchy will appear under the parent node. - * All animations from the scene will be duplicated in the scene. - * - * @param { string } name - The name of the newly created node - * @param { Scene } scene - The scene to be imported. - * @param { Node | null } parent - The parent node or null for root - * @returns { Node } The newly created node. - * @syscap SystemCapability.ArkUi.Graphics3D - * @since 18 - */ - importScene(name: string, scene: Scene, parent: Node | null): Node; - - /** - * A new frame is rendered for all active camera. - * - * @param { RenderParameters } params - Rendering parameters - * @returns { boolean } True if rendering was scheduled, false otherwise - * @syscap SystemCapability.ArkUi.Graphics3D - * @since 15 - */ - renderFrame(params?: RenderParameters): boolean; }