GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: include/gepetto/viewer/blender-geom-writer.h Lines: 0 2 0.0 %
Date: 2020-05-14 11:23:33 Branches: 0 0 - %

Line Branch Exec Source
1
//
2
//  transform-writer.h
3
//  gepetto-viewer
4
//
5
//  Created by Joseph Mirabel in November 2015.
6
//  Copyright (c) 2015 LAAS-CNRS. All rights reserved.
7
//
8
9
#ifndef GEPETTO_VIEWER_BLENDER_GEOM_WRITER_VISITOR_HH
10
#define GEPETTO_VIEWER_BLENDER_GEOM_WRITER_VISITOR_HH
11
12
#include <iostream>
13
#include <fstream>
14
#include <stack>
15
#include <gepetto/viewer/config-osg.h>
16
#include <gepetto/viewer/node-visitor.h>
17
18
namespace gepetto {
19
namespace viewer {
20
21
    DEF_CLASS_SMART_PTR(BlenderGeomWriterVisitor)
22
23
    class BlenderGeomWriterVisitor : public NodeVisitor
24
    {
25
      public:
26
        BlenderGeomWriterVisitor (const std::string& filename);
27
28
        // virtual ~BlenderGeomWriter () {}
29
30
        void apply (Node& node);
31
        void apply (GroupNode& node);
32
        void apply (LeafNodeArrow& node);
33
        void apply (LeafNodeBox& node);
34
        void apply (LeafNodeCapsule& node);
35
        void apply (LeafNodeCollada& node);
36
        void apply (LeafNodeCone& node);
37
        void apply (LeafNodeCylinder& node);
38
        void apply (LeafNodeFace& node);
39
        void apply (LeafNodeGround& node);
40
        void apply (LeafNodeLight& node);
41
        void apply (LeafNodeLine& node);
42
        void apply (LeafNodeSphere& node);
43
        void apply (LeafNodeXYZAxis& node);
44
45
      protected:
46
        std::ofstream& out () { return file_; }
47
48
        // The scale multiplier is requited for LeafNodeBox
49
        void standardApply (Node& node, osgVector3 scaleMultiplier = osgVector3(1,1,1));
50
51
        bool openFile ();
52
        void closeFile () {
53
          file_.close ();
54
        }
55
        void unimplemented(const char* type, Node& n);
56
57
        std::ofstream file_;
58
        std::string filename_;
59
        unsigned int nodeCount_;
60
        std::size_t groupDepth_;
61
    };
62
} /* namespace viewer */
63
} /* namespace gepetto */
64
65
#endif /* GEPETTO_VIEWER_BLENDER_GEOM_WRITER_VISITOR_HH */