9 #ifndef GEPETTO_VIEWER_LEAFNODELINE_HH 10 #define GEPETTO_VIEWER_LEAFNODELINE_HH 23 LeafNodeLineWeakPtr weak_ptr_;
26 ::osg::GeometryRefPtr beam_ptr_;
27 ::osg::ref_ptr< ::osg::DrawArrays > drawArray_ptr_;
28 ::osg::Vec3ArrayRefPtr points_ptr_;
29 ::osg::Vec4ArrayRefPtr color_ptr_;
42 void initWeakPtr (LeafNodeLineWeakPtr other_weak_ptr);
48 static LeafNodeLinePtr_t create (
const std::string& name,
const osgVector3& start_point,
const osgVector3& end_point);
50 static LeafNodeLinePtr_t create (
const std::string& name, const ::osg::Vec3ArrayRefPtr& points,
const osgVector4& color);
54 static LeafNodeLinePtr_t createCopy (LeafNodeLinePtr_t other);
58 virtual LeafNodeLinePtr_t clone (
void)
const;
67 LeafNodeLinePtr_t
self (void)
const;
74 virtual void setStartPoint (
const osgVector3& start_point);
80 virtual void setEndPoint (
const osgVector3& end_point);
88 virtual void setMode (
const GLenum& mode);
90 GLenum getMode ()
const;
96 virtual void setPoints (const ::osg::Vec3ArrayRefPtr& points);
100 void setPointsSubset (
const int first,
const std::size_t count);
108 void setColors(const ::osg::Vec4ArrayRefPtr& color);
112 ::osg::Vec4ArrayRefPtr color_array_ptr =
dynamic_cast<osg::Vec4Array*
>(beam_ptr_->getColorArray());
113 ASSERT(color_array_ptr,
"Problem of dynamic casting from VecArray to Vec4Array");
115 return color_array_ptr->at(0);
::osg::Vec3f osgVector3
Definition: config-osg.h:109
::osg::Vec3ArrayRefPtr getPoints()
Definition: leaf-node-line.h:102
::osg::Vec4f osgVector4
Definition: config-osg.h:110
::osg::GeometryRefPtr geometry() const
Definition: leaf-node-line.h:118
viewer::NodePtr_t NodePtr_t
Definition: fwd.hh:47
Definition: action-search-bar.hh:27
Definition: leaf-node-line.h:18
#define DEF_CLASS_SMART_PTR(className)
Definition: macros.h:50
osgVector4 getColor() const
Definition: leaf-node-line.h:110
virtual NodePtr_t copy() const
Proceed to a copy of the currend object as clone.
Definition: leaf-node-line.h:63
#define ASSERT(condition, message)
Definition: macros.h:40
SCENE_VIEWER_ACCEPT_VISITOR
Definition: leaf-node-line.h:123
Abstract base class of 3D objects in a scene.
Definition: node.h:27