gepetto-viewer 6.0.0
An user-friendly Graphical Interface
Loading...
Searching...
No Matches
blender-geom-writer.h
Go to the documentation of this file.
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
14
15#include <fstream>
16#include <iostream>
17#include <stack>
18
19namespace gepetto {
20namespace viewer {
21
23
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);
36 void apply(LeafNodeCone& 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);
44
45 protected:
46 std::ofstream& out() { return file_; }
47
48 // The scale multiplier is requited for LeafNodeBox
49 void standardApply(Node& node,
50 osgVector3 scaleMultiplier = osgVector3(1, 1, 1));
51
52 bool openFile();
53 void closeFile() { file_.close(); }
54 void unimplemented(const char* type, Node& n);
55
56 std::ofstream file_;
57 std::string filename_;
58 unsigned int nodeCount_;
59 std::size_t groupDepth_;
60};
61} /* namespace viewer */
62} /* namespace gepetto */
63
64#endif /* GEPETTO_VIEWER_BLENDER_GEOM_WRITER_VISITOR_HH */
Definition blender-geom-writer.h:24
unsigned int nodeCount_
Definition blender-geom-writer.h:58
std::string filename_
Definition blender-geom-writer.h:57
BlenderGeomWriterVisitor(const std::string &filename)
void apply(LeafNodeCylinder &node)
void apply(LeafNodeXYZAxis &node)
void apply(LeafNodeCapsule &node)
void closeFile()
Definition blender-geom-writer.h:53
std::ofstream & out()
Definition blender-geom-writer.h:46
void apply(LeafNodeCollada &node)
std::size_t groupDepth_
Definition blender-geom-writer.h:59
std::ofstream file_
Definition blender-geom-writer.h:56
void apply(LeafNodeSphere &node)
void standardApply(Node &node, osgVector3 scaleMultiplier=osgVector3(1, 1, 1))
void unimplemented(const char *type, Node &n)
void apply(LeafNodeGround &node)
Definition group-node.h:19
Definition leaf-node-arrow.h:20
Definition leaf-node-box.h:19
Definition leaf-node-capsule.h:21
Definition leaf-node-collada.h:22
Definition leaf-node-cone.h:19
Definition leaf-node-cylinder.h:19
Definition leaf-node-face.h:20
Definition leaf-node-ground.h:18
Definition leaf-node-light.h:20
Definition leaf-node-line.h:19
Definition leaf-node-sphere.h:19
Definition leaf-node-xyzaxis.h:22
Definition node-visitor.h:35
Abstract base class of 3D objects in a scene.
Definition node.h:25
::osg::Vec3f osgVector3
Definition config-osg.h:99
#define DEF_CLASS_SMART_PTR(className)
Definition macros.h:51
Definition action-search-bar.hh:27