OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
HandlerIntersector Class Reference

A class that allows to catch intersections with line loops and lines OpenGL types. More...

#include "HandlerIntersector.h"

Inheritance diagram for HandlerIntersector:

Public Member Functions

 HandlerIntersector ()
 
 HandlerIntersector (const osg::Vec3 &start, const osg::Vec3 &end)
 
 HandlerIntersector (CoordinateFrame cf, double x, double y)
 
 HandlerIntersector (CoordinateFrame cf, const osg::Vec3d &start, const osg::Vec3d &end)
 
void setOffset (float offset)
 
float getOffset () const
 
void getHitIndices (int &first, int &last) const
 
virtual Intersector * clone (osgUtil::IntersectionVisitor &iv)
 
virtual void intersect (osgUtil::IntersectionVisitor &iv, osg::Drawable *drawable)
 
bool isVirtualIntersector () const
 
void setHandlerDrawable (osg::Drawable *handler)
 

Protected Member Functions

double getSkewLinesDistance (const osg::Vec3d &r1, const osg::Vec3d &r2, const osg::Vec3d &v1, const osg::Vec3d &v2, double &intersectionRatio)
 
virtual bool isRightPrimitive (const osg::Geometry *geometry)
 

Protected Attributes

float m_offset
 
std::vector< unsigned int > m_hitIndices
 
osg::Drawable * selectorDrawable
 

Detailed Description

A class that allows to catch intersections with line loops and lines OpenGL types.

It uses shortest distance between the cast ray and the geometry line which is calculated as a distance between skew lines. In addition, it filters out the geometries whose primitive sets are different than line-types.

Constructor & Destructor Documentation

◆ HandlerIntersector() [1/4]

HandlerIntersector::HandlerIntersector ( )

◆ HandlerIntersector() [2/4]

HandlerIntersector::HandlerIntersector ( const osg::Vec3 & start,
const osg::Vec3 & end )

◆ HandlerIntersector() [3/4]

HandlerIntersector::HandlerIntersector ( CoordinateFrame cf,
double x,
double y )

◆ HandlerIntersector() [4/4]

HandlerIntersector::HandlerIntersector ( CoordinateFrame cf,
const osg::Vec3d & start,
const osg::Vec3d & end )

Member Function Documentation

◆ clone()

osgUtil::Intersector * HandlerIntersector::clone ( osgUtil::IntersectionVisitor & iv)
virtual

◆ getHitIndices()

void HandlerIntersector::getHitIndices ( int & first,
int & last ) const

◆ getOffset()

float HandlerIntersector::getOffset ( ) const

◆ getSkewLinesDistance()

double HandlerIntersector::getSkewLinesDistance ( const osg::Vec3d & r1,
const osg::Vec3d & r2,
const osg::Vec3d & v1,
const osg::Vec3d & v2,
double & intersectionRatio )
protected

◆ intersect()

void HandlerIntersector::intersect ( osgUtil::IntersectionVisitor & iv,
osg::Drawable * drawable )
virtual

◆ isRightPrimitive()

bool HandlerIntersector::isRightPrimitive ( const osg::Geometry * geometry)
protectedvirtual

◆ isVirtualIntersector()

bool HandlerIntersector::isVirtualIntersector ( ) const

◆ setHandlerDrawable()

void HandlerIntersector::setHandlerDrawable ( osg::Drawable * handler)
inline

◆ setOffset()

void HandlerIntersector::setOffset ( float offset)

Member Data Documentation

◆ m_hitIndices

std::vector<unsigned int> HandlerIntersector::m_hitIndices
protected

◆ m_offset

float HandlerIntersector::m_offset
protected

◆ selectorDrawable

osg::Drawable* HandlerIntersector::selectorDrawable
protected

The documentation for this class was generated from the following files: