Re: [osg-users] How to check if pagedLod already exists in databasepager with same filename

2016-11-30 Thread Simone Rapposelli
Hi Rafa,

thank you for your advice, but trying to replace PagedLod with ProxyNode seems 
that readNode get called also for nodes apparently very far.
I don't know why this happens, maybe there is some mechanism I am 
misunderstanding or missing, but I haven't found any example with ProxyNodes 
and I can't go beyond for time reasons.
At any rate, at the moment the current solution with PagedLods is more than 
acceptable for me.
Thank you all for your precious support!


Rafa Gaitan wrote:
> Hi Simone,
> 
> If you just want to use the PagedLOD as a kind of delayed system for loading 
> nodes (but not unload them from memory), I suggest you use instead de 
> osg::ProxyNode, it defers the loading to the DatabasePager but once loaded is 
> not unloaded anymore. If your database is well balanced the CullVisitor will 
> ensure good framerate when the node is not in the frustrum.
> 
> 
> Just my two cents,
> 
> 
> Rafa.
> 
> 
> 
> 
> El mar., 29 nov. 2016 a las 15:43, Simone Rapposelli (< ()>) escribió:
> 
> 
> > Hi Robert,  by increasing TargetMaximumNumberOfPageLOD the problem of 
> > having to reload the same PageLod disappears, so it works!! Thank you!   
> > robertosfield wrote: > Hi Simone, > > On 29 November 2016 at 12:37, Simone 
> > Rapposelli > <> wrote: > > > thank you for your fast reply. > > My problem 
> > is that osgDB::ReaderWriter::ReadResult readNode(const std::string 
> > , const osgDB::ReaderWriter::Options *options) gets called even if 
> > a PagedLod with the same fileName has been previously loaded: for example, 
> > this happens if I move to any position on the viewer and then come back. > 
> > > Thus, inside this function I need to check if any of the PagedLod 
> > currently loaded in DatabasePager has the same fileName of the passed 
> > argument: in this case I could avoid to reload data already in memory. > > 
> > > > The PagedLOD/DatabasePager paging scheme is designed to expire and > 
> > reload subgraphs, it *crucial* to load balancing.  If you cached all > 
> > loaded subgraphs your memory would rapidly
  be overwhelmed and your > system would grind to a halt.  The very scheme you 
are trying to > defeat is one of the best assets of the OSG, you *absolutely* 
do not > want to be breaking this mechanism. > > Now, if you the defaults the 
paging scheme uses for load balancing is > too conservative w.r.t the number of 
PagedLOD it will aim for in > memory at one time you can adjust it to be higher 
simply by setting > the TargetMaximumNumberOfPageLOD parameter, from the 
DatabasePager > header you'll see: > > /** Set the target maximum number of 
PagedLOD to maintain in memory. > * Note, if more than the target number are 
required for > rendering of a frame then these active PagedLOD are excempt from 
being > expiried. > * But once the number of active drops back below the target 
> the inactive PagedLOD will be trimmed back to the target number.*/ > void 
setTargetMaximumNumberOfPageLOD(unsigned int target) { > 
_targetMaximumNumberOfPageLOD = target; } > > You can also set the default 
 value using the env var OSG_MAX_PAGEDLOD > i,e under bash: > > export 
OSG_MAX_PAGEDLOD=2000 > osgviewer mypageddatabase.osgb > > You can get a 
listing of the env vars supported by doing: > > osgviewer --help-env > > 
Robert. > ___ > osg-users mailing 
list > >  () 
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 
(http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org) 
> 
> 
>  --
> Post generated by Mail2Forum


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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to check if pagedLod already exists in databasepager with same filename

2016-11-29 Thread Simone Rapposelli
Hi Robert,

by increasing TargetMaximumNumberOfPageLOD the problem of having to reload the 
same PageLod disappears, so it works!!
Thank you!


robertosfield wrote:
> Hi Simone,
> 
> On 29 November 2016 at 12:37, Simone Rapposelli
> <> wrote:
> 
> > thank you for your fast reply.
> > My problem is that osgDB::ReaderWriter::ReadResult readNode(const 
> > std::string , const osgDB::ReaderWriter::Options *options) gets 
> > called even if a PagedLod with the same fileName has been previously 
> > loaded: for example, this happens if I move to any position on the viewer 
> > and then come back.
> > Thus, inside this function I need to check if any of the PagedLod currently 
> > loaded in DatabasePager has the same fileName of the passed argument: in 
> > this case I could avoid to reload data already in memory.
> > 
> 
> The PagedLOD/DatabasePager paging scheme is designed to expire and
> reload subgraphs, it *crucial* to load balancing.  If you cached all
> loaded subgraphs your memory would rapidly be overwhelmed and your
> system would grind to a halt.  The very scheme you are trying to
> defeat is one of the best assets of the OSG, you *absolutely* do not
> want to be breaking this mechanism.
> 
> Now, if you the defaults the paging scheme uses for load balancing is
> too conservative w.r.t the number of PagedLOD it will aim for in
> memory at one time you can adjust it to be higher simply by setting
> the TargetMaximumNumberOfPageLOD parameter, from the DatabasePager
> header you'll see:
> 
> /** Set the target maximum number of PagedLOD to maintain in memory.
> * Note, if more than the target number are required for
> rendering of a frame then these active PagedLOD are excempt from being
> expiried.
> * But once the number of active drops back below the target
> the inactive PagedLOD will be trimmed back to the target number.*/
> void setTargetMaximumNumberOfPageLOD(unsigned int target) {
> _targetMaximumNumberOfPageLOD = target; }
> 
> You can also set the default value using the env var OSG_MAX_PAGEDLOD
> i,e under bash:
> 
> export OSG_MAX_PAGEDLOD=2000
> osgviewer mypageddatabase.osgb
> 
> You can get a listing of the env vars supported by doing:
> 
> osgviewer --help-env
> 
> Robert.
> ___
> osg-users mailing list
> 
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 
>  --
> Post generated by Mail2Forum


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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to check if pagedLod already exists in databasepager with same filename

2016-11-29 Thread Simone Rapposelli
Hi Laurence,

thank you, if you mean somthing like 
options->setObjectCacheHint(osgDB::Options::CACHE_NODES), I have just tried 
with no luck...

Voerman, L. wrote:
> would that not just replicate the osg filecache? readNode should just return 
> the pointer to the data with readResult FILE_LOADED_FROM_CACHEregards, 
> Laurens.
> 
> 
> On Tue, Nov 29, 2016 at 1:56 PM, Trajce Nikolov NICK < ()> wrote:
> 
> > Hi Simone,
> > 
> > just a fast thought ... Maybe you make a simple std::map to keep track of 
> > what has been loaded and what is new
> > 
> > 
> > On Tue, Nov 29, 2016 at 1:37 PM, Simone Rapposelli < ()> wrote:
> > 
> > > Hi Robert,
> > > 
> > > thank you for your fast reply.
> > > My problem is that osgDB::ReaderWriter::ReadResult readNode(const 
> > > std::string , const osgDB::ReaderWriter::Options *options) gets 
> > > called even if a PagedLod with the same fileName has been previously 
> > > loaded: for example, this happens if I move to any position on the viewer 
> > > and then come back.
> > > Thus, inside this function I need to check if any of the PagedLod 
> > > currently loaded in DatabasePager has the same fileName of the passed 
> > > argument: in this case I could avoid to reload data already in memory.
> > > 
> > > Thank you!
> > > 
> > > Cheers,
> > > Simone
> > > 
> > > --
> > > Read this topic online here:
> > > http://forum.openscenegraph.org/viewtopic.php?p=69524#69524 
> > > (http://forum.openscenegraph.org/viewtopic.php?p=69524#69524)
> > > 
> > > 
> > > 
> > > 
> > > 
> > > ___
> > > osg-users mailing list
> > >  ()
> > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 
> > > (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
> > > 
> > > 
> > > 
> > 
> > 
> > 
> > 
> > 
> > 
> > -- 
> > trajce nikolov nick
> > 
> > 
> > 
> > ___
> > osg-users mailing list
> >  ()
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 
> > (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
> > 
> > 
> 
> 
>  --
> Post generated by Mail2Forum


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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to check if pagedLod already exists in databasepager with same filename

2016-11-29 Thread Simone Rapposelli
Hi Trajce,

thank you, but the problem is that even if I can keep track of new PagedLods, 
it is not sufficient because DatabasePager unloads no more used PagedLods and 
there is no way (or at least I don't know how) to know which they are.


Trajce Nikolov NICK wrote:
> Hi Simone,
> 
> just a fast thought ... Maybe you make a simple std::map to keep track of 
> what has been loaded and what is new
> 
> 
> On Tue, Nov 29, 2016 at 1:37 PM, Simone Rapposelli < ()> wrote:
> 
> > Hi Robert,
> > 
> > thank you for your fast reply.
> > My problem is that osgDB::ReaderWriter::ReadResult readNode(const 
> > std::string , const osgDB::ReaderWriter::Options *options) gets 
> > called even if a PagedLod with the same fileName has been previously 
> > loaded: for example, this happens if I move to any position on the viewer 
> > and then come back.
> > Thus, inside this function I need to check if any of the PagedLod currently 
> > loaded in DatabasePager has the same fileName of the passed argument: in 
> > this case I could avoid to reload data already in memory.
> > 
> > Thank you!
> > 
> > Cheers,
> > Simone
> > 
> > --
> > Read this topic online here:
> > http://forum.openscenegraph.org/viewtopic.php?p=69524#69524 
> > (http://forum.openscenegraph.org/viewtopic.php?p=69524#69524)
> > 
> > 
> > 
> > 
> > 
> > ___
> > osg-users mailing list
> >  ()
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 
> > (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
> > 
> > 
> > 
> 
> 
> 
> 
> -- 
> trajce nikolov nick
> 
>  --
> Post generated by Mail2Forum


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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to check if pagedLod already exists in databasepager with same filename

2016-11-29 Thread Simone Rapposelli
Hi Robert,

thank you for your fast reply.
My problem is that osgDB::ReaderWriter::ReadResult readNode(const std::string 
, const osgDB::ReaderWriter::Options *options) gets called even if a 
PagedLod with the same fileName has been previously loaded: for example, this 
happens if I move to any position on the viewer and then come back.
Thus, inside this function I need to check if any of the PagedLod currently 
loaded in DatabasePager has the same fileName of the passed argument: in this 
case I could avoid to reload data already in memory.

Thank you!

Cheers,
Simone

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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] How to check if pagedLod already exists in databasepager with same filename

2016-11-29 Thread Simone Rapposelli
Hi,

I need to check if a pagedLod with a given fileName has been already loaded in 
the databasepager, in order to avoid to read it again from file.
My ideal sollution would be to access to the current pagedLod list from inside 
the osgDB::ReaderWriter::ReadResult readNode(const std::string , const 
osgDB::ReaderWriter::Options *options) const, but I can't understand if is 
possible and in case how.

Thank you!

Cheers,
Simone

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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] How to get points lying on a plane cutting a point cloud?

2016-10-08 Thread Simone Rapposelli
Hi,

I have a point cloud colored by intensity values and I need to extract all the 
points lying on a defined cutting plane or, even better, all the points inside 
a defined parallelepiped.

I guess that PlaneIntersector should be the right way, but it's not clear to me 
how to use Polytope.
Moreover, I have another question: is it possible to get the color of the 
points lying on the plane?Because it seems to me that intersector returns only 
the coordinates.

Thank you!

Cheers,
Simone

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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Force redraw of PagedLOD nodes

2016-08-01 Thread Simone Rapposelli
Thank you, I will try to follow your suggestions.

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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Force redraw of PagedLOD nodes

2016-08-01 Thread Simone Rapposelli
First of all thank you for your reply.

I have a point cloud structured in octree, where each node (PagedLOD) of the 
scene contains a part of the cloud which show points colored by their 
intensities using a gray scale (0: black --> 1: white).
What I need is to let the user to show points colored by their elevation (z 
value) when he push a button in a toolbar.

Nodes are loaded using osgDB::readNodeFile(path, myOptions), where myOptions is 
an object of a class I have derived from osgDB::Options and in which I have 
included some parameters that allow to set the color mode (elevation color or 
gray scale).
So, when I need to switch to the evelation view mode, I update some parameters 
in node options using setDatabaseOptions method of my PagedLOD node and this 
works fine.

The problem is that the colors on the scene are updated only when I move from 
the current position, while I need to automatically refresh colors from the 
same camera position.

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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Force redraw of PagedLOD nodes

2016-08-01 Thread Simone Rapposelli
Hi,

I am trying to force the redraw of PagedLOD nodes.
My need is to change the color of these nodes when the user push a button, but 
the only way I get it is to use the following hack:
1) set new position far from the current, using 
viewer->getCameraManipulator()->setHomePosition...
2) execute viewer->frame() to update the viewer
3) set the original position viewer->getCameraManipulator()->setHomePosition

It seems like the DatabasePager keeps a cache (or something similar) that I 
don't know if and how to clear, in order to redraw the scene. 
I don't think my method is the right way, moreover sometimes (but I don't know 
why...) the view is not refreshed. Sorry for my possible confusion, but can you 
please give me some hints?

Cheers,
Simone

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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Up vectors in setHomePosition with FirstPersonManipulator doesn't seems to affect camera view changes

2016-05-18 Thread Simone Rapposelli
Hi Robert,

first of all thank you for your reply.
I am already able to set the correct position by using sethomeposition and then 
calling home, but my problem is that I need to set a specific "up" vector: I 
have tried any possible setting but my camera rest always in the default 
(0,0,1) orientation (I didn't specify that I need to show a point cloud in 
perspective view from the ground).
By using for example TrackBallManipulator instead it works, so it seems that is 
a problem of this manipulator that doesn't allow to set up vector.
Is there a manipulator similar to FirstPersonManipulator that allow to set the 
"up" vector?
Thank you again

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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Up vectors in setHomePosition with FirstPersonManipulator doesn't seems to affect camera view changes

2016-05-17 Thread Simone Rapposelli
Hi,

I am newbie, so please excuse me for my possible blunders...

I am trying to set eye, center and up vector in setHomePosition of a 
FirstPersonManipulator.
It works correctly but if I set whatever components in the "up" vector, 
anything change in the viewer (I would like to have such a roll behavior).
What am I doing wrong? 

Thank you!

Cheers,
Simone :'

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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org