1 /* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #if !defined(API_3D_ECS_COMPONENTS_HIERARCHY_COMPONENT_H) || defined(IMPLEMENT_MANAGER) 17 #define API_3D_ECS_COMPONENTS_HIERARCHY_COMPONENT_H 18 19 #if !defined(IMPLEMENT_MANAGER) 20 #include <3d/namespace.h> 21 #include <core/ecs/component_struct_macros.h> 22 #include <core/ecs/entity.h> 23 #include <core/ecs/intf_component_manager.h> 24 #include <core/namespace.h> 25 26 CORE3D_BEGIN_NAMESPACE() 27 #endif 28 /** Node component can be used to create hierarchy for the objects in scene. 29 */ 30 BEGIN_COMPONENT(INodeComponentManager, NodeComponent) 31 32 /** Id of the parent entity in hierarchy. 33 */ 34 DEFINE_PROPERTY(CORE_NS::Entity, parent, "Parent", 0, VALUE(CORE_NS::Entity { CORE_NS::INVALID_ENTITY })) 35 36 /** Defines whether this entity is enabled or disabled. */ 37 DEFINE_PROPERTY(bool, enabled, "Enabled", 0, true) 38 39 /** Read-only property to check if this entity is enabled and belongs to enabled scene tree (all parents are also 40 * enabled). */ 41 DEFINE_PROPERTY(bool, effectivelyEnabled, "Effectively Enabled", CORE_NS::PropertyFlags::IS_READONLY, true) 42 43 /** Defines whether this entity is included in an exported scene. */ 44 DEFINE_PROPERTY(bool, exported, "Exported", 0, true) 45 46 END_COMPONENT(INodeComponentManager, NodeComponent, "d9d330b5-3900-4503-8c89-233c0c9184de") 47 #if !defined(IMPLEMENT_MANAGER) 48 CORE3D_END_NAMESPACE() 49 #endif 50 51 #endif 52