Ignore:
Timestamp:
Aug 2, 2011, 11:38:09 PM (13 years ago)
Author:
Torben Dannhauer
Message:

first try to select a vertex in a mesh.
Nextstep: catch mouse drags from the GA, transform into mesh CF and modify vertex.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • experimental/distortionNG/distortionNG.h

    r308 r309  
    22
    33#include<osg/Referenced>
     4#include<osg/Geometry>
     5#include<osg/MatrixTransform>
     6
     7#include<osgGA/GUIEventHandler>
     8
     9#include<osgViewer/Viewer>
     10
     11
     12
     13
     14class distortionHandler : public osgGA::GUIEventHandler
     15{
     16
     17public:
     18        distortionHandler( osg::Camera* camera )
     19    : _highlighter(0), _camera(camera), _highlightColor( osg::Vec4(1.0f, 0.0f, 0.0f, 1.0f) ) {}
     20
     21    void computeSelectedVertex( osgUtil::LineSegmentIntersector::Intersection& result );
     22    bool handle( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa );
     23
     24        osg::Geode* createVertexHighlighter();
     25
     26protected:
     27        osg::ref_ptr<osg::Geometry> _highlighter;
     28    osg::observer_ptr<osg::Camera> _camera;
     29        const osg::Vec4 _highlightColor;
     30};
     31
     32
    433
    534class distortionNG : public osg::Referenced
    635{
     36
    737public:
    8         distortionNG(void);
    9         virtual ~distortionNG(void);
     38        distortionNG();
     39        virtual ~distortionNG();
     40
     41        static osg::Geometry* createMesh(unsigned int column, unsigned int row);
    1042};
Note: See TracChangeset for help on using the changeset viewer.