Back to index

salome-geom  6.5.0
Functions
GEOM_AISShape.cxx File Reference
#include "GEOM_AISShape.ixx"
#include "SALOME_InteractiveObject.hxx"
#include "GEOM_AISVector.hxx"
#include <AIS_Drawer.hxx>
#include <AIS_InteractiveContext.hxx>
#include <BRep_Tool.hxx>
#include <GCPnts_AbscissaPoint.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <gp_Pnt.hxx>
#include <gp_Dir.hxx>
#include <gp_Vec.hxx>
#include <Graphic3d_AspectFillArea3d.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <Prs3d_Arrow.hxx>
#include <Prs3d_IsoAspect.hxx>
#include <SelectBasics_SensitiveEntity.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <StdSelect_BRepOwner.hxx>
#include <SelectMgr_IndexedMapOfOwner.hxx>
#include <SelectMgr_Selection.hxx>
#include <StdSelect_DisplayMode.hxx>
#include <StdPrs_WFDeflectionShape.hxx>
#include <TColStd_IndexedMapOfInteger.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <TopExp.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Vertex.hxx>
#include <SalomeApp_Tools.h>
#include <SUIT_Session.h>
#include <SUIT_ResourceMgr.h>

Go to the source code of this file.

Functions

static void getEntityOwners (const Handle(AIS_InteractiveObject)&theObj, const Handle(AIS_InteractiveContext)&theIC, SelectMgr_IndexedMapOfOwner &theMap)
static void indicesToOwners (const TColStd_IndexedMapOfInteger &aIndexMap, const TopoDS_Shape &aMainShape, const SelectMgr_IndexedMapOfOwner &anAllMap, SelectMgr_IndexedMapOfOwner &aToHiliteMap)
 Handle (SALOME_InteractiveObject) GEOM_AISShape

Function Documentation

static void getEntityOwners ( const Handle(AIS_InteractiveObject)&  theObj,
const Handle(AIS_InteractiveContext)&  theIC,
SelectMgr_IndexedMapOfOwner &  theMap 
) [static]

Definition at line 82 of file GEOM_AISShape.cxx.

{
  if ( theObj.IsNull() || theIC.IsNull() )
    return;

  TColStd_ListOfInteger modes;
  theIC->ActivatedModes( theObj, modes );

  TColStd_ListIteratorOfListOfInteger itr( modes );
  for (; itr.More(); itr.Next() ) {
    int m = itr.Value();
    if ( !theObj->HasSelection( m ) )
      continue;

    Handle(SelectMgr_Selection) sel = theObj->Selection( m );

    for ( sel->Init(); sel->More(); sel->Next() ) {
      Handle(SelectBasics_SensitiveEntity) entity = sel->Sensitive();
      if ( entity.IsNull() )
        continue;

      Handle(SelectMgr_EntityOwner) owner =
        Handle(SelectMgr_EntityOwner)::DownCast(entity->OwnerId());
      if ( !owner.IsNull() )
        theMap.Add( owner );
    }
  }
}

Here is the call graph for this function:

Handle ( SALOME_InteractiveObject  )

Definition at line 168 of file GEOM_AISShape.cxx.

                                                     {
  Handle(SALOME_InteractiveObject) IO;
  if ( !GetOwner().IsNull() )
    IO = Handle(SALOME_InteractiveObject)::DownCast( GetOwner() );
  return IO;
}
static void indicesToOwners ( const TColStd_IndexedMapOfInteger &  aIndexMap,
const TopoDS_Shape &  aMainShape,
const SelectMgr_IndexedMapOfOwner &  anAllMap,
SelectMgr_IndexedMapOfOwner &  aToHiliteMap 
) [static]

Definition at line 113 of file GEOM_AISShape.cxx.

{
  TopTools_IndexedMapOfShape aMapOfShapes;
  TopExp::MapShapes(aMainShape, aMapOfShapes);

  for  ( Standard_Integer i = 1, n = anAllMap.Extent(); i <= n; i++ ) {
    Handle(StdSelect_BRepOwner) anOwner = Handle(StdSelect_BRepOwner)::DownCast(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 );
  }
}

Here is the call graph for this function: