OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
HandlerIntersector.h
Go to the documentation of this file.
1
2#ifndef HANDLERINTERSECTOR_H
3#define HANDLERINTERSECTOR_H
4
5#include <vector>
6#include <osgUtil/LineSegmentIntersector>
7
15class HandlerIntersector : public osgUtil::LineSegmentIntersector
16{
17public:
19
20 HandlerIntersector(const osg::Vec3& start, const osg::Vec3& end);
21 HandlerIntersector(CoordinateFrame cf, double x, double y);
22 HandlerIntersector(CoordinateFrame cf, const osg::Vec3d& start, const osg::Vec3d& end);
23
24 void setOffset(float offset);
25 float getOffset() const;
26 void getHitIndices(int& first, int& last) const;
27
28 virtual Intersector* clone( osgUtil::IntersectionVisitor& iv );
29 virtual void intersect(osgUtil::IntersectionVisitor& iv, osg::Drawable* drawable);
30
31 bool isVirtualIntersector() const;
32
33 void setHandlerDrawable(osg::Drawable *handler) { selectorDrawable = handler; }
34
35protected:
36 double getSkewLinesDistance(const osg::Vec3d &r1, const osg::Vec3d &r2, const osg::Vec3d &v1, const osg::Vec3d &v2, double &intersectionRatio);
37 virtual bool isRightPrimitive(const osg::Geometry* geometry);
38
39 float m_offset;
40 std::vector<unsigned int> m_hitIndices;
41 osg::Drawable *selectorDrawable;
42};
43
44#endif // L
A class that allows to catch intersections with line loops and lines OpenGL types.
Definition HandlerIntersector.h:16
virtual bool isRightPrimitive(const osg::Geometry *geometry)
Definition HandlerIntersector.cpp:194
void setOffset(float offset)
Definition HandlerIntersector.cpp:39
float m_offset
Definition HandlerIntersector.h:39
osg::Drawable * selectorDrawable
Definition HandlerIntersector.h:41
HandlerIntersector(CoordinateFrame cf, double x, double y)
double getSkewLinesDistance(const osg::Vec3d &r1, const osg::Vec3d &r2, const osg::Vec3d &v1, const osg::Vec3d &v2, double &intersectionRatio)
Definition HandlerIntersector.cpp:163
HandlerIntersector(CoordinateFrame cf, const osg::Vec3d &start, const osg::Vec3d &end)
void getHitIndices(int &first, int &last) const
Definition HandlerIntersector.cpp:49
virtual void intersect(osgUtil::IntersectionVisitor &iv, osg::Drawable *drawable)
Definition HandlerIntersector.cpp:102
float getOffset() const
Definition HandlerIntersector.cpp:44
virtual Intersector * clone(osgUtil::IntersectionVisitor &iv)
Definition HandlerIntersector.cpp:61
std::vector< unsigned int > m_hitIndices
Definition HandlerIntersector.h:40
bool isVirtualIntersector() const
Definition HandlerIntersector.cpp:158
HandlerIntersector()
Definition HandlerIntersector.cpp:8
void setHandlerDrawable(osg::Drawable *handler)
Definition HandlerIntersector.h:33