[choreonoid] 05/07: Fix patch

Thomas Moulard thomas_moulard-guest at alioth.debian.org
Thu Sep 26 05:22:32 UTC 2013


This is an automated email from the git hooks/post-receive script.

thomas_moulard-guest pushed a commit to branch master
in repository choreonoid.

commit 13881c0969bf1ce9c807a21aa2fdb97af157f241
Author: Thomas Moulard <thomas.moulard at gmail.com>
Date:   Wed Sep 25 14:51:59 2013 +0900

    Fix patch
    
    Git-Dch: ignore
---
 ...008-Fix-OpenSceneGraph-compilation-issues.patch |  301 ++++++++++++++++++--
 1 file changed, 277 insertions(+), 24 deletions(-)

diff --git a/debian/patches/0008-Fix-OpenSceneGraph-compilation-issues.patch b/debian/patches/0008-Fix-OpenSceneGraph-compilation-issues.patch
index f7fb955..88657ff 100644
--- a/debian/patches/0008-Fix-OpenSceneGraph-compilation-issues.patch
+++ b/debian/patches/0008-Fix-OpenSceneGraph-compilation-issues.patch
@@ -7,34 +7,135 @@ Fix OpenSceneGraph compilation issues
 Forwarded: yes
 Author: Thomas Moulard <thomas.moulard at gmail.com>
 ---
- src/Base/OsgNormalVisualizer.cpp | 18 +++++++++---------
- src/Base/VrmlToOsgConverter.cpp  | 12 ++++++------
- 2 files changed, 15 insertions(+), 15 deletions(-)
+ src/Base/OsgNormalVisualizer.cpp | 60 +++++++++++++++++++++-------------------
+ src/Base/ScenePieces.cpp         |  6 ++--
+ src/Base/ScenePieces.h           |  2 +-
+ src/Base/SceneView.cpp           |  8 +++---
+ src/Base/VrmlToOsgConverter.cpp  | 38 ++++++++++++-------------
+ 5 files changed, 58 insertions(+), 56 deletions(-)
 
 diff --git a/src/Base/OsgNormalVisualizer.cpp b/src/Base/OsgNormalVisualizer.cpp
-index 2d84167..4d4fe3e 100644
+index 2d84167..dd42e7a 100644
 --- a/src/Base/OsgNormalVisualizer.cpp
 +++ b/src/Base/OsgNormalVisualizer.cpp
-@@ -104,12 +104,12 @@ void NormalExtractor::apply(osg::Geode& geode)
+@@ -7,16 +7,16 @@
+ using namespace cnoid;
+ 
+ namespace {
+-    
++
+     class NormalExtractor : public osg::NodeVisitor
+     {
+     public:
+         NormalExtractor(float normalScale = 1.0, NormalVisualizer::Mode mode = NormalVisualizer::SURFACE);
+-        
++
+         void apply(osg::Geode& geode);
+-        
++
+         osg::Vec3Array* getNormalLines() { return normalLines.get(); }
+-        
++
+     private:
+         NormalVisualizer::Mode mode;
+         float scale;
+@@ -29,14 +29,14 @@ namespace {
+         osg::Vec3Array* normals;
+         osg::Vec3Array::iterator normalIter;
+         osg::UIntArray::iterator normalIndexIter;
+-        
++
+         void extractOverallNormal();
+         void extractPrimitiveSetNormal(const osg::PrimitiveSet* primitiveSet);
+         void extractPrimitiveNormals(
+-            const osg::PrimitiveSet* primitiveSet, osg::Geometry::AttributeBinding binding, int numVertices);
++            const osg::PrimitiveSet* primitiveSet, deprecated_osg::Geometry::AttributeBinding binding, int numVertices);
+         void extractPolygonNormals(const osg::PrimitiveSet* primitiveSet);
+     };
+-}    
++}
+ 
+ 
+ NormalVisualizer::NormalVisualizer(Node *node, float scale, Mode mode)
+@@ -44,7 +44,7 @@ NormalVisualizer::NormalVisualizer(Node *node, float scale, Mode mode)
+     NormalExtractor extractor(scale, mode);
+     node->accept(extractor);
+ 
+-    osg::ref_ptr<osg::Geometry> geom = new osg::Geometry;
++    osg::ref_ptr<deprecated_osg::Geometry> geom = new deprecated_osg::Geometry;
+ 
+     osg::ref_ptr<osg::Vec3Array> lines = extractor.getNormalLines();
+     geom->setVertexArray(lines.get());
+@@ -52,7 +52,7 @@ NormalVisualizer::NormalVisualizer(Node *node, float scale, Mode mode)
+ 
+     osg::ref_ptr<osg::Vec4Array> colors = new osg::Vec4Array;
+     geom->setColorArray(colors.get());
+-    geom->setColorBinding(osg::Geometry::BIND_OVERALL);
++    geom->setColorBinding(deprecated_osg::Geometry::BIND_OVERALL);
+     if(mode == SURFACE){
+         colors->push_back(osg::Vec4(1.0, 0.0, 0.0, 1.0));
+     } else if(mode == VERTEX) {
+@@ -78,38 +78,40 @@ NormalExtractor::NormalExtractor(float normalScale, NormalVisualizer::Mode mode)
+ void NormalExtractor::apply(osg::Geode& geode)
+ {
+     for(size_t i = 0; i < geode.getNumDrawables(); i++ ){
+-        osg::Geometry* geom = dynamic_cast<osg::Geometry*>(geode.getDrawable(i));
++        deprecated_osg::Geometry* geom = dynamic_cast<deprecated_osg::Geometry*>(geode.getDrawable(i));
+         if(geom){
+             vertices = dynamic_cast<osg::Vec3Array*>(geom->getVertexArray());
+             if(!vertices) continue;
+             normals  = dynamic_cast<osg::Vec3Array*>(geom->getNormalArray());
+             if(!normals) continue;
+-            osg::Geometry::AttributeBinding binding = geom->getNormalBinding();
+-            if(binding == osg::Geometry::BIND_OFF) continue;
++            deprecated_osg::Geometry::AttributeBinding binding = geom->getNormalBinding();
++            if(binding == deprecated_osg::Geometry::BIND_OFF) continue;
+ 
+-            if(binding == osg::Geometry::BIND_OVERALL){
++            if(binding == deprecated_osg::Geometry::BIND_OVERALL){
+                 extractOverallNormal();
+ 
+             } else {
+-                osg::Geometry::PrimitiveSetList& primitiveSets = geom->getPrimitiveSetList();
+-                
++                deprecated_osg::Geometry::PrimitiveSetList& primitiveSets = geom->getPrimitiveSetList();
++
+                 vertexIter = vertices->begin();
+                 normalIter = normals->begin();
+ 
+-                osg::IntArray* vertexIndices = dynamic_cast<osg::IntArray*>(geom->getVertexIndices());
++                osg::IntArray* vertexIndices = const_cast<osg::IntArray*>
++		  (dynamic_cast<const osg::IntArray*>(geom->getVertexIndices()));
+                 if(vertexIndices){
+                     vertexIndexIter = vertexIndices->begin();
+                 }
+-                osg::UIntArray* normalIndices = dynamic_cast<osg::UIntArray*>(geom->getNormalIndices());
++                osg::UIntArray* normalIndices = const_cast<osg::UIntArray*>
++		  (dynamic_cast<const osg::UIntArray*>(geom->getNormalIndices()));
                  if(normalIndices){
                      normalIndexIter = normalIndices->begin();
                  }
--
+-                
+-                osg::Geometry::PrimitiveSetList::iterator it;
 +
-                 osg::Geometry::PrimitiveSetList::iterator it;
++                deprecated_osg::Geometry::PrimitiveSetList::iterator it;
                  for(it = primitiveSets.begin(); it != primitiveSets.end(); ++it){
                      osg::PrimitiveSet* primitiveSet = it->get();
-
+ 
 -                    if(binding == osg::Geometry::BIND_PER_PRIMITIVE_SET){
 +                    if(binding == deprecated_osg::Geometry::BIND_PER_PRIMITIVE_SET){
                          extractPrimitiveSetNormal(primitiveSet);
                      } else {
                          switch(primitiveSet->getMode()){
-@@ -168,27 +168,27 @@ void NormalExtractor::extractPrimitiveNormals
- (const osg::PrimitiveSet* primitiveSet, osg::Geometry::AttributeBinding binding, int numVertices)
+@@ -165,30 +167,30 @@ void NormalExtractor::extractPrimitiveSetNormal(const osg::PrimitiveSet* primiti
+ 
+ 
+ void NormalExtractor::extractPrimitiveNormals
+-(const osg::PrimitiveSet* primitiveSet, osg::Geometry::AttributeBinding binding, int numVertices)
++(const osg::PrimitiveSet* primitiveSet, deprecated_osg::Geometry::AttributeBinding binding, int numVertices)
  {
      for(size_t i=0; i < primitiveSet->getNumPrimitives(); ++i){
--
+-        
 -        if(mode == NormalVisualizer::SURFACE || binding == osg::Geometry::BIND_PER_PRIMITIVE){
 +
 +        if(mode == NormalVisualizer::SURFACE || binding == deprecated_osg::Geometry::BIND_PER_PRIMITIVE){
@@ -42,66 +143,218 @@ index 2d84167..4d4fe3e 100644
 -            if(binding == osg::Geometry::BIND_PER_PRIMITIVE){
 +            if(binding == deprecated_osg::Geometry::BIND_PER_PRIMITIVE){
                  n = *(normalIter++);
-             } else if(binding == osg::Geometry::BIND_PER_VERTEX){
+-            } else if(binding == osg::Geometry::BIND_PER_VERTEX){
++            } else if(binding == deprecated_osg::Geometry::BIND_PER_VERTEX){
                  for(int j = 0; j < numVertices; ++j){
                      n += *(normalIter++);
                  }
--                n /= numVertices;
+-                n /= numVertices; 
 +                n /= numVertices;
              }
--
+-            
 +
              osg::Vec3 v(0.0, 0.0, 0.0);
              for(int j = 0; j < numVertices; ++j){
                  v += *(vertexIter++);
              }
              v /= numVertices;
--
+-            
 +
              normalLines->push_back(v);
              normalLines->push_back(v + n * scale);
--
+-            
 +
          } else if(mode == NormalVisualizer::VERTEX){
              for(int j = 0; j < numVertices; ++j){
                  osg::Vec3& v = *(vertexIter++);
+diff --git a/src/Base/ScenePieces.cpp b/src/Base/ScenePieces.cpp
+index 85e44d1..72fc803 100644
+--- a/src/Base/ScenePieces.cpp
++++ b/src/Base/ScenePieces.cpp
+@@ -15,9 +15,9 @@ using namespace cnoid;
+ 
+ namespace {
+ 
+-    osg::Geometry* createCrossGeometry(const osg::Vec4& color, float size, float lineWidth)
++    deprecated_osg::Geometry* createCrossGeometry(const osg::Vec4& color, float size, float lineWidth)
+     {
+-        osg::Geometry* geom = new osg::Geometry;
++        deprecated_osg::Geometry* geom = new deprecated_osg::Geometry;
+         osg::StateSet* state = geom->getOrCreateStateSet();
+ 
+         state->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
+@@ -204,7 +204,7 @@ AttitudeDragger::AttitudeDragger()
+         const int y = axes[i][1];
+         const int z = axes[i][2];
+ 
+-        osg::Geometry* geometry = new osg::Geometry();
++        deprecated_osg::Geometry* geometry = new deprecated_osg::Geometry();
+         osg::Vec3Array* vertices = new osg::Vec3Array();
+         osg::DrawElementsUShort* face = new osg::DrawElementsUShort(osg::PrimitiveSet::QUADS, 0);
+ 
+diff --git a/src/Base/ScenePieces.h b/src/Base/ScenePieces.h
+index 4a7c38c..bfc4c07 100644
+--- a/src/Base/ScenePieces.h
++++ b/src/Base/ScenePieces.h
+@@ -39,7 +39,7 @@ namespace cnoid {
+         void setCross(const osg::Vec4& color, float size, float lineWidth = 1.0f);
+       private:
+         osg::ref_ptr<osg::Sphere> sphere;
+-        osg::ref_ptr<osg::Geometry> cross;
++        osg::ref_ptr<deprecated_osg::Geometry> cross;
+     };
+ 
+     class CNOID_EXPORT BBMarker : public osg::Geode
+diff --git a/src/Base/SceneView.cpp b/src/Base/SceneView.cpp
+index 07befae..0a44154 100644
+--- a/src/Base/SceneView.cpp
++++ b/src/Base/SceneView.cpp
+@@ -664,7 +664,7 @@ void SceneViewImpl::setupHUD()
+                 bb.expandBy(geode->getDrawable(i)->getBound());
+             }
+             
+-            osg::Geometry* geom = new osg::Geometry;
++            deprecated_osg::Geometry* geom = new deprecated_osg::Geometry;
+             
+             osg::Vec3Array* vertices = new osg::Vec3Array;
+             float depth = bb.zMin()-0.1;
+@@ -677,12 +677,12 @@ void SceneViewImpl::setupHUD()
+             osg::Vec3Array* normals = new osg::Vec3Array;
+             normals->push_back(osg::Vec3(0.0f,0.0f,1.0f));
+             geom->setNormalArray(normals);
+-            geom->setNormalBinding(osg::Geometry::BIND_OVERALL);
++            geom->setNormalBinding(deprecated_osg::Geometry::BIND_OVERALL);
+             
+             osg::Vec4Array* colors = new osg::Vec4Array;
+             colors->push_back(osg::Vec4(1.0f,1.0,0.8f,0.2f));
+             geom->setColorArray(colors);
+-            geom->setColorBinding(osg::Geometry::BIND_OVERALL);
++            geom->setColorBinding(deprecated_osg::Geometry::BIND_OVERALL);
+             
+             geom->addPrimitiveSet(new osg::DrawArrays(GL_QUADS,0,4));
+             
+@@ -892,7 +892,7 @@ void SceneViewImpl::updateFloorGridLines()
+         floorGridNode->removeDrawables(0, prevNumDrawables);
+     }
+ 
+-    osg::Geometry* geom = new osg::Geometry;
++    deprecated_osg::Geometry* geom = new deprecated_osg::Geometry;
+     osg::Vec3Array* v = new osg::Vec3Array;
+     geom->setVertexArray(v);
+ 
 diff --git a/src/Base/VrmlToOsgConverter.cpp b/src/Base/VrmlToOsgConverter.cpp
-index 8093c1f..bceb26a 100644
+index 8093c1f..461f4be 100644
 --- a/src/Base/VrmlToOsgConverter.cpp
 +++ b/src/Base/VrmlToOsgConverter.cpp
-@@ -399,10 +399,10 @@ osg::Geometry* VrmlToOsgConverterImpl::createGeometryFromIndexedFaceSet(VrmlInde
+@@ -42,7 +42,7 @@ namespace cnoid {
+         osg::Group* createTransformNode(VrmlTransform* vt);
+         osg::Node* convertShapeNode(VrmlNode* vnode);
+         osg::Material* createMaterial(VrmlMaterial* vm);
+-        osg::Geometry* createGeometryFromIndexedFaceSet(VrmlIndexedFaceSet* vface, float alpha);
++        deprecated_osg::Geometry* createGeometryFromIndexedFaceSet(VrmlIndexedFaceSet* vface, float alpha);
+         
+         VrmlMaterialPtr defaultMaterial;
+         osg::ref_ptr<osg::StateSet> stateSetForTransformWithScaling;
+@@ -54,7 +54,7 @@ namespace cnoid {
+         typedef map<VrmlNode*, osg::Node*> VrmlNodeToOsgNodeMap;
+         VrmlNodeToOsgNodeMap vrmlNodeToOsgNodeMap;
+ 
+-        typedef map<VrmlGeometry*, osg::Geometry*> VrmlGeometryToOsgGeometryMap;
++        typedef map<VrmlGeometry*, deprecated_osg::Geometry*> VrmlGeometryToOsgGeometryMap;
+         VrmlGeometryToOsgGeometryMap vrmlGeometryToOsgGeometryMap;
+ 
+         osgUtil::Optimizer optimizer;
+@@ -223,7 +223,7 @@ osg::Node* VrmlToOsgConverterImpl::convertShapeNode(VrmlNode* vnode)
+     float alpha = 1.0 - vm->transparency;
+ 
+     osg::Geode* geode = 0;
+-    osg::Geometry* geometry = 0;
++    deprecated_osg::Geometry* geometry = 0;
+     VrmlGeometry* vrmlGeometry = dynamic_node_cast<VrmlGeometry>(vrmlShape->geometry).get();
+     
+     if(vrmlGeometry){
+@@ -307,9 +307,9 @@ osg::Material* VrmlToOsgConverterImpl::createMaterial(VrmlMaterial* vm)
+ }
+ 
+ 
+-osg::Geometry* VrmlToOsgConverterImpl::createGeometryFromIndexedFaceSet(VrmlIndexedFaceSet* vface, float alpha)
++deprecated_osg::Geometry* VrmlToOsgConverterImpl::createGeometryFromIndexedFaceSet(VrmlIndexedFaceSet* vface, float alpha)
+ {
+-    osg::Geometry* geometry = new osg::Geometry;
++    deprecated_osg::Geometry* geometry = new deprecated_osg::Geometry;
+     
+     if(!vface->ccw){
+         osg::StateSet* stateSet = geometry->getOrCreateStateSet();
+@@ -382,9 +382,9 @@ osg::Geometry* VrmlToOsgConverterImpl::createGeometryFromIndexedFaceSet(VrmlInde
+             normals->push_back(osg::Vec3(vec[i][0], vec[i][1], vec[i][2]));
+         }
+         geometry->setNormalArray(normals);
+-        
++
+         if(vface->normalIndex.empty()){
+-            geometry->setNormalIndices(geometry->getVertexIndices());
++	  geometry->setNormalIndices((osg::IndexArray*)geometry->getVertexIndices());
+         } else {
+             int size = vface->normalIndex.size();
+             osg::UIntArray* indices = new osg::UIntArray;
+@@ -397,12 +397,12 @@ osg::Geometry* VrmlToOsgConverterImpl::createGeometryFromIndexedFaceSet(VrmlInde
+             geometry->setNormalIndices(indices);
+         }
          if(vface->normalPerVertex == true){
-             geometry->setNormalBinding(osg::Geometry::BIND_PER_VERTEX);
+-            geometry->setNormalBinding(osg::Geometry::BIND_PER_VERTEX);
++            geometry->setNormalBinding(deprecated_osg::Geometry::BIND_PER_VERTEX);
          } else {
 -            geometry->setNormalBinding(osg::Geometry::BIND_PER_PRIMITIVE);
 +            geometry->setNormalBinding(deprecated_osg::Geometry::BIND_PER_PRIMITIVE);
          }
      }
--
+-    
 +
      if(vface->color){
          MFColor& c = vface->color->color;
          if(!c.empty()){
+@@ -412,16 +412,16 @@ osg::Geometry* VrmlToOsgConverterImpl::createGeometryFromIndexedFaceSet(VrmlInde
+                 colors->push_back(osg::Vec4(c[i][0], c[i][1], c[i][2], alpha));
+             }
+             geometry->setColorArray(colors);
+-            
++
+             if(vface->colorIndex.empty()){
+-                geometry->setColorIndices(geometry->getVertexIndices());
++	      geometry->setColorIndices((osg::IndexArray*)geometry->getVertexIndices());
+             } else {
+                 int size = vface->colorIndex.size();
+                 osg::UIntArray* indices = new osg::UIntArray;
+-                
++
+                 // osg::TemplateIndexArray <unsigned int, osg::Array::UIntArrayType,4,4> *indices;
+                 // indices = new osg::TemplateIndexArray<unsigned int, osg::Array::UIntArrayType,4,4>;
+-                
++
+                 for(int i=0; i < size; i++){
+                     int index = vface->colorIndex[i];
+                     if(index >= 0){
 @@ -430,18 +430,18 @@ osg::Geometry* VrmlToOsgConverterImpl::createGeometryFromIndexedFaceSet(VrmlInde
                  }
                  geometry->setColorIndices(indices);
              }
--
+-            
 +
              if(vface->colorPerVertex == true){
-                 geometry->setColorBinding(osg::Geometry::BIND_PER_VERTEX);
+-                geometry->setColorBinding(osg::Geometry::BIND_PER_VERTEX);
++                geometry->setColorBinding(deprecated_osg::Geometry::BIND_PER_VERTEX);
              } else {
 -                geometry->setColorBinding(osg::Geometry::BIND_PER_PRIMITIVE);
 +                geometry->setColorBinding(deprecated_osg::Geometry::BIND_PER_PRIMITIVE);
              }
          }
      }
--
+-    
 +
      if(!vface->normal){
          osgUtil::SmoothingVisitor::smooth(*geometry);
      }
--
+-    
 +
      return geometry;
  }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/choreonoid.git



More information about the debian-science-commits mailing list