diff --git a/api/graphics3d/Scene.d.ts b/api/graphics3d/Scene.d.ts index 838408be3a469c17e0c30952d9764a067d7ef6f9..8b795356fb5fcec29449789ea2cb5b2a6005d391 100644 --- a/api/graphics3d/Scene.d.ts +++ b/api/graphics3d/Scene.d.ts @@ -375,31 +375,44 @@ export declare class Scene { /** * The environment of the scene. * - * @type { Environment } + * @return { Environment } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - environment: Environment; + get environment(): Environment; + + /** + * The environment of the scene. + * + * @param { Environment } value + * @syscap SystemCapability.ArkUi.Graphics3D + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 + */ + set environment(value: Environment); /** * The animations of the scene. * - * @type { Animation[] } + * @return { Animation[] } * @readonly * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - readonly animations: Animation[]; + get animations(): Animation[]; /** * The root node of the scene. * - * @type { Node | null } + * @return { Node | null } * @readonly * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - readonly root: Node | null; + get root(): Node | null; /** * Get a node by path. diff --git a/api/graphics3d/SceneTypes.d.ts b/api/graphics3d/SceneTypes.d.ts index 81a38d97f6b51220cc4f9b98aac21595e5355397..59ead8111f6dc86085940cf65f087625f2f7209e 100644 --- a/api/graphics3d/SceneTypes.d.ts +++ b/api/graphics3d/SceneTypes.d.ts @@ -16,7 +16,6 @@ /** * @file Defines 3D basic types * @kit ArkGraphics3D - * @arkts 1.1&1.2 */ /** @@ -24,7 +23,8 @@ * * @typedef Vec2 * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts { '1.1':'12', '1.2':'20' } + * @arkts 1.1&1.2 */ export interface Vec2 { /** @@ -32,7 +32,8 @@ export interface Vec2 { * * @type { double } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts { '1.1':'12', '1.2':'20' } + * @arkts 1.1&1.2 */ x: double; @@ -41,7 +42,8 @@ export interface Vec2 { * * @type { double } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts { '1.1':'12', '1.2':'20' } + * @arkts 1.1&1.2 */ y: double; } @@ -51,7 +53,8 @@ export interface Vec2 { * * @typedef Vec3 * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts { '1.1':'12', '1.2':'20' } + * @arkts 1.1&1.2 */ export interface Vec3 { /** @@ -59,7 +62,8 @@ export interface Vec3 { * * @type { double } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts { '1.1':'12', '1.2':'20' } + * @arkts 1.1&1.2 */ x: double; @@ -68,7 +72,8 @@ export interface Vec3 { * * @type { double } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts { '1.1':'12', '1.2':'20' } + * @arkts 1.1&1.2 */ y: double; @@ -77,7 +82,8 @@ export interface Vec3 { * * @type { double } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts { '1.1':'12', '1.2':'20' } + * @arkts 1.1&1.2 */ z: double; } @@ -87,7 +93,8 @@ export interface Vec3 { * * @typedef Vec4 * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts { '1.1':'12', '1.2':'20' } + * @arkts 1.1&1.2 */ export interface Vec4 { /** @@ -95,7 +102,8 @@ export interface Vec4 { * * @type { double } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts { '1.1':'12', '1.2':'20' } + * @arkts 1.1&1.2 */ x: double; @@ -104,7 +112,8 @@ export interface Vec4 { * * @type { double } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts { '1.1':'12', '1.2':'20' } + * @arkts 1.1&1.2 */ y: double; @@ -113,7 +122,8 @@ export interface Vec4 { * * @type { double } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts { '1.1':'12', '1.2':'20' } + * @arkts 1.1&1.2 */ z: double; @@ -122,7 +132,8 @@ export interface Vec4 { * * @type { double } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts { '1.1':'12', '1.2':'20' } + * @arkts 1.1&1.2 */ w: double; } @@ -132,7 +143,8 @@ export interface Vec4 { * * @typedef Quaternion * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts { '1.1':'12', '1.2':'20' } + * @arkts 1.1&1.2 */ export interface Quaternion { /** @@ -140,7 +152,8 @@ export interface Quaternion { * * @type { double } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts { '1.1':'12', '1.2':'20' } + * @arkts 1.1&1.2 */ x: double; @@ -149,7 +162,8 @@ export interface Quaternion { * * @type { double } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts { '1.1':'12', '1.2':'20' } + * @arkts 1.1&1.2 */ y: double; @@ -158,7 +172,8 @@ export interface Quaternion { * * @type { double } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts { '1.1':'12', '1.2':'20' } + * @arkts 1.1&1.2 */ z: double; @@ -167,7 +182,8 @@ export interface Quaternion { * * @type { double } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts { '1.1':'12', '1.2':'20' } + * @arkts 1.1&1.2 */ w: double; } @@ -177,7 +193,8 @@ export interface Quaternion { * * @typedef Aabb * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts { '1.1':'12', '1.2':'20' } + * @arkts 1.1&1.2 */ export interface Aabb { /** @@ -185,7 +202,8 @@ export interface Aabb { * * @type { Vec3 } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts { '1.1':'12', '1.2':'20' } + * @arkts 1.1&1.2 */ aabbMin: Vec3; @@ -194,7 +212,8 @@ export interface Aabb { * * @type { Vec3 } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts { '1.1':'12', '1.2':'20' } + * @arkts 1.1&1.2 */ aabbMax: Vec3; } @@ -204,7 +223,8 @@ export interface Aabb { * * @typedef Color * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts { '1.1':'12', '1.2':'20' } + * @arkts 1.1&1.2 */ export interface Color { /** @@ -212,7 +232,8 @@ export interface Color { * * @type { double } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts { '1.1':'12', '1.2':'20' } + * @arkts 1.1&1.2 */ r: double; @@ -221,7 +242,8 @@ export interface Color { * * @type { double } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts { '1.1':'12', '1.2':'20' } + * @arkts 1.1&1.2 */ g: double; @@ -230,7 +252,8 @@ export interface Color { * * @type { double } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts { '1.1':'12', '1.2':'20' } + * @arkts 1.1&1.2 */ b: double; @@ -239,7 +262,8 @@ export interface Color { * * @type { double } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts { '1.1':'12', '1.2':'20' } + * @arkts 1.1&1.2 */ a: double; } @@ -249,7 +273,8 @@ export interface Color { * * @typedef Rect * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts { '1.1':'12', '1.2':'20' } + * @arkts 1.1&1.2 */ export interface Rect { /** @@ -257,7 +282,8 @@ export interface Rect { * * @type { double } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts { '1.1':'12', '1.2':'20' } + * @arkts 1.1&1.2 */ x: double; @@ -266,7 +292,8 @@ export interface Rect { * * @type { double } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts { '1.1':'12', '1.2':'20' } + * @arkts 1.1&1.2 */ y: double; @@ -275,7 +302,8 @@ export interface Rect { * * @type { double } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts { '1.1':'12', '1.2':'20' } + * @arkts 1.1&1.2 */ width: double; @@ -284,7 +312,8 @@ export interface Rect { * * @type { double } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts { '1.1':'12', '1.2':'20' } + * @arkts 1.1&1.2 */ height: double; } @@ -294,14 +323,16 @@ export interface Rect { * * @enum { int } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 18 + * @since arkts { '1.1':'18', '1.2':'20' } + * @arkts 1.1&1.2 */ export enum GeometryType { /** * A custom geometric shape. * * @syscap SystemCapability.ArkUi.Graphics3D - * @since 18 + * @since arkts { '1.1':'18', '1.2':'20' } + * @arkts 1.1&1.2 */ CUSTOM = 0, @@ -309,7 +340,8 @@ export enum GeometryType { * A cube. * * @syscap SystemCapability.ArkUi.Graphics3D - * @since 18 + * @since arkts { '1.1':'18', '1.2':'20' } + * @arkts 1.1&1.2 */ CUBE = 1, @@ -317,7 +349,8 @@ export enum GeometryType { * A plane. * * @syscap SystemCapability.ArkUi.Graphics3D - * @since 18 + * @since arkts { '1.1':'18', '1.2':'20' } + * @arkts 1.1&1.2 */ PLANE = 2, @@ -325,7 +358,8 @@ export enum GeometryType { * A sphere. * * @syscap SystemCapability.ArkUi.Graphics3D - * @since 18 + * @since arkts { '1.1':'18', '1.2':'20' } + * @arkts 1.1&1.2 */ SPHERE = 3 } @@ -334,7 +368,8 @@ export enum GeometryType { * Define a geometric shape for mesh creation. * * @syscap SystemCapability.ArkUi.Graphics3D - * @since 18 + * @since arkts { '1.1':'18', '1.2':'20' } + * @arkts 1.1&1.2 */ export declare abstract class GeometryDefinition { /** @@ -343,7 +378,8 @@ export declare abstract class GeometryDefinition { * @type { GeometryType } * @readonly * @syscap SystemCapability.ArkUi.Graphics3D - * @since 18 + * @since arkts { '1.1':'18', '1.2':'20' } + * @arkts 1.1&1.2 */ readonly geometryType: GeometryType; } @@ -353,14 +389,16 @@ export declare abstract class GeometryDefinition { * * @enum { int } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 18 + * @since arkts { '1.1':'18', '1.2':'20' } + * @arkts 1.1&1.2 */ export enum PrimitiveTopology { /** * The vertices form a set of independent triangle. Vertices (0, 1, 2), (3, 4, 5), ... define separate triangles. * * @syscap SystemCapability.ArkUi.Graphics3D - * @since 18 + * @since arkts { '1.1':'18', '1.2':'20' } + * @arkts 1.1&1.2 */ TRIANGLE_LIST = 0, @@ -368,7 +406,8 @@ export enum PrimitiveTopology { * The vertices form a triangle strip. Starting from the 3rd, each vertex defines a triangle with the previous two. * * @syscap SystemCapability.ArkUi.Graphics3D - * @since 18 + * @since arkts { '1.1':'18', '1.2':'20' } + * @arkts 1.1&1.2 */ TRIANGLE_STRIP = 1 } @@ -378,7 +417,8 @@ export enum PrimitiveTopology { * * @extends GeometryDefinition * @syscap SystemCapability.ArkUi.Graphics3D - * @since 18 + * @since arkts { '1.1':'18', '1.2':'20' } + * @arkts 1.1&1.2 */ export declare class CustomGeometry extends GeometryDefinition { /** @@ -391,14 +431,47 @@ export declare class CustomGeometry extends GeometryDefinition { */ topology?: PrimitiveTopology; + /** + * How to form mesh triangles from the indexed vertices. + * + * @return { PrimitiveTopology | undefined } + * @default PrimitiveTopology.TRIANGLE_LIST + * @syscap SystemCapability.ArkUi.Graphics3D + * @since 20 + * @arkts 1.2 + */ + get topology(): PrimitiveTopology | undefined; + + /** + * How to form mesh triangles from the indexed vertices. + * + * @param { PrimitiveTopology | undefined } value + * @default PrimitiveTopology.TRIANGLE_LIST + * @syscap SystemCapability.ArkUi.Graphics3D + * @since 20 + * @arkts 1.2 + */ + set topology(value: PrimitiveTopology | undefined); + /** * An array of vertices. * - * @type { Vec3[] } + * @return { Vec3[] } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 + */ + get vertices(): Vec3[]; + + /** + * An array of vertices. + * + * @param { Vec3[] } value + * @syscap SystemCapability.ArkUi.Graphics3D + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ - vertices: Vec3[]; + set vertices(value: Vec3[]); /** * Indices of those vertices that form triangles. PrimitiveTopology is applied to the sequence defined by indices. @@ -419,6 +492,46 @@ export declare class CustomGeometry extends GeometryDefinition { */ indices?: int[]; + /** + * Indices of those vertices that form triangles. PrimitiveTopology is applied to the sequence defined by indices. + * + * An example of creating an identical pair of triangles, given vertices = [a, b, c, d]: + * topology = PrimitiveTopology.TRIANGLE_LIST + * indices = [0, 1, 2, 2, 1, 3] + * resulting triangles: abc, cbd + * + * topology = PrimitiveTopology.TRIANGLE_STRIP + * indices = [0, 1, 2, 3] + * resulting triangles: abc, cbd (b and c are reversed in cbd, to match the face direction of the first triangle) + * + * @return { int[] | undefined } + * @default indices: [0, 1 ,2,..., vertices.size() - 1] + * @syscap SystemCapability.ArkUi.Graphics3D + * @since 20 + * @arkts 1.2 + */ + get indices(): int[] | undefined; + + /** + * Indices of those vertices that form triangles. PrimitiveTopology is applied to the sequence defined by indices. + * + * An example of creating an identical pair of triangles, given vertices = [a, b, c, d]: + * topology = PrimitiveTopology.TRIANGLE_LIST + * indices = [0, 1, 2, 2, 1, 3] + * resulting triangles: abc, cbd + * + * topology = PrimitiveTopology.TRIANGLE_STRIP + * indices = [0, 1, 2, 3] + * resulting triangles: abc, cbd (b and c are reversed in cbd, to match the face direction of the first triangle) + * + * @param { int[] | undefined } value + * @default indices: [0, 1 ,2,..., vertices.size() - 1] + * @syscap SystemCapability.ArkUi.Graphics3D + * @since 20 + * @arkts 1.2 + */ + set indices(value: int[] | undefined); + /** * Vertex normal. If normals is not null. normals[N] is for vertices[N] and generateNormals is ignored. * @@ -428,6 +541,26 @@ export declare class CustomGeometry extends GeometryDefinition { */ normals?: Vec3[]; + /** + * Vertex normal. If normals is not null. normals[N] is for vertices[N] and generateNormals is ignored. + * + * @return { Vec3[] | undefined } + * @syscap SystemCapability.ArkUi.Graphics3D + * @since 20 + * @arkts 1.2 + */ + get normals(): Vec3[] | undefined; + + /** + * Vertex normal. If normals is not null. normals[N] is for vertices[N] and generateNormals is ignored. + * + * @param { Vec3[] | undefined } value + * @syscap SystemCapability.ArkUi.Graphics3D + * @since 20 + * @arkts 1.2 + */ + set normals(value: Vec3[] | undefined); + /** * Vertex texture mapping UV coordinate. If uvs is not null, uvs[N] is for vertices[N] * @@ -437,6 +570,26 @@ export declare class CustomGeometry extends GeometryDefinition { */ uvs?: Vec2[]; + /** + * Vertex texture mapping UV coordinate. If uvs is not null, uvs[N] is for vertices[N] + * + * @return { Vec2[] | undefined } + * @syscap SystemCapability.ArkUi.Graphics3D + * @since 20 + * @arkts 1.2 + */ + get uvs(): Vec2[] | undefined; + + /** + * Vertex texture mapping UV coordinate. If uvs is not null, uvs[N] is for vertices[N] + * + * @param { Vec2[] | undefined } value + * @syscap SystemCapability.ArkUi.Graphics3D + * @since 20 + * @arkts 1.2 + */ + set uvs(value: Vec2[] | undefined); + /** * Vertex color. If colors is not null, colors[N] is for vertices[N]. * @@ -445,6 +598,26 @@ export declare class CustomGeometry extends GeometryDefinition { * @since 18 */ colors?: Color[]; + + /** + * Vertex color. If colors is not null, colors[N] is for vertices[N]. + * + * @return { Color[] | undefined } + * @syscap SystemCapability.ArkUi.Graphics3D + * @since 20 + * @arkts 1.2 + */ + get colors(): Color[] | undefined; + + /** + * Vertex color. If colors is not null, colors[N] is for vertices[N]. + * + * @param { Color[] | undefined } value + * @syscap SystemCapability.ArkUi.Graphics3D + * @since 20 + * @arkts 1.2 + */ + set colors(value: Color[] | undefined); } /** @@ -452,17 +625,29 @@ export declare class CustomGeometry extends GeometryDefinition { * * @extends GeometryDefinition * @syscap SystemCapability.ArkUi.Graphics3D - * @since 18 + * @since arkts { '1.1':'18', '1.2':'20' } + * @arkts 1.1&1.2 */ export declare class CubeGeometry extends GeometryDefinition { /** * The width, height and depth of the cube. * - * @type { Vec3 } + * @return { Vec3 } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ - size: Vec3; + get size(): Vec3; + + /** + * The width, height and depth of the cube. + * + * @param { Vec3 } value + * @syscap SystemCapability.ArkUi.Graphics3D + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 + */ + set size(value: Vec3); } /** @@ -470,17 +655,29 @@ export declare class CubeGeometry extends GeometryDefinition { * * @extends GeometryDefinition * @syscap SystemCapability.ArkUi.Graphics3D - * @since 18 + * @since arkts { '1.1':'18', '1.2':'20' } + * @arkts 1.1&1.2 */ export declare class PlaneGeometry extends GeometryDefinition { /** * The width and length of the plane. * - * @type { Vec2 } + * @return { Vec2 } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ - size: Vec2; + get size(): Vec2; + + /** + * The width and length of the plane. + * + * @param { Vec2 } value + * @syscap SystemCapability.ArkUi.Graphics3D + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 + */ + set size(value: Vec2); } /** @@ -488,33 +685,57 @@ export declare class PlaneGeometry extends GeometryDefinition { * * @extends GeometryDefinition * @syscap SystemCapability.ArkUi.Graphics3D - * @since 18 + * @since arkts { '1.1':'18', '1.2':'20' } + * @arkts 1.1&1.2 */ export declare class SphereGeometry extends GeometryDefinition { /** * The raduis of the sphere. * - * @type { double } + * @return { double } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ - radius: double; + get radius(): double; + + /** + * The raduis of the sphere. + * + * @param { double } value + * @syscap SystemCapability.ArkUi.Graphics3D + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 + */ + set radius(value: double); /** * Divide the sphere latitudinally into this many circles and each circle longitudinally into this mant segments. * - * @type { int } + * @return { int } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ - segmentCount: int; + get segmentCount(): int; + + /** + * Divide the sphere latitudinally into this many circles and each circle longitudinally into this mant segments. + * + * @param { int } value + * @syscap SystemCapability.ArkUi.Graphics3D + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 + */ + set segmentCount(value: int); } /** * 3D position information. * * @typedef { Vec3 } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts { '1.1':'12', '1.2':'20' } + * @arkts 1.1&1.2 */ export type Position3 = Vec3; @@ -523,7 +744,8 @@ export type Position3 = Vec3; * * @typedef { Vec3 } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts { '1.1':'12', '1.2':'20' } + * @arkts 1.1&1.2 */ export type Rotation3 = Vec3; @@ -532,6 +754,7 @@ export type Rotation3 = Vec3; * * @typedef { Vec3 } * @syscap SystemCapability.ArkUi.Graphics3D - * @since 12 + * @since arkts { '1.1':'12', '1.2':'20' } + * @arkts 1.1&1.2 */ export type Scale3 = Vec3;