 Timestamp:
 11/09/15 17:13:03 (6 months ago)
 Files:

 1 modified
Legend:
 Unmodified
 Added
 Removed

OpenSceneGraph/trunk/src/osgPlugins/Inventor/ConvertFromInventor.cpp
r13502 r13557 1 #include <osg/Config>2 #ifndef OSG_USE_DEPRECATED_GEOMETRY_METHODS3 #define OSG_USE_DEPRECATED_GEOMETRY_METHODS 14 #endif5 6 1 #include "ConvertFromInventor.h" 7 2 … … 775 770 776 771 // Normal and color binding map from Inventor to OSG 777 static std::map<SoNormalBinding::Binding, osg::Geometry::AttributeBinding>772 static std::map<SoNormalBinding::Binding, deprecated_osg::Geometry::AttributeBinding> 778 773 normBindingMap; 779 static std::map<SoMaterialBinding::Binding, osg::Geometry::AttributeBinding>774 static std::map<SoMaterialBinding::Binding, deprecated_osg::Geometry::AttributeBinding> 780 775 colBindingMap; 781 776 static bool firstTime = true; … … 783 778 { 784 779 normBindingMap[SoNormalBinding::OVERALL] 785 = osg::Geometry::BIND_OVERALL;780 = deprecated_osg::Geometry::BIND_OVERALL; 786 781 normBindingMap[SoNormalBinding::PER_PART] 787 = osg::Geometry::BIND_PER_PRIMITIVE;782 = deprecated_osg::Geometry::BIND_PER_PRIMITIVE; 788 783 normBindingMap[SoNormalBinding::PER_PART_INDEXED] 789 = osg::Geometry::BIND_PER_PRIMITIVE;784 = deprecated_osg::Geometry::BIND_PER_PRIMITIVE; 790 785 normBindingMap[SoNormalBinding::PER_FACE] 791 = osg::Geometry::BIND_PER_PRIMITIVE;786 = deprecated_osg::Geometry::BIND_PER_PRIMITIVE; 792 787 normBindingMap[SoNormalBinding::PER_FACE_INDEXED] 793 = osg::Geometry::BIND_PER_PRIMITIVE;788 = deprecated_osg::Geometry::BIND_PER_PRIMITIVE; 794 789 normBindingMap[SoNormalBinding::PER_VERTEX] 795 = osg::Geometry::BIND_PER_VERTEX;790 = deprecated_osg::Geometry::BIND_PER_VERTEX; 796 791 normBindingMap[SoNormalBinding::PER_VERTEX_INDEXED] 797 = osg::Geometry::BIND_PER_VERTEX;792 = deprecated_osg::Geometry::BIND_PER_VERTEX; 798 793 799 794 colBindingMap[SoMaterialBinding::OVERALL] 800 = osg::Geometry::BIND_OVERALL;795 = deprecated_osg::Geometry::BIND_OVERALL; 801 796 colBindingMap[SoMaterialBinding::PER_PART] 802 = osg::Geometry::BIND_PER_PRIMITIVE;797 = deprecated_osg::Geometry::BIND_PER_PRIMITIVE; 803 798 colBindingMap[SoMaterialBinding::PER_PART_INDEXED] 804 = osg::Geometry::BIND_PER_PRIMITIVE;799 = deprecated_osg::Geometry::BIND_PER_PRIMITIVE; 805 800 colBindingMap[SoMaterialBinding::PER_FACE] 806 = osg::Geometry::BIND_PER_PRIMITIVE;801 = deprecated_osg::Geometry::BIND_PER_PRIMITIVE; 807 802 colBindingMap[SoMaterialBinding::PER_FACE_INDEXED] 808 = osg::Geometry::BIND_PER_PRIMITIVE;803 = deprecated_osg::Geometry::BIND_PER_PRIMITIVE; 809 804 colBindingMap[SoMaterialBinding::PER_VERTEX] 810 = osg::Geometry::BIND_PER_VERTEX;805 = deprecated_osg::Geometry::BIND_PER_VERTEX; 811 806 colBindingMap[SoMaterialBinding::PER_VERTEX_INDEXED] 812 = osg::Geometry::BIND_PER_VERTEX;807 = deprecated_osg::Geometry::BIND_PER_VERTEX; 813 808 814 809 firstTime = false; … … 823 818 else 824 819 { 825 thisPtr>normalBinding = osg::Geometry::BIND_PER_VERTEX;826 thisPtr>colorBinding = osg::Geometry::BIND_PER_VERTEX;820 thisPtr>normalBinding = deprecated_osg::Geometry::BIND_PER_VERTEX; 821 thisPtr>colorBinding = deprecated_osg::Geometry::BIND_PER_VERTEX; 827 822 } 828 823 … … 875 870 876 871 // Create a new Geometry 877 osg::ref_ptr< osg::Geometry> geometry = newosg::Geometry;872 osg::ref_ptr<deprecated_osg::Geometry> geometry = new deprecated_osg::Geometry; 878 873 879 874 … … 884 879 885 880 osg::ref_ptr<osg::Vec3Array> norms = NULL; 886 if (thisPtr>normalBinding == osg::Geometry::BIND_OVERALL)881 if (thisPtr>normalBinding == deprecated_osg::Geometry::BIND_OVERALL) 887 882 { 888 883 norms = new osg::Vec3Array(1); … … 903 898 // Set the colors 904 899 osg::ref_ptr<osg::Vec4Array> cols; 905 if (thisPtr>colorBinding == osg::Geometry::BIND_OVERALL)900 if (thisPtr>colorBinding == deprecated_osg::Geometry::BIND_OVERALL) 906 901 { 907 902 cols = new osg::Vec4Array(1); … … 2163 2158 SbVec3f norm = v>getNormal(); 2164 2159 2165 if ((normalBinding == osg::Geometry::BIND_PER_VERTEX) 2166 (normalBinding == osg::Geometry::BIND_PER_PRIMITIVE && index == 0))2160 if ((normalBinding == deprecated_osg::Geometry::BIND_PER_VERTEX)  2161 (normalBinding == deprecated_osg::Geometry::BIND_PER_PRIMITIVE && index == 0)) 2167 2162 { 2168 2163 // What is this? Why to invert normals at CLOCKWISE vertex ordering? … … 2174 2169 } 2175 2170 2176 if (colorBinding == osg::Geometry::BIND_PER_VERTEX 2177 colorBinding == osg::Geometry::BIND_PER_PRIMITIVE)2171 if (colorBinding == deprecated_osg::Geometry::BIND_PER_VERTEX  2172 colorBinding == deprecated_osg::Geometry::BIND_PER_PRIMITIVE) 2178 2173 { 2179 2174 // Get the material/color … … 2182 2177 action>getMaterial(ambient, diffuse, specular, emission, shininess, 2183 2178 transparency, v>getMaterialIndex()); 2184 if (colorBinding == osg::Geometry::BIND_PER_VERTEX)2179 if (colorBinding == deprecated_osg::Geometry::BIND_PER_VERTEX) 2185 2180 colors.push_back(osg::Vec4(diffuse[0], diffuse[1], diffuse[2], 2186 2181 1.0  transparency)); 2187 else if (colorBinding == osg::Geometry::BIND_PER_PRIMITIVE && index == 0)2182 else if (colorBinding == deprecated_osg::Geometry::BIND_PER_PRIMITIVE && index == 0) 2188 2183 colors.push_back(osg::Vec4(diffuse[0], diffuse[1], diffuse[2], 2189 2184 1.0  transparency));