AppView  0.8.1
C++ AppView API
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 
10 namespace kanzi
11 {
12 
13 namespace plugin
14 {
15 
16 namespace appview
17 {
18 
19 class AppView3D;
20 using AppView3DSharedPtr = shared_ptr<AppView3D>;
21 
23 class APP_VIEW_PLUGIN_API AppView3D : public AppViewConceptImpl<Model3D, AppView3D>
24 {
25 public:
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 
74 protected:
75  explicit AppView3D(Domain* domain, string_view name);
76 
77  void setupMaterialOverride() override;
78 
79  bool calculateHitUV(
80  const TouchPoint& touchPoint,
81  Vector2& outHitUV) override;
82 
84  void onAppViewTextureChanged() override;
85  void updateMaterial();
86  void updateMesh();
87 
89  void onNodePropertyChanged(AbstractPropertyType propertyType, PropertyNotificationReason reason) override;
90 
92  static PropertyTypeEditorInfoSharedPtr makeEditorInfo();
93 
94 private:
97  MeshSharedPtr createDefaultMesh();
98 };
99 
100 }
101 
102 }
103 
104 }
105 
106 #endif
void setOverrideMesh(ResourceSharedPtr value)
Sets the value of OverrideMeshProperty.
Definition: app_view_3d.hpp:49
void onFinishApp(FinishAppMessageArguments &messageArguments)
Definition: app_view_3d.hpp:59
Definition: app_view.hpp:11
void onUpdateVirtualDisplay(const UpdateVirtualDisplayMessageArguments &messageArguments)
Definition: app_view_3d.hpp:69
shared_ptr< AppView3D > AppView3DSharedPtr
Definition: app_view_3d.hpp:20
void onStartApp(const StartAppMessageArguments &messageArguments)
Definition: app_view_3d.hpp:54
Definition: app_view.hpp:141
App View 3D. Starts and renders a 3rd party application.
Definition: app_view_3d.hpp:23
void onNavigateBack(const NavigateBackMessageArguments &messageArguments)
Definition: app_view_3d.hpp:64