Hello Marcus,
Marcus Lindblom wrote:
> (OpenSG trac is down again, so I'll post here lest I forget it.)
the site seems to be back up (thanks to the folks that fixed it!).
> The following makes it easier to use boost::bind to process nodes:
>
> namespace OSG
> {
> template<class T, class P>
> T* get_pointer(const OSG::RefCountPtr<T, P>& p) {
> return p.get();
> }
> }
sure, I see no problem adding that.
> That means I can do cool stuff like:
>
> std::vector<std::string> geom_files = ...;
> typedef std::vector<OSG::NodeRefPtr> Nodes;
> Nodes n = QtConcurrent::blockingMapped<Nodes>(geom_files,
> boost::bind(&MyClass::loadFile, this, _1));
> std::for_each(n.begin(), n.end(), boost::bind(static_cast<void
> (OSG::Node::*const)(OSG::Node*)>(&OSG::Node::addChild), m_scene, _1));
>
> (Note that overloaded functions, addChild in this case, aren't really
> bind friendly either.)
hm, yes, but for normal use they are nice :)
> Also, why no editMFChildren() in OSG::Node? .. It'd be easier to just
> call insert(n.begin(), n.end()) than having to call addChild x times.
Node unfortunately is still handwritten instead of generated from an
.fcd and some functions were not implemented, other than that I don't
think there is anything in there that would require hiding the children
field and forcing access through the container (there are other
containers for which this is different, though).
Cheers,
Carsten
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users