OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Removing stateset for all assoc nodes without traverse


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
YuraIU02
User


Joined: 31 Mar 2017
Posts: 20

PostPosted: Wed Apr 12, 2017 12:10 pm    Post subject:
Removing stateset for all assoc nodes without traverse
Reply with quote

Hi,

How can I remove stateset for all associated nodes without calling setStateset(NULL) to each node? Or what is the fastest way to do it?

Thank you!

Cheers,
Yura
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 10892

PostPosted: Wed Apr 12, 2017 12:57 pm    Post subject:
Removing stateset for all assoc nodes without traverse
Reply with quote

Hi Yura,

On 12 April 2017 at 13:10, Yura Ivanov <> wrote:
Quote:
How can I remove stateset for all associated nodes without calling setStateset(NULL) to each node? Or what is the fastest way to do it?

The way you remove a stateset from a Node is via setStateSet(). To
remove it from all the nodes that are associated with you can get the
StateSet::ParentList using StateSet'::getParents() then traverse
through this list calling setStateSet(0) on each one.

There isn't an more efficient way to do this than the above approach,
setStateSet() does all the internal house keeping required and no
more, you can't short cut this otherwise the scene graph would end up
with a mess of dangling pointers, memory leaks or crashes.

The fact that you raise this as a performance issue SCREAMs out to me
that you are again trying to solve a problem because of poor choice of
scene graph construction. You are trying to solve the problem with
the wrong tools.

The basic approach you have taken sounds wrong, and you are hitting
performance issues because of this and trying to look to "optimize"
stuff in the OSG to solve the bottlenecks rather than look at the
basic approach you are taking.

I think the best thing you can do right now is take a step back,
accept that the approach you have taken thus far is inefficient and
call for suggestions form the community how they would solve the
particular task you are trying to tackle. I've requested you provide
more high level details like this in previous threads but so far there
hasn't been enough to go on to know what the best route would be.

Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts NodeCallback does not traverse children YuraIU02 General 3 Mon Apr 10, 2017 8:43 am View latest post
No new posts Fast move a lot of nodes to another g... YuraIU02 General 27 Fri Mar 31, 2017 8:05 am View latest post
No new posts ref null pointer in Group::traverse Meldryt General 1 Thu Mar 16, 2017 3:06 pm View latest post
No new posts Slow down with shared nodes Andre Normann General 18 Tue Mar 07, 2017 8:24 am View latest post
No new posts osgQT updates removing obsolete OSG s... internetscooter Submission 0 Fri Jan 20, 2017 12:28 am View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP