9 #ifndef GEPETTO_VIEWER_LEAFNODELINE_HH
10 #define GEPETTO_VIEWER_LEAFNODELINE_HH
24 LeafNodeLineWeakPtr weak_ptr_;
27 ::osg::GeometryRefPtr beam_ptr_;
28 ::osg::ref_ptr< ::osg::DrawArrays > drawArray_ptr_;
29 ::osg::Vec3ArrayRefPtr points_ptr_;
30 ::osg::Vec4ArrayRefPtr color_ptr_;
45 void initWeakPtr (LeafNodeLineWeakPtr other_weak_ptr);
51 static LeafNodeLinePtr_t create (
const std::string& name,
const osgVector3& start_point,
const osgVector3& end_point);
53 static LeafNodeLinePtr_t create (
const std::string& name, const ::osg::Vec3ArrayRefPtr& points,
const osgVector4& color);
57 static LeafNodeLinePtr_t createCopy (LeafNodeLinePtr_t other);
61 virtual LeafNodeLinePtr_t clone (
void)
const;
70 LeafNodeLinePtr_t
self (void)
const;
77 virtual void setStartPoint (
const osgVector3& start_point);
83 virtual void setEndPoint (
const osgVector3& end_point);
91 virtual void setMode (
const GLenum& mode);
93 GLenum getMode ()
const;
99 virtual void setPoints (const ::osg::Vec3ArrayRefPtr& points);
103 void setPointsSubset (
const int first,
const std::size_t count);
111 void setColors(const ::osg::Vec4ArrayRefPtr& color);
115 ::osg::Vec4ArrayRefPtr color_array_ptr =
dynamic_cast<osg::Vec4Array*
>(beam_ptr_->getColorArray());
116 ASSERT(color_array_ptr,
"Problem of dynamic casting from VecArray to Vec4Array");
118 return color_array_ptr->at(0);