Rumba C++ SDK
NodeDelegateWrapper.h
Go to the documentation of this file.
1 /*
2 
3  *
4  ***
5  *****
6  ********************* Mercenaries Engineering SARL
7  ***************** Copyright (C) 2025
8  *************
9  ********* http://www.mercenaries-engineering.com
10  ***********
11  **** ****
12  ** **
13 
14 */
15 #pragma once
16 
17 #include "NodeDelegate.h"
18 
19 namespace maquina
20 {
21 
24 {
25 public:
26  using Wrapper = std::shared_ptr<NodeDelegate> (*)(const std::shared_ptr<NodeDelegate>& node, const std::shared_ptr<NodeDelegateWrapper>& parent_wrapper);
27  NodeDelegateWrapper(std::shared_ptr<NodeDelegate> node, std::shared_ptr<NodeDelegateWrapper> parent_wrapper, Wrapper wrapper);
28  StringView type_name() const override;
29  std::shared_ptr<NodeDelegate> parent() const override;
30  maquina::StringView name() const override;
31  std::string path() const override;
32  std::string document_path() const override;
33  Imath::Box3d bounding_box() const override;
34  bool is_node() const override;
35  std::shared_ptr<class AttributeDescriptor> description() const override;
36  Node node() const override;
37  bool operator==(const NodeDelegate& o) const override;
38  bool operator!=(const NodeDelegate& o) const override;
39  std::shared_ptr<NodeDelegate> find(const StringView& path) override;
40  int child_count() const override;
41  std::shared_ptr<NodeDelegate> child(const StringView& name) override;
42 protected:
43  std::shared_ptr<ChildIteratorDelegate> _children_begin() override;
44  std::shared_ptr<ChildIteratorDelegate> _children_end() override;
45 public:
46  int attribute_count() const override;
47  std::shared_ptr<AttributeDelegate> attribute(const StringView& name) override;
48  bool add_attribute(const StringView& name, const Value& value) override;
49  std::shared_ptr<Channel> channel(const ChannelType sc) override;
50  std::vector<Channel> channels() override;
51  void channel_plugs( std::unordered_set<Plug>& set ) const override;
52 protected:
53  std::shared_ptr<AttributeIteratorDelegate> _attributes_begin() override;
54  std::shared_ptr<AttributeIteratorDelegate> _attributes_end() override;
55 public:
56  bool has_transform() const override;
57  Imath::M44d matrix(const QueryContext& qc=QueryContext::at_current_frame) const override;
58  Imath::M44d world_matrix(const QueryContext& qc=QueryContext::at_current_frame) const override;
59  Imath::M44d parent_world_matrix(const QueryContext& qc=QueryContext::at_current_frame) const override;
60  Imath::V3d rotate_pivot(const QueryContext& qc=QueryContext::at_current_frame) const override;
61  Imath::V3d scale_pivot(const QueryContext& qc=QueryContext::at_current_frame) const override;
62  Imath::V3d joint_orient(const QueryContext& qc=QueryContext::at_current_frame) const override;
63  Imath::V3d rotate_axis(const QueryContext& qc=QueryContext::at_current_frame) const override;
64  int mutable_flags() const override;
65  std::unique_ptr<TransformUserData> start_transform(const QueryContext& qc=QueryContext::at_current_frame) override;
66  void end_transform(const ModificationContext& mc=ModificationContext::default_mc(), TransformUserData* user_data = nullptr) override;
67  void set_matrix(const Imath::M44d& matrix, const ModificationContext& mc = ModificationContext::default_mc(), TransformUserData* user_data = nullptr) override;
68  Imath::V3d scale(const QueryContext& qc=QueryContext::at_current_frame) const override;
69  void set_scale(const Imath::V3d& scale, const ModificationContext& mc=ModificationContext::default_mc(), TransformUserData* user_data = nullptr) override;
70  Imath::V3d rotation(const QueryContext& qc=QueryContext::at_current_frame) const override;
71  Imath::Eulerd::Order rotate_order(const QueryContext& qc=QueryContext::at_current_frame) const override;
72  void set_rotation(const Imath::V3d& rotation, const ModificationContext& mc=ModificationContext::default_mc(), TransformUserData* user_data = nullptr) override;
73  Imath::V3d translation(const QueryContext& qc=QueryContext::at_current_frame) const override;
74  void set_translation(const Imath::V3d& translation, const ModificationContext& mc=ModificationContext::default_mc(), TransformUserData* user_data = nullptr) override;
75  std::shared_ptr<Observer> create_transform_observer(const std::function<void()>& func, bool in_interactive=true) override;
76  bool is_camera() const override;
77  bool is_locked() const override;
78  void set_locked(bool locked, const ModificationContext& mc=ModificationContext::default_mc()) override;
79  bool is_orthographic(const QueryContext& qc=QueryContext::at_current_frame) const override;
80  float orthographic_width(const QueryContext& qc=QueryContext::at_current_frame) const override;
81  void set_orthographic_width(float width, const ModificationContext& mc=ModificationContext::default_mc()) override;
82  float center_of_interest(const QueryContext& qc=QueryContext::at_current_frame) const override;
83  void set_center_of_interest(float coi, const ModificationContext& mc=ModificationContext::default_mc()) override;
84  float near_clipping_plane(const QueryContext& qc=QueryContext::at_current_frame) const override;
85  void set_near_clipping_plane(float near_clipping_plane, const ModificationContext& mc=ModificationContext::default_mc()) override;
86  float far_clipping_plane(const QueryContext& qc=QueryContext::at_current_frame) const override;
87  void set_far_clipping_plane(float far_clipping_plane, const ModificationContext& mc=ModificationContext::default_mc()) override;
88  Imath::M44d projection_matrix(const QueryContext& qc=QueryContext::at_current_frame) const override;
89  float aspect_ratio() const override;
90  std::shared_ptr<NodeDelegate> aim() const override;
91  std::shared_ptr<NodeDelegate> up() const override;
92  std::shared_ptr<Observer> create_camera_observer(const std::function<void()>& func, bool in_interactive=true) override;
93  bool has_geometry() const override;
94  Shape geometry() const override;
95  bool is_sculpt() const override;
96  BufferConstV3f input_points(const StringView& path, const QueryContext& qc=QueryContext::at_current_frame) const override;
97  SparseBufferConstV3f delta_points(const StringView& path, const QueryContext& qc=QueryContext::at_current_frame) const override;
98  void set_delta_points(const SparseBufferConstV3f& delta_points, const StringView& path, const ModificationContext& mc=ModificationContext::default_mc()) const override;
99  std::shared_ptr<maquina::NodeDelegate::Observer> create_sculpt_observer(const std::function<void()>& func, bool in_interactive) override;
100 protected:
101  static const NodeDelegate& _unwrap(const NodeDelegate&);
102  std::shared_ptr<NodeDelegate> _node; // The wrapped node
103  std::shared_ptr<NodeDelegateWrapper> _parent_wrapper; // The parent wrapper
105 };
106 
107 }
Definition: ImathBox.h:71
std::shared_ptr< NodeDelegate >(*)(const std::shared_ptr< NodeDelegate > &node, const std::shared_ptr< NodeDelegateWrapper > &parent_wrapper) Wrapper
Definition: NodeDelegateWrapper.h:26
Order
Definition: ImathEuler.h:151
Definition: ImathFrame.h:42
Definition: ImathFrame.h:43
A blind data provided by the start_transform&#39;s implementation and passed to set_scale, set_rotation and set_translation.
Definition: NodeDelegate.h:440
ChannelType
Predefined channel types.
Definition: ChannelType.h:23
The channel can&#39;t be modified.
A value with geometrical attributes. Base of all shape values.
Definition: Shape.h:25
This version of the SDK is unstable, i-e, it may change with no warning.
Definition: AddCurveAction.h:20
Definition: ModificationContext.h:21
static const ModificationContext & default_mc()
Automatically choose between undoable and layer.
#define MAQUINA_EXPORT
Definition: Export.h:31
bool operator!=(const C *str, const StringViewBase< C, STDS > &sv) noexcept
Definition: StringView.h:306
std::shared_ptr< NodeDelegateWrapper > _parent_wrapper
Definition: NodeDelegateWrapper.h:103
bool operator==(const C *str, const StringViewBase< C, STDS > &sv) noexcept
Definition: StringView.h:274
This interface gives a high level access to the document structure.
Definition: NodeDelegate.h:72
static const QueryContext at_current_frame
Query at the current frame.
Definition: QueryContext.h:36
std::shared_ptr< NodeDelegate > _node
Definition: NodeDelegateWrapper.h:102
Definition: QueryContext.h:22
Wrapper _wrapper
Definition: NodeDelegateWrapper.h:104
That class wraps existing node delegate and their children to override some of their behaviors...
Definition: NodeDelegateWrapper.h:23
Base class of all Rumba nodes.
Definition: Node.h:37
Base class of all Rumba values.
Definition: Value.h:34