// - use of optimisation in SelectMgr_ViewerSelector
// -> Best management in detected entities...
-#include <AIS_LocalContext.jxx>
-#include <StdSelect_BRepOwner.hxx>
-#include <TColStd_ListOfInteger.hxx>
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
-#include <TColStd_MapOfTransient.hxx>
-#include <TColStd_MapIteratorOfMapOfTransient.hxx>
-#include <Prs3d_Presentation.hxx>
-#include <Prs3d_Drawer.hxx>
-#include <Prs3d_ShadingAspect.hxx>
+#include <AIS_InteractiveContext.hxx>
+#include <AIS_InteractiveObject.hxx>
+#include <AIS_LocalContext.hxx>
#include <AIS_LocalStatus.hxx>
+#include <AIS_Selection.hxx>
+#include <AIS_Shape.hxx>
+#include <Aspect_Grid.hxx>
+#include <Geom_Transformation.hxx>
#include <Graphic3d_ArrayOfTriangles.hxx>
#include <Graphic3d_Group.hxx>
+#include <NCollection_Map.hxx>
+#include <OSD_Environment.hxx>
+#include <Prs3d_Drawer.hxx>
+#include <Prs3d_Presentation.hxx>
+#include <Prs3d_ShadingAspect.hxx>
#include <Select3D_SensitiveTriangulation.hxx>
-#include <StdSelect_ViewerSelector3d.hxx>
#include <SelectBasics_SensitiveEntity.hxx>
-#include <TCollection_AsciiString.hxx>
-#include <NCollection_Map.hxx>
-#include <Visual3d_View.hxx>
-
+#include <SelectMgr_EntityOwner.hxx>
+#include <SelectMgr_Filter.hxx>
+#include <SelectMgr_OrFilter.hxx>
+#include <SelectMgr_SelectableObject.hxx>
#include <SelectMgr_Selection.hxx>
+#include <SelectMgr_SelectionManager.hxx>
#include <SelectMgr_SequenceOfOwner.hxx>
-#include <OSD_Environment.hxx>
-
-#include <Geom_Transformation.hxx>
-#include <AIS_Selection.hxx>
-#include <Aspect_Grid.hxx>
-#include <AIS_Shape.hxx>
+#include <Standard_Transient.hxx>
+#include <StdSelect_BRepOwner.hxx>
+#include <StdSelect_ViewerSelector3d.hxx>
+#include <TCollection_AsciiString.hxx>
+#include <TColStd_ListIteratorOfListOfInteger.hxx>
+#include <TColStd_ListOfInteger.hxx>
+#include <TColStd_MapIteratorOfMapOfTransient.hxx>
+#include <TColStd_MapOfTransient.hxx>
+#include <TopoDS_Shape.hxx>
+#include <V3d_View.hxx>
+#include <Visual3d_View.hxx>
static Standard_Integer GetHiMod(const Handle(AIS_InteractiveObject)& IO)
{
Handle(StdSelect_BRepOwner) BROwnr = Handle(StdSelect_BRepOwner)::DownCast(Ownr);
if(BROwnr.IsNull() || !BROwnr->ComesFromDecomposition()){
Handle(SelectMgr_SelectableObject) SO = Ownr->Selectable();
- IO = *((Handle(AIS_InteractiveObject)*)&SO);
+ IO = Handle(AIS_InteractiveObject)::DownCast (SO);
}
}
Handle(SelectMgr_SelectableObject) SO = Ownr->Selectable();
- Standard_Integer HM = GetHiMod(*((Handle(AIS_InteractiveObject)*)&SO));
+ Standard_Integer HM = GetHiMod(Handle(AIS_InteractiveObject)::DownCast (SO));
if ( Ownr->IsAutoHilight() )
Ownr->HilightWithColor(PM,myCTX->SelectionColor(),HM);
else if ( aMap.IsBound (SO) )
Standard_Integer HM(0);
if(Ownr->HasSelectable()){
Handle(SelectMgr_SelectableObject) SO = Ownr->Selectable();
- Handle(AIS_InteractiveObject) IO = *((Handle(AIS_InteractiveObject)*)&SO);
+ Handle(AIS_InteractiveObject) IO = Handle(AIS_InteractiveObject)::DownCast (SO);
anObjMap.Add (IO);
HM = GetHiMod(IO);
{
Handle(Standard_Transient) Tr = AIS_Selection::CurrentSelection()->Value();
if( Tr.IsNull() ) return Standard_False;
- Handle(SelectMgr_EntityOwner) EO = *((Handle(SelectMgr_EntityOwner)*)&Tr);
+ Handle(SelectMgr_EntityOwner) EO = Handle(SelectMgr_EntityOwner)::DownCast (Tr);
Handle(StdSelect_BRepOwner) BRO = Handle(StdSelect_BRepOwner)::DownCast(EO);
if(BRO.IsNull()) return Standard_False;
Standard_Boolean hasshape = BRO->HasShape();
TopoDS_Shape AIS_LocalContext::SelectedShape() const
{
Handle(Standard_Transient) aTr = AIS_Selection::CurrentSelection()->Value();
- Handle(SelectMgr_EntityOwner) anEO = *((Handle(SelectMgr_EntityOwner)*)&aTr);
+ Handle(SelectMgr_EntityOwner) anEO = Handle(SelectMgr_EntityOwner)::DownCast (aTr);
Handle(StdSelect_BRepOwner) aBRO = Handle(StdSelect_BRepOwner)::DownCast(anEO);
if( aBRO.IsNull() )
{
Handle(AIS_InteractiveObject) IO;
Handle(Standard_Transient) Tr = AIS_Selection::CurrentSelection()->Value();
if( !Tr.IsNull() ) {
- Handle(SelectMgr_EntityOwner) EO = *((Handle(SelectMgr_EntityOwner)*)&Tr);
+ Handle(SelectMgr_EntityOwner) EO = Handle(SelectMgr_EntityOwner)::DownCast (Tr);
Handle(SelectMgr_SelectableObject) SO;
if(EO->HasSelectable()){
SO = EO->Selectable();
- IO = *((Handle(AIS_InteractiveObject)*)&SO);
+ IO = Handle(AIS_InteractiveObject)::DownCast (SO);
}
}
return IO;
Handle(SelectMgr_EntityOwner) EO;
Handle(Standard_Transient) Tr = AIS_Selection::CurrentSelection()->Value();
if( !Tr.IsNull() )
- EO = *((Handle(SelectMgr_EntityOwner)*)&Tr);
+ EO = Handle(SelectMgr_EntityOwner)::DownCast (Tr);
return EO;
}
SIOBJ->Init();
if(SIOBJ->More()){
Handle(SelectBasics_EntityOwner) BO = SIOBJ->Sensitive()->BaseSensitive()->OwnerId();
- EO = *((Handle(SelectMgr_EntityOwner)*)&BO);
+ EO = Handle(SelectMgr_EntityOwner)::DownCast (BO);
}
}
if(EO.IsNull())
- EO = new SelectMgr_EntityOwner(anIObj);
+ EO = new SelectMgr_EntityOwner((const Handle(SelectMgr_SelectableObject)&)anIObj);
}
ClearSelected(Standard_False);
SIOBJ->Init();
if(SIOBJ->More()){
Handle(SelectBasics_EntityOwner) BO = SIOBJ->Sensitive()->BaseSensitive()->OwnerId();
- EO = *((Handle(SelectMgr_EntityOwner)*)&BO);
+ EO = Handle(SelectMgr_EntityOwner)::DownCast (BO);
}
}
if(EO.IsNull())
{
- EO = new SelectMgr_EntityOwner(anIObj);
+ EO = new SelectMgr_EntityOwner((const Handle(SelectMgr_SelectableObject)&)anIObj);
}
}
Handle(AIS_InteractiveObject) Iobj;
if(IsValidIndex(mylastindex)){
Handle(SelectMgr_SelectableObject) SO = myMapOfOwner->FindKey(mylastindex)->Selectable();
- Iobj = *((Handle(AIS_InteractiveObject)*) &SO);
+ Iobj = Handle(AIS_InteractiveObject)::DownCast (SO);
}
return Iobj;
}
Handle(AIS_Shape) shape = Handle(AIS_Shape)::DownCast(anIObj);
if( !shape.IsNull() )
return myFilters->IsOk(new StdSelect_BRepOwner(shape->Shape(),shape));
- return myFilters->IsOk(new SelectMgr_EntityOwner(anIObj));
+ return myFilters->IsOk(new SelectMgr_EntityOwner((const Handle(SelectMgr_SelectableObject)&)anIObj));
}
for(; anIter.More(); anIter.Next()){
const Handle(Standard_Transient)& Tr = anIter.Value();
if(!Tr.IsNull()){
- EO = *((Handle(SelectMgr_EntityOwner)*)&Tr);
+ EO = Handle(SelectMgr_EntityOwner)::DownCast (Tr);
if(EO->HasSelectable()){
Handle(StdSelect_BRepOwner) BROwnr = Handle(StdSelect_BRepOwner)::DownCast(EO);
if(BROwnr.IsNull() || !BROwnr->ComesFromDecomposition()){