DART 6.12.2
Loading...
Searching...
No Matches
ShapeNode.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_GUI_OSG_RENDER_SHAPEGEODE_HPP_
34#define DART_GUI_OSG_RENDER_SHAPEGEODE_HPP_
35
36#include <memory>
37
38#include <osg/Node>
39
40namespace dart {
41
42namespace dynamics {
43class Shape;
44class ShapeFrame;
45class SimpleFrame;
46class VisualAspect;
47} // namespace dynamics
48
49namespace gui {
50namespace osg {
51
52class Node;
53class Group;
54class EntityNode;
55class ShapeFrameNode;
56
57namespace render {
58
60{
61public:
63 std::shared_ptr<dart::dynamics::Shape> shape,
64 ShapeFrameNode* parentNode,
65 ::osg::Node* node);
66
67 virtual ~ShapeNode();
68
70 const std::shared_ptr<dart::dynamics::Shape>& getShape() const;
71
73
75
77
79 ::osg::Node* getNode();
80
82 const ::osg::Node* getNode() const;
83
86
89
91 virtual void refresh() = 0;
92
94 bool wasUtilized() const;
95
97 void clearUtilization();
98
99protected:
101 const std::shared_ptr<dart::dynamics::Shape> mShape;
102
105
108
111
113 ::osg::Node* mNode;
114
119};
120
121} // namespace render
122} // namespace osg
123} // namespace gui
124} // namespace dart
125
126#endif // DART_GUI_OSG_RENDER_SHAPEGEODE_HPP_
Definition ShapeFrame.hpp:192
Definition ShapeFrame.hpp:54
Definition ShapeFrameNode.hpp:61
Definition ShapeNode.hpp:60
virtual ~ShapeNode()
Definition ShapeNode.cpp:58
dart::dynamics::VisualAspect * getVisualAspect()
Definition ShapeNode.cpp:76
ShapeFrameNode * getParentShapeFrameNode()
Pointer to the parent EntityNode of this ShapeNode.
Definition ShapeNode.cpp:100
const dart::dynamics::ShapeFrame * getShapeFrame() const
Definition ShapeNode.cpp:70
const std::shared_ptr< dart::dynamics::Shape > mShape
Pointer to the Shape associated with this ShapeNode.
Definition ShapeNode.hpp:101
ShapeFrameNode * mParentShapeFrameNode
Pointer to the parent ShapeFrameNode of this ShapeNode.
Definition ShapeNode.hpp:110
dart::dynamics::VisualAspect * mVisualAspect
Pointer to the VisualAspect associated with this ShapeNode.
Definition ShapeNode.hpp:107
bool wasUtilized() const
True iff this ShapeNode has been utilized on the latest update.
Definition ShapeNode.cpp:112
const std::shared_ptr< dart::dynamics::Shape > & getShape() const
Pointer to the Shape associated with this ShapeNode.
Definition ShapeNode.cpp:64
::osg::Node * mNode
Should generally be equal to 'this'.
Definition ShapeNode.hpp:113
virtual void refresh()=0
Update all rendering data for this ShapeNode.
::osg::Node * getNode()
Cast this ShapeNode into an osg::Node.
Definition ShapeNode.cpp:88
void clearUtilization()
Set mUtilized to false.
Definition ShapeNode.cpp:118
bool mUtilized
True iff this ShapeNode has been utilized on the latest update.
Definition ShapeNode.hpp:118
dart::dynamics::ShapeFrame * mShapeFrame
Pointer to the SimpleFrame associated with this ShapeNode.
Definition ShapeNode.hpp:104
Definition BulletCollisionDetector.cpp:60