Hi Martin,

I have merged your changes, and fixed a number of warnings that
appeared under the lInux build, and then checked into svn/trunk.  I've
included a diff so you can see the types of changes I had to make to
fix the warnings.  I've included these so you know what things you can
tweak in your code to make it cleaner when doing cross platform
coding.

I tested osgconv cow.osg cow.dxf then osgviewer cow.osg and only got a
wireframe cow.osg rendered.  Same hapended when I tried dumptruck.osg.
 Is this indended?  Lighting also suggested no normals made it through
dxf export and back into the OSG.

Cheers,
Robert.

------ Warnings under Linux (now fixed)
------------------------------------------------------------

In file included from
/home/robert/OpenSceneGraph/src/osgPlugins/dxf/DXFWriterNodeVisitor.cpp:19:
/home/robert/OpenSceneGraph/src/osgPlugins/dxf/DXFWriterNodeVisitor.h:51:
warning: extra qualification ‘Layer::’ on member ‘Layer’
In file included from
/home/robert/OpenSceneGraph/src/osgPlugins/dxf/DXFWriterNodeVisitor.cpp:19:
/home/robert/OpenSceneGraph/src/osgPlugins/dxf/DXFWriterNodeVisitor.h:61:
warning: extra qualification ‘AcadColor::’ on member ‘AcadColor’
/home/robert/OpenSceneGraph/src/osgPlugins/dxf/DXFWriterNodeVisitor.h:
In constructor ‘AcadColor::AcadColor()’:
/home/robert/OpenSceneGraph/src/osgPlugins/dxf/DXFWriterNodeVisitor.h:66:
warning: operation on ‘ii’ may be undefined
/home/robert/OpenSceneGraph/src/osgPlugins/dxf/DXFWriterNodeVisitor.h:66:
warning: operation on ‘ii’ may be undefined
/home/robert/OpenSceneGraph/src/osgPlugins/dxf/DXFWriterNodeVisitor.h:
In constructor ‘DXFWriterNodeVisitor::DXFWriterNodeVisitor(std::ostream&)’:
/home/robert/OpenSceneGraph/src/osgPlugins/dxf/DXFWriterNodeVisitor.h:271:
warning: ‘DXFWriterNodeVisitor::_firstPass’ will be initialised after
/home/robert/OpenSceneGraph/src/osgPlugins/dxf/DXFWriterNodeVisitor.h:267:
warning:   ‘osg::ref_ptr<osg::StateSet>
DXFWriterNodeVisitor::_currentStateSet’
/home/robert/OpenSceneGraph/src/osgPlugins/dxf/DXFWriterNodeVisitor.h:166:
warning:   when initialised here
/home/robert/OpenSceneGraph/src/osgPlugins/dxf/DXFWriterNodeVisitor.h:
In static member function ‘static unsigned int
DXFWriterNodeVisitor::getNodeRGB(osg::Geometry*, int)’:
/home/robert/OpenSceneGraph/src/osgPlugins/dxf/DXFWriterNodeVisitor.h:179:
warning: comparison between signed and unsigned integer expressions
/home/robert/OpenSceneGraph/src/osgPlugins/dxf/DXFWriterNodeVisitor.cpp:
In member function ‘void
DXFWriterNodeVisitor::processGeometry(osg::Geometry*, osg::Matrix&)’:
/home/robert/OpenSceneGraph/src/osgPlugins/dxf/DXFWriterNodeVisitor.cpp:512:
warning: comparison between signed and unsigned integer expressions
In file included from
/home/robert/OpenSceneGraph/src/osgPlugins/dxf/ReaderWriterDXF.cpp:26:
/home/robert/OpenSceneGraph/src/osgPlugins/dxf/DXFWriterNodeVisitor.h:51:
warning: extra qualification ‘Layer::’ on member ‘Layer’
In file included from
/home/robert/OpenSceneGraph/src/osgPlugins/dxf/ReaderWriterDXF.cpp:26:
/home/robert/OpenSceneGraph/src/osgPlugins/dxf/DXFWriterNodeVisitor.h:61:
warning: extra qualification ‘AcadColor::’ on member ‘AcadColor’
/home/robert/OpenSceneGraph/src/osgPlugins/dxf/DXFWriterNodeVisitor.h:
In constructor ‘AcadColor::AcadColor()’:
/home/robert/OpenSceneGraph/src/osgPlugins/dxf/DXFWriterNodeVisitor.h:66:
warning: operation on ‘ii’ may be undefined
/home/robert/OpenSceneGraph/src/osgPlugins/dxf/DXFWriterNodeVisitor.h:66:
warning: operation on ‘ii’ may be undefined
/home/robert/OpenSceneGraph/src/osgPlugins/dxf/DXFWriterNodeVisitor.h:
In constructor ‘DXFWriterNodeVisitor::DXFWriterNodeVisitor(std::ostream&)’:
/home/robert/OpenSceneGraph/src/osgPlugins/dxf/DXFWriterNodeVisitor.h:271:
warning: ‘DXFWriterNodeVisitor::_firstPass’ will be initialised after
/home/robert/OpenSceneGraph/src/osgPlugins/dxf/DXFWriterNodeVisitor.h:267:
warning:   ‘osg::ref_ptr<osg::StateSet>
DXFWriterNodeVisitor::_currentStateSet’
/home/robert/OpenSceneGraph/src/osgPlugins/dxf/DXFWriterNodeVisitor.h:166:
warning:   when initialised here
/home/robert/OpenSceneGraph/src/osgPlugins/dxf/DXFWriterNodeVisitor.h:
In static member function ‘static unsigned int
DXFWriterNodeVisitor::getNodeRGB(osg::Geometry*, int)’:
/home/robert/OpenSceneGraph/src/osgPlugins/dxf/DXFWriterNodeVisitor.h:179:
warning: comparison between signed and unsigned integer expressions
Linking CXX shared module ../../../lib/osgPlugins-2.9.5/osgdb_dxf.so
[100%] Built target osgdb_dxf


----------Changes made to your source to get a clean build
---------------------------------------------------
> diff DXFWriterNodeVisitor.h 
> /home/robert/Contributions/MartinBeckett/DXFWriterNodeVisitor.h

51c51
<     Layer(const std::string name="",unsigned int color=7) :
_name(name),_color(color)  { }
---
>     Layer::Layer(const std::string name="",unsigned int color=7) : 
> _name(name),_color(color)  { }
61,62c61,62
<     AcadColor()
<     {
---
>     AcadColor::AcadColor()
>     {
64c64
<         for (int ii=10*3;ii<256*3; ) {
---
>         for (int ii=10*3;ii<256*3; ) {
66,70c66,67
<             unsigned int red = (int)floor(aci::table[ii++]*255.0f);
<             unsigned int green =
(int)floor(aci::table[ii++]*255.0f);
<             unsigned int blue = (int)floor(aci::table[ii++]*255.0f);
<             unsigned int rgb = (red<<16) + (green<<8) + blue;
<             _indexColors[rgb]=index++;
---
>             unsigned int rgb = ((int)floor(aci::table[ii++]*255.0f)<<16) + 
> ((int)floor(aci::table[ii++]*255.0f)<<8) + 
> ((int)floor(aci::table[ii++]*255.0f));
>             _indexColors[rgb]=index++;
74c71
<
---
>
90c87
<         }
---
>         }
103c100
<
---
>
172,173c169,170
<             _currentStateSet(new osg::StateSet()),
<             _firstPass(true)
---
>             _firstPass(true),
>             _currentStateSet(new osg::StateSet())
179c176
<         static unsigned int getNodeRGB(osg::Geometry *geo,unsigned
int index=0)
---
>         static unsigned int getNodeRGB(osg::Geometry *geo,int index=0)
272,274c269,271
<         unsigned int             _count;
<         std::vector<Layer>       _layers;
<         bool                     _firstPass;
---
>         unsigned int            _count;
>         std::vector<Layer>      _layers;
>         bool                    _firstPass;
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to