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);