Personal tools
You are here: Home Forum Install & build Successfully built Salome with OpenCascade6.2

Successfully built Salome with OpenCascade6.2

Up to Install & build
  • Successfully built Salome with OpenCascade6.2

    Posted by Todd Martin at May 04. 2007
    Hi

    In case anyone is interested. I got Salome to build against OpenCascade 6.2 with some minor changes to the following files in the GEOM module
    GEOM_AISShape.cxx
    GEOMGUI_OCCSelector.cxx

    I have attached diff files for anyone who might want to use them.

    I'm looking forward to playing with this software in conjunction with Code Aster.

    Cheers,
    Todd.
    • Re: Successfully built Salome with OpenCascade6.2

      Posted by Todd Martin at May 04. 2007
      Hmmm. I couldn't find and option to attach files to a post. So here they are in plain text.

      --- salome3.2.2_SRC/GEOM_SRC_3.2.2/src/OBJECT/GEOM_AISShape.cxx    2006-09-22 17:08:38.000000000 +1200
      +++ GEOM_AISShape.cxx    2007-05-03 12:19:18.000000000 +1200
      @@ -46,6 +46,7 @@
       #include
       #include
       #include
      +#include
       #include
       #include
       #include
      @@ -99,18 +100,23 @@
         TopTools_IndexedMapOfShape aMapOfShapes;
         TopExp::MapShapes(aMainShape, aMapOfShapes);
       
      -  for  ( Standard_Integer i = 1, n = anAllMap.Extent(); i <= n; i++ ) {
      -    Handle(SelectMgr_EntityOwner) anOwner = anAllMap( i );
      -    if ( anOwner.IsNull() || !anOwner->HasShape() )
      -      continue;
      -
      -    const TopoDS_Shape& aSubShape = anOwner->Shape();
      -    Standard_Integer aSubShapeId = aMapOfShapes.FindIndex( aSubShape );
      -    if ( !aSubShapeId || !aIndexMap.Contains( aSubShapeId ) )
      -      continue;
      -   
      -    if ( !aToHiliteMap.Contains( anOwner ) )
      -      aToHiliteMap.Add( anOwner );
      +  for  ( Standard_Integer i = 1, n = anAllMap.Extent(); i <= n; i++ )
      +  {
      +    Handle(SelectMgr_EntityOwner) anOwner = anAllMap( i );    
      +    if (!anOwner.IsNull() && anOwner->IsKind(STANDARD_TYPE(StdSelect_BRepOwner)))
      +    {
      +      Handle(StdSelect_BRepOwner) aBRepOwner = Handle(StdSelect_BRepOwner)::DownCast(anOwner);
      +      if ( aBRepOwner->HasShape() )
      +      {
      +        const TopoDS_Shape& aSubShape = aBRepOwner->Shape();   
      +        Standard_Integer aSubShapeId = aMapOfShapes.FindIndex( aSubShape );
      +        if ( aSubShapeId && aIndexMap.Contains( aSubShapeId ) )
      +        {
      +          if ( !aToHiliteMap.Contains( anOwner ) )
      +          aToHiliteMap.Add( anOwner );
      +        }
      +      }
      +    }
         }
       }

      --- salome3.2.2_SRC/GEOM_SRC_3.2.2/src/GEOMGUI/GEOMGUI_OCCSelector.cxx    2006-09-22 17:08:39.000000000 +1200
      +++ GEOMGUI_OCCSelector.cxx    2007-05-03 12:24:03.000000000 +1200
      @@ -28,6 +28,7 @@
       #include
       #include
       #include
      +#include
       #include
       #include
       #include
      @@ -73,59 +74,61 @@
         Handle(AIS_InteractiveContext) ic = vw->getAISContext();
        
         if ( ic->HasOpenedContext() )
      +  {
      +    for ( ic->InitSelected(); ic->MoreSelected(); ic->NextSelected() )
           {
      -      for ( ic->InitSelected(); ic->MoreSelected(); ic->NextSelected() )
      -    {
      -      Handle(SelectMgr_EntityOwner) anOwner = ic->SelectedOwner();
      -      if ( anOwner.IsNull() )
      -        continue;
      -     
      -      Handle(AIS_InteractiveObject) io = Handle(AIS_InteractiveObject)::DownCast( anOwner->Selectable() );
      -     
      -      QString entryStr = entry( io );
      -      int index = -1;
      -     
      -      if ( anOwner->ComesFromDecomposition() ) // == Local Selection
      -        {
      -          TopoDS_Shape subShape = anOwner->Shape();
      -          Handle(AIS_Shape) aisShape = Handle(AIS_Shape)::DownCast( io );
      -          if ( !aisShape.IsNull() )
      -        {
      -          TopoDS_Shape bigShape = aisShape->Shape();
      -         
      -          TopTools_IndexedMapOfShape subShapes;
      -          TopExp::MapShapes( bigShape, subShapes );
      -          index = subShapes.FindIndex( subShape );
      -        }
      -        }
      -     
      -      if ( !entryStr.isEmpty() )
      -        {
      -          LightApp_DataOwner* owner;
      -          if ( index > -1 ) // Local Selection
      -        owner = new LightApp_DataSubOwner( entryStr, index );
      -          else // Global Selection
      -        owner = new LightApp_DataOwner( entryStr );
      -
      -          aList.append( SUIT_DataOwnerPtr( owner ) );
      -        }
      -    }
      +      Handle(SelectMgr_EntityOwner) anOwner = ic->SelectedOwner();
      +      if (!anOwner.IsNull() && anOwner->IsKind(STANDARD_TYPE(StdSelect_BRepOwner)))
      +      {
      +        Handle(StdSelect_BRepOwner) aBRepOwner = Handle(StdSelect_BRepOwner)::DownCast(anOwner);

      +        Handle(AIS_InteractiveObject) io = Handle(AIS_InteractiveObject)::DownCast( anOwner->Selectable() );
      +       
      +        QString entryStr = entry( io );
      +        int index = -1;

      +        if ( aBRepOwner->ComesFromDecomposition() ) // == Local Selection
      +        {
      +          TopoDS_Shape subShape = aBRepOwner->Shape();
      +          Handle(AIS_Shape) aisShape = Handle(AIS_Shape)::DownCast( io );
      +          if ( !aisShape.IsNull() )
      +          {
      +            TopoDS_Shape bigShape = aisShape->Shape();
      +           
      +            TopTools_IndexedMapOfShape subShapes;
      +            TopExp::MapShapes( bigShape, subShapes );
      +            index = subShapes.FindIndex( subShape );
      +          }
      +        }
      +       
      +        if ( !entryStr.isEmpty() )
      +        {
      +          LightApp_DataOwner* owner;
      +          if ( index > -1 ) // Local Selection
      +                  owner = new LightApp_DataSubOwner( entryStr, index );
      +          else // Global Selection
      +                  owner = new LightApp_DataOwner( entryStr );
      +   
      +          aList.append( SUIT_DataOwnerPtr( owner ) );
      +        }
      +      }
           }
      +  }
         else
      +  {
      +    for ( ic->InitCurrent(); ic->MoreCurrent(); ic->NextCurrent() )
           {
      -      for ( ic->InitCurrent(); ic->MoreCurrent(); ic->NextCurrent() )
      -    {
      -      Handle(AIS_InteractiveObject) io = ic->Current();
      -     
      -      QString entryStr = entry( io );
      -     
      -      if ( !entryStr.isEmpty() )
      -        {
      -          LightApp_DataOwner* owner = new LightApp_DataOwner( entryStr );
      -          aList.append( SUIT_DataOwnerPtr( owner ) );
      -        }
      -    }
      +      Handle(AIS_InteractiveObject) io = ic->Current();
      +     
      +      QString entryStr = entry( io );
      +     
      +      if ( !entryStr.isEmpty() )
      +      {
      +        LightApp_DataOwner* owner = new LightApp_DataOwner( entryStr );
      +        aList.append( SUIT_DataOwnerPtr( owner ) );
      +      }
           }
      +  }
       }
       
       //================================================================
      @@ -237,38 +240,43 @@
       
             for  ( int i = 1, n = owners.Extent(); i <= n; i++ )
             {
      -    Handle(SelectMgr_EntityOwner) anOwner = owners( i );
      -    if ( anOwner.IsNull() || !anOwner->HasShape() )
      -      continue;
      -
      -    // GLOBAL selection
      -    if ( !anOwner->ComesFromDecomposition() && globalSelMap.contains( entryStr ) )
      -    {
      -      ownersmap.Add( anOwner );
      -    }
      -    // LOCAL selection
      -    else
      -    {
      -      Handle(AIS_Shape) aisShape = Handle(AIS_Shape)::DownCast( io );
      -
      -      if ( !aisShape.IsNull() && indexesMap.IsBound( (char*)entryStr.latin1() ) )
      -      {
      -        TopoDS_Shape shape = aisShape->Shape();
      -        TopTools_IndexedMapOfShape aMapOfShapes;
      -        TopExp::MapShapes( shape, aMapOfShapes );
      -        const TColStd_IndexedMapOfInteger& subIndexes = indexesMap.ChangeFind((char*)entryStr.latin1());
      -
      -        const TopoDS_Shape& aSubShape = anOwner->Shape();
      -        int  aSubShapeId = aMapOfShapes.FindIndex( aSubShape );
      -
      -        // check if the "sub_shape_index" is found in the "map of indexes for this entry",
      -        // which was passes in the parameter
      -        if ( subIndexes.Contains( aSubShapeId ) )
      -        {
      -          ownersmap.Add( anOwner );
      -        }
      -      }
      -        } // end of local selection
      +        Handle(SelectMgr_EntityOwner) anOwner = owners( i );
      +        if (!anOwner.IsNull() && anOwner->IsKind(STANDARD_TYPE(StdSelect_BRepOwner)))
      +        {
      +          Handle(StdSelect_BRepOwner) aBRepOwner = Handle(StdSelect_BRepOwner)::DownCast(anOwner);

      +          if ( aBRepOwner->HasShape() )
      +          {
      +            // GLOBAL selection
      +            if ( !aBRepOwner->ComesFromDecomposition() && globalSelMap.contains( entryStr ) )
      +            {
      +              ownersmap.Add( anOwner );
      +            }
      +            // LOCAL selection
      +            else
      +            {
      +              Handle(AIS_Shape) aisShape = Handle(AIS_Shape)::DownCast( io );
      +     
      +              if ( !aisShape.IsNull() && indexesMap.IsBound( (char*)entryStr.latin1() ) )
      +              {
      +                TopoDS_Shape shape = aisShape->Shape();
      +                TopTools_IndexedMapOfShape aMapOfShapes;
      +                TopExp::MapShapes( shape, aMapOfShapes );
      +                const TColStd_IndexedMapOfInteger& subIndexes = indexesMap.ChangeFind((char*)entryStr.latin1());
      +       
      +                const TopoDS_Shape& aSubShape = aBRepOwner->Shape();
      +                int  aSubShapeId = aMapOfShapes.FindIndex( aSubShape );
      +       
      +                // check if the "sub_shape_index" is found in the "map of indexes for this entry",
      +                // which was passes in the parameter
      +                if ( subIndexes.Contains( aSubShapeId ) )
      +                {
      +                  ownersmap.Add( anOwner );
      +                }
      +              }
      +            } // end of local selection
      +          }
      +        }
             } // end of for(owners)
           }// end of if(entry)
         }// end of for(AIS_all_ios)

    • Re: Successfully built Salome with OpenCascade6.2

      Posted by Daniel Tourde - Caelae.se at May 08. 2007
      Todd Martin wrote:
      Hi

      In case anyone is interested. I got Salome to build against OpenCascade 6.2 with some minor changes to the following files in the GEOM module
      GEOM_AISShape.cxx
      GEOMGUI_OCCSelector.cxx

      I have attached diff files for anyone who might want to use them.

      I'm looking forward to playing with this software in conjunction with Code Aster.

      Cheers,
      Todd.

      Could you please give some more information: - Linux distribution? - Gcc version? I am trying to do the same on a Gentoo box with Gcc 4.1.1 and I have some issues... :(
      • Re: Successfully built Salome with OpenCascade6.2

        Posted by Todd Martin at May 08. 2007
        Daniel Tourde - Caelae.se wrote:
        Todd Martin wrote:
        Hi

        In case anyone is interested. I got Salome to build against OpenCascade 6.2 with some minor changes to the following files in the GEOM module
        GEOM_AISShape.cxx
        GEOMGUI_OCCSelector.cxx

        I have attached diff files for anyone who might want to use them.

        I'm looking forward to playing with this software in conjunction with Code Aster.

        Cheers,
        Todd.


        Could you please give some more information: - Linux distribution? - Gcc version? I am trying to do the same on a Gentoo box with Gcc 4.1.1 and I have some issues... :(


        Hi Daniel

        I was building on Mandrake 10.1 with gcc 3.4.1
        I used the Salome source tar download and installed all the prerequisite apps separately. See my previous posts on building the KERNEL and GUI modules. You might be experiencing some of the same problems I had.

        Todd.
    • Re: Successfully built Salome with OpenCascade6.2

      Posted by Sergey Mozokhin at May 08. 2007
      Todd Martin wrote:
      Hi

      In case anyone is interested. I got Salome to build against OpenCascade 6.2 with some minor changes to the following files in the GEOM module
      GEOM_AISShape.cxx
      GEOMGUI_OCCSelector.cxx

      I have attached diff files for anyone who might want to use them.

      I'm looking forward to playing with this software in conjunction with Code Aster.

      Cheers,
      Todd.

      Dear all,

      FYI:
      This week we are going to publish version 3.2.6. This version is based on OCCT6.2 and automatically contains this patch.

      Cheers,

      Sergey.

Powered by Ploneboard
Document Actions