18bf80f4bSopenharmony_ci/* 28bf80f4bSopenharmony_ci * Copyright (C) 2024 Huawei Device Co., Ltd. 38bf80f4bSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 48bf80f4bSopenharmony_ci * you may not use this file except in compliance with the License. 58bf80f4bSopenharmony_ci * You may obtain a copy of the License at 68bf80f4bSopenharmony_ci * 78bf80f4bSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 88bf80f4bSopenharmony_ci * 98bf80f4bSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 108bf80f4bSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 118bf80f4bSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 128bf80f4bSopenharmony_ci * See the License for the specific language governing permissions and 138bf80f4bSopenharmony_ci * limitations under the License. 148bf80f4bSopenharmony_ci */ 158bf80f4bSopenharmony_ci 168bf80f4bSopenharmony_ci#ifndef OHOS_RENDER_3D_NAMED_IMPL_H 178bf80f4bSopenharmony_ci#define OHOS_RENDER_3D_NAMED_IMPL_H 188bf80f4bSopenharmony_ci#include <napi_api.h> 198bf80f4bSopenharmony_ciclass SceneResourceImpl { 208bf80f4bSopenharmony_cipublic: 218bf80f4bSopenharmony_ci static constexpr uint32_t ID = 1; 228bf80f4bSopenharmony_ci enum SceneResourceType { 238bf80f4bSopenharmony_ci /** 248bf80f4bSopenharmony_ci * The resource is an Unknow. 258bf80f4bSopenharmony_ci */ 268bf80f4bSopenharmony_ci UNKNOWN = 0, 278bf80f4bSopenharmony_ci /** 288bf80f4bSopenharmony_ci * The resource is an Node. 298bf80f4bSopenharmony_ci */ 308bf80f4bSopenharmony_ci NODE = 1, 318bf80f4bSopenharmony_ci /** 328bf80f4bSopenharmony_ci * The resource is an Environment. 338bf80f4bSopenharmony_ci */ 348bf80f4bSopenharmony_ci ENVIRONMENT = 2, 358bf80f4bSopenharmony_ci /** 368bf80f4bSopenharmony_ci * The resource is a Material. 378bf80f4bSopenharmony_ci */ 388bf80f4bSopenharmony_ci MATERIAL = 3, 398bf80f4bSopenharmony_ci /** 408bf80f4bSopenharmony_ci * The resource is a Mesh. 418bf80f4bSopenharmony_ci */ 428bf80f4bSopenharmony_ci MESH = 4, 438bf80f4bSopenharmony_ci /** 448bf80f4bSopenharmony_ci * The resource is an Animation. 458bf80f4bSopenharmony_ci */ 468bf80f4bSopenharmony_ci ANIMATION = 5, 478bf80f4bSopenharmony_ci /** 488bf80f4bSopenharmony_ci * The resource is a Shader. 498bf80f4bSopenharmony_ci */ 508bf80f4bSopenharmony_ci SHADER = 6, 518bf80f4bSopenharmony_ci 528bf80f4bSopenharmony_ci /** 538bf80f4bSopenharmony_ci * The resource is a Image. 548bf80f4bSopenharmony_ci */ 558bf80f4bSopenharmony_ci IMAGE = 7, 568bf80f4bSopenharmony_ci }; 578bf80f4bSopenharmony_ci SceneResourceImpl(SceneResourceType type); 588bf80f4bSopenharmony_ci virtual ~SceneResourceImpl(); 598bf80f4bSopenharmony_ci static void RegisterEnums(NapiApi::Object exports); 608bf80f4bSopenharmony_ci 618bf80f4bSopenharmony_ci void* GetInstanceImpl(uint32_t id); 628bf80f4bSopenharmony_ci 638bf80f4bSopenharmony_ciprotected: 648bf80f4bSopenharmony_ci static void GetPropertyDescs(BASE_NS::vector<napi_property_descriptor>& props); 658bf80f4bSopenharmony_ci 668bf80f4bSopenharmony_ci void SetUri(const NapiApi::StrongRef& uri); 678bf80f4bSopenharmony_ci napi_value GetObjectType(NapiApi::FunctionContext<>& ctx); 688bf80f4bSopenharmony_ci napi_value GetName(NapiApi::FunctionContext<>& ctx); 698bf80f4bSopenharmony_ci void SetName(NapiApi::FunctionContext<BASE_NS::string>& ctx); 708bf80f4bSopenharmony_ci napi_value GetUri(NapiApi::FunctionContext<>& ctx); 718bf80f4bSopenharmony_ci napi_value Dispose(NapiApi::FunctionContext<>& ctx); 728bf80f4bSopenharmony_ci 738bf80f4bSopenharmony_ci NapiApi::StrongRef scene_; 748bf80f4bSopenharmony_ciprivate: 758bf80f4bSopenharmony_ci SceneResourceType type_; 768bf80f4bSopenharmony_ci NapiApi::StrongRef uri_; 778bf80f4bSopenharmony_ci}; 788bf80f4bSopenharmony_ci#endif // OHOS_RENDER_3D_NAMED_IMPL_H