gepetto-viewer 6.0.0
An user-friendly Graphical Interface
Loading...
Searching...
No Matches
leaf-node-mesh.h
Go to the documentation of this file.
1//
2// leaf-node-mesh.h
3// gepetto-viewer
4//
5// Created by Olivier Stasse, Justin Carpentier, Anthony Couret, Mathieu
6// Geisert in November 2014. Copyright (c) 2016 LAAS-CNRS. All rights reserved.
7//
8
9#ifndef GEPETTO_VIEWER_LEAFNODEMESH_HH
10#define GEPETTO_VIEWER_LEAFNODEMESH_HH
11
12#include <gepetto/viewer/node.h>
13
14#include <osg/Geometry>
15#include <osg/PrimitiveSet>
16
17namespace gepetto {
18namespace viewer {
19DEF_CLASS_SMART_PTR(LeafNodeMesh)
20
21
22class LeafNodeMesh : public Node {
23 private:
25 LeafNodeMeshWeakPtr weak_ptr_;
26
28 osg::GeometryRefPtr mesh_geometry_ptr_;
29
30 void init();
31
32 /* Default constructor */
33 LeafNodeMesh(const std::string& name);
34 /* Copy constructor */
35 LeafNodeMesh(const LeafNodeMesh& other);
36 LeafNodeMesh(const std::string& name, const osgVector4& color);
37
39 void initWeakPtr(LeafNodeMeshWeakPtr other_weak_ptr);
40
41 protected:
42 public:
45 static LeafNodeMeshPtr_t create(const std::string& name);
46 static LeafNodeMeshPtr_t create(const std::string& name,
47 const osgVector4& color);
48
51 static LeafNodeMeshPtr_t createCopy(LeafNodeMeshPtr_t other);
52
55 virtual LeafNodeMeshPtr_t clone(void) const;
56
60 virtual LeafNodeMeshPtr_t copy() const { return clone(); }
61
64 LeafNodeMeshPtr_t self(void) const;
65
66 void setColor(const osgVector4& color_diffuse);
67
68 void setColor(const osgVector4& color_diffuse,
69 const osgVector4& color_specular,
70 const osgVector4& color_emissive);
71
72 void setTexture(const std::string& image_path);
73
74 virtual void setAlpha(const float& alpha);
75 virtual osg::ref_ptr<osg::Node> getOsgNode() const;
76
78
81 void setVertexArray(osg::Vec3ArrayRefPtr arrayOfVertices);
82
84 void addPrimitiveSet(osg::DrawElementsUInt* aSetOfColors);
85
86 void setColorBinding(osg::Geometry::AttributeBinding aColorBinding);
88 void setColorArray(osg::Vec4ArrayRefPtr colors);
89
91 void setNormalArray(osg::Vec3ArrayRefPtr normals);
92 void setNormalBinding(osg::Geometry::AttributeBinding aNormalBinding);
94 virtual ~LeafNodeMesh();
95};
96} /* namespace viewer */
97} /* namespace gepetto */
98
99#endif /* GEPETTO_VIEWER_LEAFNODECOLLADA_HH */
Definition leaf-node-mesh.h:22
static LeafNodeMeshPtr_t createCopy(LeafNodeMeshPtr_t other)
void setVertexArray(osg::Vec3ArrayRefPtr arrayOfVertices)
virtual osg::ref_ptr< osg::Node > getOsgNode() const
void setNormalBinding(osg::Geometry::AttributeBinding aNormalBinding)
virtual LeafNodeMeshPtr_t copy() const
Proceed to a copy of the currend object as clone.
Definition leaf-node-mesh.h:60
LeafNodeMeshPtr_t self(void) const
void addPrimitiveSet(osg::DrawElementsUInt *aSetOfColors)
static LeafNodeMeshPtr_t create(const std::string &name)
SCENE_VIEWER_ACCEPT_VISITOR
Definition leaf-node-mesh.h:77
void setColorBinding(osg::Geometry::AttributeBinding aColorBinding)
void setColorArray(osg::Vec4ArrayRefPtr colors)
void setTexture(const std::string &image_path)
void setColor(const osgVector4 &color_diffuse)
virtual void setAlpha(const float &alpha)
void setNormalArray(osg::Vec3ArrayRefPtr normals)
virtual LeafNodeMeshPtr_t clone(void) const
static LeafNodeMeshPtr_t create(const std::string &name, const osgVector4 &color)
void setColor(const osgVector4 &color_diffuse, const osgVector4 &color_specular, const osgVector4 &color_emissive)
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