GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: src/node-visitor.cc Lines: 1 35 2.9 %
Date: 2020-05-14 11:23:33 Branches: 2 10 20.0 %

Line Branch Exec Source
1
// Copyright (c) 2015, Joseph Mirabel
2
// Authors: Joseph Mirabel (joseph.mirabel@laas.fr)
3
//
4
// This file is part of gepetto-viewer.
5
// gepetto-viewer is free software: you can redistribute it
6
// and/or modify it under the terms of the GNU Lesser General Public
7
// License as published by the Free Software Foundation, either version
8
// 3 of the License, or (at your option) any later version.
9
//
10
// gepetto-viewer is distributed in the hope that it will be
11
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
12
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
// General Lesser Public License for more details.  You should have
14
// received a copy of the GNU Lesser General Public License along with
15
// gepetto-viewer. If not, see <http://www.gnu.org/licenses/>.
16
17
#include <gepetto/viewer/node-visitor.h>
18
19
#include <gepetto/viewer/node.h>
20
#include <gepetto/viewer/group-node.h>
21
#include <gepetto/viewer/leaf-node-arrow.h>
22
#include <gepetto/viewer/leaf-node-box.h>
23
#include <gepetto/viewer/leaf-node-capsule.h>
24
#include <gepetto/viewer/leaf-node-collada.h>
25
#include <gepetto/viewer/leaf-node-cone.h>
26
#include <gepetto/viewer/leaf-node-cylinder.h>
27
#include <gepetto/viewer/leaf-node-face.h>
28
#include <gepetto/viewer/leaf-node-ground.h>
29
#include <gepetto/viewer/leaf-node-light.h>
30
#include <gepetto/viewer/leaf-node-line.h>
31
#include <gepetto/viewer/leaf-node-sphere.h>
32
#include <gepetto/viewer/leaf-node-xyzaxis.h>
33
#include <gepetto/viewer/node-rod.h>
34
#include <gepetto/viewer/node-visitor.h>
35
#include <gepetto/viewer/roadmap-viewer.h>
36
37
namespace gepetto {
38
namespace viewer {
39
40
  void NodeVisitor::apply (Node& node){
41
    traverse (node);
42
  }
43
  void NodeVisitor::apply (GroupNode& node){
44
    apply(static_cast<Node&>(node));
45
  }
46
  void NodeVisitor::apply (LeafNodeArrow& node){
47
    apply(static_cast<Node&>(node));
48
  }
49
  void NodeVisitor::apply (LeafNodeBox& node){
50
    apply(static_cast<Node&>(node));
51
  }
52
  void NodeVisitor::apply (LeafNodeCapsule& node){
53
    apply(static_cast<Node&>(node));
54
  }
55
  void NodeVisitor::apply (LeafNodeCollada& node){
56
    apply(static_cast<Node&>(node));
57
  }
58
  void NodeVisitor::apply (LeafNodeCone& node){
59
    apply(static_cast<Node&>(node));
60
  }
61
  void NodeVisitor::apply (LeafNodeCylinder& node){
62
    apply(static_cast<Node&>(node));
63
  }
64
  void NodeVisitor::apply (LeafNodeFace& node){
65
    apply(static_cast<Node&>(node));
66
  }
67
  void NodeVisitor::apply (LeafNodeGround& node){
68
    apply(static_cast<Node&>(node));
69
  }
70
  void NodeVisitor::apply (LeafNodeLight& node){
71
    apply(static_cast<Node&>(node));
72
  }
73
  void NodeVisitor::apply (LeafNodeLine& node){
74
    apply(static_cast<Node&>(node));
75
  }
76
  void NodeVisitor::apply (LeafNodeSphere& node){
77
    apply(static_cast<Node&>(node));
78
  }
79
  void NodeVisitor::apply (LeafNodeXYZAxis& node){
80
    apply(static_cast<Node&>(node));
81
  }
82
  bool NodeVisitor::valid (Node& node){
83
    if (invisibleAreValid_ || node.getVisibilityMode() != VISIBILITY_OFF)
84
      return true;
85
    return false;
86
  }
87
  void NodeVisitor::traverse (Node& node) {
88
    node.traverse (*this);
89
  }
90
} // namespace viewer
91

3
} // namespace gepetto