// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <Standard_NotImplemented.hxx>
-#include <AIS_ConnectedInteractive.ixx>
-#include <SelectMgr_EntityOwner.hxx>
-#include <Select3D_SensitiveEntity.hxx>
+#include <AIS_ConnectedInteractive.hxx>
+#include <AIS_InteractiveContext.hxx>
+#include <AIS_InteractiveObject.hxx>
+#include <AIS_Shape.hxx>
+#include <BRepTools.hxx>
#include <Geom_Transformation.hxx>
-
+#include <gp_Trsf.hxx>
+#include <NCollection_DataMap.hxx>
+#include <Precision.hxx>
+#include <Prs3d_Drawer.hxx>
+#include <Prs3d_Presentation.hxx>
+#include <Prs3d_Projector.hxx>
#include <PrsMgr_ModedPresentation.hxx>
#include <PrsMgr_Presentation.hxx>
-
-#include <StdSelect_BRepOwner.hxx>
-
+#include <Select3D_SensitiveEntity.hxx>
+#include <SelectMgr_EntityOwner.hxx>
+#include <SelectMgr_Selection.hxx>
+#include <Standard_NotImplemented.hxx>
+#include <Standard_ProgramError.hxx>
+#include <Standard_Type.hxx>
+#include <StdPrs_HLRPolyShape.hxx>
+#include <StdPrs_WFShape.hxx>
#include <StdSelect.hxx>
+#include <StdSelect_BRepOwner.hxx>
+#include <TopAbs_ShapeEnum.hxx>
+#include <TopoDS_Shape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_OrientedShapeMapHasher.hxx>
-#include <AIS_InteractiveContext.hxx>
-#include <BRepTools.hxx>
-#include <Precision.hxx>
-#include <AIS_Drawer.hxx>
-#include <TopAbs_ShapeEnum.hxx>
-#include <StdPrs_WFDeflectionShape.hxx>
-#include <StdPrs_HLRPolyShape.hxx>
-#include <Prs3d_Drawer.hxx>
-
-#include <AIS_Shape.hxx>
-
-#include <NCollection_DataMap.hxx>
-
+IMPLEMENT_STANDARD_RTTIEXT(AIS_ConnectedInteractive,AIS_InteractiveObject)
//=======================================================================
//function : AIS_ConnectedInteractive
SetHilightMode(0);
}
-//=======================================================================
-//function : Type
-//purpose :
-//=======================================================================
-AIS_KindOfInteractive AIS_ConnectedInteractive::Type() const
-{
- return AIS_KOI_Object;
-}
-
-Standard_Integer AIS_ConnectedInteractive::Signature() const
-{
- return 0;
-}
-
-
//=======================================================================
//function : Connect
//purpose :
{
myReference = theAnotherObj;
}
+ else
+ {
+ Standard_ProgramError::Raise ("AIS_ConnectedInteractive::Connect() - object without own presentation can not be connected");
+ }
if (!myReference.IsNull())
{
myTypeOfPresentation3d = myReference->TypeOfPresentation3d();
}
-
- theAnotherObj->AddChild (this);
}
//=======================================================================
case TopAbs_WIRE:
{
thePresentation->SetDisplayPriority (4);
- StdPrs_WFDeflectionShape::Add (thePresentation, theShape, myDrawer);
+ StdPrs_WFShape::Add (thePresentation, theShape, myDrawer);
break;
}
default:
// process HLRAngle and HLRDeviationCoefficient()
Standard_Real aPrevAngle = myDrawer->HLRAngle();
Standard_Real aNewAngle = aDefaultDrawer->HLRAngle();
- if (Abs (aNewAngle - aPrevAngle) > Precision::Angular())
+ if (myDrawer->IsAutoTriangulation() &&
+ Abs (aNewAngle - aPrevAngle) > Precision::Angular())
{
BRepTools::Clean (theShape);
}
if (!myReference->HasSelection (theMode))
{
- myReference->UpdateSelection (theMode);
+ myReference->RecomputePrimitives (theMode);
}
const Handle(SelectMgr_Selection)& TheRefSel = myReference->Selection (theMode);
Handle(SelectMgr_EntityOwner) anOwner = new SelectMgr_EntityOwner (this);
Handle(Select3D_SensitiveEntity) aSensitive, aNewSensitive;
-
+
+ TopLoc_Location aLocation (Transformation());
+ anOwner->SetLocation (aLocation);
+
if (TheRefSel->IsEmpty())
{
- myReference->UpdateSelection (theMode);
+ myReference->RecomputePrimitives (theMode);
}
for (TheRefSel->Init(); TheRefSel->More(); TheRefSel->Next())
{
- aSensitive = Handle(Select3D_SensitiveEntity)::DownCast (TheRefSel->Sensitive());
+ aSensitive = Handle(Select3D_SensitiveEntity)::DownCast (TheRefSel->Sensitive()->BaseSensitive());
if (!aSensitive.IsNull())
{
- TopLoc_Location aLocation (Transformation());
// Get the copy of SE3D
- aNewSensitive = aSensitive->GetConnected (aLocation);
+ aNewSensitive = aSensitive->GetConnected();
aNewSensitive->Set(anOwner);
- // In case if SE3D caches some location-dependent data
- // that must be updated after setting OWN
- aNewSensitive->SetLocation (aLocation);
theSelection->Add (aNewSensitive);
}
Shapes2EntitiesMap;
if (!myReference->HasSelection (theMode))
- myReference->UpdateSelection (theMode);
+ myReference->RecomputePrimitives (theMode);
const Handle(SelectMgr_Selection)& aRefSel = myReference->Selection (theMode);
if (aRefSel->IsEmpty() || aRefSel->UpdateStatus() == SelectMgr_TOU_Full)
{
- myReference->UpdateSelection (theMode);
+ myReference->RecomputePrimitives (theMode);
}
Handle(StdSelect_BRepOwner) anOwner;
// sensitive entities associated with aMode
for (aRefSel->Init(); aRefSel->More(); aRefSel->Next())
{
- aSE = Handle(Select3D_SensitiveEntity)::DownCast (aRefSel->Sensitive());
+ aSE = Handle(Select3D_SensitiveEntity)::DownCast (aRefSel->Sensitive()->BaseSensitive());
if(!aSE.IsNull())
{
anOwner = Handle(StdSelect_BRepOwner)::DownCast (aSE->OwnerId());
this,
aSEList.First()->OwnerId()->Priority(),
Standard_True);
+ anOwner->SetLocation (Transformation());
for (SensitiveList::Iterator aListIt (aSEList); aListIt.More(); aListIt.Next())
- {
+ {
aSE = aListIt.Value();
- TopLoc_Location aLocation (Transformation());
- aNewSE = aSE->GetConnected (aDummyLoc);
+ aNewSE = aSE->GetConnected();
aNewSE->Set (anOwner);
- // In case if aSE caches some location-dependent data
- // that must be updated after setting anOwner
- aNewSE->SetLocation (aLocation);
theSelection->Add (aNewSE);
}