GPU-Accelerated Coverage  0.1.0
Compute coverage tours for known environment with articulated objects on GPU
Bone.h
1 /*
2  * Copyright (c) 2018, Stefan Osswald
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * * Redistributions of source code must retain the above copyright notice, this
9  * list of conditions and the following disclaimer.
10  *
11  * * Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions and the following disclaimer in the documentation
13  * and/or other materials provided with the distribution.
14  *
15  * * Neither the name of the copyright holder nor the names of its
16  * contributors may be used to endorse or promote products derived from
17  * this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  */
30 
31 #ifndef INCLUDE_ARTICULATION_BONE_H_
32 #define INCLUDE_ARTICULATION_BONE_H_
33 
34 #include <assimp/scene.h>
35 #include <glm/detail/type_mat4x4.hpp>
36 
37 namespace gpu_coverage {
38 
39 // Forward declarations
40 class Node;
41 
47 class Bone {
48 public:
55  Bone(const aiBone * const bone, const size_t meshId, const size_t id);
56 
60  virtual ~Bone();
61 
66  void toDot(FILE *dot);
67 
72  inline const size_t& getId() const {
73  return id;
74  }
75 
80  inline const size_t& getMeshId() const {
81  return meshId;
82  }
83 
91  inline const std::string& getName() const {
92  return name;
93  }
94 
102  inline const glm::mat4& getOffsetMatrix() {
103  return offsetMatrix;
104  }
105 
110  inline void setNode(Node * node) {
111  this->node = node;
112  }
113 
120  inline Node * getNode() const {
121  return this->node;
122  }
123 
124 protected:
125  const size_t id;
126  const size_t meshId;
127  const std::string name;
128  const glm::mat4 offsetMatrix;
129  Node * node;
130 };
131 
132 } // namespace gpu_coverage
133 
134 #endif /* INCLUDE_ARTICULATION_BONE_H_ */
const size_t id
Unique ID of the bone, see getId().
Definition: Bone.h:125
const glm::mat4 offsetMatrix
Offset matrix, see getOffsetMatrix().
Definition: Bone.h:128
Node * node
Scene graph node assigned to this bone, see getNode() and setNode().
Definition: Bone.h:129
Bone(const aiBone *const bone, const size_t meshId, const size_t id)
Constructor.
Scene graph node, corresponding to Assimp&#39;s aiNode.
Definition: Node.h:52
virtual ~Bone()
Destructor.
const size_t & getId() const
Definition: Bone.h:72
const size_t & getMeshId() const
Definition: Bone.h:80
const std::string & getName() const
Definition: Bone.h:91
const size_t meshId
ID of the mesh that this bone is attached to, see getMeshId().
Definition: Bone.h:126
Definition: AbstractCamera.h:41
void toDot(FILE *dot)
Write Graphviz Dot node representing this bone to file for debugging.
void setNode(Node *node)
Definition: Bone.h:110
Node * getNode() const
Definition: Bone.h:120
Represents a bone of an animation skeleton.
Definition: Bone.h:47
const glm::mat4 & getOffsetMatrix()
Definition: Bone.h:102
const std::string name
Name of the bone for logging, see getName().
Definition: Bone.h:127