Hi Robert,

Sorry missed the post. 

I'll live with it the way it is. I'm only using Translate2DDragger so
I can just extend that and leave osg untouched.

The idea was that setupCustomGeometry would do special custom geometry
actions. Translate2DDragger is trivial but others would require more
work. As Jean-Sebastien pointed out I should make sure all draggers
are covered before submitting... And I don't have the time ;)

If I get time to update the Manipulator example with custom geometry,
that may be more appropriate.

Cheers,

Paul 

> -----Original Message-----
> From: Robert Osfield [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, 27 November 2008 3:42 AM
> To: [EMAIL PROTECTED]; OpenSceneGraph Submissions
> Subject: Re: [osg-submissions] 
> Dragger::setupCustomGeometry(osg::MatrixTransform* customxform)
> 
> Hi Paul,
> 
> I'm posting again as I got no reply to this open topic.  If I 
> don't get a reply I'll assume the existing code is just fine 
> and you can do what you want using my suggestion of using 
> addChild(), and keep the OSG as is.
> 
> Robert.
> 
> On Thu, Nov 6, 2008 at 3:51 PM, Robert Osfield 
> <[EMAIL PROTECTED]> wrote:
> > Hi Paul,
> >
> > I'm just reviewing your changes now.  All they seem to do is an 
> > addChild, which makes me wonder why don't you just do a:
> >
> >  dragger->addChild(mysubgraph);
> >
> > As it's the same thing as
> >
> >  dragger->setupCustomGeometry(customDragger);
> >
> > I also don't understand they this method only takes a 
> MatrixTransform 
> > as a parameter.
> >
> > Robert.
> >
> > On Sat, Nov 1, 2008 at 12:57 PM, Paul McIntosh 
> > <[EMAIL PROTECTED]> wrote:
> >> Hi Robert,
> >>
> >> No problems. Files attached. Let me know if there are any issues.
> >>
> >> Cheers,
> >>
> >> Paul
> >>
> >>> -----Original Message-----
> >>> From: [EMAIL PROTECTED]
> >>> [mailto:[EMAIL PROTECTED] 
> On Behalf 
> >>> Of Robert Osfield
> >>> Sent: Saturday, 1 November 2008 9:31 PM
> >>> To: OpenSceneGraph Submissions
> >>> Subject: Re:
> >>> [osg-submissions]Dragger::setupCustomGeometry(osg::MatrixTrans
> >>> form* customxform)
> >>>
> >>> Hi Paul,
> >>>
> >>> Could you post whole changed files, copy and paste in a 
> email is not 
> >>> appropriate form as it's very prone to errors.
> >>>
> >>> Thanks,
> >>> Robeert.
> >>>
> >>> On Sat, Nov 1, 2008 at 11:14 AM, Paul McIntosh 
> >>> <[EMAIL PROTECTED]> wrote:
> >>> > Hi All,
> >>> >
> >>> > This is my first submission so hopefully it will make sense...
> >>> >
> >>> > This is a very simple but powerful change to the
osgManipulator 
> >>> > "Dragger" class, it allows you to specify your own custom
> >>> geometry for
> >>> > a dragger when you create it. The actual osg changes are
> >>> very simple,
> >>> > but I have also included an example of how to use it
> >>> (because that is
> >>> > the hardest bit). I think the how to use comments should be
> >>> added to
> >>> > the Dragger code somewhere (Dragger.cpp?).
> >>> >
> >>> >
> >>> > "Dragger"
> >>> >
> >>> > /** Setup custom geometry for dragger. */ void
> >>> > setupCustomGeometry(osg::MatrixTransform* customxform);
> >>> >
> >>> >
> >>> > "Dragger.cpp"
> >>> >
> >>> > /** Setup custom geometry for dragger. */ void
> >>> > Dragger::setupCustomGeometry(osg::MatrixTransform* 
> customxform) {
> >>> >        addChild(customxform);
> >>> > }
> >>> >
> >>> > "How to use"
> >>> >
> >>> > /* Here is an example of using setupCustomGeometry // As
> >>> before create
> >>> > the type of dragger that you need dragger = new 
> >>> > osgManipulator::Translate2DDragger();
> >>> >
> >>> > // however instead of calling
"dragger->setupDefaultGeometry();"
> >>> > // create your own geometry to suit your task (refer to
> >>> > setupDefaultGeometry() for hints)
> >>> > // an example of a "box" dragger looks like...
> >>> > osg::ref_ptr<osg::MatrixTransform> customDraggerxform = new 
> >>> > osg::MatrixTransform; osg::ref_ptr<osg::Geode> 
> customDraggerGeode
> >> =
> >>> > new osg::Geode; osg::ref_ptr<osg::Box> box = new osg::Box 
> >>> > (osg::Vec3(0.0f,0.0f,0.0f), 400.0f, 2.0f, 400.0f); 
> >>> > osg::ref_ptr<osg::Drawable> drawable = new 
> >>> > osg::ShapeDrawable(box.get()); 
> >>> > //osgManipulator::setDrawableToAlwaysCull(*drawable); //
> >>> you can make
> >>> > draggers invisible too
> >>> > customDraggerGeode->addDrawable(drawable.get());
> >>> > customDraggerxform->addChild(customDraggerGeode.get());
> >>> >
> >>> > // once you have your geometry, pass it to the dragger to
> >>> use as the
> >>> > pick geometry
> >>> > dragger->setupCustomGeometry(customDraggerxform.get());
> >>> > */
> >>> >
> >>> > Cheers,
> >>> >
> >>> > Paul
> >>> > --
> >>> > Paul McIntosh
> >>> > www.internetscooter.com
> >>> >
> >>> > _______________________________________________
> >>> > osg-submissions mailing list
> >>> > [email protected]
> >>> >
> >>>
> >> 
>
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscen
> >> e
> >>> > graph.org
> >>> >
> >>> _______________________________________________
> >>> osg-submissions mailing list
> >>> [email protected]
> >>> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-o
> >>> penscenegraph.org
> >>>
> >>
> >> _______________________________________________
> >> osg-submissions mailing list
> >> [email protected]
> >> 
>
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscen
> >> egraph.org
> >>
> >>
> >
> 

_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to