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 

Custom data within nodes or drawables


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


Joined: 06 Dec 2013
Posts: 44

PostPosted: Thu Aug 24, 2017 9:52 am    Post subject:
Custom data within nodes or drawables
Reply with quote

Dear OSG forum,

I am currently implementing picking and selection inside my app. I have setup everything up to the point where I can know the osgUtil::Intersection and with it the Drawable that was picked.

Now, what I am really interested in is not the Drawable or Node itself but the object it represents in my DataBase. Hence I would like to associate my OSG rendered objects with my DataBase objects. To that intent, is there something like a custom data in the Drawables in which I could store a pointer to my DataBase objects? Or should I handle this association and lookup myself?

Thank you!

Antoine
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11152

PostPosted: Thu Aug 24, 2017 10:26 am    Post subject:
Custom data within nodes or drawables
Reply with quote

HI Antoine,


The osg::Object base class a coarse grained Object::setUserData(Referenced*) feature, or a fine grained template based Object::setUserValue(strd::string& name, T value); method.  The later functionality is managed via UserData using a UserDataContainer class that agregates use the UserValue's in the form of template UserObjects.


Drawable subclasses from Object so you can get all the functionality you want for there.


Robert.


On 24 August 2017 at 10:52, Antoine Rennuit < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Dear OSG forum,

I am currently implementing picking and selection inside my app. I have setup everything up to the point where I can know the osgUtil::Intersection and with it the Drawable that was picked.

Now, what I am really interested in is not the Drawable or Node itself but the object it represents in my DataBase. Hence I would like to associate my OSG rendered objects with my DataBase objects. To that intent, is there something like a custom data in the Drawables in which I could store a pointer to my DataBase objects? Or should I handle this association and lookup myself?

Thank you!

Antoine

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=71520#71520





_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
arennuit
User


Joined: 06 Dec 2013
Posts: 44

PostPosted: Thu Aug 24, 2017 12:25 pm    Post subject:
Reply with quote

That's awesome!

Thanks a lot Robert,

Antoine.
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 Passing input to viewer/camera (using... antiro42 General 2 Sat Sep 16, 2017 11:07 am View latest post
No new posts Passing input to viewer/camera (using... antiro42 General 0 Sat Sep 16, 2017 11:06 am View latest post
No new posts PHYSFS / VFS - How to make a custom o... Steal General 4 Mon Jul 10, 2017 1:28 pm View latest post
No new posts PHYSFS / VFS - How to make a custom o... Steal General 0 Mon Jul 10, 2017 1:18 pm View latest post
No new posts Render Geographic/Projected coordinat... Bruno Oliveira General 0 Mon Jun 05, 2017 2:58 pm 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