if( theMode== BATH_HIGHLIGHT_MODE ) // highlight ==> draw bounding box
{
AIS_PointCloud::Compute( thePresentationManager, thePresentation, AIS_PointCloud::DM_BndBox );
-// if( myBound.IsVoid() )
-// UpdateBound();
-//
-// if( myBound.IsVoid() ||
-// myBound.IsOpenXmin() || myBound.IsOpenXmax() ||
-// myBound.IsOpenYmin() || myBound.IsOpenYmax() ||
-// myBound.IsOpenZmin() || myBound.IsOpenZmax() )
-// return;
-//
-// Standard_Real xmin, xmax, ymin, ymax, zmin, zmax;
-// myBound.Get( xmin, ymin, zmin, xmax, ymax, zmax );
-//
-// Handle(Prs3d_LineAspect) aWireAspect = new Prs3d_LineAspect( Quantity_NOC_RED, Aspect_TOL_DASH, 4.0 );
-// aGroup->SetPrimitivesAspect( aWireAspect->Aspect() ); // use Aspect_TOL_DASH to find the group by the aspect style
-//
-// Handle(Graphic3d_ArrayOfPolylines) aLines = new Graphic3d_ArrayOfPolylines( 18, 6 );
-//
-// aLines->AddBound( 5 );
-// aLines->AddVertex( xmin, ymin, zmin );
-// aLines->AddVertex( xmax, ymin, zmin );
-// aLines->AddVertex( xmax, ymax, zmin );
-// aLines->AddVertex( xmin, ymax, zmin );
-// aLines->AddVertex( xmin, ymin, zmin );
-// aLines->AddBound( 5 );
-// aLines->AddVertex( xmin, ymin, zmax );
-// aLines->AddVertex( xmax, ymin, zmax );
-// aLines->AddVertex( xmax, ymax, zmax );
-// aLines->AddVertex( xmin, ymax, zmax );
-// aLines->AddVertex( xmin, ymin, zmax );
-// aLines->AddBound( 2 );
-// aLines->AddVertex( xmin, ymin, zmin );
-// aLines->AddVertex( xmin, ymin, zmax );
-// aLines->AddBound( 2 );
-// aLines->AddVertex( xmax, ymin, zmin );
-// aLines->AddVertex( xmax, ymin, zmax );
-// aLines->AddBound( 2 );
-// aLines->AddVertex( xmax, ymax, zmin );
-// aLines->AddVertex( xmax, ymax, zmax );
-// aLines->AddBound( 2 );
-// aLines->AddVertex( xmin, ymax, zmin );
-// aLines->AddVertex( xmin, ymax, zmax );
-// aGroup->AddPrimitiveArray( aLines );
}
else if (theMode == 0)
{
}
}
-// if( theMode == 0 )
-// {
-// if( myBound.IsVoid() )
-// UpdateBound();
-//
-// if( myBound.IsVoid() ||
-// myBound.IsOpenXmin() || myBound.IsOpenXmax() ||
-// myBound.IsOpenYmin() || myBound.IsOpenYmax() ||
-// myBound.IsOpenZmin() || myBound.IsOpenZmax() )
-// return;
-//
-// Handle(SelectMgr_EntityOwner) anOwner = new SelectMgr_EntityOwner( this );
-// Handle(Select3D_SensitiveBox) aSensitiveBox = new Select3D_SensitiveBox( anOwner, myBound );
-// theSelection->Add( aSensitiveBox );
-// }
if( theMode == 1 )
{
Handle(Graphic3d_ArrayOfPoints) points = GetPoints();
if (anOwner.IsNull())
return;
DEBTRACE("---"); // jamais appelé : on n'a pas de AIS_PointCloudOwner
-
-// Handle(Prs3d_Presentation) aHilightPrs = GetHilightPresentation( thePM );
-// aHilightPrs->SetZLayer( Graphic3d_ZLayerId_Topmost );
-// aHilightPrs->Clear();
-// Handle(Graphic3d_ArrayOfPoints) points = new Graphic3d_ArrayOfPoints( 1 );
-// AddPoint( points, theOwner );
-//
-// Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup( aHilightPrs );
-// Handle(Graphic3d_AspectMarker3d) anAspect = new Graphic3d_AspectMarker3d( Aspect_TOM_X, Quantity_NOC_WHITE, 1.0 );
-// aGroup->SetGroupPrimitivesAspect( anAspect );
-// aGroup->AddPrimitiveArray( points );
-//
-// if( thePM->IsImmediateModeOn() )
-// thePM->AddToImmediateList( aHilightPrs );
}
void HYDROGUI_BathymetryPrs::HilightSelected( const Handle(PrsMgr_PresentationManager3d)& thePM,
}
-
-
-
-
-
HYDROGUI_BathymetryPointOwner::HYDROGUI_BathymetryPointOwner
( const Handle(HYDROGUI_BathymetryPrs)& theBathymetry, int theIndex )
: SelectMgr_EntityOwner( Handle(SelectMgr_SelectableObject)::DownCast( theBathymetry ), 0 ),
QList<Handle(HYDROGUI_BathymetryPrs)> baths = getShownBathymetries( module() );
if( isActive )
{
-// QList<SUIT_Selector*> aSelectorList;
-// QString aViewType = OCCViewer_Viewer::Type();
-// LightApp_SelectionMgr* aSelectionMgr = module()->getApp()->selectionMgr();
-// aSelectionMgr->selectors(aViewType, aSelectorList);
-// QList<SUIT_Selector*>::iterator anIter, anIterEnd = aSelectorList.end();
-// for( anIter = aSelectorList.begin(); anIter != anIterEnd; anIter++ )
-// {
-// SUIT_Selector* aSelector = *anIter;
-// aSelector->setEnabled( false );
-// }
-
const int aSelectionMode = 1; // Cf. AIS_PointCloud 0=selection by points ?
- //ctx->Deactivate( Standard_True );
- //ctx->OpenLocalContext( Standard_True );
foreach( Handle(HYDROGUI_BathymetryPrs) bath, baths )
{
DEBTRACE("bathy name: " << bath->GetShape()->getObject()->GetName().toStdString());
ctx->Deactivate(bath);
ctx->RemoveFilters();
- //ctx->Activate( bath, aSelectionMode, Standard_True );
ctx->SetSelectionModeActive (bath, aSelectionMode, Standard_True, AIS_SelectionModesConcurrency_Multiple, Standard_False);
- //ctx->SetSelectionModeActive (bath, 0, Standard_True, AIS_SelectionModesConcurrency_Multiple, Standard_False);
bath->SetAutoHilight( Standard_False ); // True bloque le passage dans hilightSelected...
-// DEBTRACE("immediateMode: " << ctx->MainPrsMgr()->IsImmediateModeOn());
-// if (!ctx->MainPrsMgr()->IsImmediateModeOn())
-// ctx->MainPrsMgr()->BeginImmediateDraw();
}
ctx->UpdateCurrentViewer();
}
ctx->Deactivate( bath );
ctx->SetSelectionModeActive (bath, 2, Standard_True, AIS_SelectionModesConcurrency_Multiple, Standard_False);
}
- //ctx->CloseLocalContext( -1, Standard_True );
}
myIsActive = isActive;
if ( !myAISLineM.IsNull() )
{
-// if ( aCtx->HasOpenedContext() )
-// aCtx->CloseLocalContext();
aCtx->Erase( myAISLineM, Standard_False );
}
}
aCtx->SetZLayer(myAISLineM, Graphic3d_ZLayerId_Topmost);
-// if ( aCtx->HasOpenedContext() )
-// aCtx->CloseLocalContext();
aCtx->Display( myAISLineM, Standard_False );
aCtx->UpdateCurrentViewer();
}
Handle(AIS_InteractiveContext) aCtx = aViewer->getAISContext();
if ( !aCtx.IsNull() )
{
-// if ( aCtx->HasOpenedContext() )
-// aCtx->CloseLocalContext();
aCtx->Erase( myAISLineM, Standard_False );
}
myAISLineM.Nullify();
void HYDROGUI_Module::createSelector( SUIT_ViewManager* theViewManager )
{
- DEBTRACE("HYDROGUI_Module::createSelector ====================================");
+ DEBTRACE("HYDROGUI_Module::createSelector");
if( !theViewManager )
return;
for( anIter = aSelectorList.begin(); anIter != anIterEnd; anIter++ )
{
SUIT_Selector* aSelector = *anIter;
-// if( aSelector && ( !dynamic_cast<HYDROGUI_GVSelector*>( aSelector ) &&
-// !dynamic_cast<SVTK_Selector*>( aSelector ) &&
-// !dynamic_cast<HYDROGUI_OCCSelector*>( aSelector ) ) )
bool isOk = false;
if (aSelector)
{
}
}
- //if ( theToDisplay && isVisible() && !myContext.IsNull() )
- // displayShape( false );
}
else if ( myObject->IsKind( STANDARD_TYPE(HYDROData_Polyline3D) ) )
{
void HYDROGUI_Shape::displayShape( const bool theIsUpdateViewer )
{
DEBTRACE("displayShape " << theIsUpdateViewer << " " << mySelectionMode << " AIScontext " << myContext.get());
-// if ( myContext->HasOpenedContext() && mySelectionMode > 0 )
-// myContext->CloseLocalContext();
foreach( Handle(AIS_InteractiveObject) aShape, myShapes )
{
if ( mySelectionMode >= 0 )
- // Display object in local context with selection
- //myContext->Display( aShape, myDisplayMode, mySelectionMode, Standard_False, Standard_False );
+ // Display object with selection
myContext->Display( aShape, Standard_False );
else
{
-// if ( !myContext->HasOpenedContext() )
-// Ordinary display of object published in the Object Browser
-// myContext->Display( aShape, Standard_False );
-// else
- // Display object in local context without selection
+ // Display object without selection
myContext->Display( aShape, myDisplayMode, -1, Standard_False, Standard_False );
}
}
if ( mySelectionMode >= 0 )
{
- //myContext->Deactivate(); //OpenLocalContext();
foreach( Handle(AIS_InteractiveObject) aShape, myShapes )
myContext->Activate( aShape, mySelectionMode, Standard_True );
}
void HYDROGUI_Shape::eraseShape( const bool theIsUpdateViewer )
{
-// if ( myContext->HasOpenedContext() && mySelectionMode > 0 )
-// myContext->CloseLocalContext();
-
foreach( Handle(AIS_InteractiveObject) aShape, myShapes )
myContext->Erase( aShape, Standard_False );
QVector<int> selected;
// HYDROGUI_BathymetryPrs::ClearSelected() called before: Nothing left...
-// selected.reserve( myCoords->Size() );
-//
-// Handle(AIS_InteractiveObject) obj = getAISObjects().first();
-//
-// Handle(AIS_InteractiveContext) c = getContext();
-// int cnt = 0;
-// if( !c.IsNull() )
-// {
-// for( c->InitSelected(); c->MoreSelected(); c->NextSelected() )
-// {
-// cnt++;
-// Handle(HYDROGUI_BathymetryPointOwner) anOwner =
-// Handle(HYDROGUI_BathymetryPointOwner)::DownCast( c->SelectedOwner() );
-// if( !anOwner.IsNull() && anOwner->Selectable()==obj )
-// selected.append( anOwner->GetIndex() );
-// }
-// }
-// DEBTRACE("selected " << cnt << " " << selected.size() );
Handle(HYDROGUI_BathymetryPrs) aPntCloud = Handle(HYDROGUI_BathymetryPrs)::DownCast( getAISObjects()[0] );
if (!aPntCloud.IsNull())
if( !getAISObjects().isEmpty() )
{
getContext()->RecomputePrsOnly( getAISObjects()[0], true );
- //getAISObjects()[0]->Redisplay();
-}
+ }
}
void HYDROGUI_ShapeBathymetry::RescaleDefault()
selection = selected();
- //getContext()->ClearSelected(true);
prs->SetTextLabels( selection );
getContext()->RecomputePrsOnly( prs, Standard_False, Standard_False );
- //prs->Redisplay();
if( isUpdateCurrentViewer )
getContext()->UpdateCurrentViewer();
}
if ( mySplitPointPreview )
{
-// if ( aCtx->HasOpenedContext() )
-// aCtx->CloseLocalContext();
if ( aPanel->GetMode() == HYDROGUI_SplitPolylinesDlg::ByPoint )
{
if ( !aCtx->IsDisplayed( mySplitPointPreview ) )
if ( mySplitPointPreview )
{
-// if ( aCtx->HasOpenedContext() )
-// aCtx->CloseLocalContext();
aCtx->Erase( mySplitPointPreview, Standard_False );
}
mySplitPointPreview = new AIS_Shape( aShape );
-// if ( aCtx->HasOpenedContext() )
-// aCtx->CloseLocalContext();
aCtx->Display( mySplitPointPreview, Standard_False );
aCtx->UpdateCurrentViewer();
void TestViewer::eraseAll( bool isUpdate, bool eraseStructures )
{
- //context()->CloseLocalContext( -1, Standard_False );
context()->EraseAll( isUpdate );
if( eraseStructures )
{