<div dir="ltr">Did you ask Ben himself?<div><br></div><div>He's moving to Hawaii just now, but might be able to comment. I can ping him if you don't get an answer here.</div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Sep 13, 2018 at 7:48 AM Herman Varma <<a href="mailto:hermanvarma@eastlink.ca">hermanvarma@eastlink.ca</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello I am having trouble porting Ben Discoe’s VTP software from openSceneGraph-3.4.0 to osg-3.6.2<br>
<br>
The problem lies in replacing the META_object with a macro in shadowTechnique.h as depicted below.<br>
<br>
Can someone point out where the problem is.<br>
<br>
/** CSimpleInterimShadowTechnique provides an implementation of a depth map shadow tuned to the needs of VTP.*/<br>
<br>
class CSimpleInterimShadowTechnique : public osgShadow::ShadowTechnique<br>
{<br>
public:<br>
<br>
// working ********************** in opemSceneGraph-3.4.0<br>
// CSimpleInterimShadowTechnique();<br>
// CSimpleInterimShadowTechnique(const <br>
// CSimpleInterimShadowTechnique& es, const osg::CopyOp& <br>
// copyop=osg::CopyOp::SHALLOW_COPY);<br>
// META_Object(osgShadow, CSimpleInterimShadowTechnique);<br>
//***********************************************************<br>
<br>
// not working *********************in opemSceneGraph-3.6.2<br>
CSimpleInterimShadowTechnique();<br>
CSimpleInterimShadowTechnique(const CSimpleInterimShadowTechnique& es, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);<br>
<br>
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const CSimpleInterimShadowTechnique*>(obj) != NULL; } \<br>
virtual const char* libraryName() const { return "osgShadow"; }\<br>
virtual const char* className() const { return "CSimpleInterimShadowTechnique"; }<br>
<br>
<br>
//**************************************************************<br>
<br>
<br>
In the new implementation I am getting a C2259 error<br>
<br>
2>c:\vtp_vsc\terrainsdk\vtlib\vtosg\nodeosg.cpp(1026): error C2259: 'CSimpleInterimShadowTechnique': cannot instantiate abstract class<br>
<br>
2>c:\vtp_vsc\terrainsdk\vtlib\vtosg\nodeosg.cpp(1026): note: due to following members:<br>
<br>
2>c:\vtp_vsc\terrainsdk\vtlib\vtosg\nodeosg.cpp(1026): note: 'osg::Object *osg::Object::cloneType(void) const': is abstract<br>
<br>
2>c:\apis\openscenegraph-3.6.2\build\include\osg\object(80): note: see declaration of 'osg::Object::cloneType'<br>
<br>
2>c:\vtp_vsc\terrainsdk\vtlib\vtosg\nodeosg.cpp(1026): note: 'osg::Object *osg::Object::clone(const osg::CopyOp &) const': is abstract<br>
<br>
2>c:\apis\openscenegraph-3.6.2\build\include\osg\object(84): note: see declaration of 'osg::Object::clone'<br>
<br>
2>c:\vtp_vsc\terrainsdk\vtlib\vtosg\nodeosg.cpp(1026): note: 'void osgShadow::ShadowTechnique::resizeGLObjectBuffers(unsigned int)': is abstract<br>
<br>
2>c:\apis\openscenegraph-3.6.2\build\include\osgshadow\shadowtechnique(66): note: see declaration of 'osgShadow::ShadowTechnique::resizeGLObjectBuffers'<br>
2>c:\vtp_vsc\terrainsdk\vtlib\vtosg\nodeosg.cpp(1026): note: 'void osgShadow::ShadowTechnique::releaseGLObjects(osg::State *) const': is abstract<br>
2>c:\apis\openscenegraph-3.6.2\build\include\osgshadow\shadowtechnique(71): note: see declaration of 'osgShadow::ShadowTechnique::releaseGLObjects'<br>
<br>
The error manifests is in the vtShadow section of nodeOSG.cpp<br>
<br>
//////////////////////////////////////////////////////////////////////<br>
// vtShadow<br>
//<br>
<br>
vtShadow::vtShadow(const int ShadowTextureUnit, int LightNumber) :<br>
m_ShadowTextureUnit(ShadowTextureUnit), m_LightNumber(LightNumber)<br>
{<br>
setReceivesShadowTraversalMask(ReceivesShadowTraversalMask);<br>
setCastsShadowTraversalMask(CastsShadowTraversalMask);<br>
<br>
#if VTLISPSM<br>
osg::ref_ptr<CLightSpacePerspectiveShadowTechnique> pShadowTechnique = new CLightSpacePerspectiveShadowTechnique;<br>
// No need to set the BaseTextureUnit as the default of zero is OK for us<br>
// But the ShadowTextureUnit might be different (default 1)<br>
pShadowTechnique->setShadowTextureUnit(m_ShadowTextureUnit);<br>
pShadowTechnique->setLightNumber(m_LightNumber);<br>
#else<br>
<br>
//errorC2259 cannot instantiate abstract class in openSceneGraph-3.6.2 <br>
//working in osg-3.4.0<br>
<br>
osg::ref_ptr<CSimpleInterimShadowTechnique> pShadowTechnique = new <br>
<br>
#endif<br>
<br>
#if !VTLISPSM<br>
#if VTDEBUGSHADOWS<br>
// add some instrumentation<br>
pShadowTechnique->m_pParent = this;<br>
#endif<br>
<br>
pShadowTechnique->SetLightNumber(LightNumber);<br>
pShadowTechnique->SetShadowTextureUnit(m_ShadowTextureUnit);<br>
pShadowTechnique->SetShadowSphereRadius(50.0);<br>
#endif<br>
setShadowTechnique(pShadowTechnique.get());<br>
<br>
SetOsgNode(this);<br>
}<br>
<br>
Help would be appreciated<br>
<br>
<br>
Thank you!<br>
<br>
Cheers,<br>
<br>
Herman Varma<br>
Head of Cartographic Research<br>
Bedford Institute of Oceanography<br>
<br>
------------------<br>
Read this topic online here:<br>
<a href="http://forum.openscenegraph.org/viewtopic.php?p=74733#74733" rel="noreferrer" target="_blank">http://forum.openscenegraph.org/viewtopic.php?p=74733#74733</a><br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div style="text-align:center">Chris 'Xenon' Hanson, omo sanza lettere. Xenon@AlphaPixel.com <a href="http://www.alphapixel.com/" target="_blank">http://www.alphapixel.com/</a></div><div style="text-align:center">Training • Consulting • Contracting</div><div style="text-align:center">3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL</div><div style="text-align:center"><span style="font-size:12.8000001907349px">Legal/IP •</span><span style="font-size:12.8000001907349px"> </span><span style="font-size:12.8000001907349px">Forensics •</span><span style="font-size:12.8000001907349px"> </span>Imaging <span style="font-size:12.8px">•</span><span style="font-size:12.8px"> </span><span style="font-size:12.8px">UAVs </span><span style="font-size:12.8px">• GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile • iPhone/iPad/iOS • Android</span></div><div style="text-align:center"><a href="https://twitter.com/alphapixel" target="_blank">@alphapixel</a> <a href="http://facebook.com/alphapixel" target="_blank">facebook.com/alphapixel</a> (775) 623-PIXL [7495]<br></div></div></div></div></div></div>