Commit Graph

45 Commits

Author SHA1 Message Date
Robert Osfield
4a76063b03 Moved destructor to protected 2014-01-08 10:16:39 +00:00
Robert Osfield
49625a1baf From Andreas Henne, "in my application I use the TrackballDragger, the ScaleAxisDragger and the TranslateAxisDragger. Unfortunately these draggers are very thin and they do not provide methods to change their visual appearance. Another problem that I noticed is that lighting on the cones and boxes of the TranslateAxisDragger and ScaleAxisDragger is incorrect when the draggers are scaled due to not normalized normals. This small patch adresses these problems, providing methods to make the draggers thicker. I have attached a zip archive containing the corresponding files and also a modified osgManipulator example that makes use of the modifications. I don't want to retain any copyright." 2013-10-18 07:31:22 +00:00
Robert Osfield
097aedf23c From David Callu, warning fixes and removal of spaces at end of lines. 2013-06-28 12:00:43 +00:00
Robert Osfield
86a37616f7 Changed dispatch to virtual 2012-09-25 11:04:11 +00:00
Robert Osfield
f804d7dd81 From Vladimir Cheaev, "
I worked with a osg::Constraint and found strange part of code:
class OSGMANIPULATOR_EXPORT Constraint : public osg::Referenced
{
    public:
...
        virtual bool constrain(ScaleUniformCommand& command) const     { return constrain((MotionCommand&)command); }
        virtual bool constrain(const Rotate3DCommand& command)         { return constrain((MotionCommand&)command); }
...

If i use osgManipulator::Rotate3DCommand then method Rotate3DCommand::accept(const Constraint& constraint) calls Constraint::constrain(MotionCommand&) instead Constraint:: constrain(const Rotate3DCommand&).

If you replace
        virtual bool constrain(const Rotate3DCommand& command)         { return constrain((MotionCommand&)command); }
on to
        virtual bool constrain(Rotate3DCommand& command) const         { return constrain((MotionCommand&)command); }
then all works correctly.
"
2012-09-20 11:27:57 +00:00
Robert Osfield
1dbb0a7a82 Added Dragger::get/setActivationMouseButtonMask(uint). 2012-05-25 15:32:51 +00:00
Robert Osfield
c21f1f488f From Jaap Glas, "Added a default parameter to the following constructor in TabPlaneDragger
and TabPlaneDragger.cpp:

TabPlaneDragger(float handleScaleFactor=20.0f);

The reason for this is that the default OSG tab sizes are way bigger than
those we used in our application so far. And since handleScaleFactor_
is already a (constant) class member, I see no objection against making
it user defined."
2012-05-25 08:56:25 +00:00
Robert Osfield
14a563dc9f Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Robert Osfield
5e105d2fc4 From Chuck Seberino, "Attached are modified versions of RotateCylinderDragger and Projector files that clean up the use of _onCylinder / isProjectionOnCylinder().
I have also made changes to the RotateCylinderDragger to provide a cylinder ring with a thickness.   It is totally optional, but IMHO makes the default behavior work better than a solid cylinder (which typically obscures the geometry you are trying to drag).  Gives it a bit more to grab, especially in the case where eyepoint and cylinder axis are near parallel.
"
2012-03-09 10:20:23 +00:00
Robert Osfield
fd97a9a800 From Chuck Seberino, "Here is a fix for the RotateCylinderDragger. This patch fixes the case where the picking direction is close to the cylinder axis. The current behavior is this:
* If the eyepoint and cylinder axis are close to parallel (given some tolerance), then it uses a plane perpendicular to the cylinder axis.
* Otherwise it uses a plane parallel to the cylinder axis oriented towards the eyepoint (previous behavior).  This gives decent behavior and is the only path that was taken in the previous code.   I kept with previous behavior and that allowed a good bit of code to be removed, simplifying things.  There is now no need for the _onCylinder flag, but since there is a public accessor, I wasn't sure how to handle it for backwards compatibility, so I left it in.  NOTE - there is no default initialized value, so if it is kept in, it should be set to 'false' to keep same behavior as before.  I am not quite sure how the _onCylinder case was supposed to behave as even forcing that path gave undesirable behavior, even with carefully controlled dragging.
"
2012-03-06 10:08:49 +00:00
Robert Osfield
487ee0f8e7 Added DraggerTransformCallback::HandleCommandMask to DraggerTransformCallback to allow applications to select which
commands they want the dragger callback to respond to why updating the transform.
2012-02-01 13:55:38 +00:00
Robert Osfield
7664d90504 Improved the handling of osgManipulator::Constraint, DraggerCallbacks and Command so that they now use a Visitor Pattern
to ensure the correct methods on constraints and callbaks are called for each Command.  Also fixed the handling of
Constraints when applied to composite Draggers.
2012-01-31 10:56:52 +00:00
Robert Osfield
c7698c1334 From Aurelien Albert, "I made a modification in the Dragger class :
You can now set a "intersection mask" and it will be used when looking for intersections.

So you can now easily "hide" some objects from manipulators."
2011-12-23 17:21:59 +00:00
Robert Osfield
7455f6265c Fixed warnings.
OpenSceneGraph/src/osgGA/NodeTrackerManipulator.cpp:32:1: warning: base class ?class osg::Object? should be explicitly initialized in the copy constructor
OpenSceneGraph/src/osgGA/TerrainManipulator.cpp:31:1: warning: base class ?class osg::Object? should be explicitly initialized in the copy constructor
OpenSceneGraph/include/osgSim/ShapeAttribute:99:9: warning: base class ?class std::vector<osgSim::ShapeAttribute>? should be explicitly initialized in the copy constructor
OpenSceneGraph/src/osgPlugins/zip/unzip.cpp:3102:14: warning: missing initializer for member ?unz_s::gi?
OpenSceneGraph/src/osgPlugins/zip/unzip.cpp:3102:14: warning: missing initializer for member ?unz_s::byte_before_the_zipfile?
OpenSceneGraph/src/osgPlugins/zip/unzip.cpp:3102:14: warning: missing initializer for member ?unz_s::num_file?
OpenSceneGraph/src/osgPlugins/zip/unzip.cpp:3102:14: warning: missing initializer for member ?unz_s::pos_in_central_dir?
OpenSceneGraph/src/osgPlugins/zip/unzip.cpp:3102:14: warning: missing initializer for member ?unz_s::current_file_ok?
OpenSceneGraph/src/osgPlugins/zip/unzip.cpp:3102:14: warning: missing initializer for member ?unz_s::central_pos?
OpenSceneGraph/src/osgPlugins/zip/unzip.cpp:3102:14: warning: missing initializer for member ?unz_s::size_central_dir?
OpenSceneGraph/src/osgPlugins/zip/unzip.cpp:3102:14: warning: missing initializer for member ?unz_s::offset_central_dir?
OpenSceneGraph/src/osgPlugins/zip/unzip.cpp:3102:14: warning: missing initializer for member ?unz_s::cur_file_info?
OpenSceneGraph/src/osgPlugins/zip/unzip.cpp:3102:14: warning: missing initializer for member ?unz_s::cur_file_info_internal?
OpenSceneGraph/src/osgPlugins/zip/unzip.cpp:3102:14: warning: missing initializer for member ?unz_s::pfile_in_zip_read?
OpenSceneGraph/src/osgViewer/CompositeViewer.cpp:30:1: warning: base class ?class osg::Object? should be explicitly initialized in the copy constructor
OpenSceneGraph/src/osgViewer/View.cpp:159:1: warning: base class ?class osg::Object? should be explicitly initialized in the copy constructor
OpenSceneGraph/src/osgViewer/Viewer.cpp:196:1: warning: base class ?class osg::Object? should be explicitly initialized in the copy constructor
OpenSceneGraph/src/osgViewer/Viewer.cpp:196:1: warning: base class ?class osgViewer::ViewerBase? should be explicitly initialized in the copy constructor
OpenSceneGraph/include/osgManipulator/Dragger:47:9: warning: base class ?class osg::Object? should be explicitly initialized in the copy constructor
2011-06-23 11:09:49 +00:00
Robert Osfield
0adf26ec6e From Wang Rui, "The osgManipulator serializers are ready now. I need to modify the
META_OSGMANIPULATOR_Object macro to ensure these classes could work
with their wrappers, and a few naming styles should be changed as
well. Fortunately everything seems to compile fine under Windows and
my new Ubuntu system.

And I finally find the problem of the
serializers/osgTerrain/Terrain.cpp, it just missed an "osg::Group"
before "osg::CoordinateSystemNode" indicator. With the small fix
attached now VPB could generate terrain with osgt/osgb formats."
2010-04-28 20:16:44 +00:00
Robert Osfield
c541781ca5 Moved dispatch/recieve methods into public scope to allow easier custom usage. 2010-01-13 14:16:33 +00:00
Robert Osfield
589629cab8 Introduced TabBoxTrackballDragger 2009-08-05 16:02:44 +00:00
Robert Osfield
6e6a7c960e Added Dragger::s/getActivationModKeyMask(..) and Dragger::s/getActivationKeyEvent(...) methods to make it possible to have draggers that only respond when you press a specified modified key or standard key.
Changed the optional dragger in osgvolume to require the shift key to be pressed for the dragger to become active.
2009-07-03 19:16:53 +00:00
Robert Osfield
78229df14a Added setUpGeometry to Dragger base class to make it easier to use draggers interchangably. 2009-07-03 05:52:52 +00:00
Robert Osfield
a7f0f3f49d Added constructor and destructor body 2009-07-01 14:49:30 +00:00
Robert Osfield
2525bb5d06 Completed refactor of osgManipulator, key changes are:
Selection is now just a typedef of osg::MatrixTransform, and is deprecated

   CommandManager is shell class that just sets values directly on Dragger, and is deprecated

   Dragger now has list of DraggerCallback that takes over the roll of tracking changes to the Dragger, and
   allows users to track the dragger in any way they wish.

   Dragger now has a convinience method making MatrixTransforms track a dragger.

   Selection and CommandManager are no longer required for use of osgManipulator and are kept around for backwards compatibility.
2009-07-01 14:01:09 +00:00
Robert Osfield
7904fe71a5 Simplified Command and CommandManager 2009-06-30 13:00:58 +00:00
Robert Osfield
a2ae370c8e Refactored osgManipulator so that CommandManager is no longer required, instead Dragger directly manages Constaints and associate Selections. 2009-06-30 11:39:39 +00:00
Robert Osfield
e30e4df30c Introduced event handling directly into osgManipulator::Dragger to allow it be used with a global event handler passing in events. 2009-06-29 21:32:10 +00:00
Robert Osfield
c949789ac7 Updated version info for 2.9.3 dev release, fixed typo and updated wrappers 2009-04-10 11:00:54 +00:00
Robert Osfield
57f6f9f6df Added typedef and updated wrappers 2009-04-10 10:07:13 +00:00
Robert Osfield
c7b981f0d6 From Romain Charbit, "added a getConnectedSelections(Dragger&) method, so we can get which selections are connected to a dragger without make our own multimap, copying the existing _draggerSelectionMap (which is protected with no accessors) ." 2009-04-10 09:56:04 +00:00
Robert Osfield
31608b2559 From David Callu, "osgManipulator Object have not META_Object macro call in class definition.
> I add META_OSGMANIPULATOR_Object macro which define className, libraryName,
> isSameKindAs methods.
> Clone method is not appropriate for osgManipulator Object."
2009-03-11 11:29:00 +00:00
Robert Osfield
341abcb315 From Serge Lages, "Here you can find some modifications to osgManipulator to work with double values instead of floats. Indeed I faced problems with the osgManipulator library when working with Earth based scenes, it was impossible to drag objects in a precise way if they were too far from the center of the scene." 2008-11-21 11:23:21 +00:00
Robert Osfield
672a5d14fe Replaced tabs 2008-11-21 11:09:11 +00:00
Robert Osfield
6f6f56c795 Improved the doxygen docs over the various namespaces 2008-08-05 19:17:09 +00:00
Robert Osfield
49641debcb Changed method parameter to use const & 2008-02-25 14:27:57 +00:00
Robert Osfield
a97dc84228 Introduced typedef vec_type and value_type into LineSemgment class to allow easier
switching between double and float versions.
2008-02-18 14:51:05 +00:00
Robert Osfield
8e7e6529be From David Callu, warning fixes 2007-09-07 15:03:56 +00:00
Robert Osfield
b20d542317 From David Callu, improved consistency of Version strings and add version support
for osgIntrospection and osgManipulator.
2007-09-05 17:12:24 +00:00
Robert Osfield
2c16c5b87d Change interator to const_iterator to try and avoid Solaris build failure 2007-06-05 14:37:55 +00:00
Robert Osfield
11ccf8f936 Removed const to try and avoid Sun compiler error 2007-06-05 08:46:32 +00:00
Robert Osfield
49217e8a88 From Frauciel Luc, "Added support for other pointers than mouses by using a nearpoint and farpoint instead of mousex,mousey + Camera (see Dragger and Dragger.cpp).
The major modification concern the LineProjector class in Projector.cpp. The intersection was previously done in window space, I've modified it to compute it in object space."
2007-05-28 10:14:29 +00:00
Robert Osfield
d2aefbc09a Added static build support to export macros 2007-05-21 07:54:01 +00:00
Robert Osfield
07c3503dbb Changed hitItr to be a const_iterator. 2007-04-13 13:19:29 +00:00
Robert Osfield
ebb571473f Changed _pixel_x and _pixel_y to be floats 2007-03-06 12:01:55 +00:00
Robert Osfield
7f8f4e331a Completed changes to osgManipulator to make it more flexible w.r.t viewer usage, and
ported osgmanipulator example across of osgViewer
2007-02-26 13:01:17 +00:00
Robert Osfield
3006bb14f4 Changed osgManipulator::Dragger::handle(..) method to use a nested PointerInfo
class to encapsulate the pixel coords, SceneView and picking operations in prep for
making the code more general purpose, and less reliant on classes like osgUtil::SceneView and osgUtil::IntersectVisitor.
2007-02-11 21:12:34 +00:00
Robert Osfield
1484ab515e Changed the osg::Shape related projectors so that they used pointers rather
than references.
2007-02-11 12:22:58 +00:00
Robert Osfield
19db0c1674 From Vivek Rajan, new osgManipulator library, with a few minor tweaks and rename for osgDragger to osgManipulator for build by Robert Osfield.
Vivek's email to osg-submissions:

"I'm happy to release the osgdragger nodekit to the OSG community. I
implemented the nodekit for my company, Fugro-Jason Inc., and they
have kindly agreed to open source it.

The nodekit contains a few draggers but it should be easy to build new
draggers on top of it. The design of the nodekit is based on a
SIGGRAPH 2002 course - "Design and Implementation of Direct
Manipulation in 3D". You can find the course notes at
http://www.pauliface.com/Sigg02/index.html. Reading pages 20 - 29 of
the course notes should give you a fair understanding of how the
nodekit works.

The source code also contains an example of how to use the draggers."
2007-02-11 10:33:59 +00:00