gepetto-viewer 6.0.0
An user-friendly Graphical Interface
Loading...
Searching...
No Matches
leaf-node-collada.h
Go to the documentation of this file.
1//
2// leaf-node-collada.h
3// gepetto-viewer
4//
5// Created by Justin Carpentier, Anthony Couret, Mathieu Geisert in November
6// 2014. Copyright (c) 2014 LAAS-CNRS. All rights reserved.
7//
8
9#ifndef GEPETTO_VIEWER_LEAFNODECOLLADA_HH
10#define GEPETTO_VIEWER_LEAFNODECOLLADA_HH
11
12#include <gepetto/viewer/node.h>
14
15#include <osgDB/ReadFile>
16
17namespace gepetto {
18namespace viewer {
19DEF_CLASS_SMART_PTR(LeafNodeCollada)
20
21
22class LeafNodeCollada : public Node {
23 private:
24 std::string collada_file_path_;
25 std::string texture_file_path_;
26
28 LeafNodeColladaWeakPtr weak_ptr_;
29
31 ::osg::GroupRefPtr group_ptr_;
32 ::osg::NodeRefPtr collada_ptr_;
33
34 BackfaceDrawingProperty backfaceDrawing_;
35
37 osg::ref_ptr<osgDB::Options> options_;
38
39 void init();
40
41 /* Default constructor */
42 LeafNodeCollada(const std::string& name,
43 const std::string& collada_file_path);
44 LeafNodeCollada(const std::string& name, const std::string& collada_file_path,
45 const osgVector4& color);
46 LeafNodeCollada(const std::string& name, const ::osg::NodeRefPtr& node,
47 const std::string& collada_file_path);
48 /* Copy constructor */
49 LeafNodeCollada(const LeafNodeCollada& other);
50
52 void initWeakPtr(LeafNodeColladaWeakPtr other_weak_ptr);
53
54 protected:
55 public:
58 static LeafNodeColladaPtr_t create(const std::string& name,
59 ::osg::NodeRefPtr mesh,
60 const std::string& collada_file_path);
61 static LeafNodeColladaPtr_t create(const std::string& name,
62 const std::string& collada_file_path);
63 static LeafNodeColladaPtr_t create(const std::string& name,
64 const std::string& collada_file_path,
65 const osgVector4& color);
66
69 static LeafNodeColladaPtr_t createCopy(LeafNodeColladaPtr_t other);
70
73 virtual LeafNodeColladaPtr_t clone(void) const;
74
76 ::osg::NodeRefPtr getColladaPtr(void);
77
81 virtual LeafNodeColladaPtr_t copy() const { return clone(); }
82
85 LeafNodeColladaPtr_t self(void) const;
86
87 void setColor(const osgVector4& color);
88
90
91 void setTexture(const std::string& image_path);
92
93 const std::string& meshFilePath() const;
94
95 const std::string& textureFilePath() const;
96
97 virtual void setAlpha(const float& alpha);
98 virtual osg::ref_ptr<osg::Node> getOsgNode() const;
99
102
105
107
110
113};
114} /* namespace viewer */
115} /* namespace gepetto */
116
117#endif /* GEPETTO_VIEWER_LEAFNODECOLLADA_HH */
Definition leaf-node-collada.h:22
virtual void setAlpha(const float &alpha)
virtual osg::ref_ptr< osg::Node > getOsgNode() const
::osg::NodeRefPtr getColladaPtr(void)
static LeafNodeColladaPtr_t create(const std::string &name, ::osg::NodeRefPtr mesh, const std::string &collada_file_path)
virtual LeafNodeColladaPtr_t copy() const
Proceed to a copy of the currend object as clone.
Definition leaf-node-collada.h:81
SCENE_VIEWER_ACCEPT_VISITOR
Definition leaf-node-collada.h:106
void applyScale()
Apply the current scale permanently to the node.
void removeLightSources()
Remove any osg::LightSource of this mesh.
static LeafNodeColladaPtr_t create(const std::string &name, const std::string &collada_file_path)
const std::string & meshFilePath() const
void setColor(const osgVector4 &color)
static LeafNodeColladaPtr_t createCopy(LeafNodeColladaPtr_t other)
static LeafNodeColladaPtr_t create(const std::string &name, const std::string &collada_file_path, const osgVector4 &color)
void setTexture(const std::string &image_path)
virtual LeafNodeColladaPtr_t clone(void) const
const std::string & textureFilePath() const
LeafNodeColladaPtr_t self(void) const
Abstract base class of 3D objects in a scene.
Definition node.h:25
::osg::Vec4f osgVector4
Definition config-osg.h:100
#define DEF_CLASS_SMART_PTR(className)
Definition macros.h:51
Definition action-search-bar.hh:27