[dali_2.3.21] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-scene3d / public-api / model-components / model-primitive.cpp
1 /*
2  * Copyright (c) 2023 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali-scene3d/public-api/model-components/model-primitive.h>
20
21 // INTERNAL INCLUDES
22 #include <dali-scene3d/internal/model-components/model-primitive-impl.h>
23
24 namespace Dali
25 {
26 namespace Scene3D
27 {
28 ModelPrimitive ModelPrimitive::New()
29 {
30   Internal::ModelPrimitivePtr internal = Internal::ModelPrimitive::New();
31
32   return ModelPrimitive(internal.Get());
33 }
34
35 ModelPrimitive::ModelPrimitive()
36 {
37 }
38
39 ModelPrimitive::ModelPrimitive(const ModelPrimitive& modelPrimitive) = default;
40
41 ModelPrimitive::ModelPrimitive(ModelPrimitive&& rhs) noexcept = default;
42
43 ModelPrimitive::~ModelPrimitive()
44 {
45 }
46
47 ModelPrimitive& ModelPrimitive::operator=(const ModelPrimitive& handle) = default;
48
49 ModelPrimitive& ModelPrimitive::operator=(ModelPrimitive&& rhs) noexcept = default;
50
51 ModelPrimitive ModelPrimitive::DownCast(BaseHandle handle)
52 {
53   return ModelPrimitive(dynamic_cast<Dali::Scene3D::Internal::ModelPrimitive*>(handle.GetObjectPtr()));
54 }
55
56 ModelPrimitive::ModelPrimitive(Dali::Scene3D::Internal::ModelPrimitive* internal)
57 : BaseHandle(internal)
58 {
59 }
60
61 // Public Method
62 void ModelPrimitive::SetGeometry(Dali::Geometry geometry)
63 {
64   GetImplementation(*this).SetGeometry(geometry);
65 }
66
67 Dali::Geometry ModelPrimitive::GetGeometry() const
68 {
69   return GetImplementation(*this).GetGeometry();
70 }
71
72 void ModelPrimitive::SetMaterial(Dali::Scene3D::Material material)
73 {
74   GetImplementation(*this).SetMaterial(material);
75 }
76
77 Dali::Scene3D::Material ModelPrimitive::GetMaterial() const
78 {
79   return GetImplementation(*this).GetMaterial();
80 }
81
82 } // namespace Scene3D
83
84 } // namespace Dali