[osg-users] META_OBJECT

2013-04-28 Thread Sajjadul Islam
Hi forum,

I am extending a osg::Object as follows:


Code:

class LIBRARY_EXPORT osgOpenCLContext : public osg::Object
{
public:
osgOpenCLContext();

META_OBJECT(osgOpenCL,osgOpenCLContext);


bool setupOsgOpenCLAndViewer(osgViewer::ViewerBase 
viewer,
 int ctxID = -1);

~osgOpenCLContext();

  };




And i am getting the following error among many others:


Code:

[ 62%] Building CXX object 
src/osgOpenCL/CMakeFiles/osgOpenCL.dir/osgOpenCLContext.cpp.o
In file included from 
/home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/src/osgOpenCL/osgOpenCLContext.cpp:7:0:
/home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/include/osgOpenCL/osgOpenCLContext:22:16:
 error: ‘osgOpenCL’ is not a type
/home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/include/osgOpenCL/osgOpenCLContext:22:42:
 error: ISO C++ forbids declaration of ‘META_OBJECT’ with no type [-fpermissive]





Any idea folks ? i used to know that META_Object and META_Node are just 
convenience macro's that help streamline
the writing of subclasses, have a look at their definition to see what they
do.  The methods that these macros implement are useful for implementing IO
and other ops that require richer RTTI info that C++ provides by default. 

Please fill out if i miss anything in the process

Thank you!

Cheers,
Sajjadul

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





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


[osg-users] osgSim::LighPoint radius

2013-04-28 Thread Trajce Nikolov NICK
Hi Community,

I have faced a problem with the _radius from LighPoint. The showcase is to
control all of the LightPoint attributes in run tim (dynamiclly change
intensity, color ...these work just fine). However the radius can be
changed on LightPoint re-creation,only and its can not be changed in
run-time. Some hints?

Thanks a bunch.

Nick

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


Re: [osg-users] Exporting HeightFields in OSG

2013-04-28 Thread Trajce Nikolov NICK
Hi Martin,

try exporting to OpenFlight (there are various 3d content creation tools
like LightWave, 3D Max, Creator ) that support this format. I am not sure
the obj plugin has exporting function although I think I have seen some
submissions (from Cedric I think) for the obj format. The extension is flt

Hope this helps,

Nick


On Sat, Apr 27, 2013 at 6:33 PM, Martin Záleta zal...@atlas.sk wrote:

 Hi,

 I was hoping I could export a terrain geometry represented by a
 procedurally generated HeightField into an .obj file or similar, so I could
 open it as a polygonal mesh in some modelling program or whatever, but
 sadly, it doesn't seem to work that way. This line

 Code:
 writeNodeFile(*terrainTileGeode,
 ..\\res\\export\\terrain_groundtile.obj);


 just returns me a rather empty object file, while other geometry I use
 seems to be exporting just fine.

 So, is there any way to export HeightFields as polygonal meshes in OSG? My
 aim is to import these procedural terrains in other rendering engines
 afterwards, so it would be rather convenient for me.

 Thank you!

 Cheers,
 Martin

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





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




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


Re: [osg-users] META_OBJECT

2013-04-28 Thread Paul Martz
I'm not sure what META_OBJECT (all caps) is, or where it's defined. Did
you intend to use META_Object from include/osg/Object instead?

One other possible issue I noted: Assuming you intended to use META_Object,
I believe you are required to implement the copy constructor, and I don't
see that in your code...


On Sun, Apr 28, 2013 at 6:38 AM, Sajjadul Islam dosto.wa...@gmail.comwrote:

 Hi forum,

 I am extending a osg::Object as follows:


 Code:

 class LIBRARY_EXPORT osgOpenCLContext : public osg::Object
 {
 public:
 osgOpenCLContext();

 META_OBJECT(osgOpenCL,osgOpenCLContext);


 bool setupOsgOpenCLAndViewer(osgViewer::ViewerBase
 viewer,
  int ctxID = -1);

 ~osgOpenCLContext();

   };




 And i am getting the following error among many others:


 Code:

 [ 62%] Building CXX object
 src/osgOpenCL/CMakeFiles/osgOpenCL.dir/osgOpenCLContext.cpp.o
 In file included from
 /home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/src/osgOpenCL/osgOpenCLContext.cpp:7:0:
 /home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/include/osgOpenCL/osgOpenCLContext:22:16:
 error: ‘osgOpenCL’ is not a type
 /home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/include/osgOpenCL/osgOpenCLContext:22:42:
 error: ISO C++ forbids declaration of ‘META_OBJECT’ with no type
 [-fpermissive]





 Any idea folks ? i used to know that META_Object and META_Node are just
 convenience macro's that help streamline
 the writing of subclasses, have a look at their definition to see what they
 do.  The methods that these macros implement are useful for implementing IO
 and other ops that require richer RTTI info that C++ provides by default.

 Please fill out if i miss anything in the process

 Thank you!

 Cheers,
 Sajjadul

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





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




-- 
Paul Martz
Skew Matrix Software LLC
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] META_OBJECT

2013-04-28 Thread Sajjadul Islam
Hi,

If you take a look into the Resource of osgCompute you will also find that they 
have declared META_OBJECT as all caps and they have the declared the copy 
constructor in the private scope and they are not defined in the source, i find 
this strange though.But It compiled fine. 

Now i am extending the this plugin and i am having error while trying to 
compile the following class. (Now i am including the while class definition).


Code:

#ifndef OSGOPENCL_CONTEXT
#define OSGOPENCL_CONTEXT 1

#include osgOpenCL/osgOpenCLDefines


#include osg/GL
#include osg/ref_ptr
#include osg/Referenced
#include osgViewer/ViewerBase

#include osgCompute/Export
#include osgCompute/Callback


namespace osgOpenCL
{
class LIBRARY_EXPORT osgOpenCLContext : public osg::Object
{
public:
osgOpenCLContext();

META_OBJECT(osgOpenCL,osgOpenCLContext);

bool setupOsgOpenCLAndViewer(osgViewer::ViewerBase 
viewer,
 int ctxID = -1);

~osgOpenCLContext();

public:


 //typedef the list of the device within the context
 //IN THIS INITIAL VERSION WE ARE ONLY CONSIDERING ONE 
DEVICE ON ONE CONTEXT
 //SO COMMENT THE FOLLOWING 
 //typedef 
std::vectorosg::ref_ptrosgOpenCL::osgOpenCLDevice  osgOpenCLDeviceList;

 //declare the device list
 //osgOpenCLDeviceList m_osgOpenCLDeviceList;

 //hold the current OpenCL context
 cl_context m_clContext;

 //hold the current platform id
 cl_platform_id m_clPlatform;

 //hold the current device id
 cl_device_id m_clDevice;

 //hold the command queue for the device
 cl_command_queue m_clCommandQueue;

 private:
 // Copy constructor and operator should not be called
 osgOpenCLContext(const osgOpenCLContext ,const 
osg::CopyOp ) {}
 osgOpenCLContext operator=(const osgOpenCLContext) { 
return *this; } 

};
}


#endif





Any more idea to get around this issue?

Cheers,
Sajjadul

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





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


Re: [osg-users] META_OBJECT

2013-04-28 Thread Sajjadul Islam
Hi again,

I should have posted the whole compilation error in the previous post. Here it 
goes:


Code:

sajjad@sajjad-G74Sx:~/Downloads/OpenSceneGraph/osgCompute/osgCompute$ make
[ 15%] Built target osgCompute
[ 25%] Built target osgCuda
[ 32%] Built target osgCudaUtil
[ 55%] Built target osgdb_serializers_osgCuda
[ 57%] Built target osgCudaStats
[ 60%] Built target osgCudaInit
[ 62%] Building CXX object 
src/osgOpenCL/CMakeFiles/osgOpenCL.dir/osgOpenCLContext.cpp.o
In file included from 
/home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/src/osgOpenCL/osgOpenCLContext.cpp:10:0:
/home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/include/osgOpenCL/osgOpenCLContext:23:16:
 error: ‘osgOpenCL’ is not a type
/home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/include/osgOpenCL/osgOpenCLContext:23:42:
 error: ISO C++ forbids declaration of ‘META_OBJECT’ with no type [-fpermissive]
/home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/include/osgOpenCL/osgOpenCLContext:23:4:
 error: cannot declare parameter ‘anonymous’ to be of abstract type 
‘osgOpenCL::osgOpenCLContext’
/home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/include/osgOpenCL/osgOpenCLContext:18:23:
 note:   because the following virtual functions are pure within 
‘osgOpenCL::osgOpenCLContext’:
/usr/local/include/osg/Object:71:25: note:  virtual osg::Object* 
osg::Object::cloneType() const
/usr/local/include/osg/Object:75:25: note:  virtual osg::Object* 
osg::Object::clone(const osg::CopyOp) const
/usr/local/include/osg/Object:82:29: note:  virtual const char* 
osg::Object::libraryName() const
/usr/local/include/osg/Object:86:29: note:  virtual const char* 
osg::Object::className() const
/home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/src/osgOpenCL/osgOpenCLContext.cpp:
 In member function ‘bool 
osgOpenCL::osgOpenCLContext::setupOsgOpenCLAndViewer(osgViewer::ViewerBase, 
int)’:
/home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/src/osgOpenCL/osgOpenCLContext.cpp:103:26:
 error: expected type-specifier before ‘GraphicsWindowX11’
/home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/src/osgOpenCL/osgOpenCLContext.cpp:103:26:
 error: expected ‘’ before ‘GraphicsWindowX11’
/home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/src/osgOpenCL/osgOpenCLContext.cpp:103:26:
 error: expected ‘(’ before ‘GraphicsWindowX11’
/home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/src/osgOpenCL/osgOpenCLContext.cpp:103:26:
 error: ‘GraphicsWindowX11’ was not declared in this scope
/home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/src/osgOpenCL/osgOpenCLContext.cpp:103:26:
 note: suggested alternative:
/usr/local/include/osgViewer/api/X11/GraphicsWindowX11:30:24: note:   
‘osgViewer::GraphicsWindowX11’
/home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/src/osgOpenCL/osgOpenCLContext.cpp:103:44:
 error: expected primary-expression before ‘’ token
/home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/src/osgOpenCL/osgOpenCLContext.cpp:103:50:
 error: expected ‘)’ before ‘;’ token
/home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/src/osgOpenCL/osgOpenCLContext.cpp:121:51:
 error: ‘class osg::GraphicsContext’ has no member named ‘getGLXContext’
/home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/src/osgOpenCL/osgOpenCLContext.cpp:122:39:
 error: ‘class osg::GraphicsContext’ has no member named ‘getDisplay’
make[2]: *** [src/osgOpenCL/CMakeFiles/osgOpenCL.dir/osgOpenCLContext.cpp.o] 
Error 1
make[1]: *** [src/osgOpenCL/CMakeFiles/osgOpenCL.dir/all] Error 2
make: *** [all] Error 2





Thank you!

Cheers,
Sajjadul

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





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


Re: [osg-users] META_OBJECT

2013-04-28 Thread Paul Martz
Ah. I see now that you're asking about how to use a macro that is defined
in a project external to OSG. Sorry for my confusion.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Exporting HeightFields in OSG

2013-04-28 Thread Martin Záleta
Hi,

Sadly, exporting a HeightField geometry into .flt likewise produces just an 
almost empty file. I kinda suppose it's because the geometry in HeightFields 
isn't represented by polygonal meshes, so OSG can't really do anything to 
export this data straight away other that maybe except save those values into 
an image file like a heightmap. Still, it's just a guess though, so if there's 
any other way, just let me know.

Thanks anyway!

Cheers,
Martin

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





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


Re: [osg-users] META_OBJECT

2013-04-28 Thread Thomas Hogarth
hi 

Posting what META_OBJECT defines will help, but the clue is here

/home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/include/osgOpenCL/osgOpenCLContext:23:4:
 error: cannot declare parameter ?anonymous? to be of abstract type 
?osgOpenCL::osgOpenCLContext?
/home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/include/osgOpenCL/osgOpenCLContext:18:23:
 note:   because the following virtual functions are pure within 
?osgOpenCL::osgOpenCLContext?:

You have some pure virtual functions somewhere, then other code is trying to 
allocate an instance of a class with pure virtual functions which is not 
allowed.

Tom

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





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


Re: [osg-users] META_OBJECT

2013-04-28 Thread rocco martino
Hi all,

Those methods are defined by the META_Object macro ( osg/Object header )

Not completely sure because I do not have a great experience with
osgCompute, but I
used the find utility and can't find META_OBJECT (all capitals) in the
osgCompute
trunk dir


Regards,
Martino


2013/4/29 Thomas Hogarth thomas.hoga...@gmail.com

 hi

 Posting what META_OBJECT defines will help, but the clue is here

 /home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/include/osgOpenCL/osgOpenCLContext:23:4:
 error: cannot declare parameter ?anonymous? to be of abstract type
 ?osgOpenCL::osgOpenCLContext?
 /home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/include/osgOpenCL/osgOpenCLContext:18:23:
 note:   because the following virtual functions are pure within
 ?osgOpenCL::osgOpenCLContext?:

 You have some pure virtual functions somewhere, then other code is trying
 to allocate an instance of a class with pure virtual functions which is not
 allowed.

 Tom

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





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

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