// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-// Modified by XAB & Serguei Dec 97 (angle &deviation coeffts)
-
#include <AIS_ConnectedInteractive.hxx>
+
#include <AIS_DataMapIteratorOfDataMapOfILC.hxx>
#include <AIS_DataMapIteratorOfDataMapOfIOStatus.hxx>
#include <AIS_GlobalStatus.hxx>
#include <V3d_View.hxx>
#include <V3d_Viewer.hxx>
-IMPLEMENT_STANDARD_RTTIEXT(AIS_InteractiveContext,MMgt_TShared)
+IMPLEMENT_STANDARD_RTTIEXT(AIS_InteractiveContext, Standard_Transient)
-//#include <AIS_DataMapIteratorOfDataMapOfInteractiveInteger.hxx>
namespace
{
typedef NCollection_DataMap<Handle(SelectMgr_SelectableObject), Handle(SelectMgr_IndexedMapOfOwner)> AIS_MapOfObjectOwners;
InitAttributes();
}
-void AIS_InteractiveContext::Delete() const
+//=======================================================================
+//function : ~AIS_InteractiveContext
+//purpose :
+//=======================================================================
+AIS_InteractiveContext::~AIS_InteractiveContext()
{
// clear the current selection
mySelection->Clear();
anObj->CurrentSelection()->UpdateBVHStatus (SelectMgr_TBU_Renew);
}
}
- MMgt_TShared::Delete();
}
//=======================================================================
return;
}
- if (!theIObj->HasInteractiveContext())
- {
- theIObj->SetContext (this);
- }
-
+ setContextToObject (theIObj);
if (theDispStatus == AIS_DS_Temporary
&& !HasOpenedContext())
{
return;
}
- if (!theIObj->HasInteractiveContext())
- {
- theIObj->SetContext (this);
- }
-
+ setContextToObject (theIObj);
if (HasOpenedContext())
{
myLocalContexts (myCurLocalIndex)->Load (theIObj, theToAllowDecomposition, theSelMode);
return;
}
+ if (theIObj->HasInteractiveContext())
+ {
+ if (theIObj->myCTXPtr != this)
+ {
+ Standard_ProgramError::Raise ("AIS_InteractiveContext - object has been displayed in another context!");
+ }
+ theIObj->SetContext (Handle(AIS_InteractiveContext)());
+ }
+
if (HasOpenedContext())
{
myLocalContexts (myCurLocalIndex)->Remove (theIObj);
if (theObj.IsNull())
return;
- if (!theObj->HasInteractiveContext())
- theObj->SetContext (this);
-
+ setContextToObject (theObj);
if (!HasOpenedContext())
{
if (!myObjects.IsBound (theObj))
return;
}
- if (!theIObj->HasInteractiveContext())
- {
- theIObj->SetContext (this);
- }
-
+ setContextToObject (theIObj);
if (myObjects.IsBound (theIObj))
{
Handle(AIS_GlobalStatus) aStatus = myObjects (theIObj);
const Standard_Integer theMode,
const Standard_Boolean theToUpdateViewer)
{
- if (!theIObj->HasInteractiveContext())
- {
- theIObj->SetContext(this);
- }
-
+ setContextToObject (theIObj);
if (!myObjects.IsBound (theIObj))
{
theIObj->SetDisplayMode (theMode);
return;
}
- if (!theIObj->HasInteractiveContext())
- {
- theIObj->SetContext (this);
- }
+ setContextToObject (theIObj);
theIObj->SetColor (theColor);
redisplayPrsRecModes (theIObj, theToUpdateViewer);
}
return;
}
- if (!theIObj->HasInteractiveContext())
- {
- theIObj->SetContext (this);
- }
-
// to be modified after the related methods of AIS_Shape are passed to InteractiveObject
+ setContextToObject (theIObj);
if (theIObj->Type() != AIS_KOI_Object
&& theIObj->Type() != AIS_KOI_Shape)
{
return;
}
- if (!theIObj->HasInteractiveContext())
- {
- theIObj->SetContext (this);
- }
-
// To be modified after the related methods of AIS_Shape are passed to InteractiveObject
+ setContextToObject (theIObj);
if (theIObj->Type() != AIS_KOI_Object
&& theIObj->Type() != AIS_KOI_Shape)
{
return;
}
- if (!theIObj->HasInteractiveContext())
- {
- theIObj->SetContext (this);
- }
-
// To be modified after the related methods of AIS_Shape are passed to InteractiveObject
+ setContextToObject (theIObj);
if (theIObj->Type() != AIS_KOI_Shape)
{
return;
return;
}
- if (!theIObj->HasInteractiveContext())
- {
- theIObj->SetContext (this);
- }
-
// To be modified after the related methods of AIS_Shape are passed to InteractiveObject
+ setContextToObject (theIObj);
if (theIObj->Type() != AIS_KOI_Shape)
{
return;
return;
}
- if (!theIObj->HasInteractiveContext())
- {
- theIObj->SetContext (this);
- }
-
// To be modified after the related methods of AIS_Shape are passed to InteractiveObject
+ setContextToObject (theIObj);
if (theIObj->Type() != AIS_KOI_Shape)
{
return;
return;
}
- if (!theIObj->HasInteractiveContext())
- {
- theIObj->SetContext (this);
- }
-
// To be modified after the related methods of AIS_Shape are passed to InteractiveObject
+ setContextToObject (theIObj);
if (theIObj->Type() != AIS_KOI_Shape)
{
return;
return;
}
- if (!theIObj->HasInteractiveContext())
- {
- theIObj->SetContext (this);
- }
-
+ setContextToObject (theIObj);
theIObj->SetWidth (theWidth);
redisplayPrsRecModes (theIObj, theToUpdateViewer);
if (!myLastinMain.IsNull() && myLastinMain->IsSameSelectable (theIObj))
return;
}
- if (!theIObj->HasInteractiveContext())
- {
- theIObj->SetContext (this);
- }
-
+ setContextToObject (theIObj);
theIObj->SetMaterial (theName);
redisplayPrsRecModes (theIObj, theToUpdateViewer);
}
return;
}
- if (!theIObj->HasInteractiveContext())
- {
- theIObj->SetContext (this);
- }
-
+ setContextToObject (theIObj);
if (!theIObj->IsTransparent()
&& theValue <= 0.05)
{
return;
}
- if (!theIObj->HasInteractiveContext())
- {
- theIObj->SetContext (this);
- }
-
+ setContextToObject (theIObj);
theIObj->SetAttributes (theDrawer);
Update (theIObj, theToUpdateViewer);
}
return;
}
- if (!theIObj->HasInteractiveContext())
- {
- theIObj->SetContext (this);
- }
+ setContextToObject (theIObj);
theIObj->UnsetAttributes();
Update (theIObj, theToUpdateViewer);
}