From 00cc3a1833bbfe544d310b36ca5b2ef04e02b4ed Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 16 Dec 2002 13:40:58 +0000 Subject: [PATCH] Converted the instance of osgNew and osgDelete back to new and delete as part of depecating the include/osg/MemoryManager --- Make/makedefs | 4 +- include/osg/Array | 8 +- include/osg/CollectOccludersVisitor | 2 +- include/osg/CullStack | 2 +- include/osg/DrawPixels | 4 +- include/osg/Export | 25 ++-- include/osg/GeoSet | 4 +- include/osg/Geometry | 4 +- include/osg/Image | 4 +- include/osg/ImpostorSprite | 4 +- include/osg/Matrix | 4 +- include/osg/MemoryManager | 8 +- include/osg/Node | 25 ++-- include/osg/Object | 2 +- include/osg/PrimitiveSet | 20 +-- include/osg/Shape | 4 +- include/osg/ShapeDrawable | 4 +- include/osg/StateAttribute | 4 +- include/osg/StateSet | 4 +- include/osg/UnitTestFramework | 4 +- include/osgDB/Export | 9 +- include/osgDB/Registry | 4 +- include/osgUtil/CullVisitor | 4 +- include/osgUtil/RenderBin | 4 +- include/osgUtil/RenderGraph | 4 +- include/osgUtil/RenderStage | 6 +- include/osgUtil/RenderStageLighting | 4 +- include/osgUtil/RenderToTextureStage | 4 +- include/osgUtil/SceneView | 2 +- src/Demos/osganimate/osganimate.cpp | 26 ++-- src/Demos/osgbillboard/osgbillboard.cpp | 20 +-- src/Demos/osgclip/osgclip.cpp | 12 +- src/Demos/osgcube/osgcube.cpp | 30 ++--- src/Demos/osgcubemap/osgcubemap.cpp | 8 +- src/Demos/osghangglide/osghangglide.cpp | 6 +- src/Demos/osghud/osghud.cpp | 68 +++++------ src/Demos/osglight/osglight.cpp | 6 +- src/Demos/osglightpoint/osglightpoint.cpp | 22 ++-- src/Demos/osglogo/osglogo.cpp | 32 ++--- src/Demos/osgoccluder/osgoccluder.cpp | 22 ++-- src/Demos/osgparticle/osgparticle.cpp | 30 ++--- src/Demos/osgpbuffer/RenderToTextureStage.h | 4 +- src/Demos/osgpbuffer/osgpbuffer.cpp | 8 +- src/Demos/osgprerender/osgprerender.cpp | 8 +- src/Demos/osgreflect/osgreflect.cpp | 2 +- src/Demos/osgsequence/osgsequence.cpp | 8 +- .../osgshadowtexture/CreateShadowedScene.cpp | 6 +- .../osgshadowtexture/osgshadowtexture.cpp | 12 +- src/Demos/osgshape/osgshape.cpp | 16 +-- src/Demos/osgteapot/osgteapot.cpp | 4 +- src/Demos/osgtext/main.cpp | 114 +++++++++--------- src/Demos/osgtexture2D/osgtexture2D.cpp | 6 +- src/Demos/osgtexture3D/osgtexture3D.cpp | 2 +- src/Demos/osgtxp/TrPageViewer.cpp | 2 +- src/osg/Camera.cpp | 4 +- src/osg/ClearNode.cpp | 2 +- src/osg/ClipNode.cpp | 16 +-- src/osg/CullStack.cpp | 4 +- src/osg/DisplaySettings.cpp | 4 +- src/osg/Drawable.cpp | 2 +- src/osg/GeoSet.cpp | 84 ++++++------- src/osg/Image.cpp | 20 +-- src/osg/ImpostorSprite.cpp | 14 +-- src/osg/LightSource.cpp | 6 +- src/osg/Node.cpp | 2 +- src/osg/Projection.cpp | 6 +- src/osg/StateSet.cpp | 6 +- src/osg/UnitTestFramework.cpp | 4 +- src/osgDB/DynamicLibrary.cpp | 10 +- src/osgDB/Field.cpp | 10 +- src/osgDB/FieldReaderIterator.cpp | 28 ++--- src/osgDB/ReadFile.cpp | 2 +- src/osgDB/Registry.cpp | 4 +- src/osgGA/AnimationPathManipulator.cpp | 2 +- src/osgGA/DriveManipulator.cpp | 14 +-- src/osgGLUT/Viewer.cpp | 58 ++++----- src/osgParticle/ModularEmitter.cpp | 6 +- src/osgParticle/Particle.cpp | 6 +- src/osgParticle/ParticleSystem.cpp | 10 +- src/osgPlugins/geo/ReaderWriterGEO.cpp | 8 +- src/osgPlugins/lwo/Lwo2.cpp | 14 +-- src/osgPlugins/lwo/Lwo2Layer.cpp | 16 +-- src/osgPlugins/lwo/ReaderWriterLWO.cpp | 20 +-- src/osgPlugins/osg/AlphaFunc.cpp | 2 +- src/osgPlugins/osg/AnimationPath.cpp | 2 +- src/osgPlugins/osg/Billboard.cpp | 2 +- src/osgPlugins/osg/BlendFunc.cpp | 4 +- src/osgPlugins/osg/ClearNode.cpp | 4 +- src/osgPlugins/osg/ClipPlane.cpp | 2 +- src/osgPlugins/osg/ColorMask.cpp | 2 +- src/osgPlugins/osg/ColorMatrix.cpp | 2 +- src/osgPlugins/osg/ConvexPlanarOccluder.cpp | 2 +- src/osgPlugins/osg/CullFace.cpp | 2 +- src/osgPlugins/osg/DOFTransform.cpp | 2 +- src/osgPlugins/osg/Depth.cpp | 2 +- src/osgPlugins/osg/Drawable.cpp | 2 +- src/osgPlugins/osg/Fog.cpp | 2 +- src/osgPlugins/osg/FrontFace.cpp | 2 +- src/osgPlugins/osg/GeoSet.cpp | 56 ++++----- src/osgPlugins/osg/Geode.cpp | 2 +- src/osgPlugins/osg/Geometry.cpp | 40 +++--- src/osgPlugins/osg/Group.cpp | 2 +- src/osgPlugins/osg/Image.cpp | 2 +- src/osgPlugins/osg/Impostor.cpp | 2 +- src/osgPlugins/osg/LOD.cpp | 2 +- src/osgPlugins/osg/Light.cpp | 2 +- src/osgPlugins/osg/LightModel.cpp | 2 +- src/osgPlugins/osg/LightSource.cpp | 2 +- src/osgPlugins/osg/LineStipple.cpp | 2 +- src/osgPlugins/osg/LineWidth.cpp | 2 +- src/osgPlugins/osg/Material.cpp | 2 +- src/osgPlugins/osg/Matrix.cpp | 2 +- src/osgPlugins/osg/MatrixTransform.cpp | 6 +- src/osgPlugins/osg/Node.cpp | 4 +- src/osgPlugins/osg/OccluderNode.cpp | 4 +- src/osgPlugins/osg/Point.cpp | 2 +- src/osgPlugins/osg/PolygonMode.cpp | 2 +- src/osgPlugins/osg/PolygonOffset.cpp | 2 +- .../osg/PositionAttitudeTransform.cpp | 2 +- src/osgPlugins/osg/Projection.cpp | 2 +- src/osgPlugins/osg/ReaderWriterOSG.cpp | 2 +- src/osgPlugins/osg/Sequence.cpp | 2 +- src/osgPlugins/osg/ShadeModel.cpp | 2 +- src/osgPlugins/osg/ShapeDrawable.cpp | 2 +- src/osgPlugins/osg/StateSet.cpp | 4 +- src/osgPlugins/osg/Stencil.cpp | 2 +- src/osgPlugins/osg/Switch.cpp | 2 +- src/osgPlugins/osg/TexEnv.cpp | 2 +- src/osgPlugins/osg/TexEnvCombine.cpp | 2 +- src/osgPlugins/osg/TexGen.cpp | 2 +- src/osgPlugins/osg/TexMat.cpp | 2 +- src/osgPlugins/osg/Texture1D.cpp | 2 +- src/osgPlugins/osg/Texture2D.cpp | 4 +- src/osgPlugins/osg/Texture3D.cpp | 2 +- src/osgPlugins/osg/TextureCubeMap.cpp | 2 +- src/osgPlugins/osg/Transform.cpp | 2 +- .../osgParticle/IO_AccelOperator.cpp | 2 +- .../osgParticle/IO_FluidFrictionOperator.cpp | 2 +- .../osgParticle/IO_ForceOperator.cpp | 2 +- .../osgParticle/IO_LinearInterpolator.cpp | 2 +- .../osgParticle/IO_ModularEmitter.cpp | 2 +- .../osgParticle/IO_ModularProgram.cpp | 2 +- .../osgParticle/IO_MultiSegmentPlacer.cpp | 2 +- .../osgParticle/IO_ParticleProcessor.cpp | 2 +- .../osgParticle/IO_ParticleSystem.cpp | 2 +- .../osgParticle/IO_ParticleSystemUpdater.cpp | 4 +- src/osgPlugins/osgParticle/IO_PointPlacer.cpp | 2 +- .../osgParticle/IO_RadialShooter.cpp | 2 +- .../osgParticle/IO_RandomRateCounter.cpp | 2 +- .../osgParticle/IO_SectorPlacer.cpp | 2 +- .../osgParticle/IO_SegmentPlacer.cpp | 2 +- src/osgPlugins/osgText/IO_Font.cpp | 20 +-- src/osgPlugins/osgText/IO_Paragraph.cpp | 2 +- src/osgPlugins/osgText/IO_Text.cpp | 2 +- src/osgPlugins/rgb/ReaderWriterRGB.cpp | 2 +- src/osgSim/LightPointDrawable.cpp | 12 +- src/osgSim/LightPointDrawable.h | 4 +- src/osgSim/LightPointNode.cpp | 4 +- src/osgText/FTBitmapGlyph.cpp | 4 +- src/osgText/FTFace.cpp | 10 +- src/osgText/FTFont.cpp | 6 +- src/osgText/FTGLBitmapFont.cpp | 2 +- src/osgText/FTGLOutlineFont.cpp | 2 +- src/osgText/FTGLPixmapFont.cpp | 2 +- src/osgText/FTGLPolygonFont.cpp | 2 +- src/osgText/FTGLTextureFont.cpp | 12 +- src/osgText/FTGlyphContainer.cpp | 2 +- src/osgText/FTLibrary.cpp | 10 +- src/osgText/FTOutlineGlyph.cpp | 10 +- src/osgText/FTPixmapGlyph.cpp | 4 +- src/osgText/FTPolyGlyph.cpp | 14 +-- src/osgText/FTVectoriser.cpp | 4 +- src/osgText/Font.cpp | 12 +- src/osgText/Paragraph.cpp | 2 +- src/osgUtil/CubeMapGenerator.cpp | 2 +- src/osgUtil/CullVisitor.cpp | 12 +- src/osgUtil/DisplayRequirementsVisitor.cpp | 4 +- src/osgUtil/InsertImpostorsVisitor.cpp | 4 +- src/osgUtil/IntersectVisitor.cpp | 16 +-- src/osgUtil/NvTriStripObjects.cpp | 62 +++++----- src/osgUtil/NvTriStripObjects.h | 4 +- src/osgUtil/Optimizer.cpp | 4 +- src/osgUtil/RenderBin.cpp | 4 +- src/osgUtil/SceneView.cpp | 76 ++++++------ src/osgUtil/SmoothingVisitor.cpp | 2 +- src/osgUtil/TriStripVisitor.cpp | 4 +- 186 files changed, 812 insertions(+), 809 deletions(-) diff --git a/Make/makedefs b/Make/makedefs index 37b022566..c2b26a4b4 100644 --- a/Make/makedefs +++ b/Make/makedefs @@ -162,7 +162,7 @@ ifeq ($(OS),IRIX) -DEBUG:woff=1682 -DEBUG:woff=3303\ -MDupdate $(MAKEDEPEND) OPTF = -O2 - DBGF = -g -DOSG_COMPILE_UNIT_TESTS -DOSG_USE_MEMORY_MANAGER + DBGF = -g -DOSG_COMPILE_UNIT_TESTS SHARED = -shared ARCH = 32 PFLIBS = \ @@ -212,7 +212,7 @@ endif INC += DEF += -W -Wall OPTF = -O2 - DBGF = -g -DOSG_COMPILE_UNIT_TESTS -DOSG_USE_MEMORY_MANAGER + DBGF = -g -DOSG_COMPILE_UNIT_TESTS SHARED = -shared ARCHARGS = LINKARGS = -L/usr/X11R6/lib diff --git a/include/osg/Array b/include/osg/Array index e0ed0ba59..de89e25a0 100644 --- a/include/osg/Array +++ b/include/osg/Array @@ -103,8 +103,8 @@ class TemplateArray : public Array, public std::vector Array(ARRAYTYPE,DataSize,DataType), std::vector(first,last) {} - virtual Object* cloneType() const { return osgNew TemplateArray(); } - virtual Object* clone(const CopyOp& copyop) const { return osgNew TemplateArray(*this,copyop); } + virtual Object* cloneType() const { return new TemplateArray(); } + virtual Object* clone(const CopyOp& copyop) const { return new TemplateArray(*this,copyop); } virtual void accept(ArrayVisitor& av) { av.apply(*this); } virtual void accept(ConstArrayVisitor& av) const { av.apply(*this); } @@ -164,8 +164,8 @@ class TemplateIndexArray : public IndexArray, public std::vector IndexArray(ARRAYTYPE,DataSize,DataType), std::vector(first,last) {} - virtual Object* cloneType() const { return osgNew TemplateIndexArray(); } - virtual Object* clone(const CopyOp& copyop) const { return osgNew TemplateIndexArray(*this,copyop); } + virtual Object* cloneType() const { return new TemplateIndexArray(); } + virtual Object* clone(const CopyOp& copyop) const { return new TemplateIndexArray(*this,copyop); } virtual void accept(ArrayVisitor& av) { av.apply(*this); } virtual void accept(ConstArrayVisitor& av) const { av.apply(*this); } diff --git a/include/osg/CollectOccludersVisitor b/include/osg/CollectOccludersVisitor index 82bda4e3e..7224d184f 100644 --- a/include/osg/CollectOccludersVisitor +++ b/include/osg/CollectOccludersVisitor @@ -22,7 +22,7 @@ class SG_EXPORT CollectOccludersVisitor : public osg::NodeVisitor, public osg::C CollectOccludersVisitor(); virtual ~CollectOccludersVisitor(); - virtual CollectOccludersVisitor* cloneType() const { return osgNew CollectOccludersVisitor(); } + virtual CollectOccludersVisitor* cloneType() const { return new CollectOccludersVisitor(); } virtual void reset(); diff --git a/include/osg/CullStack b/include/osg/CullStack index 2e279f540..5815a4a36 100644 --- a/include/osg/CullStack +++ b/include/osg/CullStack @@ -290,7 +290,7 @@ inline Matrix* CullStack::createOrReuseMatrix(const osg::Matrix& value) } // otherwise need to create new matrix. - osg::Matrix* matrix = osgNew Matrix(value); + osg::Matrix* matrix = new Matrix(value); _reuseMatrixList.push_back(matrix); ++_currentReuseMatrixIndex; return matrix; diff --git a/include/osg/DrawPixels b/include/osg/DrawPixels index 05a0fec2f..e5c928f1b 100644 --- a/include/osg/DrawPixels +++ b/include/osg/DrawPixels @@ -22,9 +22,9 @@ class SG_EXPORT DrawPixels : public Drawable /** Copy constructor using CopyOp to manage deep vs shallow copy.*/ DrawPixels(const DrawPixels& drawimage,const CopyOp& copyop=CopyOp::SHALLOW_COPY); - virtual Object* cloneType() const { return osgNew DrawPixels(); } + virtual Object* cloneType() const { return new DrawPixels(); } - virtual Object* clone(const CopyOp& copyop) const { return osgNew DrawPixels(*this,copyop); } + virtual Object* clone(const CopyOp& copyop) const { return new DrawPixels(*this,copyop); } virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast(obj)!=NULL; } diff --git a/include/osg/Export b/include/osg/Export index 075a2dc65..98659dc81 100644 --- a/include/osg/Export +++ b/include/osg/Export @@ -39,19 +39,20 @@ /* Define NULL pointer value */ #ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif + #ifdef __cplusplus + #define NULL 0 + #else + #define NULL ((void *)0) + #endif #endif -//#include -//#include -//#include -#define osgNew new -#define osgDelete delete -#define osgFree free -#define osgMalloc malloc +#ifdef USE_DEPRECATED_API + + #define osgNew new + #define osgDelete delete + #define osgFree free + #define osgMalloc malloc + +#endif #endif diff --git a/include/osg/GeoSet b/include/osg/GeoSet index b51134ced..2073a35f4 100644 --- a/include/osg/GeoSet +++ b/include/osg/GeoSet @@ -159,9 +159,9 @@ class SG_EXPORT GeoSet : public Drawable /** Copy constructor using CopyOp to manage deep vs shallow copy.*/ GeoSet(const GeoSet& geoset,const CopyOp& copyop=CopyOp::SHALLOW_COPY); - virtual Object* cloneType() const { return osgNew GeoSet(); } + virtual Object* cloneType() const { return new GeoSet(); } - virtual Object* clone(const CopyOp& copyop) const { return osgNew GeoSet(*this,copyop); } + virtual Object* clone(const CopyOp& copyop) const { return new GeoSet(*this,copyop); } virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast(obj)!=NULL; } diff --git a/include/osg/Geometry b/include/osg/Geometry index fc4eb6643..35ff663de 100644 --- a/include/osg/Geometry +++ b/include/osg/Geometry @@ -24,8 +24,8 @@ class SG_EXPORT Geometry : public Drawable /** Copy constructor using CopyOp to manage deep vs shallow copy.*/ Geometry(const Geometry& geometry,const CopyOp& copyop=CopyOp::SHALLOW_COPY); - virtual Object* cloneType() const { return osgNew Geometry(); } - virtual Object* clone(const CopyOp& copyop) const { return osgNew Geometry(*this,copyop); } + virtual Object* cloneType() const { return new Geometry(); } + virtual Object* clone(const CopyOp& copyop) const { return new Geometry(*this,copyop); } virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast(obj)!=NULL; } virtual const char* libraryName() const { return "osg"; } virtual const char* className() const { return "Geometry"; } diff --git a/include/osg/Image b/include/osg/Image index b1f762a2a..2807f7148 100644 --- a/include/osg/Image +++ b/include/osg/Image @@ -44,8 +44,8 @@ class SG_EXPORT Image : public Object /** Copy constructor using CopyOp to manage deep vs shallow copy.*/ Image(const Image& image,const CopyOp& copyop=CopyOp::SHALLOW_COPY); - virtual Object* cloneType() const { return osgNew Image(); } - virtual Object* clone(const CopyOp& copyop) const { return osgNew Image(*this,copyop); } + virtual Object* cloneType() const { return new Image(); } + virtual Object* clone(const CopyOp& copyop) const { return new Image(*this,copyop); } virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast(obj)!=0; } virtual const char* libraryName() const { return "osg"; } virtual const char* className() const { return "Image"; } diff --git a/include/osg/ImpostorSprite b/include/osg/ImpostorSprite index aff30807f..490ddc09b 100644 --- a/include/osg/ImpostorSprite +++ b/include/osg/ImpostorSprite @@ -31,11 +31,11 @@ class SG_EXPORT ImpostorSprite : public Drawable ImpostorSprite(); /** Clone an object of the same type as an ImpostorSprite.*/ - virtual Object* cloneType() const { return osgNew ImpostorSprite(); } + virtual Object* cloneType() const { return new ImpostorSprite(); } /** Clone on ImpostorSprite just returns a clone of type, * since it is not appropriate to share data of an ImpostorSprite.*/ - virtual Object* clone(const CopyOp&) const { return osgNew ImpostorSprite(); } + virtual Object* clone(const CopyOp&) const { return new ImpostorSprite(); } virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast(obj)!=NULL; } virtual const char* libraryName() const { return "osg"; } virtual const char* className() const { return "ImpostorSprite"; } diff --git a/include/osg/Matrix b/include/osg/Matrix index b9ff6e5c7..efd5557a3 100644 --- a/include/osg/Matrix +++ b/include/osg/Matrix @@ -31,8 +31,8 @@ class SG_EXPORT Matrix : public Object float a20, float a21, float a22, float a23, float a30, float a31, float a32, float a33); - virtual Object* cloneType() const { return osgNew Matrix(); } \ - virtual Object* clone(const CopyOp&) const { return osgNew Matrix(*this); } \ + virtual Object* cloneType() const { return new Matrix(); } \ + virtual Object* clone(const CopyOp&) const { return new Matrix(*this); } \ virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast(obj)!=NULL; } \ virtual const char* libraryName() const { return "osg"; } virtual const char* className() const { return "Matrix"; } diff --git a/include/osg/MemoryManager b/include/osg/MemoryManager index 7c7c85f87..d079dbca8 100644 --- a/include/osg/MemoryManager +++ b/include/osg/MemoryManager @@ -129,8 +129,8 @@ extern SG_EXPORT sMStats m_getMemoryStatistics(); // --------------------------------------------------------------------------------------------------------------------------------- - #define osgNew (m_setOwner (__FILE__,__LINE__),false) ? NULL : new - #define osgDelete (m_setOwner (__FILE__,__LINE__),false) ? m_setOwner("",0) : delete + #define new (m_setOwner (__FILE__,__LINE__),false) ? NULL : new + #define delete (m_setOwner (__FILE__,__LINE__),false) ? m_setOwner("",0) : delete #define osgMalloc(sz) m_allocator (__FILE__,__LINE__,m_alloc_malloc,sz) #define osgCalloc(sz) m_allocator (__FILE__,__LINE__,m_alloc_calloc,sz) #define osgRealloc(ptr,sz) m_reallocator(__FILE__,__LINE__,m_alloc_realloc,sz,ptr) @@ -138,8 +138,8 @@ extern SG_EXPORT sMStats m_getMemoryStatistics(); #else // OSG_USE_MEMORY_MANAGER - #define osgNew new - #define osgDelete delete + #define new new + #define delete delete #define osgMalloc(sz) malloc(sz) #define osgCalloc(sz) calloc(sz) #define osgRealloc(ptr,sz) realloc(ptr,sz) diff --git a/include/osg/Node b/include/osg/Node index 4a3e924f1..8b32f7e55 100644 --- a/include/osg/Node +++ b/include/osg/Node @@ -1,6 +1,17 @@ -//C++ header - Open Scene Graph - Copyright (C) 1998-2002 Robert Osfield -//Distributed under the terms of the GNU Library General Public License (LGPL) -//as published by the Free Software Foundation. +//C++ header - OpenSceneGraph - Copyright (C) 1998-2003 Robert Osfield +// +// This file may be distributed and/or modified under the terms of the +// GNU Lesser General Public License (LGPL) version 2.1 as published +// by the Free Software Foundation appearing in the file COPYING included in +// this distribution. +// +// Licensees holding valid OpenSceneGraph Professional Licenses (OSGPL) may use +// this file in accordance with the OpenSceneGraph Professional License +// Agreement provided to you by OpenSceneGraph Professional Services. +// +// See http::/www.openscenegraph.org/licensing.html for details on and pricing +// of the OpenSceneGraph Professional license. + #ifndef OSG_NODE #define OSG_NODE 1 @@ -23,8 +34,8 @@ class Transform; * and accept methods. Use when subclassing from Node to make it * more convinient to define the required pure virtual methods.*/ #define META_Node(library,name) \ - virtual osg::Object* cloneType() const { return osgNew name (); } \ - virtual osg::Object* clone(const osg::CopyOp& copyop) const { return osgNew name (*this,copyop); } \ + virtual osg::Object* cloneType() const { return new name (); } \ + virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new name (*this,copyop); } \ virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast(obj)!=NULL; } \ virtual const char* className() const { return #name; } \ virtual const char* libraryName() const { return #library; } \ @@ -47,10 +58,10 @@ class SG_EXPORT Node : public Object Node(const Node&,const CopyOp& copyop=CopyOp::SHALLOW_COPY); /** clone the an object of the same type as the node.*/ - virtual Object* cloneType() const { return osgNew Node(); } + virtual Object* cloneType() const { return new Node(); } /** return a clone of a node, with Object* return type.*/ - virtual Object* clone(const CopyOp& copyop) const { return osgNew Node(*this,copyop); } + virtual Object* clone(const CopyOp& copyop) const { return new Node(*this,copyop); } /** return true if this and obj are of the same kind of object.*/ virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast(obj)!=NULL; } diff --git a/include/osg/Object b/include/osg/Object index bf84ca6f6..814e996ef 100644 --- a/include/osg/Object +++ b/include/osg/Object @@ -17,7 +17,7 @@ namespace osg { * which are required for all Object subclasses.*/ #define META_Object(library,name) \ virtual osg::Object* cloneType() const { return new name (); } \ - virtual osg::Object* clone(const osg::CopyOp& copyop) const { return osgNew name (*this,copyop); } \ + virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new name (*this,copyop); } \ virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast(obj)!=NULL; } \ virtual const char* libraryName() const { return #library; }\ virtual const char* className() const { return #name; } diff --git a/include/osg/PrimitiveSet b/include/osg/PrimitiveSet index 2a329384d..4e0b6af35 100644 --- a/include/osg/PrimitiveSet +++ b/include/osg/PrimitiveSet @@ -172,8 +172,8 @@ class SG_EXPORT DrawArrays : public PrimitiveSet _first(da._first), _count(da._count) {} - virtual Object* cloneType() const { return osgNew DrawArrays(); } - virtual Object* clone(const CopyOp& copyop) const { return osgNew DrawArrays(*this,copyop); } + virtual Object* cloneType() const { return new DrawArrays(); } + virtual Object* clone(const CopyOp& copyop) const { return new DrawArrays(*this,copyop); } virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast(obj)!=NULL; } virtual const char* libraryName() const { return "osg"; } virtual const char* className() const { return "DrawArrays"; } @@ -235,8 +235,8 @@ class SG_EXPORT DrawArrayLengths : public PrimitiveSet, public VectorSizei VectorSizei(firstItr,lastItr), _first(first) {} - virtual Object* cloneType() const { return osgNew DrawArrayLengths(); } - virtual Object* clone(const CopyOp& copyop) const { return osgNew DrawArrayLengths(*this,copyop); } + virtual Object* cloneType() const { return new DrawArrayLengths(); } + virtual Object* clone(const CopyOp& copyop) const { return new DrawArrayLengths(*this,copyop); } virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast(obj)!=NULL; } virtual const char* libraryName() const { return "osg"; } virtual const char* className() const { return "DrawArrayLengths"; } @@ -300,8 +300,8 @@ class SG_EXPORT DrawElementsUByte : public PrimitiveSet, public VectorUByte PrimitiveSet(DrawElementsUBytePrimitiveType,mode), VectorUByte(first,last) {} - virtual Object* cloneType() const { return osgNew DrawElementsUByte(); } - virtual Object* clone(const CopyOp& copyop) const { return osgNew DrawElementsUByte(*this,copyop); } + virtual Object* cloneType() const { return new DrawElementsUByte(); } + virtual Object* clone(const CopyOp& copyop) const { return new DrawElementsUByte(*this,copyop); } virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast(obj)!=NULL; } virtual const char* libraryName() const { return "osg"; } virtual const char* className() const { return "DrawElementsUByte"; } @@ -340,8 +340,8 @@ class SG_EXPORT DrawElementsUShort : public PrimitiveSet, public VectorUShort PrimitiveSet(DrawElementsUShortPrimitiveType,mode), VectorUShort(first,last) {} - virtual Object* cloneType() const { return osgNew DrawElementsUShort(); } - virtual Object* clone(const CopyOp& copyop) const { return osgNew DrawElementsUShort(*this,copyop); } + virtual Object* cloneType() const { return new DrawElementsUShort(); } + virtual Object* clone(const CopyOp& copyop) const { return new DrawElementsUShort(*this,copyop); } virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast(obj)!=NULL; } virtual const char* libraryName() const { return "osg"; } virtual const char* className() const { return "DrawElementsUShort"; } @@ -379,8 +379,8 @@ class SG_EXPORT DrawElementsUInt : public PrimitiveSet, public VectorUInt PrimitiveSet(DrawElementsUIntPrimitiveType,mode), VectorUInt(first,last) {} - virtual Object* cloneType() const { return osgNew DrawElementsUInt(); } - virtual Object* clone(const CopyOp& copyop) const { return osgNew DrawElementsUInt(*this,copyop); } + virtual Object* cloneType() const { return new DrawElementsUInt(); } + virtual Object* clone(const CopyOp& copyop) const { return new DrawElementsUInt(*this,copyop); } virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast(obj)!=NULL; } virtual const char* libraryName() const { return "osg"; } virtual const char* className() const { return "DrawElementsUInt"; } diff --git a/include/osg/Shape b/include/osg/Shape index fede89805..d951bd486 100644 --- a/include/osg/Shape +++ b/include/osg/Shape @@ -24,8 +24,8 @@ class ConstShapeVisitor; * the standard pure virtual methods which are required for all Object * subclasses.*/ #define META_Shape(library,name) \ - virtual osg::Object* cloneType() const { return osgNew name(); } \ - virtual osg::Object* clone(const osg::CopyOp& copyop) const { return osgNew name (*this,copyop); } \ + virtual osg::Object* cloneType() const { return new name(); } \ + virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new name (*this,copyop); } \ virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast(obj)!=NULL; } \ virtual const char* libraryName() const { return #library; } \ virtual const char* className() const { return #name; } \ diff --git a/include/osg/ShapeDrawable b/include/osg/ShapeDrawable index 638f7701e..861e48ffe 100644 --- a/include/osg/ShapeDrawable +++ b/include/osg/ShapeDrawable @@ -108,8 +108,8 @@ class SG_EXPORT ShapeDrawable : public Drawable /** Copy constructor using CopyOp to manage deep vs shallow copy.*/ ShapeDrawable(const ShapeDrawable& pg,const CopyOp& copyop=CopyOp::SHALLOW_COPY); - virtual Object* cloneType() const { return osgNew ShapeDrawable(); } - virtual Object* clone(const CopyOp& copyop) const { return osgNew ShapeDrawable(*this,copyop); } + virtual Object* cloneType() const { return new ShapeDrawable(); } + virtual Object* clone(const CopyOp& copyop) const { return new ShapeDrawable(*this,copyop); } virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast(obj)!=NULL; } virtual const char* libraryName() const { return "osg"; } virtual const char* className() const { return "ShapeDrawable"; } diff --git a/include/osg/StateAttribute b/include/osg/StateAttribute index f16b2d4fd..5d961652a 100644 --- a/include/osg/StateAttribute +++ b/include/osg/StateAttribute @@ -24,8 +24,8 @@ class StateSet; * the standard pure virtual methods which are required for all Object * subclasses.*/ #define META_StateAttribute(library,name,type) \ - virtual osg::Object* cloneType() const { return osgNew name(); } \ - virtual osg::Object* clone(const osg::CopyOp& copyop) const { return osgNew name (*this,copyop); } \ + virtual osg::Object* cloneType() const { return new name(); } \ + virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new name (*this,copyop); } \ virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast(obj)!=NULL; } \ virtual const char* libraryName() const { return #library; } \ virtual const char* className() const { return #name; } \ diff --git a/include/osg/StateSet b/include/osg/StateSet index 78487a251..db77d7250 100644 --- a/include/osg/StateSet +++ b/include/osg/StateSet @@ -30,8 +30,8 @@ class SG_EXPORT StateSet : public Object StateSet(); StateSet(const StateSet&,const CopyOp& copyop=CopyOp::SHALLOW_COPY); - virtual Object* cloneType() const { return osgNew StateSet(); } - virtual Object* clone(const CopyOp& copyop) const { return osgNew StateSet(*this,copyop); } + virtual Object* cloneType() const { return new StateSet(); } + virtual Object* clone(const CopyOp& copyop) const { return new StateSet(*this,copyop); } virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast(obj)!=NULL; } virtual const char* libraryName() const { return "osg"; } virtual const char* className() const { return "StateSet"; } diff --git a/include/osg/UnitTestFramework b/include/osg/UnitTestFramework index 295970773..eb9b32882 100644 --- a/include/osg/UnitTestFramework +++ b/include/osg/UnitTestFramework @@ -459,7 +459,7 @@ Starts a TestSuite singleton function { \ static osg::ref_ptr s_suite = 0; \ if ( s_suite == 0 ) { \ - s_suite = osgNew osgUtx::TestSuite( #tsuite ); + s_suite = new osgUtx::TestSuite( #tsuite ); @@ -468,7 +468,7 @@ Adds a test case to a suite object being created in a TestSuite singleton functi @see OSGUTX_BEGIN_TESTSUITE, OSGUTX_END_TESTSUITE */ #define OSGUTX_ADD_TESTCASE( tfixture, tmethod ) \ - s_suite->add( osgNew osgUtx::TestCase_( \ + s_suite->add( new osgUtx::TestCase_( \ #tmethod, &tfixture::tmethod ) ); /** diff --git a/include/osgDB/Export b/include/osgDB/Export index e582f6595..bcab1dc4d 100644 --- a/include/osgDB/Export +++ b/include/osgDB/Export @@ -22,13 +22,6 @@ # endif /* OSGDBSG_LIBRARY */ #else # define OSGDB_EXPORT -#endif - -//#include -#define osgNew new -#define osgDelete delete -#define osgFree free -#define osgMalloc malloc - +#endif #endif diff --git a/include/osgDB/Registry b/include/osgDB/Registry index ea0850dea..d8f936633 100644 --- a/include/osgDB/Registry +++ b/include/osgDB/Registry @@ -209,7 +209,7 @@ class RegisterDotOsgWrapperProxy { if (Registry::instance()) { - _wrapper = osgNew DotOsgWrapper(proto,name,associates,readFunc,writeFunc,readWriteMode); + _wrapper = new DotOsgWrapper(proto,name,associates,readFunc,writeFunc,readWriteMode); Registry::instance()->addDotOsgWrapper(_wrapper.get()); } } @@ -235,7 +235,7 @@ class RegisterReaderWriterProxy { if (Registry::instance()) { - _rw = osgNew T; + _rw = new T; Registry::instance()->addReaderWriter(_rw.get()); } } diff --git a/include/osgUtil/CullVisitor b/include/osgUtil/CullVisitor index 42318e11e..e5d02cb5b 100644 --- a/include/osgUtil/CullVisitor +++ b/include/osgUtil/CullVisitor @@ -44,7 +44,7 @@ class OSGUTIL_EXPORT CullVisitor : public osg::NodeVisitor, public osg::CullStac CullVisitor(); virtual ~CullVisitor(); - virtual CullVisitor* cloneType() const { return osgNew CullVisitor(); } + virtual CullVisitor* cloneType() const { return new CullVisitor(); } virtual void reset(); @@ -312,7 +312,7 @@ inline RenderLeaf* CullVisitor::createOrReuseRenderLeaf(osg::Drawable* drawable, } // otherwise need to create new renderleaf. - RenderLeaf* renderleaf = osgNew RenderLeaf(drawable,projection,matrix,depth); + RenderLeaf* renderleaf = new RenderLeaf(drawable,projection,matrix,depth); _reuseRenderLeafList.push_back(renderleaf); ++_currentReuseRenderLeafIndex; return renderleaf; diff --git a/include/osgUtil/RenderBin b/include/osgUtil/RenderBin index 725f46f1e..c0d129cd9 100644 --- a/include/osgUtil/RenderBin +++ b/include/osgUtil/RenderBin @@ -48,8 +48,8 @@ class OSGUTIL_EXPORT RenderBin : public osg::Object /** Copy constructor using CopyOp to manage deep vs shallow copy.*/ RenderBin(const RenderBin& rhs,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY); - virtual osg::Object* cloneType() const { return osgNew RenderBin(); } - virtual osg::Object* clone(const osg::CopyOp& copyop) const { return osgNew RenderBin(*this,copyop); } // note only implements a clone of type. + virtual osg::Object* cloneType() const { return new RenderBin(); } + virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new RenderBin(*this,copyop); } // note only implements a clone of type. virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast(obj)!=0L; } virtual const char* libraryName() const { return "osgUtil"; } virtual const char* className() const { return "RenderBin"; } diff --git a/include/osgUtil/RenderGraph b/include/osgUtil/RenderGraph index 651302e99..27667b73f 100644 --- a/include/osgUtil/RenderGraph +++ b/include/osgUtil/RenderGraph @@ -71,7 +71,7 @@ class OSGUTIL_EXPORT RenderGraph : public osg::Referenced ~RenderGraph() {} - RenderGraph* cloneType() const { return osgNew RenderGraph; } + RenderGraph* cloneType() const { return new RenderGraph; } void setUserData(osg::Referenced* obj) { _userData = obj; } osg::Referenced* getUserData() { return _userData.get(); } @@ -149,7 +149,7 @@ class OSGUTIL_EXPORT RenderGraph : public osg::Referenced // create a state group and insert it into the children list // then return the state group. - RenderGraph* sg = osgNew RenderGraph(this,stateset); + RenderGraph* sg = new RenderGraph(this,stateset); _children[stateset] = sg; return sg; } diff --git a/include/osgUtil/RenderStage b/include/osgUtil/RenderStage index 57a12a53b..671dbe5ee 100644 --- a/include/osgUtil/RenderStage +++ b/include/osgUtil/RenderStage @@ -31,8 +31,8 @@ class OSGUTIL_EXPORT RenderStage : public RenderBin RenderStage(const RenderStage& rhs,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY); - virtual osg::Object* cloneType() const { return osgNew RenderStage(); } - virtual osg::Object* clone(const osg::CopyOp& copyop) const { return osgNew RenderStage(*this,copyop); } // note only implements a clone of type. + virtual osg::Object* cloneType() const { return new RenderStage(); } + virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new RenderStage(*this,copyop); } // note only implements a clone of type. virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast(obj)!=0L; } virtual const char* className() const { return "RenderStage"; } @@ -99,7 +99,7 @@ class OSGUTIL_EXPORT RenderStage : public RenderBin RenderStageLighting* getRenderStageLighting() const { - if (!_renderStageLighting.valid()) _renderStageLighting = osgNew RenderStageLighting; + if (!_renderStageLighting.valid()) _renderStageLighting = new RenderStageLighting; return _renderStageLighting.get(); } diff --git a/include/osgUtil/RenderStageLighting b/include/osgUtil/RenderStageLighting index 913f1de1b..0cac20693 100644 --- a/include/osgUtil/RenderStageLighting +++ b/include/osgUtil/RenderStageLighting @@ -23,8 +23,8 @@ class OSGUTIL_EXPORT RenderStageLighting : public osg::Object RenderStageLighting(); - virtual osg::Object* cloneType() const { return osgNew RenderStageLighting(); } - virtual osg::Object* clone(const osg::CopyOp&) const { return osgNew RenderStageLighting(); } // note only implements a clone of type. + virtual osg::Object* cloneType() const { return new RenderStageLighting(); } + virtual osg::Object* clone(const osg::CopyOp&) const { return new RenderStageLighting(); } // note only implements a clone of type. virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast(obj)!=0L; } virtual const char* libraryName() const { return "osgUtil"; } virtual const char* className() const { return "RenderStageLighting"; } diff --git a/include/osgUtil/RenderToTextureStage b/include/osgUtil/RenderToTextureStage index 72b114b78..f4ae7c69b 100644 --- a/include/osgUtil/RenderToTextureStage +++ b/include/osgUtil/RenderToTextureStage @@ -23,8 +23,8 @@ class OSGUTIL_EXPORT RenderToTextureStage : public RenderStage RenderToTextureStage(); - virtual osg::Object* cloneType() const { return osgNew RenderToTextureStage(); } - virtual osg::Object* clone(const osg::CopyOp&) const { return osgNew RenderToTextureStage(); } // note only implements a clone of type. + virtual osg::Object* cloneType() const { return new RenderToTextureStage(); } + virtual osg::Object* clone(const osg::CopyOp&) const { return new RenderToTextureStage(); } // note only implements a clone of type. virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast(obj)!=0L; } virtual const char* libraryName() const { return "osgUtil"; } virtual const char* className() const { return "RenderToTextureStage"; } diff --git a/include/osgUtil/SceneView b/include/osgUtil/SceneView index 637149794..349179cc6 100644 --- a/include/osgUtil/SceneView +++ b/include/osgUtil/SceneView @@ -55,7 +55,7 @@ class OSGUTIL_EXPORT SceneView : public osg::Referenced else { // ensure that _viewport is always valid. - _viewport = osgNew osg::Viewport; + _viewport = new osg::Viewport; } } diff --git a/src/Demos/osganimate/osganimate.cpp b/src/Demos/osganimate/osganimate.cpp index 73b23891e..e3a4114b9 100644 --- a/src/Demos/osganimate/osganimate.cpp +++ b/src/Demos/osganimate/osganimate.cpp @@ -60,7 +60,7 @@ osg::Node* createBase(const osg::Vec3& center,float radius) osg::Vec3 dy(osg::Vec3(0.0f,height/((float)numTilesY),0.0f)); // fill in vertices for grid, note numTilesX+1 * numTilesY+1... - osg::Vec3Array* coords = osgNew osg::Vec3Array; + osg::Vec3Array* coords = new osg::Vec3Array; int iy; for(iy=0;iy<=numTilesY;++iy) { @@ -71,15 +71,15 @@ osg::Node* createBase(const osg::Vec3& center,float radius) } //Just two colours - black and white. - osg::Vec4Array* colors = osgNew osg::Vec4Array; + osg::Vec4Array* colors = new osg::Vec4Array; colors->push_back(osg::Vec4(1.0f,1.0f,1.0f,1.0f)); // white colors->push_back(osg::Vec4(0.0f,0.0f,0.0f,1.0f)); // black int numColors=colors->size(); int numIndicesPerRow=numTilesX+1; - osg::UByteArray* coordIndices = osgNew osg::UByteArray; // assumes we are using less than 256 points... - osg::UByteArray* colorIndices = osgNew osg::UByteArray; + osg::UByteArray* coordIndices = new osg::UByteArray; // assumes we are using less than 256 points... + osg::UByteArray* colorIndices = new osg::UByteArray; for(iy=0;iypush_back(osg::Vec3(0.0f,0.0f,1.0f)); - osg::Geometry* geom = osgNew osg::Geometry; + osg::Geometry* geom = new osg::Geometry; geom->setVertexArray(coords); geom->setVertexIndices(coordIndices); @@ -112,9 +112,9 @@ osg::Node* createBase(const osg::Vec3& center,float radius) geom->setNormalArray(normals); geom->setNormalBinding(osg::Geometry::BIND_OVERALL); - geom->addPrimitiveSet(osgNew osg::DrawArrays(osg::PrimitiveSet::QUADS,0,coordIndices->size())); + geom->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::QUADS,0,coordIndices->size())); - osg::Geode* geode = osgNew osg::Geode; + osg::Geode* geode = new osg::Geode; geode->addDrawable(geom); return geode; @@ -134,7 +134,7 @@ osg::Node* createMovingModel(const osg::Vec3& center, float radius) const osg::BoundingSphere& bs = glider->getBound(); float size = radius/bs.radius()*0.3f; - osg::MatrixTransform* positioned = osgNew osg::MatrixTransform; + osg::MatrixTransform* positioned = new osg::MatrixTransform; positioned->setDataVariance(osg::Object::STATIC); positioned->setMatrix(osg::Matrix::translate(-bs.center())* osg::Matrix::scale(size,size,size)* @@ -142,7 +142,7 @@ osg::Node* createMovingModel(const osg::Vec3& center, float radius) positioned->addChild(glider); - osg::PositionAttitudeTransform* xform = osgNew osg::PositionAttitudeTransform; + osg::PositionAttitudeTransform* xform = new osg::PositionAttitudeTransform; xform->setAppCallback(new osg::PositionAttitudeTransform::AnimationPathCallback(animationPath,0.0,1.0)); xform->addChild(positioned); @@ -155,7 +155,7 @@ osg::Node* createMovingModel(const osg::Vec3& center, float radius) const osg::BoundingSphere& bs = cessna->getBound(); float size = radius/bs.radius()*0.3f; - osg::MatrixTransform* positioned = osgNew osg::MatrixTransform; + osg::MatrixTransform* positioned = new osg::MatrixTransform; positioned->setDataVariance(osg::Object::STATIC); positioned->setMatrix(osg::Matrix::translate(-bs.center())* osg::Matrix::scale(size,size,size)* @@ -163,7 +163,7 @@ osg::Node* createMovingModel(const osg::Vec3& center, float radius) positioned->addChild(cessna); - osg::MatrixTransform* xform = osgNew osg::MatrixTransform; + osg::MatrixTransform* xform = new osg::MatrixTransform; xform->setAppCallback(new osg::MatrixTransform::AnimationPathCallback(animationPath,0.0f,2.0)); xform->addChild(positioned); @@ -178,7 +178,7 @@ osg::Node* createModel() osg::Vec3 center(0.0f,0.0f,0.0f); float radius = 100.0f; - osg::Group* root = osgNew osg::Group; + osg::Group* root = new osg::Group; root->addChild(createMovingModel(center,radius*0.8f)); diff --git a/src/Demos/osgbillboard/osgbillboard.cpp b/src/Demos/osgbillboard/osgbillboard.cpp index f4a589d15..25ab543ac 100644 --- a/src/Demos/osgbillboard/osgbillboard.cpp +++ b/src/Demos/osgbillboard/osgbillboard.cpp @@ -54,7 +54,7 @@ osg::Drawable* createSquare(const osg::Vec3& corner,const osg::Vec3& width,const (*tcoords)[3].set(0.0f,1.0f); geom->setTexCoordArray(0,tcoords); - geom->addPrimitiveSet(osgNew osg::DrawArrays(osg::PrimitiveSet::QUADS,0,4)); + geom->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::QUADS,0,4)); if (image) { @@ -98,7 +98,7 @@ osg::Drawable* createAxis(const osg::Vec3& corner,const osg::Vec3& xdir,const os geom->setColorArray(color); geom->setColorBinding(osg::Geometry::BIND_PER_VERTEX); - geom->addPrimitiveSet(osgNew osg::DrawArrays(osg::PrimitiveSet::LINES,0,6)); + geom->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINES,0,6)); osg::StateSet* stateset = new osg::StateSet; osg::LineWidth* linewidth = new osg::LineWidth(); @@ -114,17 +114,17 @@ osg::Node* createModel() { // create the root node which will hold the model. - osg::Group* root = osgNew osg::Group(); + osg::Group* root = new osg::Group(); // add the drawable into a single goede to be shared... - osg::Billboard* center = osgNew osg::Billboard(); + osg::Billboard* center = new osg::Billboard(); center->setMode(osg::Billboard::POINT_ROT_EYE); center->addDrawable( createSquare(osg::Vec3(-0.5f,0.0f,-0.5f),osg::Vec3(1.0f,0.0f,0.0f),osg::Vec3(0.0f,0.0f,1.0f),osgDB::readImageFile("Images/reflect.rgb")), osg::Vec3(0.0f,0.0f,0.0f)); - osg::Billboard* x_arrow = osgNew osg::Billboard(); + osg::Billboard* x_arrow = new osg::Billboard(); x_arrow->setMode(osg::Billboard::AXIAL_ROT); x_arrow->setAxis(osg::Vec3(1.0f,0.0f,0.0f)); x_arrow->setNormal(osg::Vec3(0.0f,-1.0f,0.0f)); @@ -133,7 +133,7 @@ createSquare(osg::Vec3(-0.5f,0.0f,-0.5f),osg::Vec3(1.0f,0.0f,0.0f),osg::Vec3(0.0 createSquare(osg::Vec3(-0.5f,0.0f,-0.5f),osg::Vec3(1.0f,0.0f,0.0f),osg::Vec3(0.0f,0.0f,1.0f),osgDB::readImageFile("Images/osg_posx.png")), osg::Vec3(5.0f,0.0f,0.0f)); - osg::Billboard* y_arrow = osgNew osg::Billboard(); + osg::Billboard* y_arrow = new osg::Billboard(); y_arrow->setMode(osg::Billboard::AXIAL_ROT); y_arrow->setAxis(osg::Vec3(0.0f,1.0f,0.0f)); y_arrow->setNormal(osg::Vec3(1.0f,0.0f,0.0f)); @@ -141,7 +141,7 @@ createSquare(osg::Vec3(-0.5f,0.0f,-0.5f),osg::Vec3(1.0f,0.0f,0.0f),osg::Vec3(0.0 createSquare(osg::Vec3(0.0f,-0.5f,-0.5f),osg::Vec3(0.0f,1.0f,0.0f),osg::Vec3(0.0f,0.0f,1.0f),osgDB::readImageFile("Images/osg_posy.png")), osg::Vec3(0.0f,5.0f,0.0f)); - osg::Billboard* z_arrow = osgNew osg::Billboard(); + osg::Billboard* z_arrow = new osg::Billboard(); z_arrow->setMode(osg::Billboard::AXIAL_ROT); z_arrow->setAxis(osg::Vec3(0.0f,0.0f,1.0f)); z_arrow->setNormal(osg::Vec3(0.0f,-1.0f,0.0f)); @@ -194,9 +194,9 @@ int main( int argc, char **argv ) viewer.addViewport( rootNode ); // register trackball, flight and drive. - viewer.registerCameraManipulator(osgNew osgGA::TrackballManipulator); - viewer.registerCameraManipulator(osgNew osgGA::FlightManipulator); - viewer.registerCameraManipulator(osgNew osgGA::DriveManipulator); + viewer.registerCameraManipulator(new osgGA::TrackballManipulator); + viewer.registerCameraManipulator(new osgGA::FlightManipulator); + viewer.registerCameraManipulator(new osgGA::DriveManipulator); viewer.open(); diff --git a/src/Demos/osgclip/osgclip.cpp b/src/Demos/osgclip/osgclip.cpp index 4a1215c35..664b54be3 100644 --- a/src/Demos/osgclip/osgclip.cpp +++ b/src/Demos/osgclip/osgclip.cpp @@ -56,7 +56,7 @@ void write_usage(std::ostream& out,const std::string& name) osg::Node* decorate_with_clip_node(osg::Node* subgraph) { - osg::Group* rootnode = osgNew osg::Group; + osg::Group* rootnode = new osg::Group; // create wireframe view of the model so the user can see @@ -67,7 +67,7 @@ osg::Node* decorate_with_clip_node(osg::Node* subgraph) polymode->setMode(osg::PolygonMode::FRONT_AND_BACK,osg::PolygonMode::LINE); stateset->setAttributeAndModes(polymode,osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON); - osg::Group* wireframe_subgraph = osgNew osg::Group; + osg::Group* wireframe_subgraph = new osg::Group; wireframe_subgraph->setStateSet(stateset); wireframe_subgraph->addChild(subgraph); rootnode->addChild(wireframe_subgraph); @@ -76,7 +76,7 @@ osg::Node* decorate_with_clip_node(osg::Node* subgraph) // simple approach to adding a clipnode above a subrgaph. // create clipped part. - osg::ClipNode* clipped_subgraph = osgNew osg::ClipNode; + osg::ClipNode* clipped_subgraph = new osg::ClipNode; osg::BoundingSphere bs = subgraph->getBound(); bs.radius()*= 0.4f; @@ -95,12 +95,12 @@ osg::Node* decorate_with_clip_node(osg::Node* subgraph) // ClipNode node to be transformed independantly from the subgraph // that it is clipping. - osg::MatrixTransform* transform= osgNew osg::MatrixTransform; + osg::MatrixTransform* transform= new osg::MatrixTransform; osg::NodeCallback* nc = new osgUtil::TransformCallback(subgraph->getBound().center(),osg::Vec3(0.0f,0.0f,1.0f),osg::inDegrees(45.0f)); transform->setAppCallback(nc); - osg::ClipNode* clipnode = osgNew osg::ClipNode; + osg::ClipNode* clipnode = new osg::ClipNode; osg::BoundingSphere bs = subgraph->getBound(); bs.radius()*= 0.4f; @@ -115,7 +115,7 @@ osg::Node* decorate_with_clip_node(osg::Node* subgraph) // create clipped part. - osg::Group* clipped_subgraph = osgNew osg::Group; + osg::Group* clipped_subgraph = new osg::Group; clipped_subgraph->setStateSet(clipnode->getStateSet()); clipped_subgraph->addChild(subgraph); diff --git a/src/Demos/osgcube/osgcube.cpp b/src/Demos/osgcube/osgcube.cpp index f54b42578..9ba5a01da 100644 --- a/src/Demos/osgcube/osgcube.cpp +++ b/src/Demos/osgcube/osgcube.cpp @@ -73,25 +73,25 @@ class MyTransformCallback : public osg::NodeCallback{ osg::Geode* createGeometryCube() { - osg::Geode* geode = osgNew osg::Geode(); + osg::Geode* geode = new osg::Geode(); // ------------------------------------------- // Set up a new Geometry which will be our cube // ------------------------------------------- - osg::Geometry* cube = osgNew osg::Geometry(); + osg::Geometry* cube = new osg::Geometry(); // set up the primitives - cube->addPrimitiveSet(osgNew osg::DrawArrays(osg::PrimitiveSet::POLYGON,0,4)); - cube->addPrimitiveSet(osgNew osg::DrawArrays(osg::PrimitiveSet::POLYGON,4,4)); - cube->addPrimitiveSet(osgNew osg::DrawArrays(osg::PrimitiveSet::POLYGON,8,4)); - cube->addPrimitiveSet(osgNew osg::DrawArrays(osg::PrimitiveSet::POLYGON,12,4)); - cube->addPrimitiveSet(osgNew osg::DrawArrays(osg::PrimitiveSet::POLYGON,16,4)); - cube->addPrimitiveSet(osgNew osg::DrawArrays(osg::PrimitiveSet::POLYGON,20,4)); + cube->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::POLYGON,0,4)); + cube->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::POLYGON,4,4)); + cube->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::POLYGON,8,4)); + cube->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::POLYGON,12,4)); + cube->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::POLYGON,16,4)); + cube->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::POLYGON,20,4)); // set up coords. - osg::Vec3Array* coords = osgNew osg::Vec3Array; + osg::Vec3Array* coords = new osg::Vec3Array; coords->resize(24); (*coords)[0].set( -1.0000f, 1.0000f, -1.000f ); @@ -129,7 +129,7 @@ osg::Geode* createGeometryCube() // set up the normals. - osg::Vec3Array* cubeNormals = osgNew osg::Vec3Array; + osg::Vec3Array* cubeNormals = new osg::Vec3Array; cubeNormals->resize(6); (*cubeNormals)[0].set(0.0f,0.0f,-1.0f); @@ -145,8 +145,8 @@ osg::Geode* createGeometryCube() // --------------------------------------- // Set up a StateSet to make the cube red // --------------------------------------- - osg::StateSet* cubeState = osgNew osg::StateSet(); - osg::Material* redMaterial = osgNew osg::Material(); + osg::StateSet* cubeState = new osg::StateSet(); + osg::Material* redMaterial = new osg::Material(); osg::Vec4 red( 1.0f, 0.0f, 0.0f, 1.0f ); redMaterial->setDiffuse( osg::Material::FRONT_AND_BACK, red ); cubeState->setAttribute( redMaterial ); @@ -177,17 +177,17 @@ int main( int argc, char **argv ) // parameters that have been matched. viewer.readCommandLine(commandLine); - osg::MatrixTransform* myTransform = osgNew osg::MatrixTransform(); + osg::MatrixTransform* myTransform = new osg::MatrixTransform(); myTransform->addChild( createGeometryCube() ); // move node in a circle at 90 degrees a sec. - myTransform->setAppCallback(osgNew MyTransformCallback(myTransform,osg::inDegrees(90.0f))); + myTransform->setAppCallback(new MyTransformCallback(myTransform,osg::inDegrees(90.0f))); // add model to viewer. viewer.addViewport( myTransform ); // register trackball maniupulators. - viewer.registerCameraManipulator(osgNew osgGA::TrackballManipulator); + viewer.registerCameraManipulator(new osgGA::TrackballManipulator); viewer.open(); diff --git a/src/Demos/osgcubemap/osgcubemap.cpp b/src/Demos/osgcubemap/osgcubemap.cpp index 4f15a437b..006def8fd 100644 --- a/src/Demos/osgcubemap/osgcubemap.cpp +++ b/src/Demos/osgcubemap/osgcubemap.cpp @@ -60,7 +60,7 @@ void create_specular_highlights(osg::Node *node) osg::StateSet *ss = node->getOrCreateStateSet(); // create and setup the texture object - osg::TextureCubeMap *tcm = osgNew osg::TextureCubeMap; + osg::TextureCubeMap *tcm = new osg::TextureCubeMap; tcm->setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP); tcm->setWrap(osg::Texture::WRAP_T, osg::Texture::CLAMP); tcm->setWrap(osg::Texture::WRAP_R, osg::Texture::CLAMP); @@ -68,7 +68,7 @@ void create_specular_highlights(osg::Node *node) tcm->setFilter(osg::Texture::MAG_FILTER, osg::Texture::LINEAR); // generate the six highlight map images (light direction = [1, 1, -1]) - osgUtil::HighlightMapGenerator *mapgen = osgNew osgUtil::HighlightMapGenerator( + osgUtil::HighlightMapGenerator *mapgen = new osgUtil::HighlightMapGenerator( osg::Vec3(1, 1, -1), // light direction osg::Vec4(1, 0.9f, 0.8f, 1), // light color 8); // specular exponent @@ -87,12 +87,12 @@ void create_specular_highlights(osg::Node *node) ss->setTextureAttributeAndModes(0, tcm, osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON); // texture coordinate generation - osg::TexGen *tg = osgNew osg::TexGen; + osg::TexGen *tg = new osg::TexGen; tg->setMode(osg::TexGen::REFLECTION_MAP); ss->setTextureAttributeAndModes(0, tg, osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON); // use TexEnvCombine to add the highlights to the original lighting - osg::TexEnvCombine *te = osgNew osg::TexEnvCombine; + osg::TexEnvCombine *te = new osg::TexEnvCombine; te->setCombine_RGB(osg::TexEnvCombine::ADD); te->setSource0_RGB(osg::TexEnvCombine::TEXTURE); te->setOperand0_RGB(osg::TexEnvCombine::SRC_COLOR); diff --git a/src/Demos/osghangglide/osghangglide.cpp b/src/Demos/osghangglide/osghangglide.cpp index 862228c4a..4b2ea32bd 100644 --- a/src/Demos/osghangglide/osghangglide.cpp +++ b/src/Demos/osghangglide/osghangglide.cpp @@ -86,11 +86,11 @@ int main( int argc, char **argv ) // osg::Depth, and setting their bin numbers to less than 0, // to force them to draw before the rest of the scene. - osg::ClearNode* clearNode = osgNew osg::ClearNode; + osg::ClearNode* clearNode = new osg::ClearNode; clearNode->setRequiresClear(false); // we've got base and sky to do it. // use a transform to make the sky and base around with the eye point. - osg::Transform* transform = osgNew osg::Transform; + osg::Transform* transform = new osg::Transform; // transform's value isn't knowm until in the cull traversal so its bounding // volume is can't be determined, therefore culling will be invalid, @@ -101,7 +101,7 @@ int main( int argc, char **argv ) // set the compute transform callback to do all the work of // determining the transform according to the current eye point. - transform->setComputeTransformCallback(osgNew MoveEarthySkyWithEyePointCallback); + transform->setComputeTransformCallback(new MoveEarthySkyWithEyePointCallback); // add the sky and base layer. transform->addChild(makeSky()); // bin number -2 so drawn first. diff --git a/src/Demos/osghud/osghud.cpp b/src/Demos/osghud/osghud.cpp index 59cc78d1a..79f77eec2 100644 --- a/src/Demos/osghud/osghud.cpp +++ b/src/Demos/osghud/osghud.cpp @@ -90,9 +90,9 @@ void set2dScene(osg::Group* rootNode) /////////////////////////////////////////////////////////////////////////// // BitmapFont - osgText::BitmapFont* bitmapFont= osgNew osgText::BitmapFont(ttfPath, + osgText::BitmapFont* bitmapFont= new osgText::BitmapFont(ttfPath, gFontSize1); - text= osgNew osgText::Text(bitmapFont); + text= new osgText::Text(bitmapFont); gTextList.push_back(text); text->setText(std::string("2d ")+std::string(TEXT_BITMAP)); text->setPosition(osg::Vec3(xOffset,yOffset,0)); @@ -100,14 +100,14 @@ void set2dScene(osg::Group* rootNode) osgText::Text::BOUNDINGBOX | osgText::Text::ALIGNMENT ); text->setAlignment(gAlignment); - geode = osgNew osg::Geode(); + geode = new osg::Geode(); geode->setName("BitmapFont"); geode->addDrawable( text ); - textMaterial = osgNew osg::Material(); + textMaterial = new osg::Material(); textMaterial->setColorMode( osg::Material::AMBIENT_AND_DIFFUSE); textMaterial->setDiffuse( osg::Material::FRONT_AND_BACK, TEXT_COL_2D); - textState = osgNew osg::StateSet(); + textState = new osg::StateSet(); textState->setAttribute(textMaterial ); geode->setStateSet( textState ); @@ -118,9 +118,9 @@ void set2dScene(osg::Group* rootNode) /////////////////////////////////////////////////////////////////////////// // PixmapFont - osgText::PixmapFont* pixmapFont= osgNew osgText::PixmapFont(ttfPath, + osgText::PixmapFont* pixmapFont= new osgText::PixmapFont(ttfPath, gFontSize1); - text= osgNew osgText::Text(pixmapFont); + text= new osgText::Text(pixmapFont); gTextList.push_back(text); text->setText(std::string("2d ")+std::string(TEXT_PIXMAP)); text->setPosition(osg::Vec3(xOffset,yOffset,0)); @@ -128,21 +128,21 @@ void set2dScene(osg::Group* rootNode) osgText::Text::BOUNDINGBOX | osgText::Text::ALIGNMENT ); text->setAlignment(gAlignment); - geode = osgNew osg::Geode(); + geode = new osg::Geode(); geode->setName("PixmapFont"); geode->addDrawable( text ); - textMaterial = osgNew osg::Material(); + textMaterial = new osg::Material(); textMaterial->setColorMode( osg::Material::AMBIENT_AND_DIFFUSE); textMaterial->setDiffuse( osg::Material::FRONT_AND_BACK,TEXT_COL_2D); // to get antiaA pixmapFonts we have to draw them with blending - osg::BlendFunc *transp= osgNew osg::BlendFunc(); + osg::BlendFunc *transp= new osg::BlendFunc(); transp->setFunction(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); - textState = osgNew osg::StateSet(); + textState = new osg::StateSet(); textState->setAttribute(textMaterial ); textState->setAttribute(transp); textState->setMode(GL_BLEND,osg::StateAttribute::ON); @@ -158,9 +158,9 @@ void set2dScene(osg::Group* rootNode) /////////////////////////////////////////////////////////////////////////// // TextureFont - osgText::TextureFont* textureFont= osgNew osgText::TextureFont(ttfPath1, + osgText::TextureFont* textureFont= new osgText::TextureFont(ttfPath1, gFontSize1); - text= osgNew osgText::Text(textureFont); + text= new osgText::Text(textureFont); gTextList.push_back(text); text->setText(std::string("2d ")+std::string(TEXT_TEXTURE)); text->setPosition(osg::Vec3(xOffset,yOffset,0)); @@ -168,18 +168,18 @@ void set2dScene(osg::Group* rootNode) osgText::Text::BOUNDINGBOX | osgText::Text::ALIGNMENT ); text->setAlignment(gAlignment); - geode = osgNew osg::Geode(); + geode = new osg::Geode(); geode->setName("TextureFont"); geode->addDrawable( text ); - textMaterial = osgNew osg::Material(); + textMaterial = new osg::Material(); textMaterial->setColorMode( osg::Material::AMBIENT_AND_DIFFUSE); textMaterial->setDiffuse( osg::Material::FRONT_AND_BACK, TEXT_COL_2D); // to get antiaA pixmapFonts we have to draw them with blending - transp= osgNew osg::BlendFunc(); + transp= new osg::BlendFunc(); transp->setFunction(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - textState = osgNew osg::StateSet(); + textState = new osg::StateSet(); textState->setAttribute(textMaterial ); textState->setAttribute(transp); @@ -194,10 +194,10 @@ void set2dScene(osg::Group* rootNode) /////////////////////////////////////////////////////////////////////////// // PolygonFont - osgText::PolygonFont* polygonFont= osgNew osgText::PolygonFont(ttfPath, + osgText::PolygonFont* polygonFont= new osgText::PolygonFont(ttfPath, gFontSize1, 3); - text= osgNew osgText::Text(polygonFont); + text= new osgText::Text(polygonFont); gTextList.push_back(text); text->setText(std::string("2d ")+std::string("TEXT_POLYGON")); text->setPosition(osg::Vec3(xOffset,yOffset,0)); @@ -205,14 +205,14 @@ void set2dScene(osg::Group* rootNode) osgText::Text::BOUNDINGBOX | osgText::Text::ALIGNMENT ); text->setAlignment(gAlignment); - geode = osgNew osg::Geode(); + geode = new osg::Geode(); geode->setName("PolygonFont"); geode->addDrawable( text ); - textMaterial = osgNew osg::Material(); + textMaterial = new osg::Material(); textMaterial->setColorMode( osg::Material::AMBIENT_AND_DIFFUSE); textMaterial->setDiffuse( osg::Material::FRONT_AND_BACK, TEXT_COL_2D); - textState = osgNew osg::StateSet(); + textState = new osg::StateSet(); textState->setAttribute(textMaterial ); geode->setStateSet( textState ); @@ -223,11 +223,11 @@ void set2dScene(osg::Group* rootNode) /////////////////////////////////////////////////////////////////////////// // OutlineFont - osgText::OutlineFont* outlineFont= osgNew osgText::OutlineFont(ttfPath, + osgText::OutlineFont* outlineFont= new osgText::OutlineFont(ttfPath, gFontSize1, 3); - text= osgNew osgText::Text(outlineFont); + text= new osgText::Text(outlineFont); gTextList.push_back(text); text->setText(std::string("2d ")+std::string(TEXT_OUTLINE)); text->setPosition(osg::Vec3(xOffset,yOffset,0)); @@ -235,14 +235,14 @@ void set2dScene(osg::Group* rootNode) osgText::Text::BOUNDINGBOX | osgText::Text::ALIGNMENT ); text->setAlignment(gAlignment); - geode = osgNew osg::Geode(); + geode = new osg::Geode(); geode->setName("OutlineFont"); geode->addDrawable( text ); - textMaterial = osgNew osg::Material(); + textMaterial = new osg::Material(); textMaterial->setColorMode( osg::Material::AMBIENT_AND_DIFFUSE); textMaterial->setDiffuse( osg::Material::FRONT_AND_BACK, TEXT_COL_2D); - textState = osgNew osg::StateSet(); + textState = new osg::StateSet(); textState->setAttribute(textMaterial ); geode->setStateSet( textState ); @@ -250,10 +250,10 @@ void set2dScene(osg::Group* rootNode) // now add a depth attribute to the scene to force it to draw on top. - osg::Depth* depth = osgNew osg::Depth; + osg::Depth* depth = new osg::Depth; depth->setRange(0.0,0.0); - osg::StateSet* rootState = osgNew osg::StateSet(); + osg::StateSet* rootState = new osg::StateSet(); rootState->setAttribute(depth); rootState->setMode(GL_LIGHTING,osg::StateAttribute::OFF); @@ -323,16 +323,16 @@ int main( int argc, char **argv ) osg::Group* group = dynamic_cast(rootnode); if (!group) { - group = osgNew osg::Group; + group = new osg::Group; group->addChild(rootnode); rootnode = group; } // create the hud. - osg::Projection* projection = osgNew osg::Projection; + osg::Projection* projection = new osg::Projection; projection->setMatrix(osg::Matrix::ortho2D(0,1024,0,768)); - osg::MatrixTransform* modelview_abs = osgNew osg::MatrixTransform; + osg::MatrixTransform* modelview_abs = new osg::MatrixTransform; modelview_abs->setReferenceFrame(osg::Transform::RELATIVE_TO_ABSOLUTE); modelview_abs->setMatrix(osg::Matrix::identity()); @@ -340,8 +340,8 @@ int main( int argc, char **argv ) set2dScene(modelview_abs); projection->addChild(modelview_abs); -// projection->setAppCallback(osgNew MyCallback("App callback")); -// projection->setCullCallback(osgNew MyCallback("Cull callback")); +// projection->setAppCallback(new MyCallback("App callback")); +// projection->setCullCallback(new MyCallback("Cull callback")); group->addChild(projection); diff --git a/src/Demos/osglight/osglight.cpp b/src/Demos/osglight/osglight.cpp index b555dafa5..8f4ffd29b 100644 --- a/src/Demos/osglight/osglight.cpp +++ b/src/Demos/osglight/osglight.cpp @@ -156,14 +156,14 @@ osg::Geometry* createWall(const osg::Vec3& v1,const osg::Vec3& v2,const osg::Vec { // create a drawable for occluder. - osg::Geometry* geom = osgNew osg::Geometry; + osg::Geometry* geom = new osg::Geometry; geom->setStateSet(stateset); unsigned int noXSteps = 100; unsigned int noYSteps = 100; - osg::Vec3Array* coords = osgNew osg::Vec3Array; + osg::Vec3Array* coords = new osg::Vec3Array; coords->reserve(noXSteps*noYSteps); @@ -185,7 +185,7 @@ osg::Geometry* createWall(const osg::Vec3& v1,const osg::Vec3& v2,const osg::Vec geom->setVertexArray(coords); - osg::Vec4Array* colors = osgNew osg::Vec4Array(1); + osg::Vec4Array* colors = new osg::Vec4Array(1); (*colors)[0].set(1.0f,1.0f,1.0f,1.0f); geom->setColorArray(colors); geom->setColorBinding(osg::Geometry::BIND_OVERALL); diff --git a/src/Demos/osglightpoint/osglightpoint.cpp b/src/Demos/osglightpoint/osglightpoint.cpp index 09310831f..4c4955919 100644 --- a/src/Demos/osglightpoint/osglightpoint.cpp +++ b/src/Demos/osglightpoint/osglightpoint.cpp @@ -96,7 +96,7 @@ osg::Node* createLightPointsDatabase() end._position.set(1000.0f,0.0f,0.0f); end._color.set(1.0f,1.0f,1.0f,1.0f); - osg::Transform* transform = osgNew osg::Transform; + osg::Transform* transform = new osg::Transform; osg::Vec3 start_delta(0.0f,10.0f,0.0f); osg::Vec3 end_delta(0.0f,10.0f,1.0f); @@ -104,7 +104,7 @@ osg::Node* createLightPointsDatabase() int noStepsX = 100; int noStepsY = 100; -// osgSim::BlinkSequence* bs = osgNew osgSim::BlinkSequence; +// osgSim::BlinkSequence* bs = new osgSim::BlinkSequence; // bs->addPulse(1.0,osg::Vec4(1.0f,0.0f,0.0f,1.0f)); // bs->addPulse(0.5,osg::Vec4(0.0f,0.0f,0.0f,0.0f)); // off // bs->addPulse(1.5,osg::Vec4(1.0f,1.0f,0.0f,1.0f)); @@ -113,23 +113,23 @@ osg::Node* createLightPointsDatabase() // bs->addPulse(0.5,osg::Vec4(0.0f,0.0f,0.0f,0.0f)); // off -// osgSim::Sector* sector = osgNew osgSim::ConeSector(osg::Vec3(0.0f,0.0f,1.0f),osg::inDegrees(45.0),osg::inDegrees(45.0)); -// osgSim::Sector* sector = osgNew osgSim::ElevationSector(-osg::inDegrees(45.0),osg::inDegrees(45.0),osg::inDegrees(45.0)); -// osgSim::Sector* sector = osgNew osgSim::AzimSector(-osg::inDegrees(45.0),osg::inDegrees(45.0),osg::inDegrees(90.0)); -// osgSim::Sector* sector = osgNew osgSim::AzimElevationSector(osg::inDegrees(180),osg::inDegrees(90), // azim range +// osgSim::Sector* sector = new osgSim::ConeSector(osg::Vec3(0.0f,0.0f,1.0f),osg::inDegrees(45.0),osg::inDegrees(45.0)); +// osgSim::Sector* sector = new osgSim::ElevationSector(-osg::inDegrees(45.0),osg::inDegrees(45.0),osg::inDegrees(45.0)); +// osgSim::Sector* sector = new osgSim::AzimSector(-osg::inDegrees(45.0),osg::inDegrees(45.0),osg::inDegrees(90.0)); +// osgSim::Sector* sector = new osgSim::AzimElevationSector(osg::inDegrees(180),osg::inDegrees(90), // azim range // osg::inDegrees(0.0),osg::inDegrees(90.0), // elevation range // osg::inDegrees(5.0)); for(int i=0;isetSequenceGroup(osgNew osgSim::BlinkSequence::SequenceGroup((double)i*0.1)); +// osgSim::BlinkSequence* local_bs = new osgSim::BlinkSequence(*bs); +// local_bs->setSequenceGroup(new osgSim::BlinkSequence::SequenceGroup((double)i*0.1)); // start._blinkSequence = local_bs; // start._sector = sector; - osgSim::LightPointNode* lpn = osgNew osgSim::LightPointNode; + osgSim::LightPointNode* lpn = new osgSim::LightPointNode; addToLightPointNode(*lpn,start,end,noStepsX); start._position += start_delta; @@ -138,7 +138,7 @@ osg::Node* createLightPointsDatabase() transform->addChild(lpn); } - osg::Group* group = osgNew osg::Group; + osg::Group* group = new osg::Group; group->addChild(transform); @@ -169,7 +169,7 @@ int main( int argc, char **argv ) // eat any parameters that have been matched. osgDB::readCommandLine(commandLine); - osg::Group* rootnode = osgNew osg::Group; + osg::Group* rootnode = new osg::Group; // load the nodes from the commandline arguments. rootnode->addChild(osgDB::readNodeFiles(commandLine)); diff --git a/src/Demos/osglogo/osglogo.cpp b/src/Demos/osglogo/osglogo.cpp index 6a2e825aa..fa1906436 100644 --- a/src/Demos/osglogo/osglogo.cpp +++ b/src/Demos/osglogo/osglogo.cpp @@ -71,10 +71,10 @@ osg::Geometry* createWing(const osg::Vec3& left, const osg::Vec3& nose, const os osg:: Node* createTextBelow(const osg::BoundingBox& bb) { - osg::Geode* geode = osgNew osg::Geode(); + osg::Geode* geode = new osg::Geode(); - osgText::PolygonFont* polygonFont= osgNew osgText::PolygonFont("fonts/times.ttf",20, 3); - osgText::Text* text = osgNew osgText::Text(polygonFont); + osgText::PolygonFont* polygonFont= new osgText::PolygonFont("fonts/times.ttf",20, 3); + osgText::Text* text = new osgText::Text(polygonFont); text->setText("OpenSceneGraph"); text->setAlignment(osgText::Text::CENTER_CENTER); @@ -91,13 +91,13 @@ osg:: Node* createTextBelow(const osg::BoundingBox& bb) osg:: Node* createTextLeft(const osg::BoundingBox& bb) { - osg::Geode* geode = osgNew osg::Geode(); + osg::Geode* geode = new osg::Geode(); //std::string font("fonts/times.ttf"); std::string font("fonts/arial.ttf"); - //osgText::Text* text = osgNew osgText::Text(osgNew osgText::PolygonFont(font,80, 3)); - osgText::Text* text = osgNew osgText::Text(osgNew osgText::TextureFont(font,85)); + //osgText::Text* text = new osgText::Text(new osgText::PolygonFont(font,80, 3)); + osgText::Text* text = new osgText::Text(new osgText::TextureFont(font,85)); text->setText("OpenSceneGraph"); text->setAlignment(osgText::Text::RIGHT_CENTER); @@ -110,7 +110,7 @@ osg:: Node* createTextLeft(const osg::BoundingBox& bb) osg::StateSet* stateset = text->getOrCreateStateSet(); - osg::BlendFunc *transp= osgNew osg::BlendFunc(); + osg::BlendFunc *transp= new osg::BlendFunc(); transp->setFunction(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); stateset->setMode(GL_LIGHTING,osg::StateAttribute::OFF); @@ -125,14 +125,14 @@ osg:: Node* createTextLeft(const osg::BoundingBox& bb) osg:: Node* createGlobe(const osg::BoundingBox& bb,float ratio) { - osg::Geode* geode = osgNew osg::Geode(); + osg::Geode* geode = new osg::Geode(); - osg::StateSet* stateset = osgNew osg::StateSet(); + osg::StateSet* stateset = new osg::StateSet(); osg::Image* image = osgDB::readImageFile("land_shallow_topo_2048.jpg"); if (image) { - osg::Texture2D* texture = osgNew osg::Texture2D; + osg::Texture2D* texture = new osg::Texture2D; texture->setImage(image); texture->setMaxAnisotropy(8); stateset->setTextureAttributeAndModes(0,texture,osg::StateAttribute::ON); @@ -141,7 +141,7 @@ osg:: Node* createGlobe(const osg::BoundingBox& bb,float ratio) geode->setStateSet( stateset ); // the globe - geode->addDrawable(new osg::ShapeDrawable(osgNew osg::Sphere(bb.center(),bb.radius()*ratio))); + geode->addDrawable(new osg::ShapeDrawable(new osg::Sphere(bb.center(),bb.radius()*ratio))); osg::MatrixTransform* xform = new osg::MatrixTransform; @@ -153,7 +153,7 @@ osg:: Node* createGlobe(const osg::BoundingBox& bb,float ratio) osg:: Node* createBox(const osg::BoundingBox& bb,float chordRatio) { - osg::Geode* geode = osgNew osg::Geode(); + osg::Geode* geode = new osg::Geode(); osg::Vec4 white(1.0f,1.0f,1.0f,1.0f); @@ -182,7 +182,7 @@ osg:: Node* createBox(const osg::BoundingBox& bb,float chordRatio) osg:: Node* createBoxNo5(const osg::BoundingBox& bb,float chordRatio) { - osg::Geode* geode = osgNew osg::Geode(); + osg::Geode* geode = new osg::Geode(); osg::Vec4 white(1.0f,1.0f,1.0f,1.0f); @@ -208,7 +208,7 @@ osg:: Node* createBoxNo5(const osg::BoundingBox& bb,float chordRatio) osg:: Node* createBoxNo5No2(const osg::BoundingBox& bb,float chordRatio) { - osg::Geode* geode = osgNew osg::Geode(); + osg::Geode* geode = new osg::Geode(); osg::Vec4 red(1.0f,0.0f,0.0f,1.0f); osg::Vec4 green(0.0f,1.0f,0.0f,1.0f); @@ -249,7 +249,7 @@ osg:: Node* createBackdrop(const osg::Vec3& corner,const osg::Vec3& top,const os geom->addPrimitiveSet(new osg::DrawArrays(GL_QUADS,0,vertices->getNumElements())); - osg::Geode* geode = osgNew osg::Geode(); + osg::Geode* geode = new osg::Geode(); geode->addDrawable(geom); return geode; @@ -335,7 +335,7 @@ int main( int argc, char **argv ) viewer.addViewport( node ); // register trackball maniupulators. - viewer.registerCameraManipulator(osgNew osgGA::TrackballManipulator); + viewer.registerCameraManipulator(new osgGA::TrackballManipulator); viewer.open(); diff --git a/src/Demos/osgoccluder/osgoccluder.cpp b/src/Demos/osgoccluder/osgoccluder.cpp index e279c51d4..080a1b1b9 100644 --- a/src/Demos/osgoccluder/osgoccluder.cpp +++ b/src/Demos/osgoccluder/osgoccluder.cpp @@ -105,7 +105,7 @@ bool OccluderEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIAct return true; } - osg::ref_ptr lineSegment = osgNew osg::LineSegment; + osg::ref_ptr lineSegment = new osg::LineSegment; lineSegment->set(near_point,far_point); osgUtil::IntersectVisitor iv; @@ -171,7 +171,7 @@ void OccluderEventHandler::endOccluder() { if (_convexPlanarOccluder->getOccluder().getVertexList().size()>=3) { - osg::OccluderNode* occluderNode = osgNew osg::OccluderNode; + osg::OccluderNode* occluderNode = new osg::OccluderNode; occluderNode->setOccluder(_convexPlanarOccluder.get()); if (!_occluders.valid()) @@ -201,10 +201,10 @@ void OccluderEventHandler::endOccluder() osg::Node* createOccluder(const osg::Vec3& v1,const osg::Vec3& v2,const osg::Vec3& v3,const osg::Vec3& v4,float holeRatio=-1.0f) { // create and occluder which will site along side the loadmodel model. - osg::OccluderNode* occluderNode = osgNew osg::OccluderNode; + osg::OccluderNode* occluderNode = new osg::OccluderNode; // create the convex planer occluder - osg::ConvexPlanarOccluder* cpo = osgNew osg::ConvexPlanarOccluder; + osg::ConvexPlanarOccluder* cpo = new osg::ConvexPlanarOccluder; // attach it to the occluder node. occluderNode->setOccluder(cpo); @@ -240,22 +240,22 @@ osg::Node* createOccluder(const osg::Vec3& v1,const osg::Vec3& v2,const osg::Vec // create a drawable for occluder. - osg::Geometry* geom = osgNew osg::Geometry; + osg::Geometry* geom = new osg::Geometry; - osg::Vec3Array* coords = osgNew osg::Vec3Array(occluder.getVertexList().begin(),occluder.getVertexList().end()); + osg::Vec3Array* coords = new osg::Vec3Array(occluder.getVertexList().begin(),occluder.getVertexList().end()); geom->setVertexArray(coords); - osg::Vec4Array* colors = osgNew osg::Vec4Array(1); + osg::Vec4Array* colors = new osg::Vec4Array(1); (*colors)[0].set(1.0f,1.0f,1.0f,0.5f); geom->setColorArray(colors); geom->setColorBinding(osg::Geometry::BIND_OVERALL); - geom->addPrimitiveSet(osgNew osg::DrawArrays(osg::PrimitiveSet::QUADS,0,4)); + geom->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::QUADS,0,4)); - osg::Geode* geode = osgNew osg::Geode; + osg::Geode* geode = new osg::Geode; geode->addDrawable(geom); - osg::StateSet* stateset = osgNew osg::StateSet; + osg::StateSet* stateset = new osg::StateSet; stateset->setMode(GL_LIGHTING,osg::StateAttribute::OFF); stateset->setMode(GL_BLEND,osg::StateAttribute::ON); stateset->setRenderingHint(osg::StateSet::TRANSPARENT_BIN); @@ -273,7 +273,7 @@ osg::Node* createOccluder(const osg::Vec3& v1,const osg::Vec3& v2,const osg::Vec osg::Group* createOccludersAroundModel(osg::Node* model) { - osg::Group* scene = osgNew osg::Group; + osg::Group* scene = new osg::Group; scene->setName("rootgroup"); diff --git a/src/Demos/osgparticle/osgparticle.cpp b/src/Demos/osgparticle/osgparticle.cpp index 53e53cbcc..88fa65137 100644 --- a/src/Demos/osgparticle/osgparticle.cpp +++ b/src/Demos/osgparticle/osgparticle.cpp @@ -109,7 +109,7 @@ osgParticle::ParticleSystem *create_simple_particle_system(osg::Group *root) // our particles and expose the interface for managing them; this object // is a Drawable, so we'll have to add it to a Geode later. - osgParticle::ParticleSystem *ps = osgNew osgParticle::ParticleSystem; + osgParticle::ParticleSystem *ps = new osgParticle::ParticleSystem; // As for other Drawable classes, the aspect of graphical elements of // ParticleSystem (the particles) depends on the StateAttribute's we @@ -137,7 +137,7 @@ osgParticle::ParticleSystem *create_simple_particle_system(osg::Group *root) // these default objects there, but we'll modify the counter so that it // counts faster (more particles are emitted at each frame). - osgParticle::ModularEmitter *emitter = osgNew osgParticle::ModularEmitter; + osgParticle::ModularEmitter *emitter = new osgParticle::ModularEmitter; // the first thing you *MUST* do after creating an emitter is to set the // destination particle system, otherwise it won't know where to create @@ -169,7 +169,7 @@ osgParticle::ParticleSystem *create_simple_particle_system(osg::Group *root) // to create a Geode and add the particle system to it, so it can be // displayed. - osg::Geode *geode = osgNew osg::Geode; + osg::Geode *geode = new osg::Geode; geode->addDrawable(ps); // add the geode to the scene graph @@ -221,7 +221,7 @@ osgParticle::ParticleSystem *create_complex_particle_system(osg::Group *root) // "smoke.rgb", you can find it in the data distribution of OSG. // We turn off the additive blending, because smoke has no self- // illumination. - osgParticle::ParticleSystem *ps = osgNew osgParticle::ParticleSystem; + osgParticle::ParticleSystem *ps = new osgParticle::ParticleSystem; ps->setDefaultAttributes("Images/smoke.rgb", false, false); // assign the particle template to the system. @@ -230,17 +230,17 @@ osgParticle::ParticleSystem *create_complex_particle_system(osg::Group *root) // now we have to create an emitter; this will be a ModularEmitter, for which // we define a RandomRateCounter as counter, a SectorPlacer as placer, and // a RadialShooter as shooter. - osgParticle::ModularEmitter *emitter = osgNew osgParticle::ModularEmitter; + osgParticle::ModularEmitter *emitter = new osgParticle::ModularEmitter; emitter->setParticleSystem(ps); // setup the counter - osgParticle::RandomRateCounter *counter = osgNew osgParticle::RandomRateCounter; + osgParticle::RandomRateCounter *counter = new osgParticle::RandomRateCounter; counter->setRateRange(60, 60); emitter->setCounter(counter); // setup the placer; it will be a circle of radius 5 (the particles will // be placed inside this circle). - osgParticle::SectorPlacer *placer = osgNew osgParticle::SectorPlacer; + osgParticle::SectorPlacer *placer = new osgParticle::SectorPlacer; placer->setCenter(8, 0, 10); placer->setRadiusRange(2.5, 5); placer->setPhiRange(0, 2 * osg::PI); // 360° angle to make a circle @@ -250,7 +250,7 @@ osgParticle::ParticleSystem *create_complex_particle_system(osg::Group *root) // initial speed to zero, because we want the particles to fall down // only under the effect of the gravity force. Since we se the speed // to zero, there is no need to setup the shooting angles. - osgParticle::RadialShooter *shooter = osgNew osgParticle::RadialShooter; + osgParticle::RadialShooter *shooter = new osgParticle::RadialShooter; shooter->setInitialSpeedRange(0, 0); emitter->setShooter(shooter); @@ -272,22 +272,22 @@ osgParticle::ParticleSystem *create_complex_particle_system(osg::Group *root) // Program (and its descendants) should be placed *after* the instances // of Emitter objects in the scene graph. - osgParticle::ModularProgram *program = osgNew osgParticle::ModularProgram; + osgParticle::ModularProgram *program = new osgParticle::ModularProgram; program->setParticleSystem(ps); // create an operator that simulates the gravity acceleration. - osgParticle::AccelOperator *op1 = osgNew osgParticle::AccelOperator; + osgParticle::AccelOperator *op1 = new osgParticle::AccelOperator; op1->setToGravity(); program->addOperator(op1); // now create a custom operator, we have defined it before (see // class VortexOperator). - VortexOperator *op2 = osgNew VortexOperator; + VortexOperator *op2 = new VortexOperator; op2->setCenter(osg::Vec3(8, 0, 0)); program->addOperator(op2); // let's add a fluid operator to simulate air friction. - osgParticle::FluidFrictionOperator *op3 = osgNew osgParticle::FluidFrictionOperator; + osgParticle::FluidFrictionOperator *op3 = new osgParticle::FluidFrictionOperator; op3->setFluidToAir(); program->addOperator(op3); @@ -295,7 +295,7 @@ osgParticle::ParticleSystem *create_complex_particle_system(osg::Group *root) root->addChild(program); // create a Geode to contain our particle system. - osg::Geode *geode = osgNew osg::Geode; + osg::Geode *geode = new osg::Geode; geode->addDrawable(ps); // add the geode to the scene graph. @@ -328,7 +328,7 @@ void build_world(osg::Group *root) // created, we have to add an "updater" node to the scene graph. This node // will react to cull traversal by updating the specified particles system. - osgParticle::ParticleSystemUpdater *psu = osgNew osgParticle::ParticleSystemUpdater; + osgParticle::ParticleSystemUpdater *psu = new osgParticle::ParticleSystemUpdater; psu->addParticleSystem(ps1); psu->addParticleSystem(ps2); @@ -353,7 +353,7 @@ int main(int argc, char **argv) osgGLUT::Viewer viewer; //viewer.setWindowTitle(argv[0]); - osg::Group *root = osgNew osg::Group; + osg::Group *root = new osg::Group; build_world(root); // add a viewport to the viewer and attach the scene graph. diff --git a/src/Demos/osgpbuffer/RenderToTextureStage.h b/src/Demos/osgpbuffer/RenderToTextureStage.h index 16d9ec858..8816eb663 100644 --- a/src/Demos/osgpbuffer/RenderToTextureStage.h +++ b/src/Demos/osgpbuffer/RenderToTextureStage.h @@ -24,8 +24,8 @@ class /*OSGUTIL_EXPORT*/ MyRenderToTextureStage : public osgUtil::RenderStage MyRenderToTextureStage(); - virtual osg::Object* cloneType() const { return osgNew MyRenderToTextureStage(); } - virtual osg::Object* clone(const osg::CopyOp&) const { return osgNew MyRenderToTextureStage(); } // note only implements a clone of type. + virtual osg::Object* cloneType() const { return new MyRenderToTextureStage(); } + virtual osg::Object* clone(const osg::CopyOp&) const { return new MyRenderToTextureStage(); } // note only implements a clone of type. virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast(obj)!=0L; } virtual const char* libraryName() const { return ""; } virtual const char* className() const { return "MyRenderToTextureStage"; } diff --git a/src/Demos/osgpbuffer/osgpbuffer.cpp b/src/Demos/osgpbuffer/osgpbuffer.cpp index ee1f70fac..8b555c567 100644 --- a/src/Demos/osgpbuffer/osgpbuffer.cpp +++ b/src/Demos/osgpbuffer/osgpbuffer.cpp @@ -89,7 +89,7 @@ void MyCullCallback::doPreRender(osg::Node&, osgUtil::CullVisitor& cv) } // create the render to texture stage. - osg::ref_ptr rtts = osgNew MyRenderToTextureStage; + osg::ref_ptr rtts = new MyRenderToTextureStage; rtts->setPBuffer(g_pPixelBuffer); // set up lighting. @@ -123,7 +123,7 @@ void MyCullCallback::doPreRender(osg::Node&, osgUtil::CullVisitor& cv) zfar *= 1.1f; // set up projection. - osg::Matrix* projection = osgNew osg::Matrix; + osg::Matrix* projection = new osg::Matrix; projection->makeFrustum(-right,right,-top,top,znear,zfar); cv.pushProjectionMatrix(projection); @@ -133,7 +133,7 @@ void MyCullCallback::doPreRender(osg::Node&, osgUtil::CullVisitor& cv) cv.pushModelViewMatrix(matrix); - osg::ref_ptr dummyState = osgNew osg::StateSet; + osg::ref_ptr dummyState = new osg::StateSet; cv.pushStateSet(dummyState.get()); @@ -541,7 +541,7 @@ texture->setWrap(osg::Texture2D::WRAP_T,osg::Texture2D::CLAMP); polyGeom->setAppCallback(new MyGeometryCallback(origin,xAxis,yAxis,zAxis,1.0,1.0/width,0.2f)); - osg::Geode* geode = osgNew osg::Geode(); + osg::Geode* geode = new osg::Geode(); geode->addDrawable(polyGeom); osg::Group* parent = new osg::Group; diff --git a/src/Demos/osgprerender/osgprerender.cpp b/src/Demos/osgprerender/osgprerender.cpp index 7c7326c5a..4acfc37c3 100644 --- a/src/Demos/osgprerender/osgprerender.cpp +++ b/src/Demos/osgprerender/osgprerender.cpp @@ -94,7 +94,7 @@ void MyCullCallback::doPreRender(osg::Node&, osgUtil::CullVisitor& cv) // create the render to texture stage. - osg::ref_ptr rtts = osgNew osgUtil::RenderToTextureStage; + osg::ref_ptr rtts = new osgUtil::RenderToTextureStage; // set up lighting. // currently ignore lights in the scene graph itself.. @@ -128,7 +128,7 @@ void MyCullCallback::doPreRender(osg::Node&, osgUtil::CullVisitor& cv) zfar *= 1.1f; // set up projection. - osg::Matrix* projection = osgNew osg::Matrix; + osg::Matrix* projection = new osg::Matrix; projection->makeFrustum(-right,right,-top,top,znear,zfar); cv.pushProjectionMatrix(projection); @@ -138,7 +138,7 @@ void MyCullCallback::doPreRender(osg::Node&, osgUtil::CullVisitor& cv) cv.pushModelViewMatrix(matrix); - osg::ref_ptr dummyState = osgNew osg::StateSet; + osg::ref_ptr dummyState = new osg::StateSet; cv.pushStateSet(dummyState.get()); @@ -540,7 +540,7 @@ osg::Node* createPreRenderSubGraph(osg::Node* subgraph) polyGeom->setAppCallback(new MyGeometryCallback(origin,xAxis,yAxis,zAxis,1.0,1.0/width,0.2f)); - osg::Geode* geode = osgNew osg::Geode(); + osg::Geode* geode = new osg::Geode(); geode->addDrawable(polyGeom); osg::Group* parent = new osg::Group; diff --git a/src/Demos/osgreflect/osgreflect.cpp b/src/Demos/osgreflect/osgreflect.cpp index 20d6e5f0e..0432a45d3 100644 --- a/src/Demos/osgreflect/osgreflect.cpp +++ b/src/Demos/osgreflect/osgreflect.cpp @@ -92,7 +92,7 @@ osg::Drawable* createMirrorSurface(float xMin,float xMax,float yMin,float yMax,f geom->setColorArray(colours); geom->setColorBinding(osg::Geometry::BIND_OVERALL); - geom->addPrimitiveSet(osgNew osg::DrawArrays(osg::PrimitiveSet::QUADS,0,4)); + geom->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::QUADS,0,4)); return geom; } diff --git a/src/Demos/osgsequence/osgsequence.cpp b/src/Demos/osgsequence/osgsequence.cpp index eb563566e..8c6183c5c 100644 --- a/src/Demos/osgsequence/osgsequence.cpp +++ b/src/Demos/osgsequence/osgsequence.cpp @@ -92,7 +92,7 @@ osg::Sequence* generateSeq(osg::Sequence::LoopMode mode, float speed, int nreps, std::vector& model) { - osg::Sequence* seqNode = osgNew osg::Sequence; + osg::Sequence* seqNode = new osg::Sequence; // add children, show each child for 1.0 seconds for (unsigned int i = 0; i < model.size(); i++) { @@ -151,7 +151,7 @@ int main( int argc, char **argv ) } // root - osg::Group* rootNode = osgNew osg::Group; + osg::Group* rootNode = new osg::Group; // create sequences std::vector seq; @@ -174,7 +174,7 @@ int main( int argc, char **argv ) osg::Matrix matrix; matrix.makeTranslate(x, 0.0, 0.0); - osg::MatrixTransform* xform = osgNew osg::MatrixTransform; + osg::MatrixTransform* xform = new osg::MatrixTransform; xform->setMatrix(matrix); xform->addChild(seqNode); @@ -187,7 +187,7 @@ int main( int argc, char **argv ) viewer.addViewport(rootNode); // register additional event handler - viewer.prependEventHandler(osgNew MyEventHandler(&seq), 0); + viewer.prependEventHandler(new MyEventHandler(&seq), 0); // register trackball, flight and drive. viewer.registerCameraManipulator(new osgGA::TrackballManipulator); diff --git a/src/Demos/osgshadowtexture/CreateShadowedScene.cpp b/src/Demos/osgshadowtexture/CreateShadowedScene.cpp index e10dcd6cc..fe9b30b81 100644 --- a/src/Demos/osgshadowtexture/CreateShadowedScene.cpp +++ b/src/Demos/osgshadowtexture/CreateShadowedScene.cpp @@ -89,7 +89,7 @@ void CreateShadowTextureCullCallback::doPreRender(osg::Node& node, osgUtil::Cull // create the render to texture stage. - osg::ref_ptr rtts = osgNew osgUtil::RenderToTextureStage; + osg::ref_ptr rtts = new osgUtil::RenderToTextureStage; // set up lighting. // currently ignore lights in the scene graph itself.. @@ -125,7 +125,7 @@ void CreateShadowTextureCullCallback::doPreRender(osg::Node& node, osgUtil::Cull float right = top; // set up projection. - osg::Matrix* projection = osgNew osg::Matrix; + osg::Matrix* projection = new osg::Matrix; projection->makeFrustum(-right,right,-top,top,znear,zfar); cv.pushProjectionMatrix(projection); @@ -146,7 +146,7 @@ void CreateShadowTextureCullCallback::doPreRender(osg::Node& node, osgUtil::Cull cv.pushModelViewMatrix(matrix); - osg::ref_ptr shadowState = osgNew osg::StateSet; + osg::ref_ptr shadowState = new osg::StateSet; // make the material black for a shadow. osg::Material* material = new osg::Material; diff --git a/src/Demos/osgshadowtexture/osgshadowtexture.cpp b/src/Demos/osgshadowtexture/osgshadowtexture.cpp index a445e1a1d..ae86780d4 100644 --- a/src/Demos/osgshadowtexture/osgshadowtexture.cpp +++ b/src/Demos/osgshadowtexture/osgshadowtexture.cpp @@ -58,14 +58,14 @@ osg::AnimationPath* createAnimationPath(const osg::Vec3& center,float radius,dou osg::Node* createBase(const osg::Vec3& center,float radius) { - osg::Geode* geode = osgNew osg::Geode; + osg::Geode* geode = new osg::Geode; // set up the texture of the base. - osg::StateSet* stateset = osgNew osg::StateSet(); + osg::StateSet* stateset = new osg::StateSet(); osg::Image* image = osgDB::readImageFile("Images/lz.rgb"); if (image) { - osg::Texture2D* texture = osgNew osg::Texture2D; + osg::Texture2D* texture = new osg::Texture2D; texture->setImage(image); stateset->setTextureAttributeAndModes(0,texture,osg::StateAttribute::ON); } @@ -108,7 +108,7 @@ osg::Node* createBase(const osg::Vec3& center,float radius) geode->addDrawable(new osg::ShapeDrawable(grid)); - osg::Group* group = osgNew osg::Group; + osg::Group* group = new osg::Group; group->addChild(geode); return group; @@ -129,7 +129,7 @@ osg::Node* createMovingModel(const osg::Vec3& center, float radius) const osg::BoundingSphere& bs = cessna->getBound(); float size = radius/bs.radius()*0.3f; - osg::MatrixTransform* positioned = osgNew osg::MatrixTransform; + osg::MatrixTransform* positioned = new osg::MatrixTransform; positioned->setDataVariance(osg::Object::STATIC); positioned->setMatrix(osg::Matrix::translate(-bs.center())* osg::Matrix::scale(size,size,size)* @@ -137,7 +137,7 @@ osg::Node* createMovingModel(const osg::Vec3& center, float radius) positioned->addChild(cessna); - osg::MatrixTransform* xform = osgNew osg::MatrixTransform; + osg::MatrixTransform* xform = new osg::MatrixTransform; xform->setAppCallback(new osg::MatrixTransform::AnimationPathCallback(animationPath,0.0f,2.0)); xform->addChild(positioned); diff --git a/src/Demos/osgshape/osgshape.cpp b/src/Demos/osgshape/osgshape.cpp index f5cc9ce5a..00687a985 100644 --- a/src/Demos/osgshape/osgshape.cpp +++ b/src/Demos/osgshape/osgshape.cpp @@ -17,17 +17,17 @@ osg::Geode* createShapes() { - osg::Geode* geode = osgNew osg::Geode(); + osg::Geode* geode = new osg::Geode(); // --------------------------------------- // Set up a StateSet to texture the objects // --------------------------------------- - osg::StateSet* stateset = osgNew osg::StateSet(); + osg::StateSet* stateset = new osg::StateSet(); osg::Image* image = osgDB::readImageFile("Images/lz.rgb"); if (image) { - osg::Texture2D* texture = osgNew osg::Texture2D; + osg::Texture2D* texture = new osg::Texture2D; texture->setImage(image); stateset->setTextureAttributeAndModes(0,texture,osg::StateAttribute::ON); } @@ -37,10 +37,10 @@ osg::Geode* createShapes() float radius = 0.8f; float height = 1.0f; - geode->addDrawable(new osg::ShapeDrawable(osgNew osg::Sphere(osg::Vec3(0.0f,0.0f,0.0f),radius))); - geode->addDrawable(new osg::ShapeDrawable(osgNew osg::Box(osg::Vec3(2.0f,0.0f,0.0f),2*radius))); - geode->addDrawable(new osg::ShapeDrawable(osgNew osg::Cone(osg::Vec3(4.0f,0.0f,0.0f),radius,height))); - geode->addDrawable(new osg::ShapeDrawable(osgNew osg::Cylinder(osg::Vec3(6.0f,0.0f,0.0f),radius,height))); + geode->addDrawable(new osg::ShapeDrawable(new osg::Sphere(osg::Vec3(0.0f,0.0f,0.0f),radius))); + geode->addDrawable(new osg::ShapeDrawable(new osg::Box(osg::Vec3(2.0f,0.0f,0.0f),2*radius))); + geode->addDrawable(new osg::ShapeDrawable(new osg::Cone(osg::Vec3(4.0f,0.0f,0.0f),radius,height))); + geode->addDrawable(new osg::ShapeDrawable(new osg::Cylinder(osg::Vec3(6.0f,0.0f,0.0f),radius,height))); osg::Grid* grid = new osg::Grid; grid->allocateGrid(38,39); @@ -107,7 +107,7 @@ int main( int argc, char **argv ) viewer.addViewport( node ); // register trackball maniupulators. - viewer.registerCameraManipulator(osgNew osgGA::TrackballManipulator); + viewer.registerCameraManipulator(new osgGA::TrackballManipulator); viewer.open(); diff --git a/src/Demos/osgteapot/osgteapot.cpp b/src/Demos/osgteapot/osgteapot.cpp index cb4161550..6408df0db 100644 --- a/src/Demos/osgteapot/osgteapot.cpp +++ b/src/Demos/osgteapot/osgteapot.cpp @@ -290,7 +290,7 @@ class Teapot : public osg::Drawable osg::Geode* createTeapot() { - osg::Geode* geode = osgNew osg::Geode(); + osg::Geode* geode = new osg::Geode(); // add the teapot to the geode. geode->addDrawable( new Teapot ); @@ -339,7 +339,7 @@ int main( int argc, char **argv ) viewer.addViewport( createTeapot() ); // register trackball maniupulators. - viewer.registerCameraManipulator(osgNew osgGA::TrackballManipulator); + viewer.registerCameraManipulator(new osgGA::TrackballManipulator); viewer.open(); diff --git a/src/Demos/osgtext/main.cpp b/src/Demos/osgtext/main.cpp index 5c07d6581..986da4a4e 100644 --- a/src/Demos/osgtext/main.cpp +++ b/src/Demos/osgtext/main.cpp @@ -66,9 +66,9 @@ void set2dScene(osg::Group* rootNode) /////////////////////////////////////////////////////////////////////////// // BitmapFont - osgText::BitmapFont* bitmapFont= osgNew osgText::BitmapFont(ttfPath, + osgText::BitmapFont* bitmapFont= new osgText::BitmapFont(ttfPath, gFontSize1); - text= osgNew osgText::Text(bitmapFont); + text= new osgText::Text(bitmapFont); gTextList.push_back(text); text->setText(std::string("2d ")+std::string(TEXT_BITMAP)); text->setPosition(osg::Vec3(xOffset,yOffset,0)); @@ -77,7 +77,7 @@ void set2dScene(osg::Group* rootNode) osgText::Text::ALIGNMENT ); text->setAlignment(gAlignment); text->setColor(TEXT_COL_2D); - geode = osgNew osg::Geode(); + geode = new osg::Geode(); geode->setName("BitmapFont"); geode->addDrawable( text ); @@ -88,9 +88,9 @@ void set2dScene(osg::Group* rootNode) /////////////////////////////////////////////////////////////////////////// // PixmapFont - osgText::PixmapFont* pixmapFont= osgNew osgText::PixmapFont(ttfPath, + osgText::PixmapFont* pixmapFont= new osgText::PixmapFont(ttfPath, gFontSize1); - text= osgNew osgText::Text(pixmapFont); + text= new osgText::Text(pixmapFont); gTextList.push_back(text); text->setText(std::string("2d ")+std::string(TEXT_PIXMAP)); text->setPosition(osg::Vec3(xOffset,yOffset,0)); @@ -99,15 +99,15 @@ void set2dScene(osg::Group* rootNode) osgText::Text::ALIGNMENT ); text->setAlignment(gAlignment); text->setColor(TEXT_COL_2D); - geode = osgNew osg::Geode(); + geode = new osg::Geode(); geode->setName("PixmapFont"); geode->addDrawable( text ); // to get antiaA pixmapFonts we have to draw them with blending - osg::BlendFunc *transp= osgNew osg::BlendFunc(); + osg::BlendFunc *transp= new osg::BlendFunc(); transp->setFunction(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); - textState = osgNew osg::StateSet(); + textState = new osg::StateSet(); textState->setAttributeAndModes(transp,osg::StateAttribute::ON); textState->setRenderingHint(osg::StateSet::TRANSPARENT_BIN); @@ -121,9 +121,9 @@ void set2dScene(osg::Group* rootNode) /////////////////////////////////////////////////////////////////////////// // TextureFont - osgText::TextureFont* textureFont= osgNew osgText::TextureFont(ttfPath1, + osgText::TextureFont* textureFont= new osgText::TextureFont(ttfPath1, gFontSize1); - text= osgNew osgText::Text(textureFont); + text= new osgText::Text(textureFont); gTextList.push_back(text); text->setText(std::string("2d ")+std::string(TEXT_TEXTURE)); text->setPosition(osg::Vec3(xOffset,yOffset,0)); @@ -132,15 +132,15 @@ void set2dScene(osg::Group* rootNode) osgText::Text::ALIGNMENT ); text->setAlignment(gAlignment); text->setColor(TEXT_COL_2D); - geode = osgNew osg::Geode(); + geode = new osg::Geode(); geode->setName("TextureFont"); geode->addDrawable( text ); // to get antiaA pixmapFonts we have to draw them with blending - transp= osgNew osg::BlendFunc(); + transp= new osg::BlendFunc(); transp->setFunction(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - textState = osgNew osg::StateSet(); + textState = new osg::StateSet(); textState->setAttributeAndModes(transp,osg::StateAttribute::ON); textState->setTextureMode(0,GL_TEXTURE_2D,osg::StateAttribute::ON); @@ -154,10 +154,10 @@ void set2dScene(osg::Group* rootNode) /////////////////////////////////////////////////////////////////////////// // PolygonFont - osgText::PolygonFont* polygonFont= osgNew osgText::PolygonFont(ttfPath, + osgText::PolygonFont* polygonFont= new osgText::PolygonFont(ttfPath, gFontSize1, 3); - text= osgNew osgText::Text(polygonFont); + text= new osgText::Text(polygonFont); gTextList.push_back(text); text->setText(std::string("2d ")+std::string("TEXT_POLYGON")); text->setPosition(osg::Vec3(xOffset,yOffset,0)); @@ -166,7 +166,7 @@ void set2dScene(osg::Group* rootNode) osgText::Text::ALIGNMENT ); text->setAlignment(gAlignment); text->setColor(TEXT_COL_2D); - geode = osgNew osg::Geode(); + geode = new osg::Geode(); geode->setName("PolygonFont"); geode->addDrawable( text ); @@ -177,11 +177,11 @@ void set2dScene(osg::Group* rootNode) /////////////////////////////////////////////////////////////////////////// // OutlineFont - osgText::OutlineFont* outlineFont= osgNew osgText::OutlineFont(ttfPath, + osgText::OutlineFont* outlineFont= new osgText::OutlineFont(ttfPath, gFontSize1, 3); - text= osgNew osgText::Text(outlineFont); + text= new osgText::Text(outlineFont); gTextList.push_back(text); text->setText(std::string("2d ")+std::string(TEXT_OUTLINE)); text->setPosition(osg::Vec3(xOffset,yOffset,0)); @@ -190,7 +190,7 @@ void set2dScene(osg::Group* rootNode) osgText::Text::ALIGNMENT ); text->setAlignment(gAlignment); text->setColor(TEXT_COL_2D); - geode = osgNew osg::Geode(); + geode = new osg::Geode(); geode->setName("OutlineFont"); geode->addDrawable( text ); @@ -198,10 +198,10 @@ void set2dScene(osg::Group* rootNode) // now add a depth attribute to the scene to force it to draw on top. - osg::Depth* depth = osgNew osg::Depth; + osg::Depth* depth = new osg::Depth; depth->setRange(0.0,0.0); - osg::StateSet* rootState = osgNew osg::StateSet(); + osg::StateSet* rootState = new osg::StateSet(); rootState->setAttribute(depth); rootNode->setStateSet(rootState); @@ -220,9 +220,9 @@ void setScene(osg::Group* rootNode) // setup the texts /////////////////////////////////////////////////////////////////////////// // BitmapFont - osgText::BitmapFont* bitmapFont= osgNew osgText::BitmapFont(ttfPath, + osgText::BitmapFont* bitmapFont= new osgText::BitmapFont(ttfPath, gFontSize); - text= osgNew osgText::Text(bitmapFont); + text= new osgText::Text(bitmapFont); gTextList.push_back(text); text->setText(std::string(TEXT_BITMAP)); text->setPosition(osg::Vec3(xOffset,yOffset,0)); @@ -231,14 +231,14 @@ void setScene(osg::Group* rootNode) osgText::Text::ALIGNMENT ); text->setAlignment(gAlignment); text->setColor(TEXT_COL_3D); - geode = osgNew osg::Geode(); + geode = new osg::Geode(); geode->setName("BitmapFont"); geode->addDrawable( text ); -// textMaterial = osgNew osg::Material(); +// textMaterial = new osg::Material(); // textMaterial->setColorMode( osg::Material::AMBIENT_AND_DIFFUSE); // textMaterial->setDiffuse( osg::Material::FRONT_AND_BACK,TEXT_COL_3D); -// textState = osgNew osg::StateSet(); +// textState = new osg::StateSet(); // textState->setAttribute(textMaterial ); // geode->setStateSet( textState ); @@ -248,9 +248,9 @@ void setScene(osg::Group* rootNode) /////////////////////////////////////////////////////////////////////////// // PixmapFont - osgText::PixmapFont* pixmapFont= osgNew osgText::PixmapFont(ttfPath, + osgText::PixmapFont* pixmapFont= new osgText::PixmapFont(ttfPath, gFontSize); - text= osgNew osgText::Text(pixmapFont); + text= new osgText::Text(pixmapFont); gTextList.push_back(text); text->setText(std::string(TEXT_PIXMAP)); text->setPosition(osg::Vec3(xOffset,yOffset,0)); @@ -259,18 +259,18 @@ void setScene(osg::Group* rootNode) osgText::Text::ALIGNMENT ); text->setAlignment(gAlignment); text->setColor(TEXT_COL_3D); - geode = osgNew osg::Geode(); + geode = new osg::Geode(); geode->setName("PixmapFont"); geode->addDrawable( text ); -// textMaterial = osgNew osg::Material(); +// textMaterial = new osg::Material(); // textMaterial->setColorMode( osg::Material::AMBIENT_AND_DIFFUSE); // textMaterial->setDiffuse( osg::Material::FRONT_AND_BACK,TEXT_COL_3D); // to get antiaA pixmapFonts we have to draw them with blending - osg::BlendFunc *transp= osgNew osg::BlendFunc(); + osg::BlendFunc *transp= new osg::BlendFunc(); transp->setFunction(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); - textState = osgNew osg::StateSet(); + textState = new osg::StateSet(); // textState->setAttribute(textMaterial ); textState->setAttribute(transp); textState->setMode(GL_BLEND,osg::StateAttribute::ON); @@ -283,9 +283,9 @@ void setScene(osg::Group* rootNode) /////////////////////////////////////////////////////////////////////////// // TextureFont - osgText::TextureFont* textureFont= osgNew osgText::TextureFont(ttfPath, + osgText::TextureFont* textureFont= new osgText::TextureFont(ttfPath, gFontSize); - text= osgNew osgText::Text(textureFont); + text= new osgText::Text(textureFont); gTextList.push_back(text); text->setText(std::string(TEXT_TEXTURE)); text->setPosition(osg::Vec3(xOffset,yOffset,0)); @@ -294,18 +294,18 @@ void setScene(osg::Group* rootNode) osgText::Text::ALIGNMENT ); text->setAlignment(gAlignment); text->setColor(TEXT_COL_3D); - geode = osgNew osg::Geode(); + geode = new osg::Geode(); geode->setName("TextureFont"); geode->addDrawable( text ); -// textMaterial = osgNew osg::Material(); +// textMaterial = new osg::Material(); // textMaterial->setColorMode( osg::Material::AMBIENT_AND_DIFFUSE); // textMaterial->setDiffuse( osg::Material::FRONT_AND_BACK,TEXT_COL_3D); // to get antiaA pixmapFonts we have to draw them with blending - transp= osgNew osg::BlendFunc(); + transp= new osg::BlendFunc(); transp->setFunction(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - textState = osgNew osg::StateSet(); + textState = new osg::StateSet(); // textState->setAttribute(textMaterial ); textState->setAttribute(transp); @@ -320,10 +320,10 @@ void setScene(osg::Group* rootNode) /////////////////////////////////////////////////////////////////////////// // PolygonFont - osgText::PolygonFont* polygonFont= osgNew osgText::PolygonFont(ttfPath, + osgText::PolygonFont* polygonFont= new osgText::PolygonFont(ttfPath, gFontSize, 3); - text= osgNew osgText::Text(polygonFont); + text= new osgText::Text(polygonFont); gTextList.push_back(text); text->setText(std::string(TEXT_POLYGON)); text->setPosition(osg::Vec3(xOffset,yOffset,0)); @@ -332,14 +332,14 @@ void setScene(osg::Group* rootNode) osgText::Text::ALIGNMENT ); text->setAlignment(gAlignment); text->setColor(TEXT_COL_3D); - geode = osgNew osg::Geode(); + geode = new osg::Geode(); geode->setName("PolygonFont"); geode->addDrawable( text ); -// textMaterial = osgNew osg::Material(); +// textMaterial = new osg::Material(); // textMaterial->setColorMode( osg::Material::AMBIENT_AND_DIFFUSE); // textMaterial->setDiffuse( osg::Material::FRONT_AND_BACK,TEXT_COL_3D); -// textState = osgNew osg::StateSet(); +// textState = new osg::StateSet(); // textState->setAttribute(textMaterial ); // geode->setStateSet( textState ); @@ -349,11 +349,11 @@ void setScene(osg::Group* rootNode) /////////////////////////////////////////////////////////////////////////// // OutlineFont - osgText::OutlineFont* outlineFont= osgNew osgText::OutlineFont(ttfPath, + osgText::OutlineFont* outlineFont= new osgText::OutlineFont(ttfPath, gFontSize, 3); - text= osgNew osgText::Text(outlineFont); + text= new osgText::Text(outlineFont); gTextList.push_back(text); text->setText(std::string(TEXT_OUTLINE)); text->setPosition(osg::Vec3(xOffset,yOffset,0)); @@ -362,14 +362,14 @@ void setScene(osg::Group* rootNode) osgText::Text::ALIGNMENT ); text->setAlignment(gAlignment); text->setColor(TEXT_COL_3D); - geode = osgNew osg::Geode(); + geode = new osg::Geode(); geode->setName("OutlineFont"); geode->addDrawable( text ); -// textMaterial = osgNew osg::Material(); +// textMaterial = new osg::Material(); // textMaterial->setColorMode( osg::Material::AMBIENT_AND_DIFFUSE); // textMaterial->setDiffuse( osg::Material::FRONT_AND_BACK,TEXT_COL_3D); -// textState = osgNew osg::StateSet(); +// textState = new osg::StateSet(); // textState->setAttribute(textMaterial ); // geode->setStateSet( textState ); @@ -412,7 +412,7 @@ public: void addHUD(osg::Node* rootnode) { - _hudSceneView = osgNew osgUtil::SceneView; + _hudSceneView = new osgUtil::SceneView; _hudSceneView->setDefaults(); _hudSceneView->setSceneData(rootnode); @@ -440,7 +440,7 @@ public: _hudSceneView->getCullVisitor()->setCullingMode(osgUtil::CullVisitor::NO_CULLING); _hudSceneView->setComputeNearFarMode(osgUtil::CullVisitor::DO_NOT_COMPUTE_NEAR_FAR); - _hudCam = osgNew osg::Camera; + _hudCam = new osg::Camera; // leftBottom _hudSceneView->setCamera(_hudCam.get()); @@ -541,16 +541,16 @@ int main( int argc, char **argv ) gFontSize1=8; } - osg::Group* rootNode = osgNew osg::Group; - osg::Group* scene2d = osgNew osg::Group; - osg::MatrixTransform* textGroup = osgNew osg::MatrixTransform; + osg::Group* rootNode = new osg::Group; + osg::Group* scene2d = new osg::Group; + osg::MatrixTransform* textGroup = new osg::MatrixTransform; // set the name for the hole group rootNode->setName("sceneGroup"); // turn off the culling // turn off the light - osg::StateSet* gstate = osgNew osg::StateSet; + osg::StateSet* gstate = new osg::StateSet; gstate->setMode(GL_CULL_FACE,osg::StateAttribute::OFF); gstate->setMode(GL_LIGHTING,osg::StateAttribute::OFF); gstate->setMode(GL_DEPTH_TEST,osg::StateAttribute::OFF); @@ -578,9 +578,9 @@ int main( int argc, char **argv ) viewer.addHUD(scene2d); // register trackball, flight and drive. - viewer.registerCameraManipulator(osgNew osgGA::TrackballManipulator); - viewer.registerCameraManipulator(osgNew osgGA::FlightManipulator); - viewer.registerCameraManipulator(osgNew osgGA::DriveManipulator); + viewer.registerCameraManipulator(new osgGA::TrackballManipulator); + viewer.registerCameraManipulator(new osgGA::FlightManipulator); + viewer.registerCameraManipulator(new osgGA::DriveManipulator); viewer.open(); viewer.run(); diff --git a/src/Demos/osgtexture2D/osgtexture2D.cpp b/src/Demos/osgtexture2D/osgtexture2D.cpp index 93a14d677..fa210c9d3 100644 --- a/src/Demos/osgtexture2D/osgtexture2D.cpp +++ b/src/Demos/osgtexture2D/osgtexture2D.cpp @@ -126,7 +126,7 @@ osg::Drawable* createSquare(float textureCoordMax=1.0f) (*tcoords)[3].set(textureCoordMax,textureCoordMax); geom->setTexCoordArray(0,tcoords); - geom->addPrimitiveSet(osgNew osg::DrawArrays(osg::PrimitiveSet::QUADS,0,4)); + geom->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::QUADS,0,4)); return geom; } @@ -170,11 +170,11 @@ osg::Node* createLayer(const osg::Vec3& offset,osg::Image* image,osg::Node* geom // // use DrawPixels drawable to draw a pixel image. // { // -// osg::DrawPixels* drawimage = osgNew osg::DrawPixels; +// osg::DrawPixels* drawimage = new osg::DrawPixels; // drawimage->setPosition(local_offset); // drawimage->setImage(image); // -// osg::Geode* geode = osgNew osg::Geode; +// osg::Geode* geode = new osg::Geode; // geode->addDrawable(drawimage); // // // add the transform node to root group node. diff --git a/src/Demos/osgtexture3D/osgtexture3D.cpp b/src/Demos/osgtexture3D/osgtexture3D.cpp index 509195abd..da8ee8e9d 100644 --- a/src/Demos/osgtexture3D/osgtexture3D.cpp +++ b/src/Demos/osgtexture3D/osgtexture3D.cpp @@ -166,7 +166,7 @@ osg::Drawable* createSquare(float textureCoordMax=1.0f) (*tcoords)[3].set(textureCoordMax,textureCoordMax); geom->setTexCoordArray(0,tcoords); - geom->addPrimitiveSet(osgNew osg::DrawArrays(osg::PrimitiveSet::QUADS,0,4)); + geom->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::QUADS,0,4)); return geom; } diff --git a/src/Demos/osgtxp/TrPageViewer.cpp b/src/Demos/osgtxp/TrPageViewer.cpp index 9d5b50be9..26d1fbcee 100644 --- a/src/Demos/osgtxp/TrPageViewer.cpp +++ b/src/Demos/osgtxp/TrPageViewer.cpp @@ -103,7 +103,7 @@ float PagingViewer::app(unsigned int viewport) osg::Timer_t beforeApp = _timer.tick(); // update the camera manipulator. - osg::ref_ptr ea = osgNew GLUTEventAdapter; + osg::ref_ptr ea = new GLUTEventAdapter; ea->adaptFrame(_frameStamp->getReferenceTime()); bool handled = false; diff --git a/src/osg/Camera.cpp b/src/osg/Camera.cpp index c1a0f110b..66161f900 100644 --- a/src/osg/Camera.cpp +++ b/src/osg/Camera.cpp @@ -369,7 +369,7 @@ void Camera::attachTransform(TransformMode mode, Matrix* matrix) if (_eyeToModelTransform.valid()) { _attachedTransformMode = mode; - if (!_modelToEyeTransform.valid()) _modelToEyeTransform = osgNew Matrix; + if (!_modelToEyeTransform.valid()) _modelToEyeTransform = new Matrix; if (!_modelToEyeTransform->invert(*_eyeToModelTransform)) { notify(WARN)<<"Warning: Camera::attachTransform() failed to invert _modelToEyeTransform"<invert(*_modelToEyeTransform)) { notify(WARN)<<"Warning: Camera::attachTransform() failed to invert _modelToEyeTransform"<setRenderBinDetails(-1,"RenderBin"); setStateSet(stateset); } diff --git a/src/osg/ClipNode.cpp b/src/osg/ClipNode.cpp index 5045bb6f3..56b3147b9 100644 --- a/src/osg/ClipNode.cpp +++ b/src/osg/ClipNode.cpp @@ -5,7 +5,7 @@ using namespace osg; ClipNode::ClipNode() { _value = StateAttribute::ON; - _stateset = osgNew StateSet; + _stateset = new StateSet; } ClipNode::ClipNode(const ClipNode& cn, const CopyOp& copyop):Group(cn,copyop) @@ -28,14 +28,14 @@ void ClipNode::createClipBox(const BoundingBox& bb,unsigned int clipPlaneNumberB { _planes.clear(); - _planes.push_back(osgNew ClipPlane(clipPlaneNumberBase ,1.0,0.0,0.0,-bb.xMin())); - _planes.push_back(osgNew ClipPlane(clipPlaneNumberBase+1,-1.0,0.0,0.0,bb.xMax())); + _planes.push_back(new ClipPlane(clipPlaneNumberBase ,1.0,0.0,0.0,-bb.xMin())); + _planes.push_back(new ClipPlane(clipPlaneNumberBase+1,-1.0,0.0,0.0,bb.xMax())); - _planes.push_back(osgNew ClipPlane(clipPlaneNumberBase+2,0.0,1.0,0.0,-bb.yMin())); - _planes.push_back(osgNew ClipPlane(clipPlaneNumberBase+3,0.0,-1.0,0.0,bb.yMax())); + _planes.push_back(new ClipPlane(clipPlaneNumberBase+2,0.0,1.0,0.0,-bb.yMin())); + _planes.push_back(new ClipPlane(clipPlaneNumberBase+3,0.0,-1.0,0.0,bb.yMax())); - _planes.push_back(osgNew ClipPlane(clipPlaneNumberBase+4,0.0,0.0,1.0,-bb.zMin())); - _planes.push_back(osgNew ClipPlane(clipPlaneNumberBase+5,0.0,0.0,-1.0,bb.zMax())); + _planes.push_back(new ClipPlane(clipPlaneNumberBase+4,0.0,0.0,1.0,-bb.zMin())); + _planes.push_back(new ClipPlane(clipPlaneNumberBase+5,0.0,0.0,-1.0,bb.zMax())); setLocalStateSetModes(_value); } @@ -108,7 +108,7 @@ void ClipNode::setStateSetModes(StateSet& stateset,const StateAttribute::GLModeV void ClipNode::setLocalStateSetModes(const StateAttribute::GLModeValue value) { - if (!_stateset) _stateset = osgNew StateSet; + if (!_stateset) _stateset = new StateSet; _stateset->setAllToInherit(); setStateSetModes(*_stateset,value); } diff --git a/src/osg/CullStack.cpp b/src/osg/CullStack.cpp index 08c4791c1..a46598ab0 100644 --- a/src/osg/CullStack.cpp +++ b/src/osg/CullStack.cpp @@ -91,7 +91,7 @@ void CullStack::pushCullingSet() pixelSizeVector *= scaleRatio; - _modelviewCullingStack.push_back(osgNew osg::CullingSet(*_projectionCullingStack.back(),*_modelviewStack.back(),pixelSizeVector)); + _modelviewCullingStack.push_back(new osg::CullingSet(*_projectionCullingStack.back(),*_modelviewStack.back(),pixelSizeVector)); } @@ -130,7 +130,7 @@ void CullStack::pushProjectionMatrix(Matrix* matrix) { _projectionStack.push_back(matrix); - osg::CullingSet* cullingSet = osgNew osg::CullingSet(); + osg::CullingSet* cullingSet = new osg::CullingSet(); // set up view frustum. cullingSet->getFrustum().setToUnitFrustum(((_cullingMode&NEAR_PLANE_CULLING)!=0),((_cullingMode&FAR_PLANE_CULLING)!=0)); diff --git a/src/osg/DisplaySettings.cpp b/src/osg/DisplaySettings.cpp index 163b1aafa..3ba351bce 100644 --- a/src/osg/DisplaySettings.cpp +++ b/src/osg/DisplaySettings.cpp @@ -11,7 +11,7 @@ class DisplaySettingsPtr DisplaySettingsPtr() : _ptr(0L) {} DisplaySettingsPtr(DisplaySettings* t): _ptr(t) {} DisplaySettingsPtr(const DisplaySettingsPtr& rp):_ptr(rp._ptr) { } - ~DisplaySettingsPtr() { if (_ptr) osgDelete _ptr; _ptr=0L; } + ~DisplaySettingsPtr() { if (_ptr) delete _ptr; _ptr=0L; } inline DisplaySettings* get() { return _ptr; } @@ -20,7 +20,7 @@ class DisplaySettingsPtr DisplaySettings* DisplaySettings::instance() { - static DisplaySettingsPtr s_displaySettings = osgNew DisplaySettings; + static DisplaySettingsPtr s_displaySettings = new DisplaySettings; return s_displaySettings.get(); } diff --git a/src/osg/Drawable.cpp b/src/osg/Drawable.cpp index ab1a551bd..3e1276b6b 100644 --- a/src/osg/Drawable.cpp +++ b/src/osg/Drawable.cpp @@ -64,7 +64,7 @@ void Drawable::removeParent(osg::Node* node) osg::StateSet* Drawable::getOrCreateStateSet() { - if (!_stateset) _stateset = osgNew StateSet; + if (!_stateset) _stateset = new StateSet; return _stateset.get(); } diff --git a/src/osg/GeoSet.cpp b/src/osg/GeoSet.cpp index ef3746913..ac95eaeae 100644 --- a/src/osg/GeoSet.cpp +++ b/src/osg/GeoSet.cpp @@ -17,10 +17,10 @@ using namespace osg; GeoSet::GeoSet() { - // we will use the a default osgDelete functor which + // we will use the a default delete functor which // assumes that users have allocated arrays with new only // and that now sharing of attributes exists between GeoSet's. - _adf = osgNew AttributeDeleteFunctor; + _adf = new AttributeDeleteFunctor; _coords = (Vec3 *)0; @@ -74,7 +74,7 @@ GeoSet::GeoSet(const GeoSet& geoset,const CopyOp& copyop): _flat_shaded_skip = geoset._flat_shaded_skip; if (geoset._primLengths) { - _primLengths = osgNew int [_numprims]; + _primLengths = new int [_numprims]; memcpy(_primLengths,geoset._primLengths,_numprims*sizeof(int)); } else @@ -86,7 +86,7 @@ GeoSet::GeoSet(const GeoSet& geoset,const CopyOp& copyop): _cindex = geoset._cindex; if (geoset._coords) { - _coords = osgNew Vec3 [_numcoords]; + _coords = new Vec3 [_numcoords]; memcpy(_coords,geoset._coords,_numcoords*sizeof(Vec3)); } else @@ -99,7 +99,7 @@ GeoSet::GeoSet(const GeoSet& geoset,const CopyOp& copyop): _nindex = geoset._nindex; if (geoset._normals) { - _normals = osgNew Vec3 [_numnormals]; + _normals = new Vec3 [_numnormals]; memcpy(_normals,geoset._normals,_numnormals*sizeof(Vec3)); } else @@ -112,7 +112,7 @@ GeoSet::GeoSet(const GeoSet& geoset,const CopyOp& copyop): _colindex = geoset._colindex; if (geoset._colors) { - _colors = osgNew Vec4 [_numcolors]; + _colors = new Vec4 [_numcolors]; memcpy(_colors,geoset._colors,_numcolors*sizeof(Vec4)); } else @@ -125,7 +125,7 @@ GeoSet::GeoSet(const GeoSet& geoset,const CopyOp& copyop): _tindex = geoset._tindex; if (geoset._tcoords) { - _tcoords = osgNew Vec2 [_numtcoords]; + _tcoords = new Vec2 [_numtcoords]; memcpy(_tcoords,geoset._tcoords,_numtcoords*sizeof(Vec2)); } else @@ -152,19 +152,19 @@ GeoSet::GeoSet(const GeoSet& geoset,const CopyOp& copyop): void GeoSet::AttributeDeleteFunctor::operator() (GeoSet* gset) { - // note, osgDelete checks for NULL so want osgDelete NULL pointers. - osgDelete [] gset->getPrimLengths(); - osgDelete [] gset->getCoords(); - osgDelete [] gset->getNormals(); - osgDelete [] gset->getColors(); - osgDelete [] gset->getTextureCoords(); - // can't osgDelete a void* right now... interleaved arrays needs to be reimplemented with a proper pointer.. - // osgDelete [] gset->getInterleavedArray(); + // note, delete checks for NULL so want delete NULL pointers. + delete [] gset->getPrimLengths(); + delete [] gset->getCoords(); + delete [] gset->getNormals(); + delete [] gset->getColors(); + delete [] gset->getTextureCoords(); + // can't delete a void* right now... interleaved arrays needs to be reimplemented with a proper pointer.. + // delete [] gset->getInterleavedArray(); // coord indicies may be shared so we have to go through the long winded // step of creating unique pointer sets which we then delete. This - // ensures that arrays aren't osgDelete twice. Robert. + // ensures that arrays aren't delete twice. Robert. std::set ushortList; std::set uintList; @@ -178,14 +178,14 @@ void GeoSet::AttributeDeleteFunctor::operator() (GeoSet* gset) sitr!=ushortList.end(); ++sitr) { - osgDelete [] *sitr; + delete [] *sitr; } for(std::set::iterator iitr=uintList.begin(); iitr!=uintList.end(); ++iitr) { - osgDelete [] *iitr; + delete [] *iitr; } } @@ -961,7 +961,7 @@ Geometry* GeoSet::convertToGeometry() set_fast_path(); computeNumVerts(); - ref_ptr geom = osgNew Geometry; + ref_ptr geom = new Geometry; geom->setStateSet(getStateSet()); if (_flat_shaded_skip) @@ -972,7 +972,7 @@ Geometry* GeoSet::convertToGeometry() ShadeModel* shademodel = dynamic_cast(stateset->getAttribute(StateAttribute::SHADEMODEL)); if (!shademodel) { - shademodel = osgNew osg::ShadeModel; + shademodel = new osg::ShadeModel; stateset->setAttribute(shademodel); } shademodel->setMode( ShadeModel::FLAT ); @@ -1018,11 +1018,11 @@ Geometry* GeoSet::convertToGeometry() if (_coords) { - geom->setVertexArray(osgNew Vec3Array(_numcoords,_coords)); + geom->setVertexArray(new Vec3Array(_numcoords,_coords)); if (_cindex.valid()) { - if (_cindex._is_ushort) geom->setVertexIndices(osgNew UShortArray(_cindex._size,_cindex._ptr._ushort)); - else /* _nindex._is_uint*/ geom->setVertexIndices(osgNew UIntArray(_cindex._size,_cindex._ptr._uint)); + if (_cindex._is_ushort) geom->setVertexIndices(new UShortArray(_cindex._size,_cindex._ptr._ushort)); + else /* _nindex._is_uint*/ geom->setVertexIndices(new UIntArray(_cindex._size,_cindex._ptr._uint)); } } @@ -1032,10 +1032,10 @@ Geometry* GeoSet::convertToGeometry() { if (_nindex.valid()) { - geom->setNormalArray(osgNew Vec3Array(_numnormals,_normals)); + geom->setNormalArray(new Vec3Array(_numnormals,_normals)); if (_nindex._is_ushort) { - UShortArray* indices = osgNew UShortArray; + UShortArray* indices = new UShortArray; int index=0; for(int primNo = 0; primNo<_numprims; ++primNo) { @@ -1049,7 +1049,7 @@ Geometry* GeoSet::convertToGeometry() } else { - UIntArray* indices = osgNew UIntArray; + UIntArray* indices = new UIntArray; int index=0; for(int primNo = 0; primNo<_numprims; ++primNo) { @@ -1064,7 +1064,7 @@ Geometry* GeoSet::convertToGeometry() } else { - Vec3Array* normals = osgNew Vec3Array; + Vec3Array* normals = new Vec3Array; int index=0; for(int primNo = 0; primNo<_numprims; ++primNo) { @@ -1080,12 +1080,12 @@ Geometry* GeoSet::convertToGeometry() else { // usual path. - geom->setNormalArray(osgNew Vec3Array(_numnormals,_normals)); + geom->setNormalArray(new Vec3Array(_numnormals,_normals)); if (_nindex.valid()) { if (_nindex==_cindex) geom->setNormalIndices(geom->getVertexIndices()); - else if (_nindex._is_ushort) geom->setNormalIndices(osgNew UShortArray(_nindex._size,_nindex._ptr._ushort)); - else /* _nindex._is_uint*/ geom->setNormalIndices(osgNew UIntArray(_nindex._size,_nindex._ptr._uint)); + else if (_nindex._is_ushort) geom->setNormalIndices(new UShortArray(_nindex._size,_nindex._ptr._ushort)); + else /* _nindex._is_uint*/ geom->setNormalIndices(new UIntArray(_nindex._size,_nindex._ptr._uint)); } } } @@ -1096,14 +1096,14 @@ Geometry* GeoSet::convertToGeometry() { if (_colindex.valid()) { - geom->setColorArray(osgNew Vec4Array(_numcolors,_colors)); + geom->setColorArray(new Vec4Array(_numcolors,_colors)); if (_colindex==_nindex && _normal_binding==BIND_PERVERTEX) { geom->setColorIndices(geom->getNormalIndices()); } else if (_colindex._is_ushort) { - UShortArray* indices = osgNew UShortArray; + UShortArray* indices = new UShortArray; int index=0; for(int primNo = 0; primNo<_numprims; ++primNo) { @@ -1117,7 +1117,7 @@ Geometry* GeoSet::convertToGeometry() } else { - UIntArray* indices = osgNew UIntArray; + UIntArray* indices = new UIntArray; int index=0; for(int primNo = 0; primNo<_numprims; ++primNo) { @@ -1132,7 +1132,7 @@ Geometry* GeoSet::convertToGeometry() } else { - Vec4Array* colors = osgNew Vec4Array; + Vec4Array* colors = new Vec4Array; int index=0; for(int primNo = 0; primNo<_numprims; ++primNo) { @@ -1149,38 +1149,38 @@ Geometry* GeoSet::convertToGeometry() else { // usual path. - geom->setColorArray(osgNew Vec4Array(_numcolors,_colors)); + geom->setColorArray(new Vec4Array(_numcolors,_colors)); if (_colindex.valid()) { if (_colindex==_cindex) geom->setColorIndices(geom->getVertexIndices()); else if (_colindex==_nindex) geom->setColorIndices(geom->getNormalIndices()); - else if (_colindex._is_ushort) geom->setColorIndices(osgNew UShortArray(_colindex._size,_colindex._ptr._ushort)); - else /* _colindex._is_uint*/ geom->setColorIndices(osgNew UIntArray(_colindex._size,_colindex._ptr._uint)); + else if (_colindex._is_ushort) geom->setColorIndices(new UShortArray(_colindex._size,_colindex._ptr._ushort)); + else /* _colindex._is_uint*/ geom->setColorIndices(new UIntArray(_colindex._size,_colindex._ptr._uint)); } } } if (_tcoords) { - geom->setTexCoordArray(0,osgNew Vec2Array(_numtcoords,_tcoords)); + geom->setTexCoordArray(0,new Vec2Array(_numtcoords,_tcoords)); if (_tindex.valid()) { if (_tindex==_cindex) geom->setTexCoordIndices(0,geom->getVertexIndices()); else if (_tindex==_nindex) geom->setTexCoordIndices(0,geom->getNormalIndices()); else if (_tindex==_colindex) geom->setTexCoordIndices(0,geom->getColorIndices()); - else if (_tindex._is_ushort) geom->setTexCoordIndices(0,osgNew UShortArray(_tindex._size,_tindex._ptr._ushort)); - else /* _tindex._is_uint*/ geom->setTexCoordIndices(0,osgNew UIntArray(_tindex._size,_tindex._ptr._uint)); + else if (_tindex._is_ushort) geom->setTexCoordIndices(0,new UShortArray(_tindex._size,_tindex._ptr._ushort)); + else /* _tindex._is_uint*/ geom->setTexCoordIndices(0,new UIntArray(_tindex._size,_tindex._ptr._uint)); } } if (_needprimlen) { - geom->addPrimitiveSet(osgNew DrawArrayLengths((GLenum)_oglprimtype,0, _primLengths, _primLengths+_numprims )); + geom->addPrimitiveSet(new DrawArrayLengths((GLenum)_oglprimtype,0, _primLengths, _primLengths+_numprims )); } else { - geom->addPrimitiveSet(osgNew DrawArrays((GLenum)_oglprimtype,0, _numcoords)); + geom->addPrimitiveSet(new DrawArrays((GLenum)_oglprimtype,0, _numcoords)); } return geom.take(); diff --git a/src/osg/Image.cpp b/src/osg/Image.cpp index 693e57d58..9bda2bc72 100644 --- a/src/osg/Image.cpp +++ b/src/osg/Image.cpp @@ -435,7 +435,7 @@ void Image::flipVertical(int image) unsigned char* imageData = _data+image*imageSizeInBytes; // make temp. buffer for one image - unsigned char *tmpData = (unsigned char*) osgMalloc(imageSizeInBytes); + unsigned char *tmpData = (unsigned char*) malloc(imageSizeInBytes); for (int t=0; t<_t; ++t) { @@ -447,7 +447,7 @@ void Image::flipVertical(int image) // insert fliped image memcpy(imageData, tmpData, imageSizeInBytes); - osgFree(tmpData); + free(tmpData); ++_modifiedTag; } @@ -547,42 +547,42 @@ Geode* osg::createGeodeForImage(osg::Image* image,float s,float t) float x = y*(s/t); // set up the texture. - osg::Texture2D* texture = osgNew osg::Texture2D; + osg::Texture2D* texture = new osg::Texture2D; texture->setImage(image); // set up the drawstate. - osg::StateSet* dstate = osgNew osg::StateSet; + osg::StateSet* dstate = new osg::StateSet; dstate->setMode(GL_CULL_FACE,osg::StateAttribute::OFF); dstate->setMode(GL_LIGHTING,osg::StateAttribute::OFF); dstate->setTextureAttributeAndModes(0, texture,osg::StateAttribute::ON); // set up the geoset. - Geometry* geom = osgNew Geometry; + Geometry* geom = new Geometry; geom->setStateSet(dstate); - Vec3Array* coords = osgNew Vec3Array(4); + Vec3Array* coords = new Vec3Array(4); (*coords)[0].set(-x,0.0f,y); (*coords)[1].set(-x,0.0f,-y); (*coords)[2].set(x,0.0f,-y); (*coords)[3].set(x,0.0f,y); geom->setVertexArray(coords); - Vec2Array* tcoords = osgNew Vec2Array(4); + Vec2Array* tcoords = new Vec2Array(4); (*tcoords)[0].set(0.0f,1.0f); (*tcoords)[1].set(0.0f,0.0f); (*tcoords)[2].set(1.0f,0.0f); (*tcoords)[3].set(1.0f,1.0f); geom->setTexCoordArray(0,tcoords); - osg::Vec4Array* colours = osgNew osg::Vec4Array(1); + osg::Vec4Array* colours = new osg::Vec4Array(1); (*colours)[0].set(1.0f,1.0f,1.0,1.0f); geom->setColorArray(colours); geom->setColorBinding(Geometry::BIND_OVERALL); - geom->addPrimitiveSet(osgNew DrawArrays(PrimitiveSet::QUADS,0,4)); + geom->addPrimitiveSet(new DrawArrays(PrimitiveSet::QUADS,0,4)); // set up the geode. - osg::Geode* geode = osgNew osg::Geode; + osg::Geode* geode = new osg::Geode; geode->addDrawable(geom); return geode; diff --git a/src/osg/ImpostorSprite.cpp b/src/osg/ImpostorSprite.cpp index 90a47feaa..6dcf44dde 100644 --- a/src/osg/ImpostorSprite.cpp +++ b/src/osg/ImpostorSprite.cpp @@ -143,10 +143,10 @@ ImpostorSpriteManager::ImpostorSpriteManager(): _first(NULL), _last(NULL) { - _texenv = osgNew TexEnv; + _texenv = new TexEnv; _texenv->setMode(TexEnv::REPLACE); - _alphafunc = osgNew osg::AlphaFunc; + _alphafunc = new osg::AlphaFunc; _alphafunc->setFunction( AlphaFunc::GREATER, 0.000f ); } @@ -250,7 +250,7 @@ ImpostorSprite* ImpostorSpriteManager::createOrReuseImpostorSprite(int s,int t,i // creating new impostor sprite. - StateSet* stateset = osgNew StateSet; + StateSet* stateset = new StateSet; stateset->setMode(GL_CULL_FACE,osg::StateAttribute::OFF); stateset->setMode(GL_LIGHTING,osg::StateAttribute::OFF); @@ -259,7 +259,7 @@ ImpostorSprite* ImpostorSpriteManager::createOrReuseImpostorSprite(int s,int t,i stateset->setAttributeAndModes( _alphafunc.get(), StateAttribute::ON ); - Texture2D* texture = osgNew Texture2D; + Texture2D* texture = new Texture2D; texture->setFilter(Texture2D::MIN_FILTER,Texture2D::LINEAR); texture->setFilter(Texture2D::MAG_FILTER,Texture2D::LINEAR); @@ -267,11 +267,11 @@ ImpostorSprite* ImpostorSpriteManager::createOrReuseImpostorSprite(int s,int t,i stateset->setTextureAttribute(0,_texenv.get()); /* - TexEnv* texenv = osgNew TexEnv; + TexEnv* texenv = new TexEnv; texenv->setMode(TexEnv::REPLACE); stateset->setAttribute(texenv); - AlphaFunc* alphafunc = osgNew osg::AlphaFunc; + AlphaFunc* alphafunc = new osg::AlphaFunc; alphafunc->setFunction( AlphaFunc::GREATER, 0.000f ); stateset->setAttributeAndModes( alphafunc, StateAttribute::ON ); */ @@ -279,7 +279,7 @@ ImpostorSprite* ImpostorSpriteManager::createOrReuseImpostorSprite(int s,int t,i // stateset->setMode( GL_ALPHA_TEST, StateAttribute::OFF ); - ImpostorSprite* is = osgNew ImpostorSprite; + ImpostorSprite* is = new ImpostorSprite; is->setStateSet(stateset); is->setTexture(texture,s,t); diff --git a/src/osg/LightSource.cpp b/src/osg/LightSource.cpp index 2e1aa9cc3..4b686e441 100644 --- a/src/osg/LightSource.cpp +++ b/src/osg/LightSource.cpp @@ -7,8 +7,8 @@ LightSource::LightSource(): { // switch off culling of light source nodes by default. setCullingActive(false); - _stateset = osgNew StateSet; - _light = osgNew Light; + _stateset = new StateSet; + _light = new Light; } @@ -35,7 +35,7 @@ void LightSource::setStateSetModes(StateSet& stateset,StateAttribute::GLModeValu void LightSource::setLocalStateSetModes(StateAttribute::GLModeValue value) { - if (!_stateset) _stateset = osgNew StateSet; + if (!_stateset) _stateset = new StateSet; _stateset->setAllToInherit(); setStateSetModes(*_stateset,value); } diff --git a/src/osg/Node.cpp b/src/osg/Node.cpp index c6fecad73..e3e61f932 100644 --- a/src/osg/Node.cpp +++ b/src/osg/Node.cpp @@ -72,7 +72,7 @@ void Node::ascend(NodeVisitor& nv) osg::StateSet* Node::getOrCreateStateSet() { - if (!_stateset) _stateset = osgNew StateSet; + if (!_stateset) _stateset = new StateSet; return _stateset.get(); } diff --git a/src/osg/Projection.cpp b/src/osg/Projection.cpp index 873dce1d0..11ec257ef 100644 --- a/src/osg/Projection.cpp +++ b/src/osg/Projection.cpp @@ -4,18 +4,18 @@ using namespace osg; Projection::Projection() { - _matrix = osgNew Matrix; + _matrix = new Matrix; } Projection::Projection(const Projection& projection,const CopyOp& copyop): Group(projection,copyop), - _matrix(osgNew Matrix(*projection._matrix)) + _matrix(new Matrix(*projection._matrix)) { } Projection::Projection(const Matrix& mat ) { - _matrix = osgNew Matrix(mat); + _matrix = new Matrix(mat); } diff --git a/src/osg/StateSet.cpp b/src/osg/StateSet.cpp index 2a5d0f98d..8c90848b8 100644 --- a/src/osg/StateSet.cpp +++ b/src/osg/StateSet.cpp @@ -345,10 +345,10 @@ void StateSet::setGlobalDefaults() setMode(GL_DEPTH_TEST,StateAttribute::ON); - setAttributeAndModes(osgNew AlphaFunc,StateAttribute::OFF); - setAttributeAndModes(osgNew BlendFunc,StateAttribute::OFF); + setAttributeAndModes(new AlphaFunc,StateAttribute::OFF); + setAttributeAndModes(new BlendFunc,StateAttribute::OFF); - Material *material = osgNew Material; + Material *material = new Material; material->setColorMode(Material::AMBIENT_AND_DIFFUSE); setAttributeAndModes(material,StateAttribute::ON); } diff --git a/src/osg/UnitTestFramework.cpp b/src/osg/UnitTestFramework.cpp index ee7c600cc..774fc1b06 100644 --- a/src/osg/UnitTestFramework.cpp +++ b/src/osg/UnitTestFramework.cpp @@ -141,7 +141,7 @@ TestSuite* TestGraph::suite( if(createIfNecessary){ - TestSuite* childSuite = osgNew TestSuite(*it); + TestSuite* childSuite = new TestSuite(*it); tsuite->add(childSuite); return suite(it, end, childSuite, createIfNecessary); } @@ -149,7 +149,7 @@ TestSuite* TestGraph::suite( return 0; } -TestGraph::TestGraph(): root_(osgNew TestSuite("root")) +TestGraph::TestGraph(): root_(new TestSuite("root")) { } diff --git a/src/osgDB/DynamicLibrary.cpp b/src/osgDB/DynamicLibrary.cpp index 215b736ac..39892585a 100644 --- a/src/osgDB/DynamicLibrary.cpp +++ b/src/osgDB/DynamicLibrary.cpp @@ -55,7 +55,7 @@ DynamicLibrary* DynamicLibrary::loadLibrary(const std::string& libraryName) #if defined(WIN32) && !defined(__CYGWIN__) HANDLE handle = LoadLibrary( fullLibraryName.c_str() ); - if (handle) return osgNew DynamicLibrary(libraryName,handle); + if (handle) return new DynamicLibrary(libraryName,handle); notify(WARN) << "DynamicLibrary::failed loading "<=_fieldCacheCapacity-1) _fieldCacheCapacity *= 2; char* tmp_str = _fieldCache; - _fieldCache = osgNew char[_fieldCacheCapacity]; + _fieldCache = new char[_fieldCacheCapacity]; memset(_fieldCache,0,_fieldCacheCapacity); strncpy(_fieldCache,tmp_str,_fieldCacheSize); - osgDelete [] tmp_str; + delete [] tmp_str; } _fieldCache[_fieldCacheSize++] = c; diff --git a/src/osgDB/FieldReaderIterator.cpp b/src/osgDB/FieldReaderIterator.cpp index a2da6a9d6..a20782899 100644 --- a/src/osgDB/FieldReaderIterator.cpp +++ b/src/osgDB/FieldReaderIterator.cpp @@ -34,16 +34,16 @@ void FieldReaderIterator::_free() // free all data if (_previousField) { - osgDelete _previousField; + delete _previousField; } if (_fieldQueue) { for(int i=0;i<_fieldQueueCapacity;++i) { - if (_fieldQueue[i]) osgDelete _fieldQueue[i]; + if (_fieldQueue[i]) delete _fieldQueue[i]; _fieldQueue[i] = NULL; } - osgDelete [] _fieldQueue; + delete [] _fieldQueue; } _init(); @@ -66,17 +66,17 @@ void FieldReaderIterator::_copy(const FieldReaderIterator& ic) if (ic._previousField) { - _previousField = osgNew Field(*ic._previousField); + _previousField = new Field(*ic._previousField); } if (ic._fieldQueue && ic._fieldQueueCapacity>0) { - _fieldQueue = osgNew Field* [ic._fieldQueueCapacity]; + _fieldQueue = new Field* [ic._fieldQueueCapacity]; for(int i=0;i=newCapacity) newCapacity*=2; - Field** newFieldStack = osgNew Field* [newCapacity]; + Field** newFieldStack = new Field* [newCapacity]; for(i=0;i<_fieldQueueCapacity;++i) { newFieldStack[i] = _fieldQueue[i]; @@ -139,7 +139,7 @@ void FieldReaderIterator::insert(int pos,Field* field) } // free the old memory. - osgDelete [] _fieldQueue; + delete [] _fieldQueue; _fieldQueue = newFieldStack; _fieldQueueCapacity = newCapacity; @@ -158,7 +158,7 @@ void FieldReaderIterator::insert(int pos,const char* str) { if (str) { - Field* field = osgNew Field; + Field* field = new Field; while(*str!=0) { field->addChar(*str); @@ -194,7 +194,7 @@ Field& FieldReaderIterator::field (int pos) int newCapacity = _fieldQueueCapacity*2; if (newCapacity=newCapacity) newCapacity*=2; - Field** newFieldStack = osgNew Field* [newCapacity]; + Field** newFieldStack = new Field* [newCapacity]; int i; for(i=0;i<_fieldQueueCapacity;++i) { @@ -205,14 +205,14 @@ Field& FieldReaderIterator::field (int pos) newFieldStack[i] = NULL; } // free the old memory. - osgDelete [] _fieldQueue; + delete [] _fieldQueue; _fieldQueue = newFieldStack; _fieldQueueCapacity = newCapacity; } while(!_reader.eof() && pos>=_fieldQueueSize) { - if (_fieldQueue[_fieldQueueSize]==NULL) _fieldQueue[_fieldQueueSize] = osgNew Field; + if (_fieldQueue[_fieldQueueSize]==NULL) _fieldQueue[_fieldQueueSize] = new Field; if (_reader.readField(*_fieldQueue[_fieldQueueSize])) { ++_fieldQueueSize; @@ -250,7 +250,7 @@ FieldReaderIterator& FieldReaderIterator::operator += (int no) } else if (no>0) { - Field** tmpFields = osgNew Field* [no]; + Field** tmpFields = new Field* [no]; int i; for(i=0;i& commandLine) } else // size >1 { - osg::Group* group = osgNew osg::Group; + osg::Group* group = new osg::Group; for(NodeList::iterator itr=nodeList.begin(); itr!=nodeList.end(); ++itr) diff --git a/src/osgDB/Registry.cpp b/src/osgDB/Registry.cpp index 635f8b788..faa767a0d 100644 --- a/src/osgDB/Registry.cpp +++ b/src/osgDB/Registry.cpp @@ -34,7 +34,7 @@ class RegistryPtr RegistryPtr() : _ptr(0L) {} RegistryPtr(Registry* t): _ptr(t) {} RegistryPtr(const RegistryPtr& rp):_ptr(rp._ptr) { } - ~RegistryPtr() { if (_ptr) osgDelete _ptr; _ptr=0L; } + ~RegistryPtr() { if (_ptr) delete _ptr; _ptr=0L; } inline Registry* get() { return _ptr; } @@ -43,7 +43,7 @@ class RegistryPtr Registry* Registry::instance() { - static RegistryPtr s_nodeFactory = osgNew Registry; + static RegistryPtr s_nodeFactory = new Registry; return s_nodeFactory.get(); } diff --git a/src/osgGA/AnimationPathManipulator.cpp b/src/osgGA/AnimationPathManipulator.cpp index bbdd5f198..9eb0a4138 100644 --- a/src/osgGA/AnimationPathManipulator.cpp +++ b/src/osgGA/AnimationPathManipulator.cpp @@ -12,7 +12,7 @@ AnimationPathManipulator::AnimationPathManipulator(osg::AnimationPath* animation AnimationPathManipulator::AnimationPathManipulator( const std::string& filename ) { - _animationPath = osgNew osg::AnimationPath; + _animationPath = new osg::AnimationPath; _animationPath->setLoopMode(osg::AnimationPath::LOOP); _timeOffset = 0.0f; _timeScale = 1.0f; diff --git a/src/osgGA/DriveManipulator.cpp b/src/osgGA/DriveManipulator.cpp index cd1301153..22fee8d67 100644 --- a/src/osgGA/DriveManipulator.cpp +++ b/src/osgGA/DriveManipulator.cpp @@ -67,7 +67,7 @@ void DriveManipulator::home(const GUIEventAdapter& ea,GUIActionAdapter& us) bool cameraSet = false; - osg::ref_ptr segDown = osgNew osg::LineSegment; + osg::ref_ptr segDown = new osg::LineSegment; segDown->set(ep,bp); iv.addLineSegment(segDown.get()); @@ -106,7 +106,7 @@ void DriveManipulator::home(const GUIEventAdapter& ea,GUIActionAdapter& us) bp = ep; bp.z() += _modelScale; - osg::ref_ptr segUp = osgNew osg::LineSegment; + osg::ref_ptr segUp = new osg::LineSegment; segUp->set(ep,bp); iv.addLineSegment(segUp.get()); @@ -183,7 +183,7 @@ void DriveManipulator::init(const GUIEventAdapter& ea,GUIActionAdapter& us) bool cameraSet = false; - osg::ref_ptr segDown = osgNew osg::LineSegment; + osg::ref_ptr segDown = new osg::LineSegment; segDown->set(ep,bp); iv.addLineSegment(segDown.get()); @@ -222,7 +222,7 @@ void DriveManipulator::init(const GUIEventAdapter& ea,GUIActionAdapter& us) bp = ep; bp.z() += _modelScale; - osg::ref_ptr segUp = osgNew osg::LineSegment; + osg::ref_ptr segUp = new osg::LineSegment; segUp->set(ep,bp); iv.addLineSegment(segUp.get()); @@ -507,7 +507,7 @@ bool DriveManipulator::calcMovement() // check to see if any obstruction in front. osgUtil::IntersectVisitor iv; - osg::ref_ptr segForward = osgNew osg::LineSegment; + osg::ref_ptr segForward = new osg::LineSegment; segForward->set(_eye,_eye+lv*(signedBuffer+distanceToMove)); iv.addLineSegment(segForward.get()); @@ -532,7 +532,7 @@ bool DriveManipulator::calcMovement() iv.reset(); - osg::ref_ptr segNormal = osgNew osg::LineSegment; + osg::ref_ptr segNormal = new osg::LineSegment; segNormal->set(fp,lfp); iv.addLineSegment(segNormal.get()); @@ -568,7 +568,7 @@ bool DriveManipulator::calcMovement() iv.reset(); - osg::ref_ptr segFall = osgNew osg::LineSegment; + osg::ref_ptr segFall = new osg::LineSegment; segFall->set(lfp,dp); iv.addLineSegment(segFall.get()); diff --git a/src/osgGLUT/Viewer.cpp b/src/osgGLUT/Viewer.cpp index c6bd504fd..5b43c7115 100644 --- a/src/osgGLUT/Viewer.cpp +++ b/src/osgGLUT/Viewer.cpp @@ -100,7 +100,7 @@ Viewer::Viewer() _printStats = 0; // gwm change from bool was : false; #ifdef SGV_USE_RTFS - fs = osgNew RTfs( RTFS_MODE_RTC_SPIN ); + fs = new RTfs( RTFS_MODE_RTC_SPIN ); frame_rate = 16; fs->setUpdateRate( frame_rate ); #endif @@ -125,9 +125,9 @@ Viewer::Viewer() _focusedViewport = 0; // The viewport with mouse/keyboard focus - _frameStamp = osgNew osg::FrameStamp; + _frameStamp = new osg::FrameStamp; - _displaySettings = osgNew osg::DisplaySettings; + _displaySettings = new osg::DisplaySettings; _recordingAnimationPath = false; @@ -230,7 +230,7 @@ bool Viewer::open() sceneView->setViewport(view[0], view[1], view[2], view[3]); - osg::ref_ptr ea = osgNew GLUTEventAdapter; + osg::ref_ptr ea = new GLUTEventAdapter; ea->adaptResize(clockSeconds(), view[0], view[1], view[0]+view[2], view[1]+view[3]); @@ -356,7 +356,7 @@ void Viewer::selectCameraManipulator(unsigned int pos, unsigned int viewport) viewp._cameraManipulator->setCamera(sceneView->getCamera()); viewp._cameraManipulator->setNode(sceneView->getSceneData()); - osg::ref_ptr ea = osgNew GLUTEventAdapter; + osg::ref_ptr ea = new GLUTEventAdapter; viewp._cameraManipulator->init(*ea,*this); } @@ -378,7 +378,7 @@ float Viewer::app(unsigned int viewport) // update the camera manipulator. - osg::ref_ptr ea = osgNew GLUTEventAdapter; + osg::ref_ptr ea = new GLUTEventAdapter; ea->adaptFrame(_frameStamp->getReferenceTime()); for (EventHandlerList::iterator eh = _viewportList[viewport]._eventHandlerList.begin(); @@ -628,7 +628,7 @@ void Viewer::showStats(const unsigned int /*viewport*/) //osg::notify(osg::INFO) << "ntop "<< ntop<< std::endl; } maxbins=(primStats[0].getBins()>maxbins)?primStats[0].getBins():maxbins; - osgDelete [] primStats; // free up + delete [] primStats; // free up } if (_printStats==Statistics::STAT_DC) { // yet more stats - read the depth complexity int wid=_ww, ht=_wh; // temporary local screen size - must change during this section @@ -668,9 +668,9 @@ void Viewer::showStats(const unsigned int /*viewport*/) displaytext(0,(int)(0.86f*vh),ctext); glEnable(GL_STENCIL_TEST); // re-enable stencil buffer counting - osgDelete [] buffer; + delete [] buffer; } - osgDelete [] clin; + delete [] clin; } } @@ -756,7 +756,7 @@ void Viewer::reshape(GLint w, GLint h) sceneView->setViewport(view[0], view[1], view[2], view[3]); - osg::ref_ptr ea = osgNew GLUTEventAdapter; + osg::ref_ptr ea = new GLUTEventAdapter; ea->adaptResize(clockSeconds(), view[0], view[1], view[0]+view[2], view[1]+view[3]); @@ -780,7 +780,7 @@ void Viewer::reshape(GLint w, GLint h) void Viewer::mouseMotion(int x, int y) { - osg::ref_ptr ea = osgNew GLUTEventAdapter; + osg::ref_ptr ea = new GLUTEventAdapter; ea->adaptMouseMotion(clockSeconds(),x,y); bool handled = false; @@ -810,7 +810,7 @@ void Viewer::mouseMotion(int x, int y) void Viewer::mousePassiveMotion(int x, int y) { - osg::ref_ptr ea = osgNew GLUTEventAdapter; + osg::ref_ptr ea = new GLUTEventAdapter; ea->adaptMousePassiveMotion(clockSeconds(),x,y); // Switch viewport focus if no buttons are pressed @@ -844,7 +844,7 @@ void Viewer::mousePassiveMotion(int x, int y) void Viewer::mouse(int button, int state, int x, int y) { - osg::ref_ptr ea = osgNew GLUTEventAdapter; + osg::ref_ptr ea = new GLUTEventAdapter; ea->adaptMouse(clockSeconds(),button,state,x,y); // Switch viewport focus if button is pressed, and it is the only one @@ -884,7 +884,7 @@ void Viewer::mouse(int button, int state, int x, int y) void Viewer::keyboard(unsigned char key, int x, int y) { - osg::ref_ptr ea = osgNew GLUTEventAdapter; + osg::ref_ptr ea = new GLUTEventAdapter; ea->adaptKeyboard(clockSeconds(),key,x,y); for ( EventHandlerList::iterator eh = @@ -912,7 +912,7 @@ void Viewer::keyboard(unsigned char key, int x, int y) osg::StateSet* globalStateSet = sceneView->getGlobalStateSet(); if (!globalStateSet) { - globalStateSet = osgNew osg::StateSet; + globalStateSet = new osg::StateSet; sceneView->setGlobalStateSet(globalStateSet); } @@ -1022,7 +1022,7 @@ void Viewer::keyboard(unsigned char key, int x, int y) osg::ShadeModel* shademodel = dynamic_cast(stateset->getAttribute(osg::StateAttribute::SHADEMODEL)); if (!shademodel) { - shademodel = osgNew osg::ShadeModel; + shademodel = new osg::ShadeModel; stateset->setAttribute(shademodel,osg::StateAttribute::OVERRIDE); } @@ -1096,7 +1096,7 @@ void Viewer::keyboard(unsigned char key, int x, int y) // thus causing them to all use the same texture attribute, hence // preventing a state attribute change due to unused textures. globalStateSet->setTextureMode(0,GL_TEXTURE_2D,osg::StateAttribute::OVERRIDE|osg::StateAttribute::OFF); -// static osg::ref_ptr blank_texture = osgNew osg::Texture2D; +// static osg::ref_ptr blank_texture = new osg::Texture2D; // globalStateSet->setTextureAttribute(0,blank_texture.get()); } break; @@ -1106,7 +1106,7 @@ void Viewer::keyboard(unsigned char key, int x, int y) osg::LightModel* lightmodel = dynamic_cast(globalStateSet->getAttribute(osg::StateAttribute::LIGHTMODEL)); if (lightmodel) { - lightmodel = osgNew osg::LightModel; + lightmodel = new osg::LightModel; globalStateSet->setAttribute(lightmodel); } lightmodel->setTwoSided(!lightmodel->getTwoSided()); @@ -1116,7 +1116,7 @@ void Viewer::keyboard(unsigned char key, int x, int y) case 'w' : { polymode = (polymode+1)%3; - osg::PolygonMode* polyModeObj = osgNew osg::PolygonMode; + osg::PolygonMode* polyModeObj = new osg::PolygonMode; polyModeObj->setMode(osg::PolygonMode::FRONT_AND_BACK,polymodes[polymode]); globalStateSet->setAttribute(polyModeObj); } @@ -1183,12 +1183,12 @@ void Viewer::keyboard(unsigned char key, int x, int y) case 'O' : { - osg::ref_ptr viewport = osgNew osg::Viewport; + osg::ref_ptr viewport = new osg::Viewport; viewport->setViewport(_wx,_wy,_ww,_wh); std::string filename("screenshot.bmp"); glReadBuffer(GL_FRONT); - osg::ref_ptr image = osgNew osg::Image; + osg::ref_ptr image = new osg::Image; image->readPixels(viewport->x(),viewport->y(),viewport->width(),viewport->height(), GL_RGB,GL_UNSIGNED_BYTE); @@ -1207,12 +1207,12 @@ void Viewer::keyboard(unsigned char key, int x, int y) cov.pushViewport(sceneView->getViewport()); if (sceneView->getProjectionMatrix()) cov.pushProjectionMatrix(sceneView->getProjectionMatrix()); - else if (sceneView->getCamera()) cov.pushProjectionMatrix(osgNew Matrix(sceneView->getCamera()->getProjectionMatrix())); - else cov.pushProjectionMatrix(osgNew Matrix()); + else if (sceneView->getCamera()) cov.pushProjectionMatrix(new Matrix(sceneView->getCamera()->getProjectionMatrix())); + else cov.pushProjectionMatrix(new Matrix()); if (sceneView->getModelViewMatrix()) cov.pushModelViewMatrix(sceneView->getModelViewMatrix()); - else if (sceneView->getCamera()) cov.pushModelViewMatrix(osgNew Matrix(sceneView->getCamera()->getModelViewMatrix())); - else cov.pushModelViewMatrix(osgNew Matrix()); + else if (sceneView->getCamera()) cov.pushModelViewMatrix(new Matrix(sceneView->getCamera()->getModelViewMatrix())); + else cov.pushModelViewMatrix(new Matrix()); sceneView->getSceneData()->accept(cov); @@ -1236,7 +1236,7 @@ void Viewer::keyboard(unsigned char key, int x, int y) return; } - osg::ref_ptr lineSegment = osgNew osg::LineSegment; + osg::ref_ptr lineSegment = new osg::LineSegment; lineSegment->set(near_point,far_point); osg::notify(osg::NOTICE) << "start("<start()<<") end("<end()<<")"<< std::endl; @@ -1455,7 +1455,7 @@ void Viewer::help(std::ostream& fout) <<" current mouse x and mouse y position."<< std::endl << std::endl <<"r Calculate and report the intersections with the scene under the"<< std::endl - <<" current mouse x and mouse y position and osgDelete the nearest"<< std::endl + <<" current mouse x and mouse y position and delete the nearest"<< std::endl <<" interesected geoset."<< std::endl << std::endl <<"7 Set the background color to black."<< std::endl @@ -1507,7 +1507,7 @@ bool Viewer::run() { // Reset the views of all of SceneViews - osg::ref_ptr ea = osgNew GLUTEventAdapter; + osg::ref_ptr ea = new GLUTEventAdapter; for(ViewportList::iterator itr=_viewportList.begin(); itr!=_viewportList.end(); @@ -1554,7 +1554,7 @@ unsigned int Viewer::addViewport(osgUtil::SceneView* sv, unsigned int Viewer::addViewport(osg::Node* rootnode, float x, float y, float width, float height) { - osgUtil::SceneView *sceneView = osgNew osgUtil::SceneView(_displaySettings.get()); + osgUtil::SceneView *sceneView = new osgUtil::SceneView(_displaySettings.get()); sceneView->setDefaults(); sceneView->setSceneData(rootnode); diff --git a/src/osgParticle/ModularEmitter.cpp b/src/osgParticle/ModularEmitter.cpp index 31c21a059..e654ac6f5 100644 --- a/src/osgParticle/ModularEmitter.cpp +++ b/src/osgParticle/ModularEmitter.cpp @@ -3,9 +3,9 @@ osgParticle::ModularEmitter::ModularEmitter() : Emitter(), - counter_(osgNew RandomRateCounter), - placer_(osgNew PointPlacer), - shooter_(osgNew RadialShooter) + counter_(new RandomRateCounter), + placer_(new PointPlacer), + shooter_(new RadialShooter) { } diff --git a/src/osgParticle/Particle.cpp b/src/osgParticle/Particle.cpp index 7d4da374a..09063a276 100644 --- a/src/osgParticle/Particle.cpp +++ b/src/osgParticle/Particle.cpp @@ -24,9 +24,9 @@ osgParticle::Particle::Particle() sr_(0.2f, 0.2f), ar_(1, 0), cr_(osg::Vec4(1, 1, 1, 1), osg::Vec4(1, 1, 1, 1)), - si_(osgNew LinearInterpolator), - ai_(osgNew LinearInterpolator), - ci_(osgNew LinearInterpolator), + si_(new LinearInterpolator), + ai_(new LinearInterpolator), + ci_(new LinearInterpolator), alive_(true), mustdie_(false), lifetime_(2), diff --git a/src/osgParticle/ParticleSystem.cpp b/src/osgParticle/ParticleSystem.cpp index a5faa04b3..bf8a51958 100644 --- a/src/osgParticle/ParticleSystem.cpp +++ b/src/osgParticle/ParticleSystem.cpp @@ -125,30 +125,30 @@ void osgParticle::ParticleSystem::drawImplementation(osg::State &state) const void osgParticle::ParticleSystem::setDefaultAttributes(const std::string &texturefile, bool emissive_particles, bool lighting, int texture_unit) { - osg::StateSet *stateset = osgNew osg::StateSet; + osg::StateSet *stateset = new osg::StateSet; stateset->setMode(GL_LIGHTING, lighting? osg::StateAttribute::ON: osg::StateAttribute::OFF); stateset->setRenderingHint(osg::StateSet::TRANSPARENT_BIN); - osg::Material *material = osgNew osg::Material; + osg::Material *material = new osg::Material; material->setSpecular(osg::Material::FRONT, osg::Vec4(0, 0, 0, 1)); material->setEmission(osg::Material::FRONT, osg::Vec4(0, 0, 0, 1)); material->setColorMode(lighting? osg::Material::AMBIENT_AND_DIFFUSE : osg::Material::OFF); stateset->setAttributeAndModes(material, osg::StateAttribute::ON); if (!texturefile.empty()) { - osg::Texture2D *texture = osgNew osg::Texture2D; + osg::Texture2D *texture = new osg::Texture2D; texture->setImage(osgDB::readImageFile(texturefile)); texture->setFilter(osg::Texture2D::MIN_FILTER, osg::Texture2D::LINEAR); texture->setFilter(osg::Texture2D::MAG_FILTER, osg::Texture2D::LINEAR); stateset->setTextureAttributeAndModes(texture_unit, texture, osg::StateAttribute::ON); - osg::TexEnv *texenv = osgNew osg::TexEnv; + osg::TexEnv *texenv = new osg::TexEnv; texenv->setMode(osg::TexEnv::MODULATE); stateset->setTextureAttribute(texture_unit, texenv); } - osg::BlendFunc *blend = osgNew osg::BlendFunc; + osg::BlendFunc *blend = new osg::BlendFunc; if (emissive_particles) { blend->setFunction(osg::BlendFunc::SRC_ALPHA, osg::BlendFunc::ONE); } else { diff --git a/src/osgPlugins/geo/ReaderWriterGEO.cpp b/src/osgPlugins/geo/ReaderWriterGEO.cpp index 4b1a33ba5..431689123 100644 --- a/src/osgPlugins/geo/ReaderWriterGEO.cpp +++ b/src/osgPlugins/geo/ReaderWriterGEO.cpp @@ -409,7 +409,7 @@ class ReaderWriterGEO : public ReaderWriter } else { - Group* group = osgNew Group; + Group* group = new Group; group->setName("import group"); for(NodeList::iterator itr=nodeList.begin(); itr!=nodeList.end(); @@ -698,10 +698,10 @@ class ReaderWriterGEO : public ReaderWriter osg::MatrixTransform *makeText(georecord *gr) { // make transform, geode & text std::string ttfPath("fonts/times.ttf"); int gFontSize1=2; - osgText::PolygonFont* polygonFont= osgNew osgText::PolygonFont(ttfPath, + osgText::PolygonFont* polygonFont= new osgText::PolygonFont(ttfPath, gFontSize1, 3); - osgText::Text *text= osgNew osgText::Text(polygonFont); + osgText::Text *text= new osgText::Text(polygonFont); const geoField *gfd=gr->getField(GEO_DB_TEXT_NAME); //const char *name=gfd ? gfd->getChar() : "a text"; gfd=gr->getField(GEO_DB_TEXT_STRING); @@ -735,7 +735,7 @@ class ReaderWriterGEO : public ReaderWriter } } osg::Geode *geod=new osg::Geode; - osg::StateSet *textState = osgNew osg::StateSet(); + osg::StateSet *textState = new osg::StateSet(); textState->setMode(GL_LIGHTING, osg::StateAttribute::OFF); geod->setStateSet( textState ); osg::MatrixTransform *numt=new osg::MatrixTransform; diff --git a/src/osgPlugins/lwo/Lwo2.cpp b/src/osgPlugins/lwo/Lwo2.cpp index 95c5824df..1286992fe 100644 --- a/src/osgPlugins/lwo/Lwo2.cpp +++ b/src/osgPlugins/lwo/Lwo2.cpp @@ -264,7 +264,7 @@ Lwo2::_read_layer(unsigned long size) unsigned short number = _read_short(); size -= 2; - Lwo2Layer* layer = osgNew Lwo2Layer(); + Lwo2Layer* layer = new Lwo2Layer(); _layers[number] = layer; _current_layer = layer; layer->_number = number; @@ -540,7 +540,7 @@ Lwo2::_read_image_definition(unsigned long size) void Lwo2::_read_surface(unsigned long size) { - Lwo2Surface* surface = osgNew Lwo2Surface(); + Lwo2Surface* surface = new Lwo2Surface(); surface->image_index = -1; surface->state_set = NULL; @@ -658,7 +658,7 @@ Lwo2::GenerateGroup( Group& group ) // itr++; // itr++; { - osg::Geode* geode = osgNew osg::Geode(); + osg::Geode* geode = new osg::Geode(); notify(DEBUG_INFO) << "Generate geode for layer " << (*itr).first << std::endl; DrawableToTagMapping tag_mapping; @@ -684,7 +684,7 @@ Lwo2::_generate_statesets_from_surfaces() for (IteratorSurfaces itr_surf = _surfaces.begin(); itr_surf != _surfaces.end(); itr_surf++) { Lwo2Surface* surface = (*itr_surf).second; - StateSet* state_set = osgNew osg::StateSet; + StateSet* state_set = new osg::StateSet; notify(DEBUG_INFO) << "\tcreating surface " << (*itr_surf).first << std::endl; @@ -696,14 +696,14 @@ Lwo2::_generate_statesets_from_surfaces() notify(DEBUG_INFO) << "\tresult - " << image << std::endl; if (image) { - Texture2D* texture = osgNew osg::Texture2D; + Texture2D* texture = new osg::Texture2D; texture->setImage(image); state_set->setTextureAttributeAndModes(0, texture, StateAttribute::ON); } } // set color - Material* material = osgNew Material(); + Material* material = new Material(); Vec4 color(surface->color[0], surface->color[1], surface->color[2], @@ -712,7 +712,7 @@ Lwo2::_generate_statesets_from_surfaces() state_set->setAttribute(material); // setup culling - CullFace* cull = osgNew CullFace(); + CullFace* cull = new CullFace(); cull->setMode(CullFace::BACK); state_set->setAttribute(cull); state_set->setMode(GL_CULL_FACE, StateAttribute::ON); diff --git a/src/osgPlugins/lwo/Lwo2Layer.cpp b/src/osgPlugins/lwo/Lwo2Layer.cpp index d21aabcd9..ddf14ab3f 100644 --- a/src/osgPlugins/lwo/Lwo2Layer.cpp +++ b/src/osgPlugins/lwo/Lwo2Layer.cpp @@ -95,13 +95,13 @@ Lwo2Layer::GenerateGeode( Geode& geode, short tags_count, DrawableToTagMapping& have_texture_coords = false; // new geometry - ref_ptr geometry = osgNew Geometry; + ref_ptr geometry = new Geometry; // create coords array - ref_ptr coords = osgNew Vec3Array; + ref_ptr coords = new Vec3Array; // create texture array - ref_ptr texcoords = osgNew Vec2Array; + ref_ptr texcoords = new Vec2Array; // selecting polygons for current layer only int polygon_index = 0; @@ -159,15 +159,15 @@ Lwo2Layer::GenerateGeode( Geode& geode, short tags_count, DrawableToTagMapping& unsigned int points_count = (*polygon_iterator).size(); if (points_count == 3) { - geometry->addPrimitiveSet(osgNew DrawArrays(PrimitiveSet::TRIANGLES, points_start, points_count)); + geometry->addPrimitiveSet(new DrawArrays(PrimitiveSet::TRIANGLES, points_start, points_count)); } else if (points_count == 4) { - geometry->addPrimitiveSet(osgNew DrawArrays(PrimitiveSet::QUADS, points_start, points_count)); + geometry->addPrimitiveSet(new DrawArrays(PrimitiveSet::QUADS, points_start, points_count)); } else { - geometry->addPrimitiveSet(osgNew DrawArrays(PrimitiveSet::POLYGON, points_start, points_count)); + geometry->addPrimitiveSet(new DrawArrays(PrimitiveSet::POLYGON, points_start, points_count)); } } } @@ -194,7 +194,7 @@ Lwo2Layer::GenerateGeode( Geode& geode, short tags_count, DrawableToTagMapping& unsigned int points_start = (*coords).size() - (*polygon_iterator).size(); unsigned int points_count = (*polygon_iterator).size(); - geometry->addPrimitiveSet(osgNew DrawArrays(PrimitiveSet::TRIANGLE_FAN, points_start, points_count)); + geometry->addPrimitiveSet(new DrawArrays(PrimitiveSet::TRIANGLE_FAN, points_start, points_count)); } // triangle strips of current layer @@ -219,7 +219,7 @@ Lwo2Layer::GenerateGeode( Geode& geode, short tags_count, DrawableToTagMapping& unsigned int points_start = (*coords).size() - (*polygon_iterator).size(); unsigned int points_count = (*polygon_iterator).size(); - geometry->addPrimitiveSet(osgNew DrawArrays(PrimitiveSet::TRIANGLE_STRIP, points_start, points_count)); + geometry->addPrimitiveSet(new DrawArrays(PrimitiveSet::TRIANGLE_STRIP, points_start, points_count)); } // add geometry if it contains any points diff --git a/src/osgPlugins/lwo/ReaderWriterLWO.cpp b/src/osgPlugins/lwo/ReaderWriterLWO.cpp index 4bb38c187..58572fd85 100644 --- a/src/osgPlugins/lwo/ReaderWriterLWO.cpp +++ b/src/osgPlugins/lwo/ReaderWriterLWO.cpp @@ -70,10 +70,10 @@ osgDB::RegisterReaderWriterProxy g_lwoReaderWriterProxy; osgDB::ReaderWriter::ReadResult ReaderWriterLWO::readNode_LWO2(const std::string& fileName, const osgDB::ReaderWriter::Options*) { - std::auto_ptr lwo2(osgNew Lwo2()); + std::auto_ptr lwo2(new Lwo2()); if (lwo2->ReadFile(fileName)) { - osg::ref_ptr group = osgNew osg::Group(); + osg::ref_ptr group = new osg::Group(); if (lwo2->GenerateGroup(*group)) return group.take(); } return ReadResult::FILE_NOT_HANDLED; @@ -145,14 +145,14 @@ osgDB::ReaderWriter::ReadResult ReaderWriterLWO::readNode_LWO1(const std::string { lwMaterial& lw_material = lw->material[itr->first]; - gc._geom = osgNew osg::Geometry; + gc._geom = new osg::Geometry; - osg::Vec3Array* vertArray = osgNew osg::Vec3Array(gc._numPoints); + osg::Vec3Array* vertArray = new osg::Vec3Array(gc._numPoints); gc._vertices = vertArray->begin(); gc._geom->setVertexArray(vertArray); // set up color. - osg::Vec4Array* colors = osgNew osg::Vec4Array(1); + osg::Vec4Array* colors = new osg::Vec4Array(1); (*colors)[0].set(lw_material.r, lw_material.g, lw_material.b, @@ -171,10 +171,10 @@ osgDB::ReaderWriter::ReadResult ReaderWriterLWO::readNode_LWO1(const std::string if (image) { // create state - osg::StateSet* stateset = osgNew osg::StateSet; + osg::StateSet* stateset = new osg::StateSet; // create texture - osg::Texture2D* texture = osgNew osg::Texture2D; + osg::Texture2D* texture = new osg::Texture2D; texture->setImage(image); // texture wrap mode @@ -194,7 +194,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterLWO::readNode_LWO1(const std::string gc._geom->setStateSet(stateset); - osg::Vec2Array* texcoordArray = osgNew osg::Vec2Array(gc._numPoints); + osg::Vec2Array* texcoordArray = new osg::Vec2Array(gc._numPoints); gc._texcoords = texcoordArray->begin(); gc._geom->setTexCoordArray(0,texcoordArray); } @@ -234,7 +234,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterLWO::readNode_LWO1(const std::string break; } - gc._geom->addPrimitiveSet(osgNew osg::DrawArrays(mode,gc._coordCount,face.index_cnt)); + gc._geom->addPrimitiveSet(new osg::DrawArrays(mode,gc._coordCount,face.index_cnt)); gc._coordCount += face.index_cnt; // From the spec_low.lxt : @@ -261,7 +261,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterLWO::readNode_LWO1(const std::string } } - osg::Geode* geode = osgNew osg::Geode; + osg::Geode* geode = new osg::Geode; osgUtil::Tesselator tesselator; diff --git a/src/osgPlugins/osg/AlphaFunc.cpp b/src/osgPlugins/osg/AlphaFunc.cpp index 220d19d4f..05fd236e4 100644 --- a/src/osgPlugins/osg/AlphaFunc.cpp +++ b/src/osgPlugins/osg/AlphaFunc.cpp @@ -16,7 +16,7 @@ const char* AlphaFunc_getFuncStr(AlphaFunc::ComparisonFunction func); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_AlphaFuncProxy ( - osgNew osg::AlphaFunc, + new osg::AlphaFunc, "AlphaFunc", "Object StateAttribute AlphaFunc", &AlphaFunc_readLocalData, diff --git a/src/osgPlugins/osg/AnimationPath.cpp b/src/osgPlugins/osg/AnimationPath.cpp index 431f7a6d2..699b4058d 100644 --- a/src/osgPlugins/osg/AnimationPath.cpp +++ b/src/osgPlugins/osg/AnimationPath.cpp @@ -18,7 +18,7 @@ bool AnimationPath_writeLocalData(const osg::Object &obj, osgDB::Output &fw); // register the read and write functions with the osgDB::Registry. osgDB::RegisterDotOsgWrapperProxy AnimationPath_Proxy ( - osgNew osg::AnimationPath, + new osg::AnimationPath, "AnimationPath", "Object AnimationPath", AnimationPath_readLocalData, diff --git a/src/osgPlugins/osg/Billboard.cpp b/src/osgPlugins/osg/Billboard.cpp index 875094efa..1914aa2b1 100644 --- a/src/osgPlugins/osg/Billboard.cpp +++ b/src/osgPlugins/osg/Billboard.cpp @@ -14,7 +14,7 @@ bool Billboard_writeLocalData(const Object& obj, Output& fw); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_BillboardProxy ( - osgNew osg::Billboard, + new osg::Billboard, "Billboard", "Object Node Geode Billboard", &Billboard_readLocalData, diff --git a/src/osgPlugins/osg/BlendFunc.cpp b/src/osgPlugins/osg/BlendFunc.cpp index c9b7736dd..866350d11 100644 --- a/src/osgPlugins/osg/BlendFunc.cpp +++ b/src/osgPlugins/osg/BlendFunc.cpp @@ -18,7 +18,7 @@ const char* BlendFunc_getModeStr(int value); RegisterDotOsgWrapperProxy g_TransparencyProxy ( - osgNew osg::BlendFunc, + new osg::BlendFunc, "Transparency", "Object StateAttribute Transparency", &BlendFunc_readLocalData, @@ -27,7 +27,7 @@ RegisterDotOsgWrapperProxy g_TransparencyProxy RegisterDotOsgWrapperProxy g_BlendFuncProxy ( - osgNew osg::BlendFunc, + new osg::BlendFunc, "BlendFunc", "Object StateAttribute BlendFunc", &BlendFunc_readLocalData, diff --git a/src/osgPlugins/osg/ClearNode.cpp b/src/osgPlugins/osg/ClearNode.cpp index d62db2d3e..bc281c5ba 100644 --- a/src/osgPlugins/osg/ClearNode.cpp +++ b/src/osgPlugins/osg/ClearNode.cpp @@ -15,7 +15,7 @@ bool ClearNode_writeLocalData(const Object& obj, Output& fw); RegisterDotOsgWrapperProxy g_EarthSkyProxy ( - osgNew osg::ClearNode, + new osg::ClearNode, "EarthSky", "Object Node EarthSky Group", &ClearNode_readLocalData, @@ -24,7 +24,7 @@ RegisterDotOsgWrapperProxy g_EarthSkyProxy RegisterDotOsgWrapperProxy g_ClearNodeProxy ( - osgNew osg::ClearNode, + new osg::ClearNode, "ClearNode", "Object Node ClearNode Group", &ClearNode_readLocalData, diff --git a/src/osgPlugins/osg/ClipPlane.cpp b/src/osgPlugins/osg/ClipPlane.cpp index c45c43da7..944877575 100644 --- a/src/osgPlugins/osg/ClipPlane.cpp +++ b/src/osgPlugins/osg/ClipPlane.cpp @@ -18,7 +18,7 @@ bool ClipPlane_writeLocalData(const Object& obj, Output& fw); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_ClipPlaneProxy ( - osgNew osg::ClipPlane, + new osg::ClipPlane, "ClipPlane", "Object StateAttribute ClipPlane", &ClipPlane_readLocalData, diff --git a/src/osgPlugins/osg/ColorMask.cpp b/src/osgPlugins/osg/ColorMask.cpp index 0ae194f21..e1ae1fcbe 100644 --- a/src/osgPlugins/osg/ColorMask.cpp +++ b/src/osgPlugins/osg/ColorMask.cpp @@ -16,7 +16,7 @@ const char* ColorMask_getModeStr(bool mode); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_ColorMaskProxy ( - osgNew osg::ColorMask, + new osg::ColorMask, "ColorMask", "Object StateAttribute ColorMask", &ColorMask_readLocalData, diff --git a/src/osgPlugins/osg/ColorMatrix.cpp b/src/osgPlugins/osg/ColorMatrix.cpp index 104738263..eaf522012 100644 --- a/src/osgPlugins/osg/ColorMatrix.cpp +++ b/src/osgPlugins/osg/ColorMatrix.cpp @@ -14,7 +14,7 @@ bool ColorMatrix_writeLocalData(const Object& obj, Output& fw); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_ColorMatrixProxy ( - osgNew osg::ColorMatrix, + new osg::ColorMatrix, "ColorMatrix", "Object StateAttribute ColorMatrix", &ColorMatrix_readLocalData, diff --git a/src/osgPlugins/osg/ConvexPlanarOccluder.cpp b/src/osgPlugins/osg/ConvexPlanarOccluder.cpp index a7f5c4f7b..79d984801 100644 --- a/src/osgPlugins/osg/ConvexPlanarOccluder.cpp +++ b/src/osgPlugins/osg/ConvexPlanarOccluder.cpp @@ -20,7 +20,7 @@ bool ConvexPlanarOccluder_writeLocalData(const Object& obj, Output& fw); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_ConvexPlanarOccluderFuncProxy ( - osgNew osg::ConvexPlanarOccluder, + new osg::ConvexPlanarOccluder, "ConvexPlanarOccluder", "Object ConvexPlanarOccluder", &ConvexPlanarOccluder_readLocalData, diff --git a/src/osgPlugins/osg/CullFace.cpp b/src/osgPlugins/osg/CullFace.cpp index 44926d8b3..60e79ae84 100644 --- a/src/osgPlugins/osg/CullFace.cpp +++ b/src/osgPlugins/osg/CullFace.cpp @@ -14,7 +14,7 @@ bool CullFace_writeLocalData(const Object& obj, Output& fw); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_CullFaceFuncProxy ( - osgNew osg::CullFace, + new osg::CullFace, "CullFace", "Object StateAttribute CullFace", &CullFace_readLocalData, diff --git a/src/osgPlugins/osg/DOFTransform.cpp b/src/osgPlugins/osg/DOFTransform.cpp index 328831fb8..e7c0cbc77 100644 --- a/src/osgPlugins/osg/DOFTransform.cpp +++ b/src/osgPlugins/osg/DOFTransform.cpp @@ -15,7 +15,7 @@ bool DOFTransform_writeLocalData(const Object& obj, Output& fw); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_DOFTransformProxy ( - osgNew osg::DOFTransform, + new osg::DOFTransform, "DOFTransform", "Object Node Transform DOFTransform Group", &DOFTransform_readLocalData, diff --git a/src/osgPlugins/osg/Depth.cpp b/src/osgPlugins/osg/Depth.cpp index d7d5352b7..3fa441a63 100644 --- a/src/osgPlugins/osg/Depth.cpp +++ b/src/osgPlugins/osg/Depth.cpp @@ -18,7 +18,7 @@ const char* Depth_getFuncStr(Depth::Function func); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_DepthProxy ( - osgNew osg::Depth, + new osg::Depth, "Depth", "Object StateAttribute Depth", &Depth_readLocalData, diff --git a/src/osgPlugins/osg/Drawable.cpp b/src/osgPlugins/osg/Drawable.cpp index 342cb5132..947967d98 100644 --- a/src/osgPlugins/osg/Drawable.cpp +++ b/src/osgPlugins/osg/Drawable.cpp @@ -27,7 +27,7 @@ bool Drawable_readLocalData(Object& obj, Input& fr) Drawable& drawable = static_cast(obj); - static ref_ptr s_drawstate = osgNew osg::StateSet; + static ref_ptr s_drawstate = new osg::StateSet; if (StateSet* readState = static_cast(fr.readObjectOfType(*s_drawstate))) { drawable.setStateSet(readState); diff --git a/src/osgPlugins/osg/Fog.cpp b/src/osgPlugins/osg/Fog.cpp index 751861e84..4204d0496 100644 --- a/src/osgPlugins/osg/Fog.cpp +++ b/src/osgPlugins/osg/Fog.cpp @@ -20,7 +20,7 @@ const char* Fog_getModeStr(Fog::Mode mode); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_FogProxy ( - osgNew osg::Fog, + new osg::Fog, "Fog", "Object StateAttribute Fog", &Fog_readLocalData, diff --git a/src/osgPlugins/osg/FrontFace.cpp b/src/osgPlugins/osg/FrontFace.cpp index debffb963..f9c96fe26 100644 --- a/src/osgPlugins/osg/FrontFace.cpp +++ b/src/osgPlugins/osg/FrontFace.cpp @@ -14,7 +14,7 @@ bool FrontFace_writeLocalData(const Object& obj, Output& fw); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_FrontFaceProxy ( - osgNew osg::FrontFace, + new osg::FrontFace, "FrontFace", "Object StateAttribute FrontFace", &FrontFace_readLocalData, diff --git a/src/osgPlugins/osg/GeoSet.cpp b/src/osgPlugins/osg/GeoSet.cpp index 0f9dc9635..bba4c98b9 100644 --- a/src/osgPlugins/osg/GeoSet.cpp +++ b/src/osgPlugins/osg/GeoSet.cpp @@ -27,7 +27,7 @@ int GeoSet_getInterleavedRowLength(GeoSet::InterleaveArrayType at); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_GeoSetFuncProxy ( - osgNew osg::GeoSet, + new osg::GeoSet, "GeoSet", "Object Drawable GeoSet", &GeoSet_readLocalData, @@ -38,7 +38,7 @@ RegisterDotOsgWrapperProxy g_GeoSetFuncProxy // register the old style 'Geoset' keyword read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_GeosetFuncProxy ( - osgNew osg::GeoSet, + new osg::GeoSet, "Geoset", "Object Drawable Geoset", &GeoSet_readLocalData, @@ -136,7 +136,7 @@ bool GeoSet_readLocalData(Object& obj, Input& fr) int capacity; if (!fr[1].getInt(capacity)) capacity=100; int size = 0; - int* list = osgNew int [capacity]; + int* list = new int [capacity]; memset(list,0,capacity*sizeof(int)); while (!fr.eof() && fr[0].getNoNestedBrackets()>entry) { @@ -150,13 +150,13 @@ bool GeoSet_readLocalData(Object& obj, Input& fr) int oldCapacity = capacity; while(capacity<=size) capacity *= 2; int* oldList = list; - list = osgNew int[capacity]; + list = new int[capacity]; memset(list,0,capacity*sizeof(int)); for(int i=0;ientry) { @@ -241,14 +241,14 @@ bool GeoSet_readLocalData(Object& obj, Input& fr) int oldCapacity = capacity; while(capacity<=size) capacity *= 2; Vec3* oldList = coordList; - coordList = osgNew Vec3[capacity]; + coordList = new Vec3[capacity]; for(int i=0;ientry) { @@ -311,14 +311,14 @@ bool GeoSet_readLocalData(Object& obj, Input& fr) int oldCapacity = capacity; while(capacity<=size) capacity *= 2; Vec3* oldList = normalList; - normalList = osgNew Vec3[capacity]; + normalList = new Vec3[capacity]; for(int i=0;ientry) { @@ -381,7 +381,7 @@ bool GeoSet_readLocalData(Object& obj, Input& fr) int oldCapacity = capacity; while(capacity<=size) capacity *= 2; Vec4* oldList = colorList; - colorList = osgNew Vec4[capacity]; + colorList = new Vec4[capacity]; for(int i=0;ientry) { @@ -453,13 +453,13 @@ bool GeoSet_readLocalData(Object& obj, Input& fr) int oldCapacity = capacity; while(capacity<=size) capacity *= 2; Vec2* oldList = textureList; - textureList = osgNew Vec2[capacity]; + textureList = new Vec2[capacity]; for(int i=0;ientry) { @@ -941,12 +941,12 @@ bool GeoSet_readIndexData(Input& fr, const char* IndexName, GeoSet::IndexPointer int oldCapacity = capacity; while(capacity<=size) capacity *= 2; GLushort* oldList = coordIndexList; - coordIndexList = osgNew GLushort[capacity]; + coordIndexList = new GLushort[capacity]; for(int i=0;ientry) { @@ -977,12 +977,12 @@ bool GeoSet_readIndexData(Input& fr, const char* IndexName, GeoSet::IndexPointer int oldCapacity = capacity; while(capacity<=size) capacity *= 2; GLuint* oldList = coordIndexList; - coordIndexList = osgNew GLuint[capacity]; + coordIndexList = new GLuint[capacity]; for(int i=0;ireserve(capacity); fr += 3; @@ -125,7 +125,7 @@ bool Geometry_readLocalData(Object& obj, Input& fr) int capacity; fr[1].getInt(capacity); - Vec3Array* normals = osgNew Vec3Array; + Vec3Array* normals = new Vec3Array; normals->reserve(capacity); fr += 3; @@ -237,7 +237,7 @@ bool Geometry_readLocalData(Object& obj, Input& fr) int capacity; fr[1].getInt(capacity); - FloatArray* fogcoords = osgNew FloatArray; + FloatArray* fogcoords = new FloatArray; fogcoords->reserve(capacity); fr += 3; @@ -321,7 +321,7 @@ Array* Array_readLocalData(Input& fr) if (strcmp(arrayName,"ByteArray")==0) { - ByteArray* array = osgNew ByteArray; + ByteArray* array = new ByteArray; array->reserve(capacity); while (!fr.eof() && fr[0].getNoNestedBrackets()>entry) { @@ -338,7 +338,7 @@ Array* Array_readLocalData(Input& fr) } else if (strcmp(arrayName,"ShortArray")==0) { - ShortArray* array = osgNew ShortArray; + ShortArray* array = new ShortArray; array->reserve(capacity); while (!fr.eof() && fr[0].getNoNestedBrackets()>entry) { @@ -355,7 +355,7 @@ Array* Array_readLocalData(Input& fr) } else if (strcmp(arrayName,"IntArray")==0) { - IntArray* array = osgNew IntArray; + IntArray* array = new IntArray; array->reserve(capacity); while (!fr.eof() && fr[0].getNoNestedBrackets()>entry) { @@ -372,7 +372,7 @@ Array* Array_readLocalData(Input& fr) } else if (strcmp(arrayName,"UByteArray")==0) { - UByteArray* array = osgNew UByteArray; + UByteArray* array = new UByteArray; array->reserve(capacity); while (!fr.eof() && fr[0].getNoNestedBrackets()>entry) { @@ -389,7 +389,7 @@ Array* Array_readLocalData(Input& fr) } else if (strcmp(arrayName,"UShortArray")==0) { - UShortArray* array = osgNew UShortArray; + UShortArray* array = new UShortArray; array->reserve(capacity); while (!fr.eof() && fr[0].getNoNestedBrackets()>entry) { @@ -406,7 +406,7 @@ Array* Array_readLocalData(Input& fr) } else if (strcmp(arrayName,"UIntArray")==0) { - UIntArray* array = osgNew UIntArray; + UIntArray* array = new UIntArray; array->reserve(capacity); while (!fr.eof() && fr[0].getNoNestedBrackets()>entry) { @@ -423,7 +423,7 @@ Array* Array_readLocalData(Input& fr) } else if (strcmp(arrayName,"UByte4Array")==0) { - UByte4Array* array = osgNew UByte4Array; + UByte4Array* array = new UByte4Array; array->reserve(capacity); while (!fr.eof() && fr[0].getNoNestedBrackets()>entry) { @@ -443,7 +443,7 @@ Array* Array_readLocalData(Input& fr) } else if (strcmp(arrayName,"FloatArray")==0) { - FloatArray* array = osgNew FloatArray; + FloatArray* array = new FloatArray; array->reserve(capacity); while (!fr.eof() && fr[0].getNoNestedBrackets()>entry) { @@ -460,7 +460,7 @@ Array* Array_readLocalData(Input& fr) } else if (strcmp(arrayName,"Vec2Array")==0) { - Vec2Array* array = osgNew Vec2Array; + Vec2Array* array = new Vec2Array; array->reserve(capacity); while (!fr.eof() && fr[0].getNoNestedBrackets()>entry) { @@ -477,7 +477,7 @@ Array* Array_readLocalData(Input& fr) } else if (strcmp(arrayName,"Vec3Array")==0) { - Vec3Array* array = osgNew Vec3Array; + Vec3Array* array = new Vec3Array; array->reserve(capacity); while (!fr.eof() && fr[0].getNoNestedBrackets()>entry) { @@ -494,7 +494,7 @@ Array* Array_readLocalData(Input& fr) } else if (strcmp(arrayName,"Vec4Array")==0) { - Vec4Array* array = osgNew Vec4Array; + Vec4Array* array = new Vec4Array; array->reserve(capacity); while (!fr.eof() && fr[0].getNoNestedBrackets()>entry) { @@ -696,7 +696,7 @@ bool Primitive_readLocalData(Input& fr,osg::Geometry& geom) int count; fr[3].getInt(count); - geom.addPrimitiveSet(osgNew DrawArrays(mode,first,count)); + geom.addPrimitiveSet(new DrawArrays(mode,first,count)); fr += 4; @@ -718,7 +718,7 @@ bool Primitive_readLocalData(Input& fr,osg::Geometry& geom) fr += 5; - DrawArrayLengths* prim = osgNew DrawArrayLengths; + DrawArrayLengths* prim = new DrawArrayLengths; prim->setMode(mode); prim->setFirst(first); prim->reserve(capacity); @@ -750,7 +750,7 @@ bool Primitive_readLocalData(Input& fr,osg::Geometry& geom) fr += 4; - DrawElementsUByte* prim = osgNew DrawElementsUByte; + DrawElementsUByte* prim = new DrawElementsUByte; prim->setMode(mode); prim->reserve(capacity); @@ -781,7 +781,7 @@ bool Primitive_readLocalData(Input& fr,osg::Geometry& geom) fr += 4; - DrawElementsUShort* prim = osgNew DrawElementsUShort; + DrawElementsUShort* prim = new DrawElementsUShort; prim->setMode(mode); prim->reserve(capacity); @@ -812,7 +812,7 @@ bool Primitive_readLocalData(Input& fr,osg::Geometry& geom) fr += 4; - DrawElementsUInt* prim = osgNew DrawElementsUInt; + DrawElementsUInt* prim = new DrawElementsUInt; prim->setMode(mode); prim->reserve(capacity); diff --git a/src/osgPlugins/osg/Group.cpp b/src/osgPlugins/osg/Group.cpp index 17891e4b4..602e6d1a0 100644 --- a/src/osgPlugins/osg/Group.cpp +++ b/src/osgPlugins/osg/Group.cpp @@ -14,7 +14,7 @@ bool Group_writeLocalData(const Object& obj, Output& fw); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_GroupProxy ( - osgNew osg::Group, + new osg::Group, "Group", "Object Node Group", &Group_readLocalData, diff --git a/src/osgPlugins/osg/Image.cpp b/src/osgPlugins/osg/Image.cpp index ddcdf9133..48b3cde6b 100644 --- a/src/osgPlugins/osg/Image.cpp +++ b/src/osgPlugins/osg/Image.cpp @@ -14,7 +14,7 @@ bool Image_writeLocalData(const Object& obj, Output& fw); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_ImageFuncProxy ( - osgNew osg::Image, + new osg::Image, "Image", "Object Image", &Image_readLocalData, diff --git a/src/osgPlugins/osg/Impostor.cpp b/src/osgPlugins/osg/Impostor.cpp index 5a8f2cff0..b126c503b 100644 --- a/src/osgPlugins/osg/Impostor.cpp +++ b/src/osgPlugins/osg/Impostor.cpp @@ -14,7 +14,7 @@ bool Impostor_writeLocalData(const Object& obj, Output& fw); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_ImpostorProxy ( - osgNew osg::Impostor, + new osg::Impostor, "Impostor", "Object Node Impostor LOD Group", &Impostor_readLocalData, diff --git a/src/osgPlugins/osg/LOD.cpp b/src/osgPlugins/osg/LOD.cpp index 1fdcd1484..766783465 100644 --- a/src/osgPlugins/osg/LOD.cpp +++ b/src/osgPlugins/osg/LOD.cpp @@ -14,7 +14,7 @@ bool LOD_writeLocalData(const Object& obj, Output& fw); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_LODProxy ( - osgNew osg::LOD, + new osg::LOD, "LOD", "Object Node LOD Group", &LOD_readLocalData, diff --git a/src/osgPlugins/osg/Light.cpp b/src/osgPlugins/osg/Light.cpp index e31069326..e7b36efc6 100644 --- a/src/osgPlugins/osg/Light.cpp +++ b/src/osgPlugins/osg/Light.cpp @@ -18,7 +18,7 @@ bool Light_writeLocalData(const Object& obj, Output& fw); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_LightProxy ( - osgNew osg::Light, + new osg::Light, "Light", "Object StateAttribute Light", &Light_readLocalData, diff --git a/src/osgPlugins/osg/LightModel.cpp b/src/osgPlugins/osg/LightModel.cpp index 788a969b2..2e5238be9 100644 --- a/src/osgPlugins/osg/LightModel.cpp +++ b/src/osgPlugins/osg/LightModel.cpp @@ -15,7 +15,7 @@ bool LightModel_writeLocalData(const Object& obj, Output& fw); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_LightModelProxy ( - osgNew osg::LightModel, + new osg::LightModel, "LightModel", "Object StateAttribute LightModel", &LightModel_readLocalData, diff --git a/src/osgPlugins/osg/LightSource.cpp b/src/osgPlugins/osg/LightSource.cpp index 6eaf1ad31..6155db004 100644 --- a/src/osgPlugins/osg/LightSource.cpp +++ b/src/osgPlugins/osg/LightSource.cpp @@ -14,7 +14,7 @@ bool LightSource_writeLocalData(const Object& obj, Output& fw); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_LightSourceProxy ( - osgNew osg::LightSource, + new osg::LightSource, "LightSource", "Object Node LightSource", &LightSource_readLocalData, diff --git a/src/osgPlugins/osg/LineStipple.cpp b/src/osgPlugins/osg/LineStipple.cpp index 1286a4e6a..770d51257 100644 --- a/src/osgPlugins/osg/LineStipple.cpp +++ b/src/osgPlugins/osg/LineStipple.cpp @@ -16,7 +16,7 @@ bool LineStipple_writeLocalData(const Object& obj, Output& fw); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_LineStippleProxy ( - osgNew osg::LineStipple, + new osg::LineStipple, "LineStipple", "Object StateAttribute LineStipple", &LineStipple_readLocalData, diff --git a/src/osgPlugins/osg/LineWidth.cpp b/src/osgPlugins/osg/LineWidth.cpp index 9689654b9..fabf69ff0 100644 --- a/src/osgPlugins/osg/LineWidth.cpp +++ b/src/osgPlugins/osg/LineWidth.cpp @@ -18,7 +18,7 @@ bool LineWidth_writeLocalData(const Object& obj, Output& fw); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_LineWidthProxy ( - osgNew osg::LineWidth, + new osg::LineWidth, "LineWidth", "Object StateAttribute LineWidth", &LineWidth_readLocalData, diff --git a/src/osgPlugins/osg/Material.cpp b/src/osgPlugins/osg/Material.cpp index 282f5d193..727d211ba 100644 --- a/src/osgPlugins/osg/Material.cpp +++ b/src/osgPlugins/osg/Material.cpp @@ -19,7 +19,7 @@ bool Material_matchFaceAndColor(Input& fr,const char* name,Material::Face& mf,Ve // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_MaterialProxy ( - osgNew osg::Material, + new osg::Material, "Material", "Object StateAttribute Material", &Material_readLocalData, diff --git a/src/osgPlugins/osg/Matrix.cpp b/src/osgPlugins/osg/Matrix.cpp index 9240231f5..dae9807c8 100644 --- a/src/osgPlugins/osg/Matrix.cpp +++ b/src/osgPlugins/osg/Matrix.cpp @@ -14,7 +14,7 @@ bool Matrix_writeLocalData(const Object& obj, Output& fw); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_MatrixFuncProxy ( - osgNew osg::Matrix, + new osg::Matrix, "Matrix", "Object Matrix", &Matrix_readLocalData, diff --git a/src/osgPlugins/osg/MatrixTransform.cpp b/src/osgPlugins/osg/MatrixTransform.cpp index 365c9e7d1..acc2a5d7e 100644 --- a/src/osgPlugins/osg/MatrixTransform.cpp +++ b/src/osgPlugins/osg/MatrixTransform.cpp @@ -14,7 +14,7 @@ bool MatrixTransform_writeLocalData(const Object& obj, Output& fw); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_MatrixTransformProxy ( - osgNew osg::MatrixTransform, + new osg::MatrixTransform, "MatrixTransform", "Object Node Transform MatrixTransform Group", &MatrixTransform_readLocalData, @@ -25,7 +25,7 @@ RegisterDotOsgWrapperProxy g_MatrixTransformProxy // register old style 'DCS' read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_DCSProxy ( - osgNew osg::MatrixTransform, + new osg::MatrixTransform, "DCS", "Object Node Group DCS", &MatrixTransform_readLocalData, @@ -63,7 +63,7 @@ bool MatrixTransform_readLocalData(Object& obj, Input& fr) transform.setMatrix(*tmpMatrix); - osgDelete tmpMatrix; + delete tmpMatrix; iteratorAdvanced = true; } diff --git a/src/osgPlugins/osg/Node.cpp b/src/osgPlugins/osg/Node.cpp index 66e70d0db..644092496 100644 --- a/src/osgPlugins/osg/Node.cpp +++ b/src/osgPlugins/osg/Node.cpp @@ -14,7 +14,7 @@ bool Node_writeLocalData(const Object& obj, Output& fw); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_NodeProxy ( - osgNew osg::Node, + new osg::Node, "Node", "Object Node", &Node_readLocalData, @@ -87,7 +87,7 @@ bool Node_readLocalData(Object& obj, Input& fr) iteratorAdvanced = true; } - static ref_ptr s_drawstate = osgNew osg::StateSet; + static ref_ptr s_drawstate = new osg::StateSet; if (StateSet* readState = static_cast(fr.readObjectOfType(*s_drawstate))) { node.setStateSet(readState); diff --git a/src/osgPlugins/osg/OccluderNode.cpp b/src/osgPlugins/osg/OccluderNode.cpp index 2f61b2bae..32089aa0f 100644 --- a/src/osgPlugins/osg/OccluderNode.cpp +++ b/src/osgPlugins/osg/OccluderNode.cpp @@ -14,7 +14,7 @@ bool OccluderNode_writeLocalData(const Object& obj, Output& fw); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_OccluderNodeProxy ( - osgNew osg::OccluderNode, + new osg::OccluderNode, "OccluderNode", "Object Node OccluderNode Group", &OccluderNode_readLocalData, @@ -27,7 +27,7 @@ bool OccluderNode_readLocalData(Object& obj, Input& fr) OccluderNode& occludernode = static_cast(obj); - static ref_ptr s_occluder = osgNew ConvexPlanarOccluder; + static ref_ptr s_occluder = new ConvexPlanarOccluder; ConvexPlanarOccluder* tmpOccluder = static_cast(fr.readObjectOfType(*s_occluder)); diff --git a/src/osgPlugins/osg/Point.cpp b/src/osgPlugins/osg/Point.cpp index 2c7b32bf9..6652eed3d 100644 --- a/src/osgPlugins/osg/Point.cpp +++ b/src/osgPlugins/osg/Point.cpp @@ -18,7 +18,7 @@ bool Point_writeLocalData(const Object& obj, Output& fw); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_PointProxy ( - osgNew osg::Point, + new osg::Point, "Point", "Object StateAttribute Point", &Point_readLocalData, diff --git a/src/osgPlugins/osg/PolygonMode.cpp b/src/osgPlugins/osg/PolygonMode.cpp index e3a969b79..6f9ee9dc7 100644 --- a/src/osgPlugins/osg/PolygonMode.cpp +++ b/src/osgPlugins/osg/PolygonMode.cpp @@ -14,7 +14,7 @@ bool PolygonMode_writeLocalData(const Object& obj, Output& fw); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_PolygonModeProxy ( - osgNew osg::PolygonMode, + new osg::PolygonMode, "PolygonMode", "Object StateAttribute PolygonMode", &PolygonMode_readLocalData, diff --git a/src/osgPlugins/osg/PolygonOffset.cpp b/src/osgPlugins/osg/PolygonOffset.cpp index f8f3af5fb..35dde873b 100644 --- a/src/osgPlugins/osg/PolygonOffset.cpp +++ b/src/osgPlugins/osg/PolygonOffset.cpp @@ -14,7 +14,7 @@ bool PolygonOffset_writeLocalData(const Object& obj, Output& fw); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_PolygonOffsetProxy ( - osgNew osg::PolygonOffset, + new osg::PolygonOffset, "PolygonOffset", "Object StateAttribute PolygonOffset", &PolygonOffset_readLocalData, diff --git a/src/osgPlugins/osg/PositionAttitudeTransform.cpp b/src/osgPlugins/osg/PositionAttitudeTransform.cpp index 10d5a1ca2..3542501e3 100644 --- a/src/osgPlugins/osg/PositionAttitudeTransform.cpp +++ b/src/osgPlugins/osg/PositionAttitudeTransform.cpp @@ -14,7 +14,7 @@ bool PositionAttitudeTransform_writeLocalData(const Object& obj, Output& fw); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_PositionAttitudeTransformProxy ( - osgNew osg::PositionAttitudeTransform, + new osg::PositionAttitudeTransform, "PositionAttitudeTransform", "Object Node Transform PositionAttitudeTransform Group", &PositionAttitudeTransform_readLocalData, diff --git a/src/osgPlugins/osg/Projection.cpp b/src/osgPlugins/osg/Projection.cpp index 6e92286bc..c28e35788 100644 --- a/src/osgPlugins/osg/Projection.cpp +++ b/src/osgPlugins/osg/Projection.cpp @@ -15,7 +15,7 @@ bool Projection_writeLocalData(const Object& obj, Output& fw); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_ProjectionProxy ( - osgNew osg::Projection, + new osg::Projection, "Projection", "Object Node Group Projection", &Projection_readLocalData, diff --git a/src/osgPlugins/osg/ReaderWriterOSG.cpp b/src/osgPlugins/osg/ReaderWriterOSG.cpp index 95047d03b..1ff40ea02 100644 --- a/src/osgPlugins/osg/ReaderWriterOSG.cpp +++ b/src/osgPlugins/osg/ReaderWriterOSG.cpp @@ -53,7 +53,7 @@ class OSGReaderWriter : public ReaderWriter } else { - Group* group = osgNew Group; + Group* group = new Group; group->setName("import group"); for(NodeList::iterator itr=nodeList.begin(); itr!=nodeList.end(); diff --git a/src/osgPlugins/osg/Sequence.cpp b/src/osgPlugins/osg/Sequence.cpp index 66e6546ce..1ba0f92bb 100644 --- a/src/osgPlugins/osg/Sequence.cpp +++ b/src/osgPlugins/osg/Sequence.cpp @@ -14,7 +14,7 @@ bool Sequence_writeLocalData(const Object& obj, Output& fw); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_SequenceProxy ( - osgNew osg::Sequence, + new osg::Sequence, "Sequence", "Object Node Switch Sequence Group", &Sequence_readLocalData, diff --git a/src/osgPlugins/osg/ShadeModel.cpp b/src/osgPlugins/osg/ShadeModel.cpp index 5a158adfa..9b02b4da2 100644 --- a/src/osgPlugins/osg/ShadeModel.cpp +++ b/src/osgPlugins/osg/ShadeModel.cpp @@ -14,7 +14,7 @@ bool ShadeModel_writeLocalData(const Object& obj, Output& fw); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_ShadeModelFuncProxy ( - osgNew osg::ShadeModel, + new osg::ShadeModel, "ShadeModel", "Object StateAttribute ShadeModel", &ShadeModel_readLocalData, diff --git a/src/osgPlugins/osg/ShapeDrawable.cpp b/src/osgPlugins/osg/ShapeDrawable.cpp index a6f3eaaa3..02b2dd2d8 100644 --- a/src/osgPlugins/osg/ShapeDrawable.cpp +++ b/src/osgPlugins/osg/ShapeDrawable.cpp @@ -14,7 +14,7 @@ bool ShapeDrawable_writeLocalData(const Object& obj, Output& fw); //register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_ShapeDrawableFuncProxy ( - osgNew osg::ShapeDrawable, + new osg::ShapeDrawable, "ShapeDrawable", "Object Drawable ShapeDrawable", &ShapeDrawable_readLocalData, diff --git a/src/osgPlugins/osg/StateSet.cpp b/src/osgPlugins/osg/StateSet.cpp index 601c24a57..6e368ab51 100644 --- a/src/osgPlugins/osg/StateSet.cpp +++ b/src/osgPlugins/osg/StateSet.cpp @@ -27,7 +27,7 @@ const char* StateSet_getRenderBinModeStr(StateSet::RenderBinMode mode); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_StateSetFuncProxy ( - osgNew osg::StateSet, + new osg::StateSet, "StateSet", "Object StateSet", &StateSet_readLocalData, @@ -38,7 +38,7 @@ RegisterDotOsgWrapperProxy g_StateSetFuncProxy // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_GeoStateFuncProxy ( - osgNew osg::StateSet, + new osg::StateSet, "GeoState", "Object GeoState", &GeoState_readLocalData, diff --git a/src/osgPlugins/osg/Stencil.cpp b/src/osgPlugins/osg/Stencil.cpp index 8559d55a1..8d03efc14 100644 --- a/src/osgPlugins/osg/Stencil.cpp +++ b/src/osgPlugins/osg/Stencil.cpp @@ -21,7 +21,7 @@ const char* Stencil_getOperationStr(Stencil::Operation op); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_StencilProxy ( - osgNew osg::Stencil, + new osg::Stencil, "Stencil", "Object StateAttribute Stencil", &Stencil_readLocalData, diff --git a/src/osgPlugins/osg/Switch.cpp b/src/osgPlugins/osg/Switch.cpp index ce87005d6..752c90f4f 100644 --- a/src/osgPlugins/osg/Switch.cpp +++ b/src/osgPlugins/osg/Switch.cpp @@ -14,7 +14,7 @@ bool Switch_writeLocalData(const Object& obj, Output& fw); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_SwitchProxy ( - osgNew osg::Switch, + new osg::Switch, "Switch", "Object Node Switch Group", &Switch_readLocalData, diff --git a/src/osgPlugins/osg/TexEnv.cpp b/src/osgPlugins/osg/TexEnv.cpp index 78f864a55..84b5d02e9 100644 --- a/src/osgPlugins/osg/TexEnv.cpp +++ b/src/osgPlugins/osg/TexEnv.cpp @@ -16,7 +16,7 @@ const char* TexEnv_getModeStr(TexEnv::Mode mode); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_TexEnvProxy ( - osgNew osg::TexEnv, + new osg::TexEnv, "TexEnv", "Object StateAttribute TexEnv", &TexEnv_readLocalData, diff --git a/src/osgPlugins/osg/TexEnvCombine.cpp b/src/osgPlugins/osg/TexEnvCombine.cpp index e5f8a6fd6..61e09522f 100644 --- a/src/osgPlugins/osg/TexEnvCombine.cpp +++ b/src/osgPlugins/osg/TexEnvCombine.cpp @@ -23,7 +23,7 @@ const char* TexEnvCombine_getOperandParamStr(GLint value); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_TexEnvCombineProxy ( - osgNew osg::TexEnvCombine, + new osg::TexEnvCombine, "TexEnvCombine", "Object StateAttribute TexEnvCombine", &TexEnvCombine_readLocalData, diff --git a/src/osgPlugins/osg/TexGen.cpp b/src/osgPlugins/osg/TexGen.cpp index 6526aa4e2..e37b557e2 100644 --- a/src/osgPlugins/osg/TexGen.cpp +++ b/src/osgPlugins/osg/TexGen.cpp @@ -20,7 +20,7 @@ const char* TexGen_getModeStr(TexGen::Mode mode); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_TexGenProxy ( - osgNew osg::TexGen, + new osg::TexGen, "TexGen", "Object StateAttribute TexGen", &TexGen_readLocalData, diff --git a/src/osgPlugins/osg/TexMat.cpp b/src/osgPlugins/osg/TexMat.cpp index 049482223..afebcc7a2 100644 --- a/src/osgPlugins/osg/TexMat.cpp +++ b/src/osgPlugins/osg/TexMat.cpp @@ -14,7 +14,7 @@ bool TexMat_writeLocalData(const Object& obj, Output& fw); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_TexMatProxy ( - osgNew osg::TexMat, + new osg::TexMat, "TexMat", "Object StateAttribute TexMat", &TexMat_readLocalData, diff --git a/src/osgPlugins/osg/Texture1D.cpp b/src/osgPlugins/osg/Texture1D.cpp index 3fa9ee89c..39daacbc8 100644 --- a/src/osgPlugins/osg/Texture1D.cpp +++ b/src/osgPlugins/osg/Texture1D.cpp @@ -23,7 +23,7 @@ const char* Texture1D_getInternalFormatStr(int value); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_Texture1DProxy ( - osgNew osg::Texture1D, + new osg::Texture1D, "Texture1D", "Object StateAttribute Texture1D TextureBase", &Texture1D_readLocalData, diff --git a/src/osgPlugins/osg/Texture2D.cpp b/src/osgPlugins/osg/Texture2D.cpp index 1794dbbcc..15a84b73c 100644 --- a/src/osgPlugins/osg/Texture2D.cpp +++ b/src/osgPlugins/osg/Texture2D.cpp @@ -22,7 +22,7 @@ const char* Texture2D_getInternalFormatStr(int value); RegisterDotOsgWrapperProxy g_OldTextureProxy ( - osgNew osg::Texture2D, + new osg::Texture2D, "Texture", "Object StateAttribute Texture2D TextureBase", 0, @@ -32,7 +32,7 @@ RegisterDotOsgWrapperProxy g_OldTextureProxy // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_Texture2DProxy ( - osgNew osg::Texture2D, + new osg::Texture2D, "Texture2D", "Object StateAttribute Texture2D TextureBase", &Texture2D_readLocalData, diff --git a/src/osgPlugins/osg/Texture3D.cpp b/src/osgPlugins/osg/Texture3D.cpp index b725d83f0..7e2011114 100644 --- a/src/osgPlugins/osg/Texture3D.cpp +++ b/src/osgPlugins/osg/Texture3D.cpp @@ -23,7 +23,7 @@ const char* Texture3D_getInternalFormatStr(int value); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_Texture3DProxy ( - osgNew osg::Texture3D, + new osg::Texture3D, "Texture3D", "Object StateAttribute Texture3D TextureBase", &Texture3D_readLocalData, diff --git a/src/osgPlugins/osg/TextureCubeMap.cpp b/src/osgPlugins/osg/TextureCubeMap.cpp index ed53180b9..667cd5bc7 100644 --- a/src/osgPlugins/osg/TextureCubeMap.cpp +++ b/src/osgPlugins/osg/TextureCubeMap.cpp @@ -14,7 +14,7 @@ bool TextureCubeMap_writeLocalData(const Object& obj, Output& fw); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_TextureCubeMapProxy ( - osgNew osg::TextureCubeMap, + new osg::TextureCubeMap, "TextureCubeMap", "Object StateAttribute TextureCubeMap TextureBase", &TextureCubeMap_readLocalData, diff --git a/src/osgPlugins/osg/Transform.cpp b/src/osgPlugins/osg/Transform.cpp index acd1e3eab..f90221d2d 100644 --- a/src/osgPlugins/osg/Transform.cpp +++ b/src/osgPlugins/osg/Transform.cpp @@ -17,7 +17,7 @@ bool Transform_writeLocalData(const Object& obj, Output& fw); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_TransformProxy ( - osgNew osg::Transform, + new osg::Transform, "Transform", "Object Node Transform Group", &Transform_readLocalData, diff --git a/src/osgPlugins/osgParticle/IO_AccelOperator.cpp b/src/osgPlugins/osgParticle/IO_AccelOperator.cpp index dbde4c3de..85596501f 100644 --- a/src/osgPlugins/osgParticle/IO_AccelOperator.cpp +++ b/src/osgPlugins/osgParticle/IO_AccelOperator.cpp @@ -14,7 +14,7 @@ bool AccelOperator_writeLocalData(const osg::Object &obj, osgDB::Output &fw); osgDB::RegisterDotOsgWrapperProxy AccelOperator_Proxy ( - osgNew osgParticle::AccelOperator, + new osgParticle::AccelOperator, "AccelOperator", "Object Operator AccelOperator", AccelOperator_readLocalData, diff --git a/src/osgPlugins/osgParticle/IO_FluidFrictionOperator.cpp b/src/osgPlugins/osgParticle/IO_FluidFrictionOperator.cpp index 8a9de1b43..d06e5fbae 100644 --- a/src/osgPlugins/osgParticle/IO_FluidFrictionOperator.cpp +++ b/src/osgPlugins/osgParticle/IO_FluidFrictionOperator.cpp @@ -12,7 +12,7 @@ bool FluidFrictionOperator_writeLocalData(const osg::Object &obj, osgDB::Output osgDB::RegisterDotOsgWrapperProxy FluidFrictionOperator_Proxy ( - osgNew osgParticle::FluidFrictionOperator, + new osgParticle::FluidFrictionOperator, "FluidFrictionOperator", "Object Operator FluidFrictionOperator", FluidFrictionOperator_readLocalData, diff --git a/src/osgPlugins/osgParticle/IO_ForceOperator.cpp b/src/osgPlugins/osgParticle/IO_ForceOperator.cpp index 220f6aea0..5827a393c 100644 --- a/src/osgPlugins/osgParticle/IO_ForceOperator.cpp +++ b/src/osgPlugins/osgParticle/IO_ForceOperator.cpp @@ -14,7 +14,7 @@ bool ForceOperator_writeLocalData(const osg::Object &obj, osgDB::Output &fw); osgDB::RegisterDotOsgWrapperProxy ForceOperator_Proxy ( - osgNew osgParticle::ForceOperator, + new osgParticle::ForceOperator, "ForceOperator", "Object Operator ForceOperator", ForceOperator_readLocalData, diff --git a/src/osgPlugins/osgParticle/IO_LinearInterpolator.cpp b/src/osgPlugins/osgParticle/IO_LinearInterpolator.cpp index 5f5954b8d..b96426718 100644 --- a/src/osgPlugins/osgParticle/IO_LinearInterpolator.cpp +++ b/src/osgPlugins/osgParticle/IO_LinearInterpolator.cpp @@ -10,7 +10,7 @@ bool LinearInterpolator_writeLocalData(const osg::Object &obj, osgDB::Output &f osgDB::RegisterDotOsgWrapperProxy LinearInterpolator_Proxy ( - osgNew osgParticle::LinearInterpolator, + new osgParticle::LinearInterpolator, "LinearInterpolator", "Object Interpolator LinearInterpolator", LinearInterpolator_readLocalData, diff --git a/src/osgPlugins/osgParticle/IO_ModularEmitter.cpp b/src/osgPlugins/osgParticle/IO_ModularEmitter.cpp index 37ea46707..3d2f31976 100644 --- a/src/osgPlugins/osgParticle/IO_ModularEmitter.cpp +++ b/src/osgPlugins/osgParticle/IO_ModularEmitter.cpp @@ -13,7 +13,7 @@ bool ModularEmitter_writeLocalData(const osg::Object &obj, osgDB::Output &fw); osgDB::RegisterDotOsgWrapperProxy ModularEmitter_Proxy ( - osgNew osgParticle::ModularEmitter, + new osgParticle::ModularEmitter, "ModularEmitter", "Object Node ParticleProcessor Emitter ModularEmitter", ModularEmitter_readLocalData, diff --git a/src/osgPlugins/osgParticle/IO_ModularProgram.cpp b/src/osgPlugins/osgParticle/IO_ModularProgram.cpp index 9f2ea2953..7cf338d76 100644 --- a/src/osgPlugins/osgParticle/IO_ModularProgram.cpp +++ b/src/osgPlugins/osgParticle/IO_ModularProgram.cpp @@ -13,7 +13,7 @@ bool ModularProgram_writeLocalData(const osg::Object &obj, osgDB::Output &fw); osgDB::RegisterDotOsgWrapperProxy ModularProgram_Proxy ( - osgNew osgParticle::ModularProgram, + new osgParticle::ModularProgram, "ModularProgram", "Object Node ParticleProcessor Program ModularProgram", ModularProgram_readLocalData, diff --git a/src/osgPlugins/osgParticle/IO_MultiSegmentPlacer.cpp b/src/osgPlugins/osgParticle/IO_MultiSegmentPlacer.cpp index 969b07a80..42f4c5273 100644 --- a/src/osgPlugins/osgParticle/IO_MultiSegmentPlacer.cpp +++ b/src/osgPlugins/osgParticle/IO_MultiSegmentPlacer.cpp @@ -14,7 +14,7 @@ bool MultiSegmentPlacer_writeLocalData(const osg::Object &obj, osgDB::Output &f osgDB::RegisterDotOsgWrapperProxy MultiSegmentPlacer_Proxy ( - osgNew osgParticle::MultiSegmentPlacer, + new osgParticle::MultiSegmentPlacer, "MultiSegmentPlacer", "Object Placer MultiSegmentPlacer", MultiSegmentPlacer_readLocalData, diff --git a/src/osgPlugins/osgParticle/IO_ParticleProcessor.cpp b/src/osgPlugins/osgParticle/IO_ParticleProcessor.cpp index bc6a60fb3..9f2e66be1 100644 --- a/src/osgPlugins/osgParticle/IO_ParticleProcessor.cpp +++ b/src/osgPlugins/osgParticle/IO_ParticleProcessor.cpp @@ -30,7 +30,7 @@ bool ParticleProcessor_readLocalData(osg::Object &obj, osgDB::Input &fr) osgParticle::ParticleProcessor &myobj = static_cast(obj); bool itAdvanced = false; - osg::ref_ptr ps_proto = osgNew osgParticle::ParticleSystem; + osg::ref_ptr ps_proto = new osgParticle::ParticleSystem; osgParticle::ParticleSystem *ps = static_cast(fr.readObjectOfType(*ps_proto)); if (ps) { diff --git a/src/osgPlugins/osgParticle/IO_ParticleSystem.cpp b/src/osgPlugins/osgParticle/IO_ParticleSystem.cpp index 21dfb9c3a..2a6d63851 100644 --- a/src/osgPlugins/osgParticle/IO_ParticleSystem.cpp +++ b/src/osgPlugins/osgParticle/IO_ParticleSystem.cpp @@ -18,7 +18,7 @@ bool ParticleSystem_writeLocalData(const osg::Object &obj, osgDB::Output &fw); osgDB::RegisterDotOsgWrapperProxy ParticleSystem_Proxy ( - osgNew osgParticle::ParticleSystem, + new osgParticle::ParticleSystem, "ParticleSystem", "Object Drawable ParticleSystem", ParticleSystem_readLocalData, diff --git a/src/osgPlugins/osgParticle/IO_ParticleSystemUpdater.cpp b/src/osgPlugins/osgParticle/IO_ParticleSystemUpdater.cpp index 084d11234..e16729079 100644 --- a/src/osgPlugins/osgParticle/IO_ParticleSystemUpdater.cpp +++ b/src/osgPlugins/osgParticle/IO_ParticleSystemUpdater.cpp @@ -11,7 +11,7 @@ bool PSU_writeLocalData(const osg::Object &obj, osgDB::Output &fr); osgDB::RegisterDotOsgWrapperProxy PSU_Proxy ( - osgNew osgParticle::ParticleSystemUpdater, + new osgParticle::ParticleSystemUpdater, "ParticleSystemUpdater", "Object Node ParticleSystemUpdater", PSU_readLocalData, @@ -23,7 +23,7 @@ bool PSU_readLocalData(osg::Object &obj, osgDB::Input &fr) osgParticle::ParticleSystemUpdater &myobj = static_cast(obj); bool itAdvanced = false; - osg::ref_ptr proto = osgNew osgParticle::ParticleSystem; + osg::ref_ptr proto = new osgParticle::ParticleSystem; osgParticle::ParticleSystem *ps = static_cast(fr.readObjectOfType(*proto)); if (ps) { myobj.addParticleSystem(ps); diff --git a/src/osgPlugins/osgParticle/IO_PointPlacer.cpp b/src/osgPlugins/osgParticle/IO_PointPlacer.cpp index 72cbe4375..9ddde42ba 100644 --- a/src/osgPlugins/osgParticle/IO_PointPlacer.cpp +++ b/src/osgPlugins/osgParticle/IO_PointPlacer.cpp @@ -10,7 +10,7 @@ bool PointPlacer_writeLocalData(const osg::Object &obj, osgDB::Output &fw); osgDB::RegisterDotOsgWrapperProxy PointPlacer_Proxy ( - osgNew osgParticle::PointPlacer, + new osgParticle::PointPlacer, "PointPlacer", "Object Placer CenteredPlacer PointPlacer", PointPlacer_readLocalData, diff --git a/src/osgPlugins/osgParticle/IO_RadialShooter.cpp b/src/osgPlugins/osgParticle/IO_RadialShooter.cpp index 9c48146ab..1daead192 100644 --- a/src/osgPlugins/osgParticle/IO_RadialShooter.cpp +++ b/src/osgPlugins/osgParticle/IO_RadialShooter.cpp @@ -11,7 +11,7 @@ bool RadialShooter_writeLocalData(const osg::Object &obj, osgDB::Output &fw); osgDB::RegisterDotOsgWrapperProxy RadialShooter_Proxy ( - osgNew osgParticle::RadialShooter, + new osgParticle::RadialShooter, "RadialShooter", "Object Shooter RadialShooter", RadialShooter_readLocalData, diff --git a/src/osgPlugins/osgParticle/IO_RandomRateCounter.cpp b/src/osgPlugins/osgParticle/IO_RandomRateCounter.cpp index 98244aee4..bc1c6b477 100644 --- a/src/osgPlugins/osgParticle/IO_RandomRateCounter.cpp +++ b/src/osgPlugins/osgParticle/IO_RandomRateCounter.cpp @@ -12,7 +12,7 @@ bool RandomRateCounter_writeLocalData(const osg::Object &obj, osgDB::Output &fw osgDB::RegisterDotOsgWrapperProxy RandomRateCounter_Proxy ( - osgNew osgParticle::RandomRateCounter, + new osgParticle::RandomRateCounter, "RandomRateCounter", "Object Counter VariableRateCounter RandomRateCounter", RandomRateCounter_readLocalData, diff --git a/src/osgPlugins/osgParticle/IO_SectorPlacer.cpp b/src/osgPlugins/osgParticle/IO_SectorPlacer.cpp index 93693cab1..8580ad571 100644 --- a/src/osgPlugins/osgParticle/IO_SectorPlacer.cpp +++ b/src/osgPlugins/osgParticle/IO_SectorPlacer.cpp @@ -12,7 +12,7 @@ bool SectorPlacer_writeLocalData(const osg::Object &obj, osgDB::Output &fw); osgDB::RegisterDotOsgWrapperProxy SectorPlacer_Proxy ( - osgNew osgParticle::SectorPlacer, + new osgParticle::SectorPlacer, "SectorPlacer", "Object Placer CenteredPlacer SectorPlacer", SectorPlacer_readLocalData, diff --git a/src/osgPlugins/osgParticle/IO_SegmentPlacer.cpp b/src/osgPlugins/osgParticle/IO_SegmentPlacer.cpp index 5104936e6..c52889af9 100644 --- a/src/osgPlugins/osgParticle/IO_SegmentPlacer.cpp +++ b/src/osgPlugins/osgParticle/IO_SegmentPlacer.cpp @@ -14,7 +14,7 @@ bool SegmentPlacer_writeLocalData(const osg::Object &obj, osgDB::Output &fw); osgDB::RegisterDotOsgWrapperProxy SegmentPlacer_Proxy ( - osgNew osgParticle::SegmentPlacer, + new osgParticle::SegmentPlacer, "SegmentPlacer", "Object Placer SegmentPlacer", SegmentPlacer_readLocalData, diff --git a/src/osgPlugins/osgText/IO_Font.cpp b/src/osgPlugins/osgText/IO_Font.cpp index 42cd53c60..513f7c2c2 100644 --- a/src/osgPlugins/osgText/IO_Font.cpp +++ b/src/osgPlugins/osgText/IO_Font.cpp @@ -45,7 +45,7 @@ bool BitmapFont_readLocalData(osg::Object &obj, osgDB::Input &fr); osgDB::RegisterDotOsgWrapperProxy BitmapFont_Proxy ( - osgNew osgText::BitmapFont, + new osgText::BitmapFont, "BitmapFont", "Object Font RasterFont BitmapFont", BitmapFont_readLocalData, @@ -60,7 +60,7 @@ bool BitmapFont_readLocalData(osg::Object &obj, osgDB::Input &fr) if (fr[0].matchWord("parameters")) { int psize; if (fr[1].getInt(psize) && fr[2].isInt() && fr[3].isString()) { - osgText::BitmapFont *temp = osgNew osgText::BitmapFont(std::string(fr[3].getStr()), psize); + osgText::BitmapFont *temp = new osgText::BitmapFont(std::string(fr[3].getStr()), psize); temp->copyAndInvalidate(myobj); fr += 4; itAdvanced = true; @@ -79,7 +79,7 @@ bool PixmapFont_readLocalData(osg::Object &obj, osgDB::Input &fr); osgDB::RegisterDotOsgWrapperProxy PixmapFont_Proxy ( - osgNew osgText::PixmapFont, + new osgText::PixmapFont, "PixmapFont", "Object Font RasterFont PixmapFont", PixmapFont_readLocalData, @@ -94,7 +94,7 @@ bool PixmapFont_readLocalData(osg::Object &obj, osgDB::Input &fr) if (fr[0].matchWord("parameters")) { int psize; if (fr[1].getInt(psize) && fr[2].isInt() && fr[3].isString()) { - osgText::PixmapFont *temp = osgNew osgText::PixmapFont(std::string(fr[3].getStr()), psize); + osgText::PixmapFont *temp = new osgText::PixmapFont(std::string(fr[3].getStr()), psize); temp->copyAndInvalidate(myobj); fr += 4; itAdvanced = true; @@ -112,7 +112,7 @@ bool TextureFont_readLocalData(osg::Object &obj, osgDB::Input &fr); osgDB::RegisterDotOsgWrapperProxy TextureFont_Proxy ( - osgNew osgText::TextureFont, + new osgText::TextureFont, "TextureFont", "Object Font RasterFont TextureFont", TextureFont_readLocalData, @@ -127,7 +127,7 @@ bool TextureFont_readLocalData(osg::Object &obj, osgDB::Input &fr) if (fr[0].matchWord("parameters")) { int psize, txsize; if (fr[1].getInt(psize) && fr[2].getInt(txsize) && fr[3].isString()) { - osgText::TextureFont *temp = osgNew osgText::TextureFont(std::string(fr[3].getStr()), psize, txsize); + osgText::TextureFont *temp = new osgText::TextureFont(std::string(fr[3].getStr()), psize, txsize); temp->copyAndInvalidate(myobj); fr += 4; itAdvanced = true; @@ -146,7 +146,7 @@ bool OutlineFont_readLocalData(osg::Object &obj, osgDB::Input &fr); osgDB::RegisterDotOsgWrapperProxy OutlineFont_Proxy ( - osgNew osgText::OutlineFont, + new osgText::OutlineFont, "OutlineFont", "Object Font VectorFont OutlineFont", OutlineFont_readLocalData, @@ -161,7 +161,7 @@ bool OutlineFont_readLocalData(osg::Object &obj, osgDB::Input &fr) if (fr[0].matchWord("parameters")) { int psize; if (fr[1].getInt(psize) && fr[2].isInt() && fr[3].isString()) { - osgText::OutlineFont *temp = osgNew osgText::OutlineFont(std::string(fr[3].getStr()), psize, 1); + osgText::OutlineFont *temp = new osgText::OutlineFont(std::string(fr[3].getStr()), psize, 1); temp->copyAndInvalidate(myobj); fr += 4; itAdvanced = true; @@ -179,7 +179,7 @@ bool PolygonFont_readLocalData(osg::Object &obj, osgDB::Input &fr); osgDB::RegisterDotOsgWrapperProxy PolygonFont_Proxy ( - osgNew osgText::PolygonFont, + new osgText::PolygonFont, "PolygonFont", "Object Font VectorFont PolygonFont", PolygonFont_readLocalData, @@ -194,7 +194,7 @@ bool PolygonFont_readLocalData(osg::Object &obj, osgDB::Input &fr) if (fr[0].matchWord("parameters")) { int psize; if (fr[1].getInt(psize) && fr[2].isInt() && fr[3].isString()) { - osgText::PolygonFont *temp = osgNew osgText::PolygonFont(std::string(fr[3].getStr()), psize, 1); + osgText::PolygonFont *temp = new osgText::PolygonFont(std::string(fr[3].getStr()), psize, 1); temp->copyAndInvalidate(myobj); fr += 4; itAdvanced = true; diff --git a/src/osgPlugins/osgText/IO_Paragraph.cpp b/src/osgPlugins/osgText/IO_Paragraph.cpp index 2d133c307..6c53b24fd 100644 --- a/src/osgPlugins/osgText/IO_Paragraph.cpp +++ b/src/osgPlugins/osgText/IO_Paragraph.cpp @@ -15,7 +15,7 @@ bool Paragraph_writeLocalData(const osg::Object &obj, osgDB::Output &fw); // osgDB::RegisterDotOsgWrapperProxy Paragraph_Proxy // ( -// osgNew osgText::Paragraph, +// new osgText::Paragraph, // "Paragraph", // "Object Node Geode Paragraph", // Paragraph_readLocalData, diff --git a/src/osgPlugins/osgText/IO_Text.cpp b/src/osgPlugins/osgText/IO_Text.cpp index 3c88c1e9a..11d6e501f 100644 --- a/src/osgPlugins/osgText/IO_Text.cpp +++ b/src/osgPlugins/osgText/IO_Text.cpp @@ -16,7 +16,7 @@ bool Text_writeLocalData(const osg::Object &obj, osgDB::Output &fw); osgDB::RegisterDotOsgWrapperProxy Text_Proxy ( - osgNew osgText::Text, + new osgText::Text, "Text", "Object Drawable Text", Text_readLocalData, diff --git a/src/osgPlugins/rgb/ReaderWriterRGB.cpp b/src/osgPlugins/rgb/ReaderWriterRGB.cpp index dbeb628e1..266429d97 100644 --- a/src/osgPlugins/rgb/ReaderWriterRGB.cpp +++ b/src/osgPlugins/rgb/ReaderWriterRGB.cpp @@ -358,7 +358,7 @@ class ReaderWriterRGB : public osgDB::ReaderWriter RawImageGetData(raw, &data); RawImageClose(raw); - Image* image = osgNew Image(); + Image* image = new Image(); image->setFileName(fileName.c_str()); image->setImage(s,t,r, internalFormat, diff --git a/src/osgSim/LightPointDrawable.cpp b/src/osgSim/LightPointDrawable.cpp index 7a0cc459e..749938d8c 100644 --- a/src/osgSim/LightPointDrawable.cpp +++ b/src/osgSim/LightPointDrawable.cpp @@ -19,22 +19,22 @@ LightPointDrawable::LightPointDrawable(): { setSupportsDisplayList(false); - _depthOff = osgNew osg::Depth; + _depthOff = new osg::Depth; _depthOff->setWriteMask(false); - _depthOn = osgNew osg::Depth; + _depthOn = new osg::Depth; _depthOn->setWriteMask(true); - _blendOne = osgNew osg::BlendFunc; + _blendOne = new osg::BlendFunc; _blendOne->setFunction(osg::BlendFunc::SRC_ALPHA,osg::BlendFunc::ONE); - _blendOneMinusSrcAlpha = osgNew osg::BlendFunc; + _blendOneMinusSrcAlpha = new osg::BlendFunc; _blendOneMinusSrcAlpha->setFunction(osg::BlendFunc::SRC_ALPHA,osg::BlendFunc::ONE_MINUS_SRC_ALPHA); - _colorMaskOff = osgNew osg::ColorMask; + _colorMaskOff = new osg::ColorMask; _colorMaskOff->setMask(false,false,false,false); - _point = osgNew osg::Point; + _point = new osg::Point; } LightPointDrawable::LightPointDrawable(const LightPointDrawable& lpd,const osg::CopyOp& copyop): diff --git a/src/osgSim/LightPointDrawable.h b/src/osgSim/LightPointDrawable.h index 64a547d44..ccad6870b 100644 --- a/src/osgSim/LightPointDrawable.h +++ b/src/osgSim/LightPointDrawable.h @@ -33,8 +33,8 @@ class OSGSIM_EXPORT LightPointDrawable : public osg::Drawable /** Copy constructor using CopyOp to manage deep vs shallow copy.*/ LightPointDrawable(const LightPointDrawable&,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY); - virtual osg::Object* cloneType() const { return osgNew LightPointDrawable(); } - virtual osg::Object* clone(const osg::CopyOp&) const { return osgNew LightPointDrawable(); } + virtual osg::Object* cloneType() const { return new LightPointDrawable(); } + virtual osg::Object* clone(const osg::CopyOp&) const { return new LightPointDrawable(); } virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast(obj)!=NULL; } virtual const char* className() const { return "LightPointDrawable"; } diff --git a/src/osgSim/LightPointNode.cpp b/src/osgSim/LightPointNode.cpp index ca2b5fd94..8fcb29885 100644 --- a/src/osgSim/LightPointNode.cpp +++ b/src/osgSim/LightPointNode.cpp @@ -149,7 +149,7 @@ void LightPointNode::traverse(osg::NodeVisitor& nv) if (!drawable) { // set it for the frst time. - drawable = osgNew LightPointDrawable; + drawable = new LightPointDrawable; rg->setUserData(drawable); if (cv->getFrameStamp()) @@ -173,7 +173,7 @@ void LightPointNode::traverse(osg::NodeVisitor& nv) // and update its time signatures. drawable->reset(); - rg->addLeaf(osgNew osgUtil::RenderLeaf(drawable,&projection,NULL,FLT_MAX)); + rg->addLeaf(new osgUtil::RenderLeaf(drawable,&projection,NULL,FLT_MAX)); // need to update the drawable's frame count. if (cv->getFrameStamp()) diff --git a/src/osgText/FTBitmapGlyph.cpp b/src/osgText/FTBitmapGlyph.cpp index fbb4f0e7b..e6364512c 100644 --- a/src/osgText/FTBitmapGlyph.cpp +++ b/src/osgText/FTBitmapGlyph.cpp @@ -37,7 +37,7 @@ FTBitmapGlyph::FTBitmapGlyph( FT_Glyph glyph) destWidth = srcWidth; destHeight = srcHeight; - data = osgNew unsigned char[srcPitch * destHeight]; + data = new unsigned char[srcPitch * destHeight]; // !!!! THIS assumes a positive Pitch value. No allowance for negative pitch for(int y = 0; y < srcHeight; ++y) @@ -59,7 +59,7 @@ FTBitmapGlyph::FTBitmapGlyph( FT_Glyph glyph) FTBitmapGlyph::~FTBitmapGlyph() { - osgDelete [] data; + delete [] data; } diff --git a/src/osgText/FTFace.cpp b/src/osgText/FTFace.cpp index da0dee24e..8e00deaed 100644 --- a/src/osgText/FTFace.cpp +++ b/src/osgText/FTFace.cpp @@ -18,7 +18,7 @@ FTFace::FTFace(): FTFace::~FTFace() { - osgDelete charMap; + delete charMap; charMap = 0; Close(); } @@ -26,18 +26,18 @@ FTFace::~FTFace() bool FTFace::Open( const char* filename) { - ftFace = osgNew FT_Face; + ftFace = new FT_Face; err = FT_New_Face( *FTLibrary::Instance().GetLibrary(), filename, 0, ftFace); if( err) { - osgDelete ftFace; + delete ftFace; ftFace = 0; return false; } else { - charMap = osgNew FTCharmap( *ftFace); + charMap = new FTCharmap( *ftFace); return true; } } @@ -48,7 +48,7 @@ void FTFace::Close() if( ftFace) { FT_Done_Face( *ftFace); - osgDelete ftFace; + delete ftFace; ftFace = 0; } } diff --git a/src/osgText/FTFont.cpp b/src/osgText/FTFont.cpp index 169d74fd2..6f0e33405 100644 --- a/src/osgText/FTFont.cpp +++ b/src/osgText/FTFont.cpp @@ -49,7 +49,7 @@ void FTFont::Close() { GlyphContextContainer::iterator itr; for(itr=_contextGlyphList.begin();itr!=_contextGlyphList.end();itr++) - osgDelete *itr; + delete *itr; _contextGlyphList.clear(); } @@ -65,9 +65,9 @@ bool FTFont::FaceSize( const unsigned int size, const unsigned int res , unsigne FTGlyphContainer*& glyphList=_contextGlyphList[renderContext]; if( glyphList) - osgDelete glyphList; + delete glyphList; - glyphList = osgNew FTGlyphContainer( &face, numGlyphs); + glyphList = new FTGlyphContainer( &face, numGlyphs); if( MakeGlyphList(renderContext)) { diff --git a/src/osgText/FTGLBitmapFont.cpp b/src/osgText/FTGLBitmapFont.cpp index 5ab3314aa..886ccf9c0 100644 --- a/src/osgText/FTGLBitmapFont.cpp +++ b/src/osgText/FTGLBitmapFont.cpp @@ -25,7 +25,7 @@ bool FTGLBitmapFont::MakeGlyphList(unsigned int renderContext) if( ftGlyph) { - FTBitmapGlyph* tempGlyph = osgNew FTBitmapGlyph( *ftGlyph); + FTBitmapGlyph* tempGlyph = new FTBitmapGlyph( *ftGlyph); glyphList->Add( tempGlyph); } else diff --git a/src/osgText/FTGLOutlineFont.cpp b/src/osgText/FTGLOutlineFont.cpp index e59c736f8..be7b4c7de 100644 --- a/src/osgText/FTGLOutlineFont.cpp +++ b/src/osgText/FTGLOutlineFont.cpp @@ -23,7 +23,7 @@ bool FTGLOutlineFont::MakeGlyphList( unsigned int renderContext) if( ftGlyph) { - FTOutlineGlyph* tempGlyph = osgNew FTOutlineGlyph( *ftGlyph); + FTOutlineGlyph* tempGlyph = new FTOutlineGlyph( *ftGlyph); glyphList->Add( tempGlyph); } else diff --git a/src/osgText/FTGLPixmapFont.cpp b/src/osgText/FTGLPixmapFont.cpp index 0ace582f5..58c8a1826 100644 --- a/src/osgText/FTGLPixmapFont.cpp +++ b/src/osgText/FTGLPixmapFont.cpp @@ -25,7 +25,7 @@ bool FTGLPixmapFont::MakeGlyphList(unsigned int renderContext) if( ftGlyph) { - FTPixmapGlyph* tempGlyph = osgNew FTPixmapGlyph( *ftGlyph); + FTPixmapGlyph* tempGlyph = new FTPixmapGlyph( *ftGlyph); glyphList->Add( tempGlyph); } else diff --git a/src/osgText/FTGLPolygonFont.cpp b/src/osgText/FTGLPolygonFont.cpp index 826a6c793..ccf5fdc04 100644 --- a/src/osgText/FTGLPolygonFont.cpp +++ b/src/osgText/FTGLPolygonFont.cpp @@ -24,7 +24,7 @@ bool FTGLPolygonFont::MakeGlyphList( unsigned int renderContext) if( ftGlyph) { - FTPolyGlyph* tempGlyph = osgNew FTPolyGlyph( *ftGlyph); + FTPolyGlyph* tempGlyph = new FTPolyGlyph( *ftGlyph); glyphList->Add( tempGlyph); } else diff --git a/src/osgText/FTGLTextureFont.cpp b/src/osgText/FTGLTextureFont.cpp index b4e5ef402..702a42f6b 100644 --- a/src/osgText/FTGLTextureFont.cpp +++ b/src/osgText/FTGLTextureFont.cpp @@ -53,7 +53,7 @@ FTGLTextureFont::~FTGLTextureFont() if (*itr) { glDeleteTextures( numTextures, (const GLuint*)*itr); - osgDelete [] *itr; + delete [] *itr; } } } @@ -73,7 +73,7 @@ bool FTGLTextureFont::MakeGlyphList(unsigned int renderContext) return true; else { - glTextureID= osgNew unsigned long[16]; + glTextureID= new unsigned long[16]; memset(glTextureID,0,sizeof(unsigned long)*16); glContextTextureID[renderContext]=glTextureID; } @@ -98,7 +98,7 @@ bool FTGLTextureFont::MakeGlyphList(unsigned int renderContext) glGenTextures( numTextures, (GLuint*)&glTextureID[0]); - textMem = osgNew unsigned char[totalMem]; // GL_ALPHA texture; + textMem = new unsigned char[totalMem]; // GL_ALPHA texture; memset( textMem, 0, totalMem); unsigned int glyphNum = 0; @@ -125,14 +125,14 @@ bool FTGLTextureFont::MakeGlyphList(unsigned int renderContext) glGenTextures( numTextures, (GLuint*)&glTextureID[0]); - textMem = osgNew unsigned char[totalMem]; // GL_ALPHA texture; + textMem = new unsigned char[totalMem]; // GL_ALPHA texture; memset( textMem, 0, totalMem); FillGlyphs( 0, glTextureID[0], textureWidth, textureHeight, textMem,renderContext); CreateTexture( glTextureID[0], textureWidth, textureHeight, textMem); } - osgDelete [] textMem; + delete [] textMem; return !err; } @@ -159,7 +159,7 @@ unsigned int FTGLTextureFont::FillGlyphs( unsigned int glyphStart, GLuint id, GL currTextU = (float)currentTextX / (float)width; - FTTextureGlyph* tempGlyph = osgNew FTTextureGlyph( *ftGlyph, id, data, width, height, currTextU, currTextV); + FTTextureGlyph* tempGlyph = new FTTextureGlyph( *ftGlyph, id, data, width, height, currTextU, currTextV); glyphList->Add( tempGlyph); currentTextX += glyphWidth; diff --git a/src/osgText/FTGlyphContainer.cpp b/src/osgText/FTGlyphContainer.cpp index 98b12a8ed..f72bb8710 100644 --- a/src/osgText/FTGlyphContainer.cpp +++ b/src/osgText/FTGlyphContainer.cpp @@ -19,7 +19,7 @@ FTGlyphContainer::~FTGlyphContainer() vector::iterator iter; for( iter = glyphs.begin(); iter != glyphs.end(); ++iter) { - osgDelete *iter; + delete *iter; } glyphs.clear(); diff --git a/src/osgText/FTLibrary.cpp b/src/osgText/FTLibrary.cpp index fab5ad689..72788c023 100644 --- a/src/osgText/FTLibrary.cpp +++ b/src/osgText/FTLibrary.cpp @@ -14,7 +14,7 @@ FTLibrary::~FTLibrary() { FT_Done_FreeType( *lib); - osgDelete lib; + delete lib; lib= 0; } @@ -22,7 +22,7 @@ FTLibrary::~FTLibrary() // { // FTC_Manager_Done( manager ); // -// osgDelete manager; +// delete manager; // manager= 0; // } } @@ -41,12 +41,12 @@ bool FTLibrary::Init() if( lib != 0 ) return true; - lib = osgNew FT_Library; + lib = new FT_Library; err = FT_Init_FreeType( lib); if( err) { - osgDelete lib; + delete lib; lib = 0; return false; } @@ -55,7 +55,7 @@ bool FTLibrary::Init() // // if( FTC_Manager_New( lib, 0, 0, 0, my_face_requester, 0, manager ) // { -// osgDelete manager; +// delete manager; // manager= 0; // return false; // } diff --git a/src/osgText/FTOutlineGlyph.cpp b/src/osgText/FTOutlineGlyph.cpp index 8dea1058b..8fae47e0b 100644 --- a/src/osgText/FTOutlineGlyph.cpp +++ b/src/osgText/FTOutlineGlyph.cpp @@ -21,7 +21,7 @@ FTOutlineGlyph::FTOutlineGlyph( FT_Glyph glyph) advance = glyph->advance.x >> 16; - vectoriser = osgNew FTVectoriser( glyph); + vectoriser = new FTVectoriser( glyph); vectoriser->Process(); numContours = vectoriser->contours(); @@ -32,7 +32,7 @@ FTOutlineGlyph::FTOutlineGlyph( FT_Glyph glyph) return; } - contourLength = osgNew int[ numContours]; + contourLength = new int[ numContours]; memset(contourLength,0,sizeof(int)*numContours); for( int cn = 0; cn < numContours; ++cn) { @@ -40,7 +40,7 @@ FTOutlineGlyph::FTOutlineGlyph( FT_Glyph glyph) } numPoints = vectoriser->points(); - data = osgNew double[ numPoints * 3]; + data = new double[ numPoints * 3]; for( int cp = 0; cp < numPoints * 3; ++cp) { data[cp]=0.0; @@ -80,8 +80,8 @@ FTOutlineGlyph::FTOutlineGlyph( FT_Glyph glyph) FTOutlineGlyph::~FTOutlineGlyph() { - osgDelete [] data; - osgDelete [] contourLength; + delete [] data; + delete [] contourLength; } diff --git a/src/osgText/FTPixmapGlyph.cpp b/src/osgText/FTPixmapGlyph.cpp index df442a82b..8280f6fc1 100644 --- a/src/osgText/FTPixmapGlyph.cpp +++ b/src/osgText/FTPixmapGlyph.cpp @@ -41,7 +41,7 @@ FTPixmapGlyph::FTPixmapGlyph( FT_Glyph glyph) destWidth = srcWidth; destHeight = srcHeight; - data = osgNew unsigned char[destWidth * destHeight * 4]; + data = new unsigned char[destWidth * destHeight * 4]; // Get the current glColor. float ftglColour[4] = { 1.0, 1.0, 1.0, 1.0 }; @@ -71,7 +71,7 @@ FTPixmapGlyph::FTPixmapGlyph( FT_Glyph glyph) FTPixmapGlyph::~FTPixmapGlyph() { - osgDelete [] data; + delete [] data; } diff --git a/src/osgText/FTPolyGlyph.cpp b/src/osgText/FTPolyGlyph.cpp index 83412f00b..3734234da 100644 --- a/src/osgText/FTPolyGlyph.cpp +++ b/src/osgText/FTPolyGlyph.cpp @@ -41,7 +41,7 @@ static CreatedVertices s_createdVertices; void CALLBACK ftglCombine( GLdouble coords[3], void* /*vertex_data*/[4], GLfloat /*weight*/[4], void** outData) { - double* vertex = osgNew double[3]; // FIXME MEM LEAK + double* vertex = new double[3]; // FIXME MEM LEAK s_createdVertices.push_back(vertex); @@ -71,14 +71,14 @@ FTPolyGlyph::FTPolyGlyph( FT_Glyph glyph) advance = glyph->advance.x >> 16; - vectoriser = osgNew FTVectoriser( glyph); + vectoriser = new FTVectoriser( glyph); vectoriser->Process(); numContours = vectoriser->contours(); if (numContours==0) return; - contourLength = osgNew int[ numContours]; + contourLength = new int[ numContours]; memset(contourLength,0,sizeof(int)*numContours); for( int c = 0; c < numContours; ++c) @@ -87,7 +87,7 @@ FTPolyGlyph::FTPolyGlyph( FT_Glyph glyph) } numPoints = vectoriser->points(); - data = osgNew double[ numPoints * 3]; + data = new double[ numPoints * 3]; // initalize memory. for( int pc=0;pcsetAlignment(_alignment); textDrawable->setPosition(pos); textDrawable->setText(*itr); diff --git a/src/osgUtil/CubeMapGenerator.cpp b/src/osgUtil/CubeMapGenerator.cpp index 763ece073..40fd35d38 100644 --- a/src/osgUtil/CubeMapGenerator.cpp +++ b/src/osgUtil/CubeMapGenerator.cpp @@ -9,7 +9,7 @@ CubeMapGenerator::CubeMapGenerator(int texture_size) { for (int i=0; i<6; ++i) { - osg::ref_ptr image = osgNew osg::Image; + osg::ref_ptr image = new osg::Image; unsigned char* data = (static_cast(malloc(texture_size*texture_size*4))); image->setImage(texture_size, texture_size, 1, 4, GL_RGBA, GL_UNSIGNED_BYTE, data); images_.push_back(image); diff --git a/src/osgUtil/CullVisitor.cpp b/src/osgUtil/CullVisitor.cpp index 282554cd9..4237676ff 100644 --- a/src/osgUtil/CullVisitor.cpp +++ b/src/osgUtil/CullVisitor.cpp @@ -87,7 +87,7 @@ CullVisitor::CullVisitor(): _numFramesToKeepImpostorSprites(10), _currentReuseRenderLeafIndex(0) { - _impostorSpriteManager = osgNew ImpostorSpriteManager; + _impostorSpriteManager = new ImpostorSpriteManager; } @@ -669,7 +669,7 @@ ImpostorSprite* CullVisitor::createImpostorSprite(Impostor& node) // one for use. // create the render to texture stage. - ref_ptr rtts = osgNew RenderToTextureStage; + ref_ptr rtts = new RenderToTextureStage; // set up lighting. // currently ignore lights in the scene graph itself.. @@ -748,7 +748,7 @@ ImpostorSprite* CullVisitor::createImpostorSprite(Impostor& node) zfar *= 1.1f; // set up projection. - osg::Matrix* projection = osgNew osg::Matrix; + osg::Matrix* projection = new osg::Matrix; if (isPerspectiveProjection) { // deal with projection issue move the top and right points @@ -768,7 +768,7 @@ ImpostorSprite* CullVisitor::createImpostorSprite(Impostor& node) Vec3 rotate_from = bs.center()-eye_local; Vec3 rotate_to = getLookVectorLocal(); - osg::Matrix* rotate_matrix = osgNew osg::Matrix( + osg::Matrix* rotate_matrix = new osg::Matrix( osg::Matrix::translate(-eye_local)* osg::Matrix::rotate(rotate_from,rotate_to)* osg::Matrix::translate(eye_local)* @@ -778,7 +778,7 @@ ImpostorSprite* CullVisitor::createImpostorSprite(Impostor& node) // into account the new camera orientation. pushModelViewMatrix(rotate_matrix); - ref_ptr dummyState = osgNew StateSet; + ref_ptr dummyState = new StateSet; pushStateSet(dummyState.get()); @@ -860,7 +860,7 @@ ImpostorSprite* CullVisitor::createImpostorSprite(Impostor& node) int center_x = viewport.x()+viewport.width()/2; int center_y = viewport.y()+viewport.height()/2; - Viewport* new_viewport = osgNew Viewport; + Viewport* new_viewport = new Viewport; new_viewport->setViewport(center_x-new_s/2,center_y-new_t/2,new_s,new_t); rtts->setViewport(new_viewport); diff --git a/src/osgUtil/DisplayRequirementsVisitor.cpp b/src/osgUtil/DisplayRequirementsVisitor.cpp index 2c5bfc716..5711469a6 100644 --- a/src/osgUtil/DisplayRequirementsVisitor.cpp +++ b/src/osgUtil/DisplayRequirementsVisitor.cpp @@ -18,7 +18,7 @@ DisplayRequirementsVisitor::DisplayRequirementsVisitor() void DisplayRequirementsVisitor::applyStateSet(StateSet& stateset) { - if (!_ds) _ds = osgNew osg::DisplaySettings; + if (!_ds) _ds = new osg::DisplaySettings; unsigned int min = 0; // assume stencil not needed by this stateset. @@ -61,7 +61,7 @@ void DisplayRequirementsVisitor::apply(Geode& geode) void DisplayRequirementsVisitor::apply(Impostor& impostor) { - if (!_ds) _ds = osgNew osg::DisplaySettings; + if (!_ds) _ds = new osg::DisplaySettings; unsigned int min = 1; // number alpha bits we need at least. if (min>_ds->getMinimumNumAlphaBits()) diff --git a/src/osgUtil/InsertImpostorsVisitor.cpp b/src/osgUtil/InsertImpostorsVisitor.cpp index baf6446ae..26b54ff89 100644 --- a/src/osgUtil/InsertImpostorsVisitor.cpp +++ b/src/osgUtil/InsertImpostorsVisitor.cpp @@ -92,7 +92,7 @@ void InsertImpostorsVisitor::insertImpostors() // to an impostor. Node::ParentList parentList = group->getParents(); - Impostor* impostor = osgNew Impostor; + Impostor* impostor = new Impostor; // standard LOD settings impostor->addChild(group); @@ -139,7 +139,7 @@ void InsertImpostorsVisitor::insertImpostors() // to an impostor. Node::ParentList parentList = lod->getParents(); - osg::Impostor* impostor = osgNew Impostor; + osg::Impostor* impostor = new Impostor; // standard LOD settings for(unsigned int ci=0;cigetNumChildren();++ci) diff --git a/src/osgUtil/IntersectVisitor.cpp b/src/osgUtil/IntersectVisitor.cpp index 9fb49c4dc..ddc89c18d 100644 --- a/src/osgUtil/IntersectVisitor.cpp +++ b/src/osgUtil/IntersectVisitor.cpp @@ -155,7 +155,7 @@ void IntersectVisitor::reset() _intersectStateStack.clear(); // create a empty IntersectState on the the intersectStateStack. - _intersectStateStack.push_back(osgNew IntersectState); + _intersectStateStack.push_back(new IntersectState); _nodePath.clear(); _segHitList.clear(); @@ -196,7 +196,7 @@ void IntersectVisitor::addLineSegment(LineSegment* seg) // create a new segment transformed to local coordintes. IntersectState* cis = _intersectStateStack.back().get(); - LineSegment* ns = osgNew LineSegment; + LineSegment* ns = new LineSegment; if (cis->_inverse.valid()) ns->mult(*seg,*(cis->_inverse)); else *ns = *seg; @@ -208,21 +208,21 @@ void IntersectVisitor::addLineSegment(LineSegment* seg) void IntersectVisitor::pushMatrix(const Matrix& matrix) { - IntersectState* nis = osgNew IntersectState; + IntersectState* nis = new IntersectState; IntersectState* cis = _intersectStateStack.back().get(); if (cis->_matrix.valid()) { - nis->_matrix = osgNew Matrix; + nis->_matrix = new Matrix; nis->_matrix->mult(matrix,*(cis->_matrix)); } else { - nis->_matrix = osgNew Matrix(matrix); + nis->_matrix = new Matrix(matrix); } - Matrix* inverse_world = osgNew Matrix; + Matrix* inverse_world = new Matrix; inverse_world->invert(*(nis->_matrix)); nis->_inverse = inverse_world; @@ -234,7 +234,7 @@ void IntersectVisitor::pushMatrix(const Matrix& matrix) { if ((segMaskIn & mask)) { - LineSegment* seg = osgNew LineSegment; + LineSegment* seg = new LineSegment; seg->mult(*(sitr->first),*inverse_world); nis->addLineSegmentPair(sitr->first.get(),seg); } @@ -526,7 +526,7 @@ void IntersectVisitor::apply(Transform& node) { if (!enterNode(node)) return; - osg::ref_ptr matrix = osgNew Matrix; + osg::ref_ptr matrix = new Matrix; node.getLocalToWorldMatrix(*matrix,this); pushMatrix(*matrix); diff --git a/src/osgUtil/NvTriStripObjects.cpp b/src/osgUtil/NvTriStripObjects.cpp index 82f2b7ad5..aba7e1a13 100644 --- a/src/osgUtil/NvTriStripObjects.cpp +++ b/src/osgUtil/NvTriStripObjects.cpp @@ -21,7 +21,7 @@ VertexCache::VertexCache(int size) { numEntries = size; - entries = osgNew int[numEntries]; + entries = new int[numEntries]; for(int i = 0; i < numEntries; i++) entries[i] = -1; @@ -30,7 +30,7 @@ VertexCache::VertexCache(int size) VertexCache::~VertexCache() { - osgDelete [] entries; + delete [] entries; } @@ -169,7 +169,7 @@ void NvStripifier::BuildStripifyInfo(NvFaceInfoVec &faceInfos, NvEdgeInfoVec &ed // create the face info and add it to the list of faces, but only if this exact face doesn't already // exist in the list - NvFaceInfo *faceInfo = osgNew NvFaceInfo(v0, v1, v2); + NvFaceInfo *faceInfo = new NvFaceInfo(v0, v1, v2); if(!AlreadyExists(faceInfo, faceInfos)) { faceInfos.push_back(faceInfo); @@ -180,7 +180,7 @@ void NvStripifier::BuildStripifyInfo(NvFaceInfoVec &faceInfos, NvEdgeInfoVec &ed { // create the info - edgeInfo01 = osgNew NvEdgeInfo(v0, v1); + edgeInfo01 = new NvEdgeInfo(v0, v1); // update the linked list on both edgeInfo01->m_nextV0 = edgeInfos[v0]; @@ -205,7 +205,7 @@ void NvStripifier::BuildStripifyInfo(NvFaceInfoVec &faceInfos, NvEdgeInfoVec &ed { // create the info - edgeInfo12 = osgNew NvEdgeInfo(v1, v2); + edgeInfo12 = new NvEdgeInfo(v1, v2); // update the linked list on both edgeInfo12->m_nextV0 = edgeInfos[v1]; @@ -230,7 +230,7 @@ void NvStripifier::BuildStripifyInfo(NvFaceInfoVec &faceInfos, NvEdgeInfoVec &ed { // create the info - edgeInfo20 = osgNew NvEdgeInfo(v2, v0); + edgeInfo20 = new NvEdgeInfo(v2, v0); // update the linked list on both edgeInfo20->m_nextV0 = edgeInfos[v2]; @@ -789,7 +789,7 @@ void NvStripifier::RemoveSmallStrips(NvStripInfoVec& allStrips, NvStripInfoVec& tempFaceList.push_back(allStrips[i]->m_faces[j]); //and free memory - osgDelete allStrips[i]; + delete allStrips[i]; } else { @@ -797,10 +797,10 @@ void NvStripifier::RemoveSmallStrips(NvStripInfoVec& allStrips, NvStripInfoVec& } } - bool *bVisitedList = osgNew bool[tempFaceList.size()]; + bool *bVisitedList = new bool[tempFaceList.size()]; memset(bVisitedList, 0, tempFaceList.size()*sizeof(bool)); - VertexCache* vcache = osgNew VertexCache(cacheSize); + VertexCache* vcache = new VertexCache(cacheSize); int bestNumHits = -1; int numHits; @@ -831,8 +831,8 @@ void NvStripifier::RemoveSmallStrips(NvStripInfoVec& allStrips, NvStripInfoVec& faceList.push_back(tempFaceList[bestIndex]); } - osgDelete vcache; - osgDelete [] bVisitedList; + delete vcache; + delete [] bVisitedList; } @@ -875,7 +875,7 @@ void NvStripifier::Stripify(const WordVec &in_indices, const int in_numVertices, int i; for(i = 0; i < (int)allStrips.size(); i++) { - osgDelete allStrips[i]; + delete allStrips[i]; } for (i = 0; i < (int)allEdgeInfos.size(); i++) @@ -921,7 +921,7 @@ NvEdgeInfoVec& edgeInfos, NvFaceInfoVec& outFaceList) int j; for(j = 0; j < numTimes; j++) { - currentStrip = osgNew NvStripInfo(startInfo, 0, -1); + currentStrip = new NvStripInfo(startInfo, 0, -1); for(int faceCtr = j*threshold; faceCtr < threshold+(j*threshold); faceCtr++) { @@ -935,7 +935,7 @@ NvEdgeInfoVec& edgeInfos, NvFaceInfoVec& outFaceList) if(numLeftover != 0) { - currentStrip = osgNew NvStripInfo(startInfo, 0, -1); + currentStrip = new NvStripInfo(startInfo, 0, -1); for(int k = 0; k < numLeftover; k++) { @@ -948,8 +948,8 @@ NvEdgeInfoVec& edgeInfos, NvFaceInfoVec& outFaceList) else { //we're not just doing a tempStrips.push_back(allBigStrips[i]) because - // this way we can osgDelete allBigStrips later to free the memory - currentStrip = osgNew NvStripInfo(startInfo, 0, -1); + // this way we can delete allBigStrips later to free the memory + currentStrip = new NvStripInfo(startInfo, 0, -1); for(unsigned int j = 0; j < allStrips[i]->m_faces.size(); j++) currentStrip->m_faces.push_back(allStrips[i]->m_faces[j]); @@ -966,7 +966,7 @@ NvEdgeInfoVec& edgeInfos, NvFaceInfoVec& outFaceList) if(tempStrips2.size() != 0) { //Optimize for the vertex cache - VertexCache* vcache = osgNew VertexCache(cacheSize); + VertexCache* vcache = new VertexCache(cacheSize); float bestNumHits = -1.0f; float numHits; @@ -1025,7 +1025,7 @@ NvEdgeInfoVec& edgeInfos, NvFaceInfoVec& outFaceList) outStrips.push_back(tempStrips2[bestIndex]); } - osgDelete vcache; + delete vcache; } } @@ -1195,7 +1195,7 @@ int numSamples) // // PHASE 1: Set up numSamples * numEdges experiments // - NvStripInfoVec *experiments = osgNew NvStripInfoVec [numSamples * 6]; + NvStripInfoVec *experiments = new NvStripInfoVec [numSamples * 6]; int experimentIndex = 0; std::set resetPoints; int i; @@ -1226,32 +1226,32 @@ int numSamples) // build the strip off of this face's 0-1 edge NvEdgeInfo *edge01 = FindEdgeInfo(allEdgeInfos, nextFace->m_v0, nextFace->m_v1); - NvStripInfo *strip01 = osgNew NvStripInfo(NvStripStartInfo(nextFace, edge01, true), stripId++, experimentId++); + NvStripInfo *strip01 = new NvStripInfo(NvStripStartInfo(nextFace, edge01, true), stripId++, experimentId++); experiments[experimentIndex++].push_back(strip01); // build the strip off of this face's 1-0 edge NvEdgeInfo *edge10 = FindEdgeInfo(allEdgeInfos, nextFace->m_v0, nextFace->m_v1); - NvStripInfo *strip10 = osgNew NvStripInfo(NvStripStartInfo(nextFace, edge10, false), stripId++, experimentId++); + NvStripInfo *strip10 = new NvStripInfo(NvStripStartInfo(nextFace, edge10, false), stripId++, experimentId++); experiments[experimentIndex++].push_back(strip10); // build the strip off of this face's 1-2 edge NvEdgeInfo *edge12 = FindEdgeInfo(allEdgeInfos, nextFace->m_v1, nextFace->m_v2); - NvStripInfo *strip12 = osgNew NvStripInfo(NvStripStartInfo(nextFace, edge12, true), stripId++, experimentId++); + NvStripInfo *strip12 = new NvStripInfo(NvStripStartInfo(nextFace, edge12, true), stripId++, experimentId++); experiments[experimentIndex++].push_back(strip12); // build the strip off of this face's 2-1 edge NvEdgeInfo *edge21 = FindEdgeInfo(allEdgeInfos, nextFace->m_v1, nextFace->m_v2); - NvStripInfo *strip21 = osgNew NvStripInfo(NvStripStartInfo(nextFace, edge21, false), stripId++, experimentId++); + NvStripInfo *strip21 = new NvStripInfo(NvStripStartInfo(nextFace, edge21, false), stripId++, experimentId++); experiments[experimentIndex++].push_back(strip21); // build the strip off of this face's 2-0 edge NvEdgeInfo *edge20 = FindEdgeInfo(allEdgeInfos, nextFace->m_v2, nextFace->m_v0); - NvStripInfo *strip20 = osgNew NvStripInfo(NvStripStartInfo(nextFace, edge20, true), stripId++, experimentId++); + NvStripInfo *strip20 = new NvStripInfo(NvStripStartInfo(nextFace, edge20, true), stripId++, experimentId++); experiments[experimentIndex++].push_back(strip20); // build the strip off of this face's 0-2 edge NvEdgeInfo *edge02 = FindEdgeInfo(allEdgeInfos, nextFace->m_v2, nextFace->m_v0); - NvStripInfo *strip02 = osgNew NvStripInfo(NvStripStartInfo(nextFace, edge02, false), stripId++, experimentId++); + NvStripInfo *strip02 = new NvStripInfo(NvStripStartInfo(nextFace, edge02, false), stripId++, experimentId++); experiments[experimentIndex++].push_back(strip02); } @@ -1276,7 +1276,7 @@ int numSamples) { // create the new strip info - stripIter = osgNew NvStripInfo(startInfo, stripId++, experimentId); + stripIter = new NvStripInfo(startInfo, stripId++, experimentId); // build the next strip stripIter->Build(allEdgeInfos, allFaceInfos); @@ -1319,13 +1319,13 @@ int numSamples) int numStrips = experiments[i].size(); for (int j = 0; j < numStrips; j++) { - osgDelete experiments[i][j]; + delete experiments[i][j]; } } } - // osgDelete the array that we used for all experiments - osgDelete [] experiments; + // delete the array that we used for all experiments + delete [] experiments; } } @@ -1525,7 +1525,7 @@ MyVertexVec& optimizedVerts) //caches oldIndex --> newIndex conversion int *indexCache; - indexCache = osgNew int[vertices.size()]; + indexCache = new int[vertices.size()]; memset(indexCache, -1, sizeof(int)*vertices.size()); @@ -1634,7 +1634,7 @@ MyVertexVec& optimizedVerts) } } - osgDelete [] indexCache; + delete [] indexCache; assert(optimizedVerts.size() == vertices.size()); } diff --git a/src/osgUtil/NvTriStripObjects.h b/src/osgUtil/NvTriStripObjects.h index 1a799624f..7931654dc 100644 --- a/src/osgUtil/NvTriStripObjects.h +++ b/src/osgUtil/NvTriStripObjects.h @@ -6,8 +6,6 @@ #include #include -#include - ///////////////////////////////////////////////////////////////////////////////// // // Types defined for stripification @@ -135,7 +133,7 @@ class NvEdgeInfo } // ref and unref - void Unref () { if (--m_refCount == 0) osgDelete this; } + void Unref () { if (--m_refCount == 0) delete this; } // data members are left public UINT m_refCount; diff --git a/src/osgUtil/Optimizer.cpp b/src/osgUtil/Optimizer.cpp index eb807d11e..737cc1aa8 100644 --- a/src/osgUtil/Optimizer.cpp +++ b/src/osgUtil/Optimizer.cpp @@ -709,7 +709,7 @@ bool CollectLowestTransformsVisitor::removeTransforms() transformRemoved = true; osg::ref_ptr transform = titr->first; - osg::ref_ptr group = osgNew osg::Group; + osg::ref_ptr group = new osg::Group; group->setDataVariance(osg::Object::STATIC); for(unsigned int i=0;igetNumChildren();++i) { @@ -1012,7 +1012,7 @@ void Optimizer::CombineLODsVisitor::combineLODs() } // create new LOD containing all other LOD's children. - osg::LOD* newLOD = osgNew osg::LOD; + osg::LOD* newLOD = new osg::LOD; newLOD->setName("newLOD"); newLOD->setCenter(bb.center()); diff --git a/src/osgUtil/RenderBin.cpp b/src/osgUtil/RenderBin.cpp index 1917ce1ad..0717b5616 100644 --- a/src/osgUtil/RenderBin.cpp +++ b/src/osgUtil/RenderBin.cpp @@ -10,8 +10,8 @@ using namespace osg; using namespace osgUtil; // register a RenderStage prototype with the RenderBin prototype list. -RegisterRenderBinProxy s_registerRenderBinProxy("RenderBin",osgNew RenderBin(RenderBin::SORT_BY_STATE)); -RegisterRenderBinProxy s_registerDepthSortedBinProxy("DepthSortedBin",osgNew RenderBin(RenderBin::SORT_BACK_TO_FRONT)); +RegisterRenderBinProxy s_registerRenderBinProxy("RenderBin",new RenderBin(RenderBin::SORT_BY_STATE)); +RegisterRenderBinProxy s_registerDepthSortedBinProxy("DepthSortedBin",new RenderBin(RenderBin::SORT_BACK_TO_FRONT)); typedef std::map< std::string, osg::ref_ptr > RenderBinPrototypeList; diff --git a/src/osgUtil/SceneView.cpp b/src/osgUtil/SceneView.cpp index 6f760657d..af52cd996 100644 --- a/src/osgUtil/SceneView.cpp +++ b/src/osgUtil/SceneView.cpp @@ -34,7 +34,7 @@ SceneView::SceneView(DisplaySettings* ds) _prioritizeTextures = false; - _viewport = osgNew Viewport; + _viewport = new Viewport; _initCalled = false; @@ -52,21 +52,21 @@ SceneView::~SceneView() void SceneView::setDefaults() { - _globalState = osgNew osg::StateSet; + _globalState = new osg::StateSet; _lightingMode=HEADLIGHT; - _light = osgNew osg::Light; + _light = new osg::Light; _light->setLightNum(0); _light->setAmbient(Vec4(0.00f,0.0f,0.00f,1.0f)); _light->setDiffuse(Vec4(0.8f,0.8f,0.8f,1.0f)); _light->setSpecular(Vec4(1.0f,1.0f,1.0f,1.0f)); - _state = osgNew State; + _state = new State; - _camera = osgNew Camera(_displaySettings.get()); + _camera = new Camera(_displaySettings.get()); - _rendergraph = osgNew RenderGraph; - _renderStage = osgNew RenderStage; + _rendergraph = new RenderGraph; + _renderStage = new RenderStage; #ifndef __sgi @@ -74,15 +74,15 @@ void SceneView::setDefaults() // lighting state with the display list, and the display list visitor doesn't currently apply // state before creating display lists. So will disable the init visitor default, this won't // affect functionality since the display lists will be created as and when needed. - DisplayListVisitor* dlv = osgNew DisplayListVisitor(); + DisplayListVisitor* dlv = new DisplayListVisitor(); dlv->setState(_state.get()); dlv->setNodeMaskOverride(0xffffffff); _initVisitor = dlv; #endif - _appVisitor = osgNew AppVisitor; + _appVisitor = new AppVisitor; - _cullVisitor = osgNew CullVisitor; + _cullVisitor = new CullVisitor; _cullVisitor->setRenderGraph(_rendergraph.get()); _cullVisitor->setRenderStage(_renderStage.get()); @@ -97,16 +97,16 @@ void SceneView::setDefaults() _globalState->setMode(GL_DEPTH_TEST, osg::StateAttribute::ON); // set up an alphafunc by default to speed up blending operations. - osg::AlphaFunc* alphafunc = osgNew osg::AlphaFunc; + osg::AlphaFunc* alphafunc = new osg::AlphaFunc; alphafunc->setFunction(osg::AlphaFunc::GREATER,0.0f); _globalState->setAttributeAndModes(alphafunc, osg::StateAttribute::ON); // set up an texture environment by default to speed up blending operations. - osg::TexEnv* texenv = osgNew osg::TexEnv; + osg::TexEnv* texenv = new osg::TexEnv; texenv->setMode(osg::TexEnv::MODULATE); _globalState->setTextureAttributeAndModes(0,texenv, osg::StateAttribute::ON); - osg::LightModel* lightmodel = osgNew osg::LightModel; + osg::LightModel* lightmodel = new osg::LightModel; lightmodel->setAmbientIntensity(osg::Vec4(0.1f,0.1f,0.1f,1.0f)); _globalState->setAttributeAndModes(lightmodel, osg::StateAttribute::ON); @@ -188,14 +188,14 @@ void SceneView::cull() // note the constructor for osg::State will set ContextID to 0 which will be fine to single context graphics // applications which is ok for most apps, but not multiple context/pipe applications. - _state = osgNew osg::State; + _state = new osg::State; } if (!_globalState) { osg::notify(osg::INFO) << "Warning: no valid osgUtil::SceneView::_globalState attached, creating a default global stateset automatically."<< std::endl; - _globalState = osgNew osg::StateSet; + _globalState = new osg::StateSet; _globalState->setGlobalDefaults(); } @@ -235,30 +235,30 @@ void SceneView::cull() if (_displaySettings.valid()) _camera->setScreenDistance(_displaySettings->getScreenDistance()); - if (!projection) projection = osgNew osg::Matrix(_camera->getProjectionMatrix()); - if (!modelview) modelview = osgNew osg::Matrix(_camera->getModelViewMatrix()); + if (!projection) projection = new osg::Matrix(_camera->getProjectionMatrix()); + if (!modelview) modelview = new osg::Matrix(_camera->getModelViewMatrix()); //cout <<"fovx="<<_camera->calc_fovx()<getStereo()) @@ -288,14 +288,14 @@ void SceneView::cull() if (_displaySettings->getStereoMode()==osg::DisplaySettings::LEFT_EYE) { // set up the left eye. - osg::ref_ptr projectionLeft = osgNew osg::Matrix(osg::Matrix(1.0f,0.0f,0.0f,0.0f, + osg::ref_ptr projectionLeft = new osg::Matrix(osg::Matrix(1.0f,0.0f,0.0f,0.0f, 0.0f,1.0f,0.0f,0.0f, iod/(2.0f*sd),0.0f,1.0f,0.0f, 0.0f,0.0f,0.0f,1.0f)* (*projection)); - osg::ref_ptr modelviewLeft = osgNew osg::Matrix( (*modelview) * + osg::ref_ptr modelviewLeft = new osg::Matrix( (*modelview) * osg::Matrix(1.0f,0.0f,0.0f,0.0f, 0.0f,1.0f,0.0f,0.0f, 0.0f,0.0f,1.0f,0.0f, @@ -313,13 +313,13 @@ void SceneView::cull() else if (_displaySettings->getStereoMode()==osg::DisplaySettings::RIGHT_EYE) { // set up the right eye. - osg::ref_ptr projectionRight = osgNew osg::Matrix(osg::Matrix(1.0f,0.0f,0.0f,0.0f, + osg::ref_ptr projectionRight = new osg::Matrix(osg::Matrix(1.0f,0.0f,0.0f,0.0f, 0.0f,1.0f,0.0f,0.0f, -iod/(2.0f*sd),0.0f,1.0f,0.0f, 0.0f,0.0f,0.0f,1.0f)* (*projection)); - osg::ref_ptr modelviewRight = osgNew osg::Matrix( (*modelview) * + osg::ref_ptr modelviewRight = new osg::Matrix( (*modelview) * osg::Matrix(1.0f,0.0f,0.0f,0.0f, 0.0f,1.0f,0.0f,0.0f, 0.0f,0.0f,1.0f,0.0f, @@ -348,14 +348,14 @@ void SceneView::cull() // set up the left eye. - osg::ref_ptr projectionLeft = osgNew osg::Matrix(osg::Matrix(1.0f,0.0f,0.0f,0.0f, + osg::ref_ptr projectionLeft = new osg::Matrix(osg::Matrix(1.0f,0.0f,0.0f,0.0f, 0.0f,1.0f,0.0f,0.0f, iod/(2.0f*sd),0.0f,1.0f,0.0f, 0.0f,0.0f,0.0f,1.0f)* (*projection)); - osg::ref_ptr modelviewLeft = osgNew osg::Matrix( (*modelview) * + osg::ref_ptr modelviewLeft = new osg::Matrix( (*modelview) * osg::Matrix(1.0f,0.0f,0.0f,0.0f, 0.0f,1.0f,0.0f,0.0f, 0.0f,0.0f,1.0f,0.0f, @@ -366,13 +366,13 @@ void SceneView::cull() // set up the right eye. - osg::ref_ptr projectionRight = osgNew osg::Matrix(osg::Matrix(1.0f,0.0f,0.0f,0.0f, + osg::ref_ptr projectionRight = new osg::Matrix(osg::Matrix(1.0f,0.0f,0.0f,0.0f, 0.0f,1.0f,0.0f,0.0f, -iod/(2.0f*sd),0.0f,1.0f,0.0f, 0.0f,0.0f,0.0f,1.0f)* (*projection)); - osg::ref_ptr modelviewRight = osgNew osg::Matrix( (*modelview) * + osg::ref_ptr modelviewRight = new osg::Matrix( (*modelview) * osg::Matrix(1.0f,0.0f,0.0f,0.0f, 0.0f,1.0f,0.0f,0.0f, 0.0f,0.0f,1.0f,0.0f, @@ -594,14 +594,14 @@ void SceneView::draw() _renderStageRight->drawPreRenderStages(*_state,previous); // draw left eye. - osg::ref_ptr red = osgNew osg::ColorMask; + osg::ref_ptr red = new osg::ColorMask; red->setMask(true,false,false,true); _globalState->setAttribute(red.get()); _renderStageLeft->setColorMask(red.get()); _renderStageLeft->draw(*_state,previous); // draw right eye. - osg::ref_ptr green = osgNew osg::ColorMask; + osg::ref_ptr green = new osg::ColorMask; green->setMask(false,true,true,true); _globalState->setAttribute(green.get()); _renderStageRight->setColorMask(green.get()); @@ -620,10 +620,10 @@ void SceneView::draw() int right_half_begin = (_viewport->width()+separation)/2; int right_half_width = _viewport->width()-right_half_begin; - osg::ref_ptr viewportLeft = osgNew osg::Viewport; + osg::ref_ptr viewportLeft = new osg::Viewport; viewportLeft->setViewport(_viewport->x(),_viewport->y(),left_half_width,_viewport->height()); - osg::ref_ptr viewportRight = osgNew osg::Viewport; + osg::ref_ptr viewportRight = new osg::Viewport; viewportRight->setViewport(_viewport->x()+right_half_begin,_viewport->y(),right_half_width,_viewport->height()); @@ -664,10 +664,10 @@ void SceneView::draw() int top_half_begin = (_viewport->height()+separation)/2; int top_half_height = _viewport->height()-top_half_begin; - osg::ref_ptr viewportTop = osgNew osg::Viewport; + osg::ref_ptr viewportTop = new osg::Viewport; viewportTop->setViewport(_viewport->x(),_viewport->y()+top_half_begin,_viewport->width(),top_half_height); - osg::ref_ptr viewportBottom = osgNew osg::Viewport; + osg::ref_ptr viewportBottom = new osg::Viewport; viewportBottom->setViewport(_viewport->x(),_viewport->y(),_viewport->width(),bottom_half_height); clearArea(_viewport->x(),_viewport->y()+bottom_half_height,_viewport->width(),separation,_renderStageLeft->getClearColor()); @@ -712,7 +712,7 @@ void SceneView::draw() else { _globalState->setAttribute(_viewport.get()); - osg::ref_ptr cmask = osgNew osg::ColorMask; + osg::ref_ptr cmask = new osg::ColorMask; cmask->setMask(true,true,true,true); _globalState->setAttribute(cmask.get()); @@ -794,7 +794,7 @@ const osg::Matrix SceneView::computeMVPW() const void SceneView::clearArea(int x,int y,int width,int height,const osg::Vec4& color) { - osg::ref_ptr viewport = osgNew osg::Viewport; + osg::ref_ptr viewport = new osg::Viewport; viewport->setViewport(x,y,width,height); _state->applyAttribute(viewport.get()); diff --git a/src/osgUtil/SmoothingVisitor.cpp b/src/osgUtil/SmoothingVisitor.cpp index 3e2c82fd1..26c3ec64c 100644 --- a/src/osgUtil/SmoothingVisitor.cpp +++ b/src/osgUtil/SmoothingVisitor.cpp @@ -98,7 +98,7 @@ void SmoothingVisitor::smooth(osg::Geometry& geom) osg::Vec3Array *coords = geom.getVertexArray(); if (!coords || !coords->size()) return; - osg::Vec3Array *normals = osgNew osg::Vec3Array(coords->size()); + osg::Vec3Array *normals = new osg::Vec3Array(coords->size()); osg::Vec3Array::iterator nitr; for(nitr = normals->begin(); diff --git a/src/osgUtil/TriStripVisitor.cpp b/src/osgUtil/TriStripVisitor.cpp index a69adcf85..2b399d6cb 100644 --- a/src/osgUtil/TriStripVisitor.cpp +++ b/src/osgUtil/TriStripVisitor.cpp @@ -124,7 +124,7 @@ void TriStripVisitor::stripify(Geometry& geom) NvStripInfo *strip = strips[i]; int nStripFaceCount = strip->m_faces.size(); - osg::DrawElementsUShort* elements = osgNew osg::DrawElementsUShort(osg::PrimitiveSet::TRIANGLE_STRIP); + osg::DrawElementsUShort* elements = new osg::DrawElementsUShort(osg::PrimitiveSet::TRIANGLE_STRIP); elements->reserve(nStripFaceCount+2); new_primitives.push_back(elements); @@ -187,7 +187,7 @@ void TriStripVisitor::stripify(Geometry& geom) if (leftoverFaces.size()) { - osg::DrawElementsUShort* triangles = osgNew osg::DrawElementsUShort(osg::PrimitiveSet::TRIANGLES); + osg::DrawElementsUShort* triangles = new osg::DrawElementsUShort(osg::PrimitiveSet::TRIANGLES); triangles->reserve(leftoverFaces.size()*3); new_primitives.push_back(triangles);