dart
ShapeNode.hpp
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 #include <osg/Node>
38 
39 namespace dart {
40 
41 namespace dynamics {
42 class Shape;
43 class ShapeFrame;
44 class SimpleFrame;
45 class VisualAspect;
46 } // namespace dynamics
47 
48 namespace gui {
49 namespace osg {
50 
51 class Node;
52 class Group;
53 class EntityNode;
54 class ShapeFrameNode;
55 
56 namespace render {
57 
58 class ShapeNode
59 {
60 public:
61  ShapeNode(
62  std::shared_ptr<dart::dynamics::Shape> shape,
63  ShapeFrameNode* parentNode,
64  ::osg::Node* node);
65 
66  virtual ~ShapeNode();
67 
69  const std::shared_ptr<dart::dynamics::Shape>& getShape() const;
70 
71  const dart::dynamics::ShapeFrame* getShapeFrame() const;
72 
73  dart::dynamics::VisualAspect* getVisualAspect();
74 
75  const dart::dynamics::VisualAspect* getVisualAspect() const;
76 
78  ::osg::Node* getNode();
79 
81  const ::osg::Node* getNode() const;
82 
84  ShapeFrameNode* getParentShapeFrameNode();
85 
87  const ShapeFrameNode* getParentShapeFrameNode() const;
88 
90  virtual void refresh() = 0;
91 
93  bool wasUtilized() const;
94 
96  void clearUtilization();
97 
98 protected:
100  const std::shared_ptr<dart::dynamics::Shape> mShape;
101 
104 
107 
110 
112  ::osg::Node* mNode;
113 
117  bool mUtilized;
118 };
119 
120 } // namespace render
121 } // namespace osg
122 } // namespace gui
123 } // namespace dart
124 
125 #endif // DART_GUI_OSG_RENDER_SHAPEGEODE_HPP_
bool mUtilized
True iff this ShapeNode has been utilized on the latest update.
Definition: ShapeNode.hpp:117
ShapeFrameNode * mParentShapeFrameNode
Pointer to the parent ShapeFrameNode of this ShapeNode.
Definition: ShapeNode.hpp:109
Definition: Aspect.cpp:40
Definition: ShapeNode.hpp:58
const std::shared_ptr< dart::dynamics::Shape > mShape
Pointer to the Shape associated with this ShapeNode.
Definition: ShapeNode.hpp:100
::osg::Node * mNode
Should generally be equal to &#39;this&#39;.
Definition: ShapeNode.hpp:112
Definition: ShapeFrame.hpp:189
Definition: ShapeFrameNode.hpp:60
dart::dynamics::VisualAspect * mVisualAspect
Pointer to the VisualAspect associated with this ShapeNode.
Definition: ShapeNode.hpp:106
Definition: ShapeFrame.hpp:50
dart::dynamics::ShapeFrame * mShapeFrame
Pointer to the SimpleFrame associated with this ShapeNode.
Definition: ShapeNode.hpp:103