#include "SOCC_ViewModel.h"
#include "SOCC_Prs.h"
+#include "SOCC_ViewWindow.h"
#include "SUIT_Session.h"
#include "SUIT_Application.h"
#include "SALOMEDSClient.hxx"
#include "SALOMEDS_StudyManager.hxx"
+#include <AIS_TypeOfIso.hxx>
+
// in order NOT TO link with SalomeApp, here the code returns SALOMEDS_Study.
// SalomeApp_Study::studyDS() does it as well, but -- here it is retrieved from
// SALOMEDS::StudyManager - no linkage with SalomeApp.
//=======================================================================
void SOCC_Viewer::LocalSelection( const SALOME_OCCPrs* thePrs, const int theMode )
{
- Handle(AIS_InteractiveContext) anIC = getAISContext();
+ Handle(AIS_InteractiveContext) ic = getAISContext();
const SOCC_Prs* anOCCPrs = dynamic_cast<const SOCC_Prs*>( thePrs );
- if ( anIC.IsNull() )
+ if ( ic.IsNull() )
return;
// Open local context if there is no one
bool allObjects = thePrs == 0 || thePrs->IsNull();
- if ( !anIC->HasOpenedContext() ) {
- anIC->ClearCurrents( false );
- anIC->OpenLocalContext( allObjects, true, true );
+ if ( !ic->HasOpenedContext() ) {
+ ic->ClearCurrents( false );
+ ic->OpenLocalContext( allObjects, true, true );
}
AIS_ListOfInteractive anObjs;
// Get objects to be activated
if ( allObjects )
- anIC->DisplayedObjects( anObjs );
+ ic->DisplayedObjects( anObjs );
else
anOCCPrs->GetObjects( anObjs );
{
if ( anAIS->IsKind( STANDARD_TYPE( AIS_Shape ) ) )
{
- anIC->Load( anAIS, -1, false );
- anIC->Activate( anAIS, AIS_Shape::SelectionMode( (TopAbs_ShapeEnum)theMode ) );
+ ic->Load( anAIS, -1, false );
+ ic->Activate( anAIS, AIS_Shape::SelectionMode( (TopAbs_ShapeEnum)theMode ) );
}
else if ( anAIS->DynamicType() != STANDARD_TYPE(AIS_Trihedron) )
{
- anIC->Load( anAIS, -1, false );
- anIC->Activate( anAIS, theMode );
+ ic->Load( anAIS, -1, false );
+ ic->Activate( anAIS, theMode );
}
}
}
//=======================================================================
void SOCC_Viewer::GlobalSelection( const bool update ) const
{
- Handle(AIS_InteractiveContext) anIC = getAISContext();
- if ( !anIC.IsNull() )
- anIC->CloseAllContexts( false );
- if ( update )
- anIC->CurrentViewer()->Redraw();
+ Handle(AIS_InteractiveContext) ic = getAISContext();
+ if ( !ic.IsNull() )
+ {
+ ic->CloseAllContexts( false );
+ if ( update )
+ ic->CurrentViewer()->Redraw();
+ }
}
//=======================================================================
if ( aMaxSide < Ymax -Ymin ) aMaxSide = Ymax -Ymin;
if ( aMaxSide < Zmax -Zmin ) aMaxSide = Zmax -Zmin;
- float aSizeInPercents = SUIT_Session::session()->resourceMgr()->doubleValue("Viewer:TrihedronSize", 105.);
+ float aSizeInPercents = SUIT_Session::session()->resourceMgr()->doubleValue("Viewer","TrihedronSize", 105.);
static float EPS = 5.0E-3;
theSize = getTrihedron()->Size();
getViewer3d()->Update();
}
+//=======================================================================
+// name : createView
+// Purpose : create SOCC_ViewWindow
+//=======================================================================
+SUIT_ViewWindow* SOCC_Viewer::createView( SUIT_Desktop* theDesktop )
+{
+ SOCC_ViewWindow* view = new SOCC_ViewWindow(theDesktop, this);
+ initView( view );
+ return view;
+}