AppView 0.8.2
app_view_3d.hpp
Go to the documentation of this file.
1// Copyright 2008-2023 by Rightware. All rights reserved.
2
3#ifndef APP_VIEW_3D_HPP
4#define APP_VIEW_3D_HPP
5
6#include <kanzi/core.ui/node/model3d.hpp>
7
8#include "app_view.hpp"
9
10namespace kanzi
11{
12
13namespace plugin
14{
15
16namespace appview
17{
18
19class AppView3D;
20using AppView3DSharedPtr = shared_ptr<AppView3D>;
21
23class APP_VIEW_PLUGIN_API AppView3D : public AppViewConceptImpl<Model3D, AppView3D>
24{
25public:
26
28
29 static AppView3DSharedPtr create(Domain* domain, string_view name);
30
31 KZ_METACLASS_BEGIN(AppView3D, ConceptClass, "Kanzi.AppView3D")
32 KZ_METACLASS_PROPERTY_TYPE(OverrideMeshProperty)
33 KZ_METACLASS_END()
34
38 static PropertyType<ResourceSharedPtr> OverrideMeshProperty;
39
42 MeshSharedPtr getOverrideMesh() const
43 {
44 return dynamic_pointer_cast<Mesh>(getProperty(OverrideMeshProperty));
45 }
46
49 void setOverrideMesh(ResourceSharedPtr value)
50 {
51 setProperty(OverrideMeshProperty, value);
52 }
53
54 void onStartApp(const StartAppMessageArguments& messageArguments)
55 {
56 ConceptClass::handleStartAppMessage(messageArguments);
57 }
58
59 void onFinishApp(FinishAppMessageArguments& messageArguments)
60 {
61 ConceptClass::handleFinishAppMessage(messageArguments);
62 }
63
64 void onNavigateBack(const NavigateBackMessageArguments& messageArguments)
65 {
66 ConceptClass::handleNavigateBackMessage(messageArguments);
67 }
68
70 {
71 ConceptClass::handleUpdateVirtualDisplayMessage(messageArguments);
72 }
73
74protected:
75 explicit AppView3D(Domain* domain, string_view name);
76
77 void setupMaterialOverride() override;
78
80 const TouchPoint& touchPoint,
81 Vector2& outHitUV) override;
82
84 void onAppViewTextureChanged() override;
86 void updateMesh();
87
89 void onNodePropertyChanged(AbstractPropertyType propertyType, PropertyNotificationReason reason) override;
90
92 static PropertyTypeEditorInfoSharedPtr makeEditorInfo();
93
94private:
97 MeshSharedPtr createDefaultMesh();
98};
99
100}
101
102}
103
104}
105
106#endif
Definition app_view.hpp:12
shared_ptr< AppView3D > AppView3DSharedPtr
Definition app_view_3d.hpp:20
App View 3D. Starts and renders a 3rd party application.
Definition app_view_3d.hpp:24
void onAppViewTextureChanged() override
AppView::onAppViewTextureChanged() implementation.
bool calculateHitUV(const TouchPoint &touchPoint, Vector2 &outHitUV) override
void onNavigateBack(const NavigateBackMessageArguments &messageArguments)
Definition app_view_3d.hpp:64
void onNodePropertyChanged(AbstractPropertyType propertyType, PropertyNotificationReason reason) override
Node::onNodePropertyChanged() implementation.
static PropertyTypeEditorInfoSharedPtr makeEditorInfo()
Defines editor information for Kanzi Studio.
AppView3D(Domain *domain, string_view name)
static AppView3DSharedPtr create(Domain *domain, string_view name)
void onFinishApp(FinishAppMessageArguments &messageArguments)
Definition app_view_3d.hpp:59
void onUpdateVirtualDisplay(const UpdateVirtualDisplayMessageArguments &messageArguments)
Definition app_view_3d.hpp:69
void setOverrideMesh(ResourceSharedPtr value)
Sets the value of OverrideMeshProperty.
Definition app_view_3d.hpp:49
void onStartApp(const StartAppMessageArguments &messageArguments)
Definition app_view_3d.hpp:54