diff --git a/samples/mfc/standard/01_Geometry/CMakeLists.txt b/samples/mfc/standard/01_Geometry/CMakeLists.txt
index fbe3267a41..051970a4c5 100644
--- a/samples/mfc/standard/01_Geometry/CMakeLists.txt
+++ b/samples/mfc/standard/01_Geometry/CMakeLists.txt
@@ -33,15 +33,13 @@ set (Geometry_ISESSION2D_HEADER_FILES ${Geometry_ISESSION2D_DIR}/ISession_Curve.
${Geometry_ISESSION2D_DIR}/ISession_Point.h
${Geometry_ISESSION2D_DIR}/ISession_Surface.h
${Geometry_ISESSION2D_DIR}/ISession_Text.h
- ${Geometry_ISESSION2D_DIR}/ISession2D_Curve.h
- ${Geometry_ISESSION2D_DIR}/ISession2D_SensitiveCurve.h)
+ ${Geometry_ISESSION2D_DIR}/ISession2D_Curve.h)
set (Geometry_ISESSION2D_SOURCE_FILES ${Geometry_ISESSION2D_DIR}/ISession_Curve.cpp
${Geometry_ISESSION2D_DIR}/ISession_Direction.cpp
${Geometry_ISESSION2D_DIR}/ISession_Point.cpp
${Geometry_ISESSION2D_DIR}/ISession_Surface.cpp
${Geometry_ISESSION2D_DIR}/ISession_Text.cpp
- ${Geometry_ISESSION2D_DIR}/ISession2D_Curve.cpp
- ${Geometry_ISESSION2D_DIR}/ISession2D_SensitiveCurve.cpp)
+ ${Geometry_ISESSION2D_DIR}/ISession2D_Curve.cpp)
set (Geometry_RESOURCE_DIR ${MFC_STANDARD_SAMPLES_DIR}/01_Geometry/res)
set (Geometry_RESOURCE_HEADER ${Geometry_RESOURCE_DIR}/resource.h)
diff --git a/samples/mfc/standard/01_Geometry/adm/win/vc10/Geometry.vcxproj b/samples/mfc/standard/01_Geometry/adm/win/vc10/Geometry.vcxproj
index 7788b35a2d..512ec89b7d 100644
--- a/samples/mfc/standard/01_Geometry/adm/win/vc10/Geometry.vcxproj
+++ b/samples/mfc/standard/01_Geometry/adm/win/vc10/Geometry.vcxproj
@@ -457,24 +457,6 @@
%(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
-
- Disabled
- %(AdditionalIncludeDirectories)
- %(PreprocessorDefinitions)
- EnableFastChecks
- true
- Disabled
- %(AdditionalIncludeDirectories)
- %(PreprocessorDefinitions)
- EnableFastChecks
- true
- MaxSpeed
- %(AdditionalIncludeDirectories)
- %(PreprocessorDefinitions)
- MaxSpeed
- %(AdditionalIncludeDirectories)
- %(PreprocessorDefinitions)
-
Disabled
%(AdditionalIncludeDirectories)
@@ -588,7 +570,6 @@
-
diff --git a/samples/mfc/standard/01_Geometry/adm/win/vc10/Geometry.vcxproj.filters b/samples/mfc/standard/01_Geometry/adm/win/vc10/Geometry.vcxproj.filters
index 812b3b1160..185f27ebaa 100644
--- a/samples/mfc/standard/01_Geometry/adm/win/vc10/Geometry.vcxproj.filters
+++ b/samples/mfc/standard/01_Geometry/adm/win/vc10/Geometry.vcxproj.filters
@@ -54,9 +54,6 @@
Source Files\ISession2d
-
- Source Files\ISession2d
-
Source Files\ISession2d
@@ -106,9 +103,6 @@
Header Files
-
- Header Files
-
Header Files
diff --git a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession2D_SensitiveCurve.cpp b/samples/mfc/standard/01_Geometry/src/ISession2D/ISession2D_SensitiveCurve.cpp
deleted file mode 100755
index 01a5c843ae..0000000000
--- a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession2D_SensitiveCurve.cpp
+++ /dev/null
@@ -1,138 +0,0 @@
-// Copyright: Matra-Datavision 1995
-
-#include "stdafx.h"
-
-#include
-#include
-#include
-
-IMPLEMENT_STANDARD_HANDLE(ISession2D_SensitiveCurve,Select3D_SensitiveEntity)
-IMPLEMENT_STANDARD_RTTIEXT(ISession2D_SensitiveCurve,Select3D_SensitiveEntity)
-
-//=====================================================
-// Function : Create
-// Purpose :Constructor
-//=====================================================
-
-
-ISession2D_SensitiveCurve::
-ISession2D_SensitiveCurve(const Handle(SelectBasics_EntityOwner)& OwnerId,
- const Handle(Geom2d_Curve)& C,
- const Standard_Real CDeflect,
- const Standard_Integer MaxRect):
-Select3D_SensitiveEntity(OwnerId),
-myMaxRect(MaxRect),
-myCurve(C),
-myCDeflect(CDeflect)
-{
- Compute();
-}
-
-void ISession2D_SensitiveCurve::Compute()
-{
- Geom2dAdaptor_Curve Curve (myCurve);
- Standard_Real ADeflect = 180; //Angular deflection
-
- GCPnts_TangentialDeflection PointsOnCurve;
- PointsOnCurve.Initialize (Curve, ADeflect, myCDeflect,myMaxRect,1.0e-9);
-
-
- myPolyP2d = new TColgp_HArray1OfPnt2d(1,PointsOnCurve.NbPoints());
-
- gp_Pnt P;
- for (Standard_Integer i=1; i<=PointsOnCurve.NbPoints();i++) {
- P = PointsOnCurve.Value (i);
- myPolyP2d->SetValue(i,gp_Pnt2d(P.X(),P.Y()));
- }
-
-}
-
-
-//=====================================================
-// Function : Areas
-// Purpose : return the bounding boxes
-//=====================================================
-void ISession2D_SensitiveCurve::Areas(SelectBasics_ListOfBox2d& boxes)
-{
- // calcul des Areas --> le nombre voulu est myMaxRect
- // mais il y a myPolyP2d->Length() segments
-
- Standard_Integer NbSeg = myPolyP2d->Length()-1;
- Standard_Integer nbPerBoxes= NbSeg/myMaxRect;
-
- Standard_Integer CurrentPoint =1;
- for (Standard_Integer i=1;i<=myMaxRect-1;i++)
- {
- Bnd_Box2d abox;
- abox.Set(myPolyP2d->Value(CurrentPoint));
- for(Standard_Integer j=1;j<=nbPerBoxes;j++)
- {
- CurrentPoint++;
- abox.Add(myPolyP2d->Value(CurrentPoint));
- }
- boxes.Append(abox);
- }
- Bnd_Box2d abox;
- abox.Set(myPolyP2d->Value(CurrentPoint));
- for(Standard_Integer j=CurrentPoint;j<=myPolyP2d->Length()-1;j++)
- {
- CurrentPoint++;
- abox.Add(myPolyP2d->Value(CurrentPoint));
- }
- boxes.Append(abox);
-
-}
-
-//=======================================================
-// Function : Matches
-// Purpose : test : segments in the bounding boxe
-//=======================================================
-Standard_Boolean ISession2D_SensitiveCurve::
-Matches (const Standard_Real XMin,
- const Standard_Real YMin,
- const Standard_Real XMax,
- const Standard_Real YMax,
- const Standard_Real aTol)
-{
-
- Bnd_Box2d BoundBox;
- BoundBox.Update(XMin-aTol,YMin-aTol,XMax+aTol,YMax+aTol);
-
- for(Standard_Integer j=1;j<=myPolyP2d->Length()-1;j++)
- {
- if(BoundBox.IsOut(myPolyP2d->Value(j))) return Standard_False;
- }
- return Standard_True;
-
-}
-
-//====================================================
-// Function : Matches
-// Purpose : test the real dist to the segments
-//====================================================
-Standard_Boolean ISession2D_SensitiveCurve::
- Matches(const Standard_Real X,
- const Standard_Real Y,
- const Standard_Real aTol,
- Standard_Real& DMin)
-{
- // VERY VERY IMPORTANT : set the selector sensibility !!! ( it's aTol !! )
- Standard_Integer Rank=0; // New in 2.0
- if (aTol == 0) {TRACE0("VERY VERY IMPORTANT : set the selector sensibility !!! ( it's aTol !! )");}
-
- Standard_Boolean Result = SelectBasics_BasicTool::MatchPolyg2d(myPolyP2d->Array1(),
- X,Y,
- aTol,
- DMin,
- Rank); // new in 2.0
- return Result;
-}
-
-
-Handle(TColgp_HArray1OfPnt2d) ISession2D_SensitiveCurve::
-SensitivePolygon()
-{
- return myPolyP2d;
-}
-
-
diff --git a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession2D_SensitiveCurve.h b/samples/mfc/standard/01_Geometry/src/ISession2D/ISession2D_SensitiveCurve.h
deleted file mode 100755
index 6daa3b4501..0000000000
--- a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession2D_SensitiveCurve.h
+++ /dev/null
@@ -1,86 +0,0 @@
-// File generated by CPPExt (Transient)
-//
-// Copyright (C) 1991,1995 by
-//
-// MATRA DATAVISION, FRANCE
-//
-// This software is furnished in accordance with the terms and conditions
-// of the contract and with the inclusion of the above copyright notice.
-// This software or any other copy thereof may not be provided or otherwise
-// be made available to any other person. No title to an ownership of the
-// software is hereby transferred.
-//
-// At the termination of the contract, the software and all copies of this
-// software must be deleted.
-//
-#ifndef _ISession2D_SensitiveCurve_HeaderFile
-#define _ISession2D_SensitiveCurve_HeaderFile
-#include
-#include
-
-
-#include
-#include
-#include
-#include
-#include
-#include
-class SelectBasics_EntityOwner;
-class gp_Pnt2d;
-#include
-#include "TColgp_HArray1OfPnt2d.hxx"
-#include
-
-
-DEFINE_STANDARD_HANDLE(ISession2D_SensitiveCurve,Select3D_SensitiveEntity)
-class ISession2D_SensitiveCurve : public Select3D_SensitiveEntity {
-
-public:
-
- // Methods PUBLIC
- //
- Standard_EXPORT ISession2D_SensitiveCurve(const Handle(SelectBasics_EntityOwner)& OwnerId,
- const Handle(Geom2d_Curve)& C,
- const Standard_Real CDeflect,
- const Standard_Integer MaxRect = 3);
- inline void SetMaxBoxes(const Standard_Integer MaxRect) ;
- inline virtual Standard_Integer MaxBoxes() const;
-
- inline void SetCurve(const Handle(Geom2d_Curve) aCurve) ;
- inline Handle(Geom2d_Curve) GetCurve() ;
-
- void Compute();
-
- Standard_EXPORT void Areas(SelectBasics_ListOfBox2d& aSeq) ;
- Standard_EXPORT Standard_Boolean Matches(const Standard_Real XMin,const Standard_Real YMin,const Standard_Real XMax,const Standard_Real YMax,const Standard_Real aTol) ;
- Standard_EXPORT Standard_Boolean Matches(const Standard_Real X,const Standard_Real Y,const Standard_Real aTol,Standard_Real& DMin) ;
- Handle(TColgp_HArray1OfPnt2d) SensitivePolygon();
-
- DEFINE_STANDARD_RTTI(ISession2D_SensitiveCurve)
-
-private:
- // Fields PRIVATE
- //
-Standard_Real myCDeflect;
-Standard_Integer myMaxRect;
-Handle(Geom2d_Curve) myCurve;
-Handle(TColgp_HArray1OfPnt2d) myPolyP2d;
-
-};
-
-inline Standard_Integer ISession2D_SensitiveCurve::
-MaxBoxes() const {return myMaxRect;}
-
-inline void ISession2D_SensitiveCurve::
-SetMaxBoxes(const Standard_Integer nbrect)
-{myMaxRect = nbrect;}
-
-inline void ISession2D_SensitiveCurve::
-SetCurve(const Handle(Geom2d_Curve) aCurve)
-{myCurve = aCurve;}
-
-inline Handle(Geom2d_Curve) ISession2D_SensitiveCurve::
-GetCurve()
-{return myCurve;}
-
-#endif
diff --git a/samples/mfc/standard/01_Geometry/src/StdAfx.h b/samples/mfc/standard/01_Geometry/src/StdAfx.h
index 0a91b8fd85..50c8ddd55f 100755
--- a/samples/mfc/standard/01_Geometry/src/StdAfx.h
+++ b/samples/mfc/standard/01_Geometry/src/StdAfx.h
@@ -229,7 +229,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/samples/mfc/standard/03_Viewer2d/src/StdAfx.h b/samples/mfc/standard/03_Viewer2d/src/StdAfx.h
index 257f72db8c..25e3a10bd3 100755
--- a/samples/mfc/standard/03_Viewer2d/src/StdAfx.h
+++ b/samples/mfc/standard/03_Viewer2d/src/StdAfx.h
@@ -127,8 +127,6 @@
#include
#include
#include
-#include
-#include
#include
#include
#include
diff --git a/samples/mfc/standard/04_Viewer3d/src/Viewer3dView.cpp b/samples/mfc/standard/04_Viewer3d/src/Viewer3dView.cpp
index 1a019cf29f..785de91a18 100755
--- a/samples/mfc/standard/04_Viewer3d/src/Viewer3dView.cpp
+++ b/samples/mfc/standard/04_Viewer3d/src/Viewer3dView.cpp
@@ -846,10 +846,10 @@ void CViewer3dView::DrawRectangle(const Standard_Integer MinX ,
m_IsVisible = false;
}
- StoredMinX = min ( MinX, MaxX );
- StoredMinY = min ( MinY, MaxY );
- StoredMaxX = max ( MinX, MaxX );
- StoredMaxY = max ( MinY, MaxY);
+ StoredMinX = Min ( MinX, MaxX );
+ StoredMinY = Min ( MinY, MaxY );
+ StoredMaxX = Max ( MinX, MaxX );
+ StoredMaxY = Max ( MinY, MaxY);
if (Draw) // move : draw
{
diff --git a/samples/mfc/standard/05_ImportExport/src/StdAfx.h b/samples/mfc/standard/05_ImportExport/src/StdAfx.h
index debe0e2210..7eee7acf55 100755
--- a/samples/mfc/standard/05_ImportExport/src/StdAfx.h
+++ b/samples/mfc/standard/05_ImportExport/src/StdAfx.h
@@ -99,8 +99,6 @@
#include
#include
#include
-#include
-#include
#include
#include
#include
diff --git a/samples/mfc/standard/06_Ocaf/src/StdAfx.h b/samples/mfc/standard/06_Ocaf/src/StdAfx.h
index 89edb6e681..6b2e5a3792 100755
--- a/samples/mfc/standard/06_Ocaf/src/StdAfx.h
+++ b/samples/mfc/standard/06_Ocaf/src/StdAfx.h
@@ -96,8 +96,6 @@
#include
#include
#include
-#include
-#include
#include
#include
#include
diff --git a/samples/mfc/standard/08_HLR/src/StdAfx.h b/samples/mfc/standard/08_HLR/src/StdAfx.h
index 540aa5a53c..32c76a5af4 100755
--- a/samples/mfc/standard/08_HLR/src/StdAfx.h
+++ b/samples/mfc/standard/08_HLR/src/StdAfx.h
@@ -153,8 +153,6 @@
#include
#include
#include
-#include
-#include
#include
#include
#include
diff --git a/samples/mfc/standard/09_Animation/src/AnimationView3D.cpp b/samples/mfc/standard/09_Animation/src/AnimationView3D.cpp
index 09f8aec6c6..ec6d921628 100755
--- a/samples/mfc/standard/09_Animation/src/AnimationView3D.cpp
+++ b/samples/mfc/standard/09_Animation/src/AnimationView3D.cpp
@@ -680,10 +680,10 @@ void CAnimationView3D::DrawRectangle(const Standard_Integer MinX ,
m_IsVisible = false;
}
- StoredMinX = min ( MinX, MaxX );
- StoredMinY = min ( MinY, MaxY );
- StoredMaxX = max ( MinX, MaxX );
- StoredMaxY = max ( MinY, MaxY);
+ StoredMinX = Min ( MinX, MaxX );
+ StoredMinY = Min ( MinY, MaxY );
+ StoredMaxX = Max ( MinX, MaxX );
+ StoredMaxY = Max ( MinY, MaxY);
if (Draw) // move : draw
{
diff --git a/samples/mfc/standard/09_Animation/src/StdAfx.h b/samples/mfc/standard/09_Animation/src/StdAfx.h
index 4e70e4c70f..a2a7663e4b 100755
--- a/samples/mfc/standard/09_Animation/src/StdAfx.h
+++ b/samples/mfc/standard/09_Animation/src/StdAfx.h
@@ -164,8 +164,6 @@ enum CurrentAction3d {
#include
#include
#include
-#include
-#include
#include
#include
#include
diff --git a/samples/mfc/standard/10_Convert/src/WNT/OCCDemoView.cpp b/samples/mfc/standard/10_Convert/src/WNT/OCCDemoView.cpp
index 3cd62d5915..cd2c43c792 100755
--- a/samples/mfc/standard/10_Convert/src/WNT/OCCDemoView.cpp
+++ b/samples/mfc/standard/10_Convert/src/WNT/OCCDemoView.cpp
@@ -450,10 +450,10 @@ void COCCDemoView::DrawRectangle(const Standard_Integer MinX,
m_IsVisible = false;
}
- StoredMinX = min ( MinX, MaxX );
- StoredMinY = min ( MinY, MaxY );
- StoredMaxX = max ( MinX, MaxX );
- StoredMaxY = max ( MinY, MaxY);
+ StoredMinX = Min ( MinX, MaxX );
+ StoredMinY = Min ( MinY, MaxY );
+ StoredMaxX = Max ( MinX, MaxX );
+ StoredMaxY = Max ( MinY, MaxY);
if (Draw) // move : draw
{
diff --git a/samples/mfc/standard/Common/OCC_2dView.cpp b/samples/mfc/standard/Common/OCC_2dView.cpp
index 439c7e08b9..8209ab828d 100755
--- a/samples/mfc/standard/Common/OCC_2dView.cpp
+++ b/samples/mfc/standard/Common/OCC_2dView.cpp
@@ -594,10 +594,10 @@ void OCC_2dView::DrawRectangle2D(const Standard_Integer MinX,
m_IsVisible = false;
}
- StoredMinX = min ( MinX, MaxX );
- StoredMinY = min ( MinY, MaxY );
- StoredMaxX = max ( MinX, MaxX );
- StoredMaxY = max ( MinY, MaxY);
+ StoredMinX = Min ( MinX, MaxX );
+ StoredMinY = Min ( MinY, MaxY );
+ StoredMaxX = Max ( MinX, MaxX );
+ StoredMaxY = Max ( MinY, MaxY);
if (Draw) // move : draw
{
diff --git a/samples/mfc/standard/Common/OCC_3dView.cpp b/samples/mfc/standard/Common/OCC_3dView.cpp
index a8e1093bfc..3f4a8821b8 100755
--- a/samples/mfc/standard/Common/OCC_3dView.cpp
+++ b/samples/mfc/standard/Common/OCC_3dView.cpp
@@ -542,10 +542,10 @@ void OCC_3dView::DrawRectangle(const Standard_Integer MinX ,
m_IsVisible = false;
}
- StoredMinX = min ( MinX, MaxX );
- StoredMinY = min ( MinY, MaxY );
- StoredMaxX = max ( MinX, MaxX );
- StoredMaxY = max ( MinY, MaxY);
+ StoredMinX = Min ( MinX, MaxX );
+ StoredMinY = Min ( MinY, MaxY );
+ StoredMaxX = Max ( MinX, MaxX );
+ StoredMaxY = Max ( MinY, MaxY);
if (Draw) // move : draw
{
diff --git a/samples/mfc/standard/Common/StdAfx.h b/samples/mfc/standard/Common/StdAfx.h
index 2415a82ceb..122108e25e 100755
--- a/samples/mfc/standard/Common/StdAfx.h
+++ b/samples/mfc/standard/Common/StdAfx.h
@@ -83,7 +83,6 @@
#include
#include
-#include
#include
#include
#include
diff --git a/src/AIS/AIS_Axis.cxx b/src/AIS/AIS_Axis.cxx
index 9202253743..f7ad1d1149 100644
--- a/src/AIS/AIS_Axis.cxx
+++ b/src/AIS/AIS_Axis.cxx
@@ -23,6 +23,7 @@
#include
#include
#include
+#include
#include
#include
#include
diff --git a/src/AIS/AIS_Chamf2dDimension.cxx b/src/AIS/AIS_Chamf2dDimension.cxx
index 4a36258f11..878843a471 100644
--- a/src/AIS/AIS_Chamf2dDimension.cxx
+++ b/src/AIS/AIS_Chamf2dDimension.cxx
@@ -25,6 +25,7 @@
#include
#include
+#include
#include
#include
diff --git a/src/AIS/AIS_Chamf3dDimension.cxx b/src/AIS/AIS_Chamf3dDimension.cxx
index 0405edcdf5..3d7d183d19 100644
--- a/src/AIS/AIS_Chamf3dDimension.cxx
+++ b/src/AIS/AIS_Chamf3dDimension.cxx
@@ -25,6 +25,7 @@
#include
#include
+#include
#include
#include
diff --git a/src/AIS/AIS_Circle.cxx b/src/AIS/AIS_Circle.cxx
index f7c4ac3ca4..e2dae1d21b 100644
--- a/src/AIS/AIS_Circle.cxx
+++ b/src/AIS/AIS_Circle.cxx
@@ -22,6 +22,7 @@
#include
#include
#include
+#include
#include
#include
#include
diff --git a/src/AIS/AIS_ConcentricRelation.cxx b/src/AIS/AIS_ConcentricRelation.cxx
index 9fb1036b24..f209345691 100644
--- a/src/AIS/AIS_ConcentricRelation.cxx
+++ b/src/AIS/AIS_ConcentricRelation.cxx
@@ -19,6 +19,7 @@
#include
#include
+#include
#include
#include
diff --git a/src/AIS/AIS_ConnectedInteractive.cxx b/src/AIS/AIS_ConnectedInteractive.cxx
index 9a4fef784f..79e1228970 100644
--- a/src/AIS/AIS_ConnectedInteractive.cxx
+++ b/src/AIS/AIS_ConnectedInteractive.cxx
@@ -18,6 +18,7 @@
#include
#include
+#include
#include
#include
@@ -287,31 +288,30 @@ void AIS_ConnectedInteractive::ComputeSelection (const Handle(SelectMgr_Selectio
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);
}
@@ -330,13 +330,13 @@ void AIS_ConnectedInteractive::computeSubShapeSelection (const Handle(SelectMgr_
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;
@@ -352,7 +352,7 @@ void AIS_ConnectedInteractive::computeSubShapeSelection (const Handle(SelectMgr_
// 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());
@@ -376,17 +376,14 @@ void AIS_ConnectedInteractive::computeSubShapeSelection (const Handle(SelectMgr_
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);
}
diff --git a/src/AIS/AIS_Dimension.cxx b/src/AIS/AIS_Dimension.cxx
index 34cf02bbb2..a09e1a1da2 100755
--- a/src/AIS/AIS_Dimension.cxx
+++ b/src/AIS/AIS_Dimension.cxx
@@ -50,8 +50,6 @@
#include
#include
#include
-#include
-#include
#include
#include
#include
diff --git a/src/AIS/AIS_Dimension.hxx b/src/AIS/AIS_Dimension.hxx
index 03ad7d01b1..6992339ff9 100755
--- a/src/AIS/AIS_Dimension.hxx
+++ b/src/AIS/AIS_Dimension.hxx
@@ -32,7 +32,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/src/AIS/AIS_EqualRadiusRelation.cxx b/src/AIS/AIS_EqualRadiusRelation.cxx
index ff6e431237..553cd05929 100644
--- a/src/AIS/AIS_EqualRadiusRelation.cxx
+++ b/src/AIS/AIS_EqualRadiusRelation.cxx
@@ -26,6 +26,7 @@
#include
#include
#include
+#include
#include
#include
#include
diff --git a/src/AIS/AIS_FixRelation.cxx b/src/AIS/AIS_FixRelation.cxx
index 57d1236dec..f9ae72a042 100644
--- a/src/AIS/AIS_FixRelation.cxx
+++ b/src/AIS/AIS_FixRelation.cxx
@@ -23,6 +23,7 @@
#include
#include
+#include
#include
#include
diff --git a/src/AIS/AIS_IdenticRelation.cxx b/src/AIS/AIS_IdenticRelation.cxx
index 9947d35c4c..6031f37205 100644
--- a/src/AIS/AIS_IdenticRelation.cxx
+++ b/src/AIS/AIS_IdenticRelation.cxx
@@ -40,6 +40,7 @@
#include
#include
#include
+#include
#include
diff --git a/src/AIS/AIS_InteractiveContext.cdl b/src/AIS/AIS_InteractiveContext.cdl
index 6398d8cb1f..2270226d10 100644
--- a/src/AIS/AIS_InteractiveContext.cdl
+++ b/src/AIS/AIS_InteractiveContext.cdl
@@ -427,43 +427,16 @@ is
---Purpose:
-- Removes selection mode from Interactive Objects.
-- aMode provides the selection mode index of the entity aniobj.
-
- SetSensitivityMode(me : mutable;
- aMode : SensitivityMode from StdSelect) is static;
- ---Level: Public
- ---Purpose: Sets the selection sensitivity mode. SM_WINDOW mode
- -- uses the specified pixel tolerance to compute the sensitivity
- -- value, SM_VIEW mode allows to define the sensitivity manually.
-
- SensitivityMode(me) returns SensitivityMode from StdSelect;
- ---Level: Public
- ---Purpose: Returns the selection sensitivity mode.
-
- SetSensitivity(me:mutable;
- aPrecision: Real from Standard);
- ---Level: Public
- ---Purpose: Sets the sensitivity aPrecision
--- according to the view size for the current context or local
--- context if any is activated.
--- Sets the sensitivity aPrecision in pixels for the current context
--- or local context if any is activated. By default, this
--- sensitivity is equal to 4 pixels.
--- When a local context is open, the defined sensitivity applies to
--- this local context instead of the main context.
-
- Sensitivity (me) returns Real from Standard;
- ---Level: Public
- ---Purpose: Returns the selection sensitivity value.
SetPixelTolerance(me:mutable;
- aPrecision: Integer from Standard = 4);
+ aPrecision: Real from Standard = 4.0);
---Level: Public
---Purpose: Define the current selection pixel sensitivity
-- for this context or local context if any one is activated.
-- Warning: When a local context is open the sensitivity is apply on it
-- instead on the main context.
- PixelTolerance(me) returns Integer from Standard;
+ PixelTolerance(me) returns Real from Standard;
---Level: Public
---Purpose: Returns the pixel tolerance.
@@ -1668,9 +1641,10 @@ is
ZDetection(me) returns Boolean;
---Purpose: Retrieves the Z detection state.
- Activate(me : mutable;
- anIobj : InteractiveObject from AIS;
- aMode : Integer from Standard = 0);
+ Activate(me : mutable;
+ anIobj : InteractiveObject from AIS;
+ aMode : Integer from Standard = 0;
+ theIsForce : Boolean from Standard = Standard_False);
---Purpose: Activates the selection mode aMode whose index is
-- given, for the given interactive entity anIobj.
@@ -1947,10 +1921,10 @@ is
---C++: inline
---C++: return const &
- MainSelector(me) returns any ViewerSelector3d from StdSelect;
+ MainSelector(me) returns ViewerSelector3d from StdSelect;
---C++: inline
---C++: return const &
- LocalSelector(me) returns any ViewerSelector3d from StdSelect;
+ LocalSelector(me) returns ViewerSelector3d from StdSelect;
PurgeDisplay(me:mutable)
returns Integer from Standard;
@@ -1962,12 +1936,6 @@ is
HighestIndex(me) returns Integer from Standard;
-
- DisplayActiveAreas(me:mutable;aView:View from V3d) ;
-
- ClearActiveAreas (me :mutable;
- aView: View from V3d) is static;
- ---Level: Internal
DisplayActiveSensitive(me:mutable;aView : View from V3d) is static;
@@ -1978,9 +1946,6 @@ is
DisplayActiveSensitive(me:mutable;
anObject: InteractiveObject from AIS;
aView : View from V3d) is static;
- DisplayActiveAreas(me:mutable;
- anObject: InteractiveObject from AIS;
- aView : View from V3d) is static;
GetDefModes(me;
anIobj : InteractiveObject from AIS;
@@ -2010,6 +1975,8 @@ is
---Purpose: returns if possible,
-- the first local context where the object is seen
+ RebuildSelectionStructs (me : mutable);
+ ---Purpose: Rebuilds 1st level of BVH selection forcibly
SetViewAffinity (me : mutable;
theIObj : InteractiveObject from AIS;
theView : View from V3d;
@@ -2017,6 +1984,12 @@ is
---Purpose: setup object visibility in specified view,
-- has no effect if object is not disaplyed in this context.
+ Disconnect (me : mutable;
+ theAssembly : InteractiveObject from AIS;
+ theObjToDisconnect : InteractiveObject from AIS = NULL)
+ is static;
+ ---Purpose: Disconnects theObjToDisconnect from theAssembly and removes dependent selection structures
+
ObjectsForView (me;
theListOfIO : in out ListOfInteractive from AIS;
theView : View from V3d;
diff --git a/src/AIS/AIS_InteractiveContext.cxx b/src/AIS/AIS_InteractiveContext.cxx
index ffe89cfd72..3c3d400254 100644
--- a/src/AIS/AIS_InteractiveContext.cxx
+++ b/src/AIS/AIS_InteractiveContext.cxx
@@ -43,6 +43,7 @@
#include
#include
#include
+#include
#include
#include
@@ -2364,6 +2365,9 @@ void AIS_InteractiveContext::ClearGlobal (const Handle(AIS_InteractiveObject)& t
if (theIObj.IsNull()
|| !myObjects.IsBound (theIObj))
{
+ // for cases when reference shape of connected interactives was not displayed
+ // but its selection primitives were calculated
+ mgrSelector->Remove (theIObj);
return;
}
@@ -2584,65 +2588,11 @@ void AIS_InteractiveContext::UnsetSelectionMode (const Handle(AIS_InteractiveObj
//
}
-//=======================================================================
-//function : SetSensitivityMode
-//purpose :
-//=======================================================================
-void AIS_InteractiveContext::SetSensitivityMode (const StdSelect_SensitivityMode theMode)
-{
- if (HasOpenedContext())
- {
- myLocalContexts (myCurLocalIndex)->SetSensitivityMode (theMode);
- }
- else
- {
- myMainSel->SetSensitivityMode (theMode);
- }
-}
-
-//=======================================================================
-//function : SensitivityMode
-//purpose :
-//=======================================================================
-StdSelect_SensitivityMode AIS_InteractiveContext::SensitivityMode() const
-{
- return HasOpenedContext()
- ? myLocalContexts (myCurLocalIndex)->SensitivityMode()
- : myMainSel->SensitivityMode();
-}
-
-//=======================================================================
-//function : SetSensitivity
-//purpose :
-//=======================================================================
-void AIS_InteractiveContext::SetSensitivity (const Standard_Real thePrecision)
-{
- if (HasOpenedContext())
- {
- myLocalContexts(myCurLocalIndex)->SetSensitivity (thePrecision);
- }
- else
- {
- myMainSel->SetSensitivity (thePrecision);
- }
-}
-
-//=======================================================================
-//function : Sensitivity
-//purpose :
-//=======================================================================
-Standard_Real AIS_InteractiveContext::Sensitivity() const
-{
- return HasOpenedContext()
- ? myLocalContexts(myCurLocalIndex)->Sensitivity()
- : myMainSel->Sensitivity();
-}
-
//=======================================================================
//function : SetPixelTolerance
//purpose :
//=======================================================================
-void AIS_InteractiveContext::SetPixelTolerance (const Standard_Integer thePrecision)
+void AIS_InteractiveContext::SetPixelTolerance (const Standard_Real thePrecision)
{
if (HasOpenedContext())
{
@@ -2658,7 +2608,7 @@ void AIS_InteractiveContext::SetPixelTolerance (const Standard_Integer thePrecis
//function : PixelTolerance
//purpose :
//=======================================================================
-Standard_Integer AIS_InteractiveContext::PixelTolerance() const
+Standard_Real AIS_InteractiveContext::PixelTolerance() const
{
return HasOpenedContext()
? myLocalContexts (myCurLocalIndex)->PixelTolerance()
@@ -2836,3 +2786,37 @@ Standard_Integer AIS_InteractiveContext::GetZLayer (const Handle(AIS_Interactive
? theIObj->ZLayer()
: Graphic3d_ZLayerId_UNKNOWN;
}
+
+//=======================================================================
+//function : RebuildSelectionStructs
+//purpose : Rebuilds 1st level of BVH selection forcibly
+//=======================================================================
+void AIS_InteractiveContext::RebuildSelectionStructs()
+{
+ myMainSel->RebuildObjectsTree (Standard_True);
+}
+
+//=======================================================================
+//function : Disconnect
+//purpose : Disconnects selectable object from an assembly and updates selection structures
+//=======================================================================
+void AIS_InteractiveContext::Disconnect (const Handle(AIS_InteractiveObject)& theAssembly,
+ const Handle(AIS_InteractiveObject)& theObjToDisconnect)
+{
+ if (theAssembly->IsInstance ("AIS_MultipleConnectedInteractive"))
+ {
+ const Handle(AIS_MultipleConnectedInteractive)& theObj =
+ Handle(AIS_MultipleConnectedInteractive)::DownCast (theAssembly);
+ theObj->Disconnect (theObjToDisconnect);
+ mgrSelector->Remove (theObjToDisconnect);
+ }
+ else if (theAssembly->IsInstance ("AIS_ConnectedInteractive") && theObjToDisconnect == NULL)
+ {
+ const Handle(AIS_ConnectedInteractive)& theObj =
+ Handle(AIS_ConnectedInteractive)::DownCast (theAssembly);
+ theObj->Disconnect();
+ mgrSelector->Remove (theObj);
+ }
+ else
+ return;
+}
diff --git a/src/AIS/AIS_InteractiveContext_1.cxx b/src/AIS/AIS_InteractiveContext_1.cxx
index b8423a9acd..d82f767c21 100644
--- a/src/AIS/AIS_InteractiveContext_1.cxx
+++ b/src/AIS/AIS_InteractiveContext_1.cxx
@@ -16,6 +16,7 @@
#include
#include
+#include
#include
#include
#include
@@ -1098,11 +1099,11 @@ void AIS_InteractiveContext::EntityOwners(SelectMgr_IndexedMapOfOwner& theOwners
if ( !theIObj->HasSelection( aMode ) )
continue;
- Handle(SelectMgr_Selection) aSel = theIObj->Selection( aMode );
+ Handle(SelectMgr_Selection) aSel = theIObj->Selection(aMode);
for ( aSel->Init(); aSel->More(); aSel->Next() )
{
- Handle(SelectBasics_SensitiveEntity) aEntity = aSel->Sensitive();
+ Handle(SelectBasics_SensitiveEntity) aEntity = aSel->Sensitive()->BaseSensitive();
if ( aEntity.IsNull() )
continue;
diff --git a/src/AIS/AIS_InteractiveContext_2.cxx b/src/AIS/AIS_InteractiveContext_2.cxx
index 10c9c5ff62..0fef9640fa 100644
--- a/src/AIS/AIS_InteractiveContext_2.cxx
+++ b/src/AIS/AIS_InteractiveContext_2.cxx
@@ -29,6 +29,8 @@
#include
#include
+#include
+
//=======================================================================
//function : OpenLocalContext
//purpose :
@@ -59,10 +61,6 @@ OpenLocalContext(const Standard_Boolean UseDisplayedObjects,
myLastPicked.Nullify();
myWasLastMain = Standard_True;
-
-
- Standard_Integer untilnow = myCurLocalIndex;
-
myCurLocalIndex = HighestIndex() + 1;
Handle(AIS_LocalContext) NewLocal= new AIS_LocalContext(this,myCurLocalIndex,
@@ -72,12 +70,6 @@ OpenLocalContext(const Standard_Boolean UseDisplayedObjects,
// the AIS_LocalContext bind itself to myLocalContexts
// because procedures performed in AIS_LocalContext constructor
// already may access myLocalContexts(myCurLocalIndex) (like methods AIS_LocalContext::IsSelected()).
- //myLocalContexts.Bind (myCurLocalIndex, NewLocal);
- NewLocal->MainSelector()->Set ((myLocalContexts.Extent() > 1)
- ? myLocalContexts (untilnow)->MainSelector()->Projector()
- : myMainSel->Projector());
-
- NewLocal->MainSelector()->UpdateConversion();
#ifdef OCCT_DEBUG
cout<<"\tOpen Local Context No "<HasSameProjector(myMainSel->Projector()));
myLocalContexts(myCurLocalIndex)->Terminate( updateviewer );
myLocalContexts.UnBind(myCurLocalIndex);
myCurLocalIndex = 0;
ResetOriginalState(Standard_False);
- if(updateproj)
- myMainSel->UpdateConversion();
- else{
- myMainSel->UpdateSort();
- }
if(debugmode)
cout<<"No More Opened Local Context "<HasSameProjector (VS->Projector()))
- {
- LocCtx->MainSelector()->UpdateConversion();
- }
}
else if(debugmode)
cout<<"a No Current Local Context WasClosed"<UpdateSort();
if(updateviewer) myMainVwr->Update();
}
@@ -226,12 +206,13 @@ Standard_Integer AIS_InteractiveContext::HighestIndex() const
void AIS_InteractiveContext::
Activate(const Handle(AIS_InteractiveObject)& anIObj,
- const Standard_Integer aMode)
+ const Standard_Integer aMode,
+ const Standard_Boolean theIsForce)
{
if(!HasOpenedContext()){
if(!myObjects.IsBound(anIObj)) return;
const Handle(AIS_GlobalStatus)& STAT = myObjects(anIObj);
- if(STAT->GraphicStatus()==AIS_DS_Displayed)
+ if(STAT->GraphicStatus()==AIS_DS_Displayed || theIsForce)
mgrSelector->Activate(anIObj,aMode,myMainSel);
STAT ->AddSelectionMode(aMode);
}
@@ -570,31 +551,6 @@ const SelectMgr_ListOfFilter& AIS_InteractiveContext::Filters() const
return myFilters->StoredFilters();
}
-//=======================================================================
-//function : DisplayActiveAreas
-//purpose :
-//=======================================================================
-void AIS_InteractiveContext::DisplayActiveAreas(const Handle(V3d_View)& aviou)
-{
- if(HasOpenedContext())
- myLocalContexts(myCurLocalIndex)->DisplayAreas(aviou);
- else
- myMainSel->DisplayAreas(aviou);
-
-}
-
-//=======================================================================
-//function : ClearActiveAreas
-//purpose :
-//=======================================================================
-void AIS_InteractiveContext::ClearActiveAreas(const Handle(V3d_View)& aviou)
-{
- if(HasOpenedContext())
- myLocalContexts(myCurLocalIndex)->ClearAreas(aviou);
- else
- myMainSel->ClearAreas(aviou);
-}
-
//=======================================================================
//function : DisplayActiveSensitive
//purpose :
@@ -631,41 +587,11 @@ void AIS_InteractiveContext::DisplayActiveSensitive(const Handle(AIS_Interactive
for(;It.More();It.Next()){
const Handle(SelectMgr_Selection)& Sel = anIObj->Selection(It.Value());
- VS->DisplaySensitive(Sel,aviou,Standard_False);
+ VS->DisplaySensitive(Sel,anIObj->Transformation(), aviou,Standard_False);
}
}
-//=======================================================================
-//function : DisplayActiveAreas
-//purpose :
-//=======================================================================
-
-void AIS_InteractiveContext::DisplayActiveAreas(const Handle(AIS_InteractiveObject)& anIObj,
- const Handle(V3d_View)& aviou)
-{
- TColStd_ListIteratorOfListOfInteger It;
- Handle(StdSelect_ViewerSelector3d) VS;
- if(HasOpenedContext()){
- const Handle(AIS_LocalContext)& LC = myLocalContexts(myCurLocalIndex);
- if(!LC->IsIn(anIObj)) return;
- It.Initialize(LC->SelectionModes(anIObj));
- VS = LC->MainSelector();
- }
- else{
- if(!myObjects.IsBound(anIObj)) return;
- It.Initialize(myObjects(anIObj)->SelectionModes());
- VS = myMainSel;
- }
-
-
- for(;It.More();It.Next()){
- const Handle(SelectMgr_Selection)& Sel = anIObj->Selection(It.Value());
- VS->DisplayAreas(Sel,aviou,Standard_False);
- }
-
-}
-
//=======================================================================
//function : ClearActiveSensitive
//purpose :
@@ -848,6 +774,7 @@ void AIS_InteractiveContext::ResetOriginalState(const Standard_Boolean updatevie
{
Standard_Boolean upd_main(Standard_False);
TColStd_ListIteratorOfListOfInteger itl;
+ myMainSel->ResetSelectionActivationStatus();
for (AIS_DataMapIteratorOfDataMapOfIOStatus it(myObjects);it.More();it.Next()){
const Handle(AIS_InteractiveObject)& iobj = it.Key();
diff --git a/src/AIS/AIS_InteractiveObject.cdl b/src/AIS/AIS_InteractiveObject.cdl
index 5134ed6e1a..601a008340 100644
--- a/src/AIS/AIS_InteractiveObject.cdl
+++ b/src/AIS/AIS_InteractiveObject.cdl
@@ -581,6 +581,12 @@ is
---Purpose: Retrieves current polygon offsets settings from .
---Category: Inquire methods
+ BoundingBox (me : mutable;
+ theBndBox : out Box from Bnd)
+ is redefined;
+ ---Level: Public
+ ---Purpose: Returns bounding box of object correspondingly to its current display mode.
+
fields
myCTXPtr : PToContext from AIS;
diff --git a/src/AIS/AIS_InteractiveObject.cxx b/src/AIS/AIS_InteractiveObject.cxx
index 639c75c434..0256b6ec47 100644
--- a/src/AIS/AIS_InteractiveObject.cxx
+++ b/src/AIS/AIS_InteractiveObject.cxx
@@ -33,6 +33,8 @@
#include
#include
#include
+#include
+#include
#include
#include
@@ -586,3 +588,62 @@ void AIS_InteractiveObject::PolygonOffsets(Standard_Integer& aMode,
if( HasPolygonOffsets() )
myDrawer->ShadingAspect()->Aspect()->PolygonOffsets( aMode, aFactor, aUnits );
}
+
+//=======================================================================
+//function : BoundingBox
+//purpose : Returns bounding box of object correspondingly to its
+// current display mode
+//=======================================================================
+void AIS_InteractiveObject::BoundingBox (Bnd_Box& theBndBox)
+{
+ if (myDisplayMode == -1)
+ {
+ if (!myPresentations.IsEmpty())
+ {
+ const Handle(PrsMgr_Presentation)& aPrs3d = myPresentations.First().Presentation();
+ const Handle(Graphic3d_Structure)& aStruct = aPrs3d->Presentation();
+ const Graphic3d_BndBox4f& aBndBox = aStruct->CStructure()->BoundingBox();
+ theBndBox.Update (static_cast (aBndBox.CornerMin().x()),
+ static_cast (aBndBox.CornerMin().y()),
+ static_cast (aBndBox.CornerMin().z()),
+ static_cast (aBndBox.CornerMax().x()),
+ static_cast (aBndBox.CornerMax().y()),
+ static_cast (aBndBox.CornerMax().z()));
+ return;
+ }
+ else
+ {
+ for (PrsMgr_ListOfPresentableObjectsIter aPrsIter (Children()); aPrsIter.More(); aPrsIter.Next())
+ {
+ const Handle(AIS_InteractiveObject)& aChild = Handle(AIS_InteractiveObject)::DownCast (aPrsIter.Value());
+ if (aChild.IsNull())
+ {
+ continue;
+ }
+ Bnd_Box aBox;
+ aChild->BoundingBox (aBox);
+ theBndBox.Add (aBox);
+ }
+ return;
+ }
+ }
+ else
+ {
+ for (Standard_Integer aPrsIter = 1; aPrsIter <= myPresentations.Length(); ++aPrsIter)
+ {
+ if (myPresentations (aPrsIter).Mode() == myDisplayMode)
+ {
+ const Handle(PrsMgr_Presentation)& aPrs3d = myPresentations (aPrsIter).Presentation();
+ const Handle(Graphic3d_Structure)& aStruct = aPrs3d->Presentation();
+ const Graphic3d_BndBox4f& aBndBox = aStruct->CStructure()->BoundingBox();
+ theBndBox.Update (static_cast (aBndBox.CornerMin().x()),
+ static_cast (aBndBox.CornerMin().y()),
+ static_cast (aBndBox.CornerMin().z()),
+ static_cast (aBndBox.CornerMax().x()),
+ static_cast (aBndBox.CornerMax().y()),
+ static_cast (aBndBox.CornerMax().z()));
+ return;
+ }
+ }
+ }
+}
diff --git a/src/AIS/AIS_Line.cxx b/src/AIS/AIS_Line.cxx
index 08e5a03907..8cc19f814c 100644
--- a/src/AIS/AIS_Line.cxx
+++ b/src/AIS/AIS_Line.cxx
@@ -23,6 +23,7 @@
#include
#include
#include
+#include
#include
#include
#include
diff --git a/src/AIS/AIS_LocalContext.cdl b/src/AIS/AIS_LocalContext.cdl
index 2177f65c09..5a9b10424f 100644
--- a/src/AIS/AIS_LocalContext.cdl
+++ b/src/AIS/AIS_LocalContext.cdl
@@ -51,7 +51,6 @@ uses
Shape from TopoDS,
View from V3d,
PresentationManager3d from PrsMgr,
- Projector from Select3D,
IndexedMapOfOwner from SelectMgr,
EntityOwner from SelectMgr,
OrFilter from SelectMgr,
@@ -105,14 +104,6 @@ is
Terminate(me: mutable; updateviewer : Boolean from Standard = Standard_True);
- HasSameProjector(me;aPrj:Projector from Select3D)
- returns Boolean from Standard;
- ---Purpose: compares the current projector of the localContext
- -- with
- -- returns True if the projectors are identical.
- -- (no need to update projection of selection primitives
- -- when closing the local context)....
-
Reactivate(me:mutable);
---Purpose: to be called when a upper local context was closed...
-- useful to put pack the right projector...
@@ -445,35 +436,14 @@ is
WithColor : out Boolean from Standard;
HiCol : out NameOfColor from Quantity)
returns Boolean from Standard;
-
- SetSensitivityMode(me : mutable;
- aMode : SensitivityMode from StdSelect) is static;
- ---Level: Public
- ---Purpose: Sets the selection sensitivity mode. SM_WINDOW mode
- -- uses the specified pixel tolerance to compute the sensitivity
- -- value, SM_VIEW mode allows to define the sensitivity manually.
-
- SensitivityMode(me) returns SensitivityMode from StdSelect;
- ---Level: Public
- ---Purpose: Returns the selection sensitivity mode.
-
- SetSensitivity(me:mutable;
- aPrecision: Real from Standard);
- ---Level: Public
- ---Purpose: Define the current selection sensitivity for
- -- this local context according to the view size.
-
- Sensitivity (me) returns Real from Standard;
- ---Level: Public
- ---Purpose: Returns the selection sensitivity value.
SetPixelTolerance(me:mutable;
- aPrecision: Integer from Standard = 2);
+ aPrecision: Real from Standard = 2);
---Level: Public
---Purpose: Define the current selection sensitivity for
-- this local context according to the view size.
- PixelTolerance(me) returns Integer from Standard;
+ PixelTolerance(me) returns Real from Standard;
---Level: Public
---Purpose: Returns the pixel tolerance.
@@ -505,11 +475,6 @@ is
---Category: INTERNAL METHODS;
- UpdateConversion(me:mutable);
-
- UpdateSort(me:mutable);
-
-
Status(me) returns AsciiString from TCollection is private;
@@ -524,15 +489,12 @@ is
UnloadContextObjects(me:mutable);
Process(me : mutable;
- anObject : SelectableObject from SelectMgr;
- WithProj: Boolean from Standard = Standard_True) is static private;
+ anObject : SelectableObject from SelectMgr) is static private;
- Process(me:mutable;
- WithProj: Boolean from Standard = Standard_True) is static private;
+ Process(me:mutable) is static private;
- ActivateStandardModes(me:mutable;anObject: SelectableObject from SelectMgr;
- WithProj: Boolean from Standard = Standard_True) is static private;
+ ActivateStandardModes(me:mutable;anObject: SelectableObject from SelectMgr) is static private;
manageDetected (me : mutable;
thePickOwner : EntityOwner from SelectMgr;
@@ -566,13 +528,6 @@ is
ComesFromDecomposition(me; aPickedIndex : Integer from Standard)
returns Boolean from Standard is static private;
-
- DisplayAreas(me:mutable;aviou:View from V3d);
-
- ClearAreas (me:mutable;
- aView: View from V3d) is static;
- ---Level: Internal
-
HasFilters(me;aType:ShapeEnum from TopAbs)
returns Boolean from Standard is private;
@@ -580,7 +535,7 @@ is
ClearSensitive(me:mutable;aView:View from V3d) is static;
- MainSelector(me) returns any ViewerSelector3d from StdSelect;
+ MainSelector(me) returns ViewerSelector3d from StdSelect;
---C++: inline
---C++: return const&
diff --git a/src/AIS/AIS_LocalContext.cxx b/src/AIS/AIS_LocalContext.cxx
index c62f8467bb..6549e9a388 100644
--- a/src/AIS/AIS_LocalContext.cxx
+++ b/src/AIS/AIS_LocalContext.cxx
@@ -33,6 +33,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -70,7 +71,7 @@ myLoadDisplayed(LoadDisplayed),
myAcceptStdMode(AcceptStandardModes),
myAcceptErase(AcceptEraseOfTemp),
mySM(aCtx->SelectionManager()),
-myMainVS(new StdSelect_ViewerSelector3d(aCtx->MainSelector()->Projector())),
+myMainVS(aCtx->MainSelector()),
myFilters(new SelectMgr_OrFilter()),
myAutoHilight(Standard_True),
mylastindex(0),
@@ -84,13 +85,14 @@ myAISCurDetected(0)
// created and mapped.
aCtx->myLocalContexts.Bind (Index, this);
+ myMainVS->ResetSelectionActivationStatus();
myMainPM = aCtx->MainPrsMgr();
mySelName = AIS_Local_SelName(this, Index);
AIS_Selection::CreateSelection(mySelName.ToCString());
mySM->Add(myMainVS);
if(myLoadDisplayed) LoadContextObjects();
- Process(Standard_False);
+ Process();
}
@@ -195,7 +197,24 @@ Load(const Handle(AIS_InteractiveObject)& anInteractive,
const Standard_Boolean AllowShapeDecomposition,
const Standard_Integer ActivationMode)
{
- if(myActiveObjects.IsBound(anInteractive)) return Standard_False;
+ if (myActiveObjects.IsBound (anInteractive))
+ {
+ if (anInteractive->HasSelection (ActivationMode))
+ {
+ const Handle(SelectMgr_Selection)& aSel = anInteractive->Selection (ActivationMode);
+ if (aSel->GetSelectionState() != SelectMgr_SOS_Activated)
+ {
+ if (!myMainVS->Contains (anInteractive))
+ {
+ mySM->Load (anInteractive, myMainVS);
+ }
+ mySM->Activate (anInteractive, ActivationMode, myMainVS);
+ return Standard_True;
+ }
+ }
+ return Standard_False;
+ }
+
Handle(AIS_LocalStatus) Att = new AIS_LocalStatus();
if(anInteractive->AcceptShapeDecomposition() && AllowShapeDecomposition)
@@ -296,8 +315,6 @@ Erase(const Handle(AIS_InteractiveObject)& anInteractive)
}
}
- UpdateSort();
-
ClearOutdatedSelection (anInteractive, Standard_True);
return status;
@@ -353,7 +370,6 @@ void AIS_LocalContext::Clear(const AIS_ClearMode aType)
case AIS_CM_TemporaryShapePrs:
ClearDetected();
}
- UpdateSort();
}
//=======================================================================
//function : ActivateMode
@@ -370,7 +386,6 @@ void AIS_LocalContext::ActivateMode(const Handle(AIS_InteractiveObject)& aSelect
myActiveObjects(aSelectable)->AddSelectionMode(aMode);
mySM->Activate(aSelectable,aMode,myMainVS);
}
- UpdateSort();
}
//=======================================================================
//function : ActivateMode
@@ -386,8 +401,6 @@ void AIS_LocalContext::DeactivateMode(const Handle(AIS_InteractiveObject)& aSele
myActiveObjects(aSelectable)->RemoveSelectionMode(aMode);
mySM->Deactivate(aSelectable,aMode,myMainVS);
- UpdateSort();
-
}
//=======================================================================
//function : ActivateMode
@@ -398,9 +411,8 @@ void AIS_LocalContext::Deactivate(const Handle(AIS_InteractiveObject)& aSelectab
{
if(!myActiveObjects.IsBound(aSelectable)) return;
- mySM->Deactivate(aSelectable,myMainVS);
+ mySM->Deactivate(aSelectable, -1, myMainVS);
myActiveObjects(aSelectable)->ClearSelectionModes();
- UpdateSort();
}
//=======================================================================
@@ -465,7 +477,6 @@ Standard_Boolean AIS_LocalContext::Remove(const Handle(AIS_InteractiveObject)& a
{
mySM->Remove (aSelectable);
}
- UpdateSort();
ClearOutdatedSelection (aSelectable, Standard_True);
// This should be done at the very end because most methods use
@@ -538,10 +549,8 @@ void AIS_LocalContext::DeactivateStandardMode(const TopAbs_ShapeEnum aType)
myListOfStandardMode.Remove(It);
if(myFilters->IsIn(myStdFilters[IMode]))
myFilters->Remove(myStdFilters[IMode]);
- UpdateSort();
return;
}
- UpdateSort();
}
//=======================================================================
@@ -588,31 +597,6 @@ void AIS_LocalContext::RemoveFilter(const Handle(SelectMgr_Filter)& aFilter)
}
}
-
-
-Standard_Boolean AIS_LocalContext::HasSameProjector(const Handle(Select3D_Projector)& thePrj) const
-{
- const Handle(Select3D_Projector)& aCurPrj = myMainVS->Projector();
- if (aCurPrj->Perspective() != thePrj->Perspective())
- return Standard_False;
- if (aCurPrj->Perspective() && aCurPrj->Focus() != thePrj->Focus())
- return Standard_False;
- const gp_GTrsf& aCurTrsf = aCurPrj->Transformation();
- const gp_GTrsf& aPrjTrsf = thePrj->Transformation();
-
- for (Standard_Integer i = 1; i <= 3; ++i)
- {
- for (Standard_Integer j = 1; j <= 3 ; ++j)
- {
- if (aCurTrsf.Value (i, j) != aPrjTrsf.Value (i, j))
- return Standard_False;
- }
- }
-
- return Standard_True;
-}
-
-
//=======================================================================
//function : Terminate
//purpose :
@@ -627,7 +611,6 @@ void AIS_LocalContext::Terminate (const Standard_Boolean theToUpdate)
mylastindex=0;
// clear the selector...
myMainVS->Clear();
- myCTX->SelectionManager()->Remove(myMainVS);
AIS_Selection::SetCurrentSelection(mySelName.ToCString());
@@ -650,7 +633,6 @@ void AIS_LocalContext::Terminate (const Standard_Boolean theToUpdate)
}
Handle(V3d_View) aDummyView;
- myMainVS->ClearAreas (aDummyView);
myMainVS->ClearSensitive (aDummyView);
if (theToUpdate)
@@ -893,12 +875,17 @@ void AIS_LocalContext::LoadContextObjects()
myCTX->DisplayedObjects(LL,Standard_True);
Handle(AIS_LocalStatus) Att;
for (It.Initialize(LL);It.More();It.Next()){
+ const Handle(AIS_InteractiveObject)& anObj = It.Value();
Att= new AIS_LocalStatus();
- Att->SetDecomposition((It.Value()->AcceptShapeDecomposition() && myAcceptStdMode));
+ Att->SetDecomposition((anObj->AcceptShapeDecomposition() && myAcceptStdMode));
Att->SetTemporary(Standard_False);
- Att->SetHilightMode(It.Value()->HasHilightMode()? It.Value()->HilightMode(): 0);
-
- myActiveObjects.Bind(It.Value(),Att);
+ Att->SetHilightMode(anObj->HasHilightMode()? anObj->HilightMode(): 0);
+ for (anObj->Init(); anObj->More(); anObj->Next())
+ {
+ const Handle(SelectMgr_Selection)& aSel = anObj->CurrentSelection();
+ aSel->SetSelectionState (SelectMgr_SOS_Deactivated);
+ }
+ myActiveObjects.Bind(anObj,Att);
}
}
}
@@ -922,17 +909,16 @@ void AIS_LocalContext::UnloadContextObjects()
//purpose :
//=======================================================================
-void AIS_LocalContext::Process(const Handle(SelectMgr_SelectableObject)& anObject,
- const Standard_Boolean WithProj)
+void AIS_LocalContext::Process(const Handle(SelectMgr_SelectableObject)& anObject)
{
if(!myActiveObjects.IsBound(anObject)) return;
if(myActiveObjects(anObject)->Decomposed())
- ActivateStandardModes(anObject,WithProj);
+ ActivateStandardModes(anObject);
else
{
TColStd_ListIteratorOfListOfInteger It(myActiveObjects(anObject)->SelectionModes());
for(;It.More();It.Next())
- myCTX->SelectionManager()->Activate(anObject,It.Value(),myMainVS,WithProj);
+ myCTX->SelectionManager()->Activate(anObject,It.Value(),myMainVS);
}
}
@@ -941,7 +927,7 @@ void AIS_LocalContext::Process(const Handle(SelectMgr_SelectableObject)& anObjec
//purpose :
//=======================================================================
-void AIS_LocalContext::Process(const Standard_Boolean WithProj)
+void AIS_LocalContext::Process()
{
myMainVS->Clear();
@@ -951,11 +937,11 @@ void AIS_LocalContext::Process(const Standard_Boolean WithProj)
for(;It.More();It.Next()){
myCTX->SelectionManager()->Load(It.Key(),myMainVS);
if(It.Value()->Decomposed())
- ActivateStandardModes(It.Key(),WithProj);
+ ActivateStandardModes(It.Key());
else if( myCTX->GetAutoActivateSelection() )
{
It.Value()->AddSelectionMode(0);
- myCTX->SelectionManager()->Activate(It.Key(),0,myMainVS,WithProj);
+ myCTX->SelectionManager()->Activate(It.Key(),0,myMainVS);
}
}
@@ -966,8 +952,7 @@ void AIS_LocalContext::Process(const Standard_Boolean WithProj)
//purpose :
//=======================================================================
-void AIS_LocalContext::ActivateStandardModes(const Handle(SelectMgr_SelectableObject)& anObject,
- const Standard_Boolean WithProj)
+void AIS_LocalContext::ActivateStandardModes(const Handle(SelectMgr_SelectableObject)& anObject)
{
if(!myActiveObjects.IsBound(anObject)) return;
@@ -976,7 +961,7 @@ void AIS_LocalContext::ActivateStandardModes(const Handle(SelectMgr_SelectableOb
const Handle(AIS_LocalStatus)& LS = myActiveObjects(anObject);
if(LS->Decomposed()){
for(;itl.More();itl.Next()){
- myCTX->SelectionManager()->Activate(anObject,itl.Value(),myMainVS,WithProj);
+ myCTX->SelectionManager()->Activate(anObject,itl.Value(),myMainVS);
LS->AddSelectionMode(itl.Value());
}
}
@@ -1023,13 +1008,13 @@ void AIS_LocalContext::ClearObjects()
myMainPM->Erase(SO,CurAtt->DisplayMode());
}
- TColStd_ListIteratorOfListOfInteger ITL(CurAtt->SelectionModes());
- for(;ITL.More();ITL.Next())
- mySM->Deactivate(SO,ITL.Value(),myMainVS);
-
- if(CurAtt->IsTemporary())
- mySM->Remove(SO,myMainVS);
-
+ TColStd_ListIteratorOfListOfInteger aSelModeIter (CurAtt->SelectionModes());
+ for ( ; aSelModeIter.More(); aSelModeIter.Next())
+ {
+ Standard_Integer aSelMode = aSelModeIter.Value();
+ mySM->Deactivate (SO, aSelMode, myMainVS);
+ }
+
}
ClearSelected( Standard_False );
myActiveObjects.Clear();
@@ -1082,16 +1067,6 @@ void AIS_LocalContext::ClearDetected()
}
}
-void AIS_LocalContext::UpdateConversion()
-{
- myMainVS->UpdateConversion();
-}
-
-void AIS_LocalContext::UpdateSort()
-{
- myMainVS->UpdateSort();
-}
-
//=======================================================================
//function : BeginImmediateDraw
//purpose :
@@ -1155,32 +1130,12 @@ Standard_Boolean AIS_LocalContext::IsImmediateModeOn() const
return myMainPM->IsImmediateModeOn();
}
-void AIS_LocalContext::SetSensitivityMode(const StdSelect_SensitivityMode aMode) {
-
- myMainVS->SetSensitivityMode(aMode);
-}
-
-StdSelect_SensitivityMode AIS_LocalContext::SensitivityMode() const {
-
- return myMainVS->SensitivityMode();
-}
-
-void AIS_LocalContext::SetSensitivity(const Standard_Real aPrecision) {
-
- myMainVS->SetSensitivity(aPrecision);
-}
-
-Standard_Real AIS_LocalContext::Sensitivity() const {
-
- return myMainVS->Sensitivity();
-}
-
-void AIS_LocalContext::SetPixelTolerance(const Standard_Integer aPrecision) {
+void AIS_LocalContext::SetPixelTolerance(const Standard_Real aPrecision) {
myMainVS->SetPixelTolerance(aPrecision);
}
-Standard_Integer AIS_LocalContext::PixelTolerance() const {
+Standard_Real AIS_LocalContext::PixelTolerance() const {
return myMainVS->PixelTolerance();
}
diff --git a/src/AIS/AIS_LocalContext_1.cxx b/src/AIS/AIS_LocalContext_1.cxx
index cbf86d849e..c5a9217bcf 100644
--- a/src/AIS/AIS_LocalContext_1.cxx
+++ b/src/AIS/AIS_LocalContext_1.cxx
@@ -31,12 +31,12 @@
#include
#include
#include
+#include
#include
#include
#include
#include
-#include
#include
#include
#include
@@ -855,7 +855,7 @@ void AIS_LocalContext::ClearOutdatedSelection (const Handle(AIS_InteractiveObjec
continue;
}
- if (toClearDeactivated && !mySM->IsActivated (theIO, myMainVS, aMode))
+ if (toClearDeactivated && !mySM->IsActivated(theIO, aMode, myMainVS))
{
continue;
}
@@ -863,7 +863,7 @@ void AIS_LocalContext::ClearOutdatedSelection (const Handle(AIS_InteractiveObjec
Handle(SelectMgr_Selection) aSelection = theIO->Selection(aMode);
for (aSelection->Init(); aSelection->More(); aSelection->Next())
{
- Handle(SelectBasics_SensitiveEntity) anEntity = aSelection->Sensitive();
+ Handle(SelectBasics_SensitiveEntity) anEntity = aSelection->Sensitive()->BaseSensitive();
if (anEntity.IsNull())
{
continue;
@@ -1012,7 +1012,7 @@ void AIS_LocalContext::SetSelected(const Handle(AIS_InteractiveObject)& anIObj,
const Handle(SelectMgr_Selection)& SIOBJ = anIObj->Selection(0);
SIOBJ->Init();
if(SIOBJ->More()){
- Handle(SelectBasics_EntityOwner) BO = SIOBJ->Sensitive()->OwnerId();
+ Handle(SelectBasics_EntityOwner) BO = SIOBJ->Sensitive()->BaseSensitive()->OwnerId();
EO = *((Handle(SelectMgr_EntityOwner)*)&BO);
}
}
@@ -1049,10 +1049,9 @@ void AIS_LocalContext::AddOrRemoveSelected(const Handle(AIS_InteractiveObject)&
{
const Handle(SelectMgr_Selection)& SIOBJ = anIObj->Selection(0);
SIOBJ->Init();
- if(SIOBJ->More())
- {
- Handle(SelectBasics_EntityOwner) BO = SIOBJ->Sensitive()->OwnerId();
- EO = *((Handle(SelectMgr_EntityOwner)*)&BO);
+ if(SIOBJ->More()){
+ Handle(SelectBasics_EntityOwner) BO = SIOBJ->Sensitive()->BaseSensitive()->OwnerId();
+ EO = *((Handle(SelectMgr_EntityOwner)*)&BO);
}
}
if(EO.IsNull())
@@ -1272,27 +1271,6 @@ Standard_Boolean AIS_LocalContext::ComesFromDecomposition(const Standard_Integer
return Standard_False;
}
-
-//=======================================================================
-//function : DisplayAreas
-//purpose :
-//=======================================================================
-
-void AIS_LocalContext::DisplayAreas(const Handle(V3d_View)& aviou)
-{
- myMainVS->DisplayAreas(aviou);
-}
-
-//=======================================================================
-//function : ClearAreas
-//purpose :
-//=======================================================================
-
-void AIS_LocalContext::ClearAreas(const Handle(V3d_View)& aviou)
-{
- myMainVS->ClearAreas(aviou);
-}
-
//=======================================================================
//function : DisplaySensitive
//purpose :
@@ -1475,9 +1453,9 @@ Handle(SelectMgr_EntityOwner) AIS_LocalContext::FindSelectedOwnerFromShape(const
Standard_Boolean found(Standard_False);
if (!found) {
- SelectMgr_DataMapIteratorOfDataMapOfIntegerSensitive aSensitiveIt (myMainVS->Primitives());
- for (; aSensitiveIt.More(); aSensitiveIt.Next()) {
- EO = Handle(SelectMgr_EntityOwner)::DownCast (aSensitiveIt.Value()->OwnerId());
+ NCollection_List::Iterator anOwnersIt (myMainVS->ActiveOwners());
+ for (; anOwnersIt.More(); anOwnersIt.Next()) {
+ EO = Handle(SelectMgr_EntityOwner)::DownCast (anOwnersIt.Value());
Handle(StdSelect_BRepOwner) BROwnr = Handle(StdSelect_BRepOwner)::DownCast(EO);
if (!BROwnr.IsNull() && BROwnr->HasShape() && BROwnr->Shape() == sh) {
found = Standard_True;
diff --git a/src/AIS/AIS_MaxRadiusDimension.cxx b/src/AIS/AIS_MaxRadiusDimension.cxx
index 6ef3c3a205..695ec44660 100644
--- a/src/AIS/AIS_MaxRadiusDimension.cxx
+++ b/src/AIS/AIS_MaxRadiusDimension.cxx
@@ -30,6 +30,7 @@
#include
#include
#include
+#include
#include
#include
diff --git a/src/AIS/AIS_MidPointRelation.cxx b/src/AIS/AIS_MidPointRelation.cxx
index 8ec70b4e01..f17c0cfad3 100644
--- a/src/AIS/AIS_MidPointRelation.cxx
+++ b/src/AIS/AIS_MidPointRelation.cxx
@@ -38,6 +38,7 @@
#include
#include
+#include
#include
#include
diff --git a/src/AIS/AIS_MinRadiusDimension.cxx b/src/AIS/AIS_MinRadiusDimension.cxx
index 39f8426cc3..861f2d0549 100644
--- a/src/AIS/AIS_MinRadiusDimension.cxx
+++ b/src/AIS/AIS_MinRadiusDimension.cxx
@@ -31,6 +31,7 @@
#include
#include
#include
+#include
#include
#include
diff --git a/src/AIS/AIS_MultipleConnectedInteractive.cxx b/src/AIS/AIS_MultipleConnectedInteractive.cxx
index 4cde3df6d6..82ac598c1e 100644
--- a/src/AIS/AIS_MultipleConnectedInteractive.cxx
+++ b/src/AIS/AIS_MultipleConnectedInteractive.cxx
@@ -159,6 +159,7 @@ AIS_MultipleConnectedInteractive::AIS_MultipleConnectedInteractive()
: AIS_InteractiveObject (PrsMgr_TOP_AllView)
{
myHasOwnPresentations = Standard_False;
+ myAssemblyOwner = NULL;
SetHilightMode (0);
}
@@ -189,12 +190,16 @@ Handle(AIS_InteractiveObject) AIS_MultipleConnectedInteractive::Connect (const H
const Graphic3d_TransModeFlags& theTrsfPersFlag,
const gp_Pnt& theTrsfPersPoint)
{
+ if (myAssemblyOwner.IsNull())
+ myAssemblyOwner = new SelectMgr_EntityOwner (this);
+
Handle(AIS_InteractiveObject) anObjectToAdd;
Handle(AIS_MultipleConnectedInteractive) aMultiConnected = Handle(AIS_MultipleConnectedInteractive)::DownCast (theAnotherObj);
if (!aMultiConnected.IsNull())
{
Handle(AIS_MultipleConnectedInteractive) aNewMultiConnected = new AIS_MultipleConnectedInteractive();
+ aNewMultiConnected->myAssemblyOwner = myAssemblyOwner;
aNewMultiConnected->SetLocalTransformation (aMultiConnected->LocalTransformation());
// Perform deep copy of instance tree
@@ -357,7 +362,7 @@ Standard_Boolean AIS_MultipleConnectedInteractive::AcceptShapeDecomposition() co
//function : ComputeSelection
//purpose :
//=======================================================================
-void AIS_MultipleConnectedInteractive::ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
+void AIS_MultipleConnectedInteractive::ComputeSelection (const Handle(SelectMgr_Selection)& /*theSelection*/,
const Standard_Integer theMode)
{
if (theMode != 0)
@@ -370,67 +375,13 @@ void AIS_MultipleConnectedInteractive::ComputeSelection (const Handle(SelectMgr_
continue;
}
- if (!aChild->HasSelection(theMode))
+ if (!aChild->HasSelection (theMode))
{
- aChild->UpdateSelection(theMode);
+ aChild->RecomputePrimitives (theMode);
}
- aChild->ComputeSelection (theSelection, theMode);
- }
-
- return;
- }
-
- for (PrsMgr_ListOfPresentableObjectsIter anIter (Children()); anIter.More(); anIter.Next())
- {
- Handle(AIS_InteractiveObject) aChild = Handle(AIS_InteractiveObject)::DownCast (anIter.Value());
- if (aChild.IsNull())
- {
- continue;
- }
-
- if (!aChild->HasSelection (theMode))
- {
- aChild->UpdateSelection (theMode);
- }
-
- const Handle(SelectMgr_Selection)& TheRefSel = aChild->Selection (theMode);
-
- // To redirect selection we must replace owners in sensitives, but we don't want new owner for each SE.
- // Only for each existing owner.
- NCollection_DataMap anOwnerMap;
-
- Handle(Select3D_SensitiveEntity) aSensitive, aNewSensitive;
-
- if (TheRefSel->IsEmpty())
- {
- aChild->UpdateSelection(theMode);
- }
-
- for (TheRefSel->Init(); TheRefSel->More(); TheRefSel->Next())
- {
- aSensitive = Handle(Select3D_SensitiveEntity)::DownCast(TheRefSel->Sensitive());
-
- if (!aSensitive.IsNull())
- {
- TopLoc_Location aLocation (Transformation());
- // Get the copy of aSensitive
- aNewSensitive = aSensitive->GetConnected (aLocation);
- Handle(SelectMgr_EntityOwner) anOwner = Handle(SelectMgr_EntityOwner)::DownCast (aNewSensitive->OwnerId());
-
- if (!anOwnerMap.IsBound (anOwner))
- {
- Handle(SelectMgr_EntityOwner) aNewOwner = new SelectMgr_AssemblyEntityOwner (anOwner, this);
- anOwnerMap.Bind (anOwner, aNewOwner);
- }
-
- aNewSensitive->Set (anOwnerMap.Find (anOwner));
- // In case if aSensitive caches some location-dependent data
- // that must be updated after setting OWN
- aNewSensitive->SetLocation (aLocation);
-
- theSelection->Add (aNewSensitive);
- }
+ Handle(SelectMgr_Selection) aSelection = new SelectMgr_Selection (theMode);
+ aChild->ComputeSelection (aSelection, theMode);
}
}
}
diff --git a/src/AIS/AIS_OffsetDimension.cxx b/src/AIS/AIS_OffsetDimension.cxx
index a799327d71..376bf99a93 100644
--- a/src/AIS/AIS_OffsetDimension.cxx
+++ b/src/AIS/AIS_OffsetDimension.cxx
@@ -35,6 +35,7 @@
#include
#include
#include
+#include
#include
#include
#include
diff --git a/src/AIS/AIS_ParallelRelation.cxx b/src/AIS/AIS_ParallelRelation.cxx
index 7b47bb2f51..0a9fbe7fd0 100644
--- a/src/AIS/AIS_ParallelRelation.cxx
+++ b/src/AIS/AIS_ParallelRelation.cxx
@@ -33,6 +33,7 @@
#include
#include
+#include
#include
#include
diff --git a/src/AIS/AIS_PerpendicularRelation.cxx b/src/AIS/AIS_PerpendicularRelation.cxx
index 5ef137afc9..d964b2f147 100644
--- a/src/AIS/AIS_PerpendicularRelation.cxx
+++ b/src/AIS/AIS_PerpendicularRelation.cxx
@@ -41,6 +41,7 @@
#include
#include
+#include
#include
#include
diff --git a/src/AIS/AIS_Plane.lxx b/src/AIS/AIS_Plane.lxx
index 8d955d4afe..90df73229e 100644
--- a/src/AIS/AIS_Plane.lxx
+++ b/src/AIS/AIS_Plane.lxx
@@ -50,7 +50,7 @@ inline Select3D_TypeOfSensitivity AIS_Plane::TypeOfSensitivity() const
return myTypeOfSensitivity;
}
-inline void AIS_Plane::SetTypeOfSensitivity (const Select3D_TypeOfSensitivity theTypeOfSensitivity)
+inline void AIS_Plane::SetTypeOfSensitivity (const Select3D_TypeOfSensitivity& theTypeOfSensitivity)
{
myTypeOfSensitivity = theTypeOfSensitivity;
}
diff --git a/src/AIS/AIS_PlaneTrihedron.cxx b/src/AIS/AIS_PlaneTrihedron.cxx
index dfc50e87e3..b9b57955f7 100644
--- a/src/AIS/AIS_PlaneTrihedron.cxx
+++ b/src/AIS/AIS_PlaneTrihedron.cxx
@@ -26,6 +26,7 @@
#include
#include
+#include
#include
#include
#include
diff --git a/src/AIS/AIS_SymmetricRelation.cxx b/src/AIS/AIS_SymmetricRelation.cxx
index dc822b5e52..0f51dce1bb 100644
--- a/src/AIS/AIS_SymmetricRelation.cxx
+++ b/src/AIS/AIS_SymmetricRelation.cxx
@@ -21,6 +21,7 @@
#include
#include
+#include
#include
#include
#include
diff --git a/src/AIS/AIS_TangentRelation.cxx b/src/AIS/AIS_TangentRelation.cxx
index a86fa6a512..e6565331aa 100644
--- a/src/AIS/AIS_TangentRelation.cxx
+++ b/src/AIS/AIS_TangentRelation.cxx
@@ -21,6 +21,7 @@
#include
#include
+#include
#include
#include
diff --git a/src/BVH/BVH_BinnedBuilder.hxx b/src/BVH/BVH_BinnedBuilder.hxx
index 06a32286f7..ee2c4474e1 100644
--- a/src/BVH/BVH_BinnedBuilder.hxx
+++ b/src/BVH/BVH_BinnedBuilder.hxx
@@ -45,7 +45,8 @@ public:
//! Creates binned SAH BVH builder.
BVH_BinnedBuilder (const Standard_Integer theLeafNodeSize = 5,
- const Standard_Integer theMaxTreeDepth = 32);
+ const Standard_Integer theMaxTreeDepth = 32,
+ const Standard_Boolean theToUseMainAxis = Standard_False);
//! Releases resources of binned SAH BVH builder.
virtual ~BVH_BinnedBuilder();
@@ -64,6 +65,10 @@ protected:
BVH_BinVector& theBins,
const Standard_Integer theAxis);
+private:
+
+ Standard_Boolean myUseMainAxis; //!< Defines whether to search for the best split or use the widest axis
+
};
#include
diff --git a/src/BVH/BVH_BinnedBuilder.lxx b/src/BVH/BVH_BinnedBuilder.lxx
index 7ad8c22e5f..9ab554b509 100644
--- a/src/BVH/BVH_BinnedBuilder.lxx
+++ b/src/BVH/BVH_BinnedBuilder.lxx
@@ -19,9 +19,11 @@
// =======================================================================
template
BVH_BinnedBuilder::BVH_BinnedBuilder (const Standard_Integer theLeafNodeSize,
- const Standard_Integer theMaxTreeDepth)
+ const Standard_Integer theMaxTreeDepth,
+ const Standard_Boolean theToUseMainAxis)
: BVH_QueueBuilder