DART 6.10.1
Loading...
Searching...
No Matches
CompositeNode.hpp
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011-2021, The DART development contributors
3 * All rights reserved.
4 *
5 * The list of contributors can be found at:
6 * https://github.com/dartsim/dart/blob/master/LICENSE
7 *
8 * This file is provided under the following "BSD-style" License:
9 * Redistribution and use in source and binary forms, with or
10 * without modification, are permitted provided that the following
11 * conditions are met:
12 * * Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * * Redistributions in binary form must reproduce the above
15 * copyright notice, this list of conditions and the following
16 * disclaimer in the documentation and/or other materials provided
17 * with the distribution.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
19 * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
20 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
23 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
26 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#ifndef DART_DYNAMICS_COMPOSITENODE_HPP_
34#define DART_DYNAMICS_COMPOSITENODE_HPP_
35
38
39namespace dart {
40namespace dynamics {
41
42//==============================================================================
43template <class Base>
44class CompositeStateNode : public Base
45{
46public:
48
50 template <typename... Args>
51 CompositeStateNode(Args&&... args) : Base(std::forward<Args>(args)...)
52 {
53 // Do nothing
54 }
55
56 // Documentation inherited from Node
57 void setNodeState(const Node::State& otherState) override final;
58
59 // Documentation inherited from Node
60 std::unique_ptr<Node::State> getNodeState() const override final;
61
62 // Documentation inherited from Node
63 void copyNodeStateTo(
64 std::unique_ptr<Node::State>& outputState) const override final;
65};
66
67//==============================================================================
68template <class Base>
69class CompositePropertiesNode : public Base
70{
71public:
73
75 template <typename... Args>
76 CompositePropertiesNode(Args&&... args) : Base(std::forward<Args>(args)...)
77 {
78 // Do nothing
79 }
80
81 // Documentation inherited from Node
82 void setNodeProperties(
83 const Node::Properties& otherProperties) override final;
84
85 // Documentation inherited from Node
86 std::unique_ptr<Node::Properties> getNodeProperties() const override final;
87
88 // Documentation inherited from Node
89 void copyNodePropertiesTo(
90 std::unique_ptr<Node::Properties>& outputProperties) const override final;
91};
92
93//==============================================================================
94template <class Base>
96{
97public:
99 template <typename... Args>
100 CompositeNode(Args&&... args)
102 std::forward<Args>(args)...)
103 {
104 // Do nothing
105 }
106};
107
108} // namespace dynamics
109} // namespace dart
110
112
113#endif // DART_DYNAMICS_COMPOSITENODE_HPP_
The MakeCloneable class is used to easily create an Cloneable (such as Node::State) which simply take...
Definition Cloneable.hpp:84
Definition CompositeNode.hpp:96
CompositeNode(Args &&... args)
Forwarding constructor.
Definition CompositeNode.hpp:100
Definition CompositeNode.hpp:70
CompositePropertiesNode(Args &&... args)
Forwarding constructor.
Definition CompositeNode.hpp:76
Definition CompositeNode.hpp:45
Node::MakeState< common::Composite::State > State
Definition CompositeNode.hpp:47
void copyNodeStateTo(std::unique_ptr< Node::State > &outputState) const override final
Definition CompositeNode.hpp:57
void setNodeState(const Node::State &otherState) override final
Definition CompositeNode.hpp:43
CompositeStateNode(Args &&... args)
Forwarding constructor.
Definition CompositeNode.hpp:51
std::unique_ptr< Node::State > getNodeState() const override final
Definition CompositeNode.hpp:50
If your Node has a Properties class, then that Properties class should inherit this Node::Properties ...
Definition Node.hpp:126
If your Node has a State class, then that State class should inherit this Node::State class.
Definition Node.hpp:105
The Node class is a base class for BodyNode and any object that attaches to a BodyNode.
Definition Node.hpp:81
Definition BulletCollisionDetector.cpp:65
Definition SharedLibraryManager.hpp:46