gepetto-viewer 6.0.0
An user-friendly Graphical Interface
Loading...
Searching...
No Matches
leaf-node-face.h
Go to the documentation of this file.
1//
2// leaf-node-face.h
3// gepetto-viewer
4//
5// Created by Justin Carpentier, Mathieu Geisert in November 2014.
6// Copyright (c) 2014 LAAS-CNRS. All rights reserved.
7//
8
9#ifndef GEPETTO_VIEWER_LEAFNODEFACE_HH
10#define GEPETTO_VIEWER_LEAFNODEFACE_HH
11
12#include <gepetto/viewer/node.h>
13
14namespace gepetto {
15namespace viewer {
16
17DEF_CLASS_SMART_PTR(LeafNodeFace)
18
19
20class LeafNodeFace : public Node {
21 private:
23 LeafNodeFaceWeakPtr weak_ptr_;
24
26 ::osg::GeometryRefPtr face_ptr_;
27 ::osg::Vec3ArrayRefPtr vertices_;
28 ::osg::Vec4ArrayRefPtr color_ptr_;
29
30 void init();
31
32 /* Default constructor */
33 LeafNodeFace(const std::string& name, const osgVector3& point1,
34 const osgVector3& point2, const osgVector3& point3);
35 LeafNodeFace(const std::string& name, const osgVector3& point1,
36 const osgVector3& point2, const osgVector3& point3,
37 const osgVector4& color);
38 LeafNodeFace(const std::string& name, const osgVector3& point1,
39 const osgVector3& point2, const osgVector3& point3,
40 const osgVector3& point4);
41 LeafNodeFace(const std::string& name, const osgVector3& point1,
42 const osgVector3& point2, const osgVector3& point3,
43 const osgVector3& point4, const osgVector4& color);
44
45 /* Copy constructor */
46 LeafNodeFace(const LeafNodeFace& other);
47
49 void initWeakPtr(LeafNodeFaceWeakPtr other_weak_ptr);
50
51 protected:
52 public:
53 void addVertex(const osgVector3& vertex);
56 static LeafNodeFacePtr_t create(const std::string& name,
57 const osgVector3& point1,
58 const osgVector3& point2,
59 const osgVector3& point3);
60 static LeafNodeFacePtr_t create(const std::string& name,
61 const osgVector3& point1,
62 const osgVector3& point2,
63 const osgVector3& point3,
64 const osgVector4& color);
65 static LeafNodeFacePtr_t create(const std::string& name,
66 const osgVector3& point1,
67 const osgVector3& point2,
68 const osgVector3& point3,
69 const osgVector3& point4);
70 static LeafNodeFacePtr_t create(const std::string& name,
71 const osgVector3& point1,
72 const osgVector3& point2,
73 const osgVector3& point3,
74 const osgVector3& point4,
75 const osgVector4& color);
76
79 static LeafNodeFacePtr_t createCopy(LeafNodeFacePtr_t other);
80
83 virtual LeafNodeFacePtr_t clone(void) const;
84
88 virtual NodePtr_t copy() const { return clone(); }
89
92 LeafNodeFacePtr_t self(void) const;
93
94 // set color
95 void setColor(const osgVector4& color);
96
97 void setTexture(const std::string& image_path);
98
100 std::size_t nbVertices() const { return vertices_->size(); }
101
103
105 virtual ~LeafNodeFace();
106};
107} /* namespace viewer */
108} /* namespace gepetto */
109
110#endif /* GEPETTO_VIEWER_LEAFNODEFACE_HH */
Definition leaf-node-face.h:20
virtual NodePtr_t copy() const
Proceed to a copy of the currend object as clone.
Definition leaf-node-face.h:88
static LeafNodeFacePtr_t create(const std::string &name, const osgVector3 &point1, const osgVector3 &point2, const osgVector3 &point3, const osgVector3 &point4, const osgVector4 &color)
void setColor(const osgVector4 &color)
SCENE_VIEWER_ACCEPT_VISITOR
Definition leaf-node-face.h:102
std::size_t nbVertices() const
Get number of vertices.
Definition leaf-node-face.h:100
void setTexture(const std::string &image_path)
void addVertex(const osgVector3 &vertex)
static LeafNodeFacePtr_t create(const std::string &name, const osgVector3 &point1, const osgVector3 &point2, const osgVector3 &point3, const osgVector4 &color)
static LeafNodeFacePtr_t createCopy(LeafNodeFacePtr_t other)
virtual LeafNodeFacePtr_t clone(void) const
static LeafNodeFacePtr_t create(const std::string &name, const osgVector3 &point1, const osgVector3 &point2, const osgVector3 &point3, const osgVector3 &point4)
LeafNodeFacePtr_t self(void) const
static LeafNodeFacePtr_t create(const std::string &name, const osgVector3 &point1, const osgVector3 &point2, const osgVector3 &point3)
Abstract base class of 3D objects in a scene.
Definition node.h:25
::osg::Vec3f osgVector3
Definition config-osg.h:99
::osg::Vec4f osgVector4
Definition config-osg.h:100
#define DEF_CLASS_SMART_PTR(className)
Definition macros.h:51
Definition action-search-bar.hh:27