mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-27 21:20:34 +05:00
Porting to DEV version of OpenCASCADE.
This commit is contained in:
parent
01cd54d814
commit
7e333dca6e
@ -144,9 +144,9 @@ bool BasicGUI::OnMousePress( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWin
|
||||
|
||||
ic->InitSelected();
|
||||
if ( pe->modifiers() == Qt::ShiftModifier )
|
||||
ic->ShiftSelect(); // Append selection
|
||||
ic->ShiftSelect( Standard_True ); // Append selection
|
||||
else
|
||||
ic->Select(); // New selection
|
||||
ic->Select( Standard_True ); // New selection
|
||||
|
||||
ic->InitSelected();
|
||||
if ( ic->MoreSelected() ) {
|
||||
|
@ -687,7 +687,7 @@ void CurveCreator_Utils::setLocalPointContext( const CurveCreator_ICurve* theCur
|
||||
}
|
||||
else {
|
||||
if ( theContext->HasOpenedContext() )
|
||||
theContext->CloseAllContexts();
|
||||
theContext->CloseAllContexts( Standard_True );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1090,7 +1090,7 @@ void CurveCreator_Widget::onMouseRelease( SUIT_ViewWindow* theWindow, QMouseEven
|
||||
{
|
||||
Handle(AIS_InteractiveContext) aCtx = getAISContext();
|
||||
if ( !aCtx.IsNull() )
|
||||
aCtx->ClearSelected();
|
||||
aCtx->ClearSelected( Standard_True );
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -1121,11 +1121,11 @@ void CurveCreator_Widget::onMouseRelease( SUIT_ViewWindow* theWindow, QMouseEven
|
||||
// otherwise a rectangular selection.
|
||||
if ( myStartPoint == myEndPoint )
|
||||
{
|
||||
aCtx->MoveTo( myEndPoint.x(), myEndPoint.y(), aView3d );
|
||||
aCtx->MoveTo( myEndPoint.x(), myEndPoint.y(), aView3d, Standard_True );
|
||||
if ( aHasShift )
|
||||
aCtx->ShiftSelect();
|
||||
aCtx->ShiftSelect( Standard_True );
|
||||
else
|
||||
aCtx->Select();
|
||||
aCtx->Select( Standard_True );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -234,9 +234,9 @@ bool EntityGUI::OnMousePress( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWi
|
||||
|
||||
ic->InitSelected();
|
||||
if ( pe->modifiers() == Qt::ShiftModifier )
|
||||
ic->ShiftSelect(); // Append selection
|
||||
ic->ShiftSelect( Standard_True ); // Append selection
|
||||
else
|
||||
ic->Select(); // New selection
|
||||
ic->Select( Standard_True ); // New selection
|
||||
|
||||
ic->InitSelected();
|
||||
if ( ic->MoreSelected() ) {
|
||||
@ -263,7 +263,7 @@ bool EntityGUI::OnMousePress( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWi
|
||||
Handle(AIS_InteractiveContext) ic = anOCCViewer->getAISContext();
|
||||
|
||||
ic->InitSelected();
|
||||
ic->Select(); // New selection
|
||||
ic->Select( Standard_True ); // New selection
|
||||
|
||||
ic->InitSelected();
|
||||
TopoDS_Shape aShape;
|
||||
@ -365,7 +365,7 @@ void EntityGUI::DisplaySimulationShape( const TopoDS_Shape& S1, const TopoDS_Sha
|
||||
if ( !S1.IsNull() ) {
|
||||
/* erase any previous */
|
||||
ic->Erase( mySimulationShape1, Standard_True );
|
||||
ic->ClearPrs( mySimulationShape1 );
|
||||
ic->ClearPrs( mySimulationShape1, 0, Standard_True );
|
||||
|
||||
mySimulationShape1 = new AIS_Shape( TopoDS_Shape() );
|
||||
mySimulationShape1->Set( S1 );
|
||||
@ -377,7 +377,7 @@ void EntityGUI::DisplaySimulationShape( const TopoDS_Shape& S1, const TopoDS_Sha
|
||||
}
|
||||
if ( !S2.IsNull() ) {
|
||||
ic->Erase( mySimulationShape2, Standard_True );
|
||||
ic->ClearPrs( mySimulationShape2 );
|
||||
ic->ClearPrs( mySimulationShape2, 0, Standard_True );
|
||||
|
||||
mySimulationShape2 = new AIS_Shape( TopoDS_Shape() );
|
||||
mySimulationShape2->Set( S2 );
|
||||
@ -422,8 +422,8 @@ void EntityGUI::EraseSimulationShape()
|
||||
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
|
||||
ic->Erase( mySimulationShape1, Standard_True );
|
||||
ic->Erase( mySimulationShape2, Standard_True );
|
||||
ic->ClearPrs( mySimulationShape1 );
|
||||
ic->ClearPrs( mySimulationShape2 );
|
||||
ic->ClearPrs( mySimulationShape1, 0, Standard_True );
|
||||
ic->ClearPrs( mySimulationShape2, 0, Standard_True );
|
||||
ic->UpdateCurrentViewer();
|
||||
}
|
||||
}
|
||||
|
@ -780,7 +780,7 @@ void EntityGUI_PolylineDlg::displayPreview()
|
||||
|
||||
// Set color for temporary AIS_InteractiveObject
|
||||
anAISObj->Attributes()->WireAspect()->SetColor( Quantity_NOC_VIOLET );
|
||||
aCtx->Redisplay( anAISObj );
|
||||
aCtx->Redisplay( anAISObj, Standard_True );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -251,7 +251,7 @@ void GEOMGUI_AnnotationMgr::Redisplay( const QString& theEntry, const int theInd
|
||||
Handle(GEOM_Annotation) aPresentation = Handle(GEOM_Annotation)::DownCast( aPrs );
|
||||
|
||||
GEOMGUI_AnnotationAttrs::SetupPresentation( aPresentation, theProperty, aShapeLCS );
|
||||
aView->getAISContext()->Redisplay( aPresentation );
|
||||
aView->getAISContext()->Redisplay( aPresentation, Standard_True );
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -440,7 +440,7 @@ void GEOMGUI_AnnotationMgr::UpdateVisibleAnnotations( const QString& theEntry, S
|
||||
|
||||
setDisplayProperties( aPresentation, aView, theEntry );
|
||||
|
||||
aView->getAISContext()->Redisplay( aPresentation );
|
||||
aView->getAISContext()->Redisplay( aPresentation, Standard_True );
|
||||
}
|
||||
}
|
||||
getDisplayer()->UpdateViewer();
|
||||
|
@ -2068,7 +2068,7 @@ void GEOM_Displayer::BeforeDisplay( SALOME_View* v, const SALOME_OCCPrs* )
|
||||
if ( !ic.IsNull() )
|
||||
{
|
||||
if ( ic->HasOpenedContext() )
|
||||
ic->CloseAllContexts();
|
||||
ic->CloseAllContexts(Standard_True);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3128,11 +3128,11 @@ void GEOM_Displayer::UpdateColorScale( const bool theIsRedisplayFieldSteps, cons
|
||||
aView->ColorScaleErase();
|
||||
#else
|
||||
if( !aViewModel->getAISContext()->IsDisplayed( myColorScale ) )
|
||||
aViewModel->getAISContext()->Display( myColorScale );
|
||||
aViewModel->getAISContext()->Display( myColorScale, Standard_True);
|
||||
}
|
||||
else
|
||||
if( aViewModel->getAISContext()->IsDisplayed( myColorScale ) )
|
||||
aViewModel->getAISContext()->Erase( myColorScale );
|
||||
aViewModel->getAISContext()->Erase( myColorScale, Standard_True );
|
||||
#endif
|
||||
|
||||
if( theIsRedisplayFieldSteps )
|
||||
|
@ -211,7 +211,7 @@ bool MeasureGUI_AnnotationInteractor::eventFilter( QObject* theObject, QEvent* t
|
||||
|
||||
const Handle(AIS_InteractiveContext) anAISContext = myViewer->getAISContext();
|
||||
|
||||
anAISContext->MoveTo( aMouseEv->x(), aMouseEv->y(), aView3d );
|
||||
anAISContext->MoveTo( aMouseEv->x(), aMouseEv->y(), aView3d, Standard_True );
|
||||
|
||||
if ( !anAISContext->HasDetected() )
|
||||
{
|
||||
@ -316,7 +316,7 @@ bool MeasureGUI_AnnotationInteractor::eventFilter( QObject* theObject, QEvent* t
|
||||
|
||||
anAISContext->Update( myActiveIO, Standard_False );
|
||||
anAISContext->UpdateCurrentViewer();
|
||||
anAISContext->MoveTo( aMouseEv->pos().x(), aMouseEv->pos().y(), aView3d );
|
||||
anAISContext->MoveTo( aMouseEv->pos().x(), aMouseEv->pos().y(), aView3d, Standard_True );
|
||||
|
||||
emit SignalInteractionFinished( myActiveIO );
|
||||
|
||||
|
@ -440,7 +440,7 @@ void MeasureGUI_CreateDimensionDlg::StartLocalEditing()
|
||||
anAISContext->SetZLayer( myDimension, myEditingLayer );
|
||||
anAISContext->Activate( myDimension, AIS_DSM_Line );
|
||||
anAISContext->Activate( myDimension, AIS_DSM_Text );
|
||||
anAISContext->Redisplay( myDimension );
|
||||
anAISContext->Redisplay( myDimension , Standard_True );
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
@ -460,7 +460,7 @@ void MeasureGUI_CreateDimensionDlg::StopLocalEditing()
|
||||
Handle(V3d_Viewer) aViewer3d = myEditingViewer->getViewer3d();
|
||||
|
||||
aViewer3d->RemoveZLayer( myEditingLayer );
|
||||
anAISContext->CloseLocalContext();
|
||||
anAISContext->CloseLocalContext( Standard_True );
|
||||
|
||||
myEditingViewer = NULL;
|
||||
}
|
||||
|
@ -373,7 +373,7 @@ void MeasureGUI_DimensionInteractor::MoveFlyoutFree( const Handle(V3d_View)& the
|
||||
if ( aNewFlyout <= Precision::Confusion() )
|
||||
{
|
||||
myInteractedIO->SetFlyout( 0.0 );
|
||||
myViewer->getAISContext()->Redisplay( myInteractedIO );
|
||||
myViewer->getAISContext()->Redisplay( myInteractedIO, Standard_True );
|
||||
return;
|
||||
}
|
||||
|
||||
@ -382,7 +382,7 @@ void MeasureGUI_DimensionInteractor::MoveFlyoutFree( const Handle(V3d_View)& the
|
||||
myInteractedIO->SetFlyout( aNewFlyout );
|
||||
myInteractedIO->SetCustomPlane( aNewPlane );
|
||||
|
||||
myViewer->getAISContext()->Redisplay( myInteractedIO );
|
||||
myViewer->getAISContext()->Redisplay( myInteractedIO, Standard_True );
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
@ -496,7 +496,7 @@ void MeasureGUI_DimensionInteractor::MoveFlyoutInPlane( const Handle(V3d_View)&
|
||||
|
||||
myInteractedIO->SetFlyout( aFlyout );
|
||||
|
||||
myViewer->getAISContext()->Redisplay( myInteractedIO );
|
||||
myViewer->getAISContext()->Redisplay( myInteractedIO, Standard_True );
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
@ -668,7 +668,7 @@ void MeasureGUI_DimensionInteractor::MoveText( const Handle(V3d_View)& theView,
|
||||
myInteractedIO->DimensionAspect()->SetArrowOrientation( aArrPos );
|
||||
myInteractedIO->SetToUpdate();
|
||||
|
||||
myViewer->getAISContext()->Redisplay( myInteractedIO );
|
||||
myViewer->getAISContext()->Redisplay( myInteractedIO, Standard_True );
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
@ -691,7 +691,7 @@ bool MeasureGUI_DimensionInteractor::eventFilter( QObject* theObject, QEvent* th
|
||||
QMouseEvent* aMouseEv = dynamic_cast<QMouseEvent*>( theEvent );
|
||||
|
||||
// init detection
|
||||
anAISContext->MoveTo( aMouseEv->x(), aMouseEv->y(), aView3d );
|
||||
anAISContext->MoveTo( aMouseEv->x(), aMouseEv->y(), aView3d, Standard_True );
|
||||
if ( !anAISContext->HasDetected() )
|
||||
{
|
||||
return false;
|
||||
@ -738,7 +738,7 @@ bool MeasureGUI_DimensionInteractor::eventFilter( QObject* theObject, QEvent* th
|
||||
}
|
||||
|
||||
anAISContext->ClearSelected( Standard_False );
|
||||
anAISContext->AddOrRemoveSelected( aDetectedOwner );
|
||||
anAISContext->AddOrRemoveSelected( aDetectedOwner, Standard_True );
|
||||
|
||||
emit InteractionStarted( myInteractedIO );
|
||||
|
||||
|
@ -66,7 +66,9 @@ GEOM_Annotation::GEOM_Annotation() : AIS_InteractiveObject()
|
||||
SetDisplayMode( 0 );
|
||||
SetZLayer( Graphic3d_ZLayerId_Default );
|
||||
SetAutoHide( Standard_True );
|
||||
#if OCC_VERSION_LARGE <= 0x07010000
|
||||
SetHilightMode( HighlightAll );
|
||||
#endif
|
||||
SetMutable( Standard_True );
|
||||
SetDepthCulling( Standard_True );
|
||||
|
||||
@ -616,9 +618,9 @@ GEOM_Annotation::OpenGl_Annotation::OpenGl_Annotation( GEOM_Annotation* theAnnot
|
||||
const Standard_Integer theTextHeight,
|
||||
const OpenGl_GraphicDriver* theDriver )
|
||||
: OpenGl_Element(),
|
||||
myDepthMode( 0 ),
|
||||
myAISObject( theAnnotation ),
|
||||
myText( theAnnotation->myText.ToExtString() ),
|
||||
myDepthMode( 0 ),
|
||||
myTextLineY( 0.f ),
|
||||
myTextDPI( 0 )
|
||||
{
|
||||
@ -747,7 +749,15 @@ void GEOM_Annotation::OpenGl_Annotation::Render( const Handle(OpenGl_Workspace)&
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#if OCC_VERSION_LARGE > 0x07010000
|
||||
const Handle(Graphic3d_PresentationAttributes) aHighlightStyle = theWorkspace->HighlightStyle();
|
||||
if (!aHighlightStyle.IsNull() && myAISObject->myHilightMode == HighlightLabel)
|
||||
{
|
||||
Handle(Graphic3d_PresentationAttributes) empty;
|
||||
theWorkspace->SetHighlightStyle(empty);
|
||||
theWorkspace->ApplyAspectLine();
|
||||
}
|
||||
#else
|
||||
const bool toHighlight = theWorkspace->ToHighlight();
|
||||
|
||||
if (toHighlight && myAISObject->myHilightMode == HighlightLabel)
|
||||
@ -755,6 +765,7 @@ void GEOM_Annotation::OpenGl_Annotation::Render( const Handle(OpenGl_Workspace)&
|
||||
theWorkspace->SetHighlight( false );
|
||||
theWorkspace->ApplyAspectLine();
|
||||
}
|
||||
#endif
|
||||
|
||||
GLint myOldDepthMode = 0;
|
||||
|
||||
@ -868,10 +879,14 @@ void GEOM_Annotation::OpenGl_Annotation::Render( const Handle(OpenGl_Workspace)&
|
||||
|
||||
aContext->ApplyModelViewMatrix();
|
||||
|
||||
#if OCC_VERSION_LARGE > 0x07010000
|
||||
theWorkspace->SetHighlightStyle(aHighlightStyle);
|
||||
#else
|
||||
if ( toHighlight != theWorkspace->ToHighlight() )
|
||||
{
|
||||
theWorkspace->SetHighlight( toHighlight );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
@ -880,14 +895,21 @@ void GEOM_Annotation::OpenGl_Annotation::Render( const Handle(OpenGl_Workspace)&
|
||||
// purpose : Perform highlighting of the presentation.
|
||||
// =======================================================================
|
||||
void GEOM_Annotation::GEOM_AnnotationOwner::HilightWithColor( const Handle(PrsMgr_PresentationManager3d)& thePM,
|
||||
#if OCC_VERSION_LARGE > 0x07010000
|
||||
const Handle(Prs3d_Drawer)& theStyle,
|
||||
#else
|
||||
const Handle(Graphic3d_HighlightStyle)& theStyle,
|
||||
#endif
|
||||
const Standard_Integer theMode )
|
||||
{
|
||||
if ( myPrsSh.IsNull() )
|
||||
{
|
||||
Handle(Prs3d_Drawer) aDrawer = new Prs3d_Drawer;
|
||||
#if OCC_VERSION_LARGE > 0x07010000
|
||||
aDrawer->Link( theStyle );
|
||||
#else
|
||||
aDrawer->Link( Selectable()->HilightAttributes() );
|
||||
|
||||
#endif
|
||||
Handle(Prs3d_IsoAspect) aUIsoAspect = new Prs3d_IsoAspect(
|
||||
aDrawer->UIsoAspect()->Aspect()->Color(),
|
||||
aDrawer->UIsoAspect()->Aspect()->Type(),
|
||||
@ -921,7 +943,11 @@ void GEOM_Annotation::GEOM_AnnotationOwner::Unhilight ( const Handle(PrsMgr_Pres
|
||||
{
|
||||
SelectMgr_EntityOwner::Unhilight( thePM, theMode );
|
||||
|
||||
#if OCC_VERSION_LARGE > 0x07010000
|
||||
thePM->Unhighlight( myPrsSh );
|
||||
#else
|
||||
thePM->Unhighlight( myPrsSh, theMode );
|
||||
#endif
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
|
@ -27,6 +27,8 @@
|
||||
#ifndef GEOM_Annotation_HeaderFile
|
||||
#define GEOM_Annotation_HeaderFile
|
||||
|
||||
#include <Basics_OCCTVersion.hxx>
|
||||
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <Bnd_Box.hxx>
|
||||
#include <Font_FontAspect.hxx>
|
||||
@ -361,7 +363,11 @@ public:
|
||||
//! \param theMode [in] the display mode.
|
||||
virtual void
|
||||
HilightWithColor( const Handle(PrsMgr_PresentationManager3d)& thePM,
|
||||
#if OCC_VERSION_LARGE > 0x07010000
|
||||
const Handle(Prs3d_Drawer)& theStyle,
|
||||
#else
|
||||
const Handle(Graphic3d_HighlightStyle)& theStyle,
|
||||
#endif
|
||||
const Standard_Integer theMode = 0 ) Standard_OVERRIDE;
|
||||
|
||||
//! Removes highlighting from the type of shape.
|
||||
|
Loading…
Reference in New Issue
Block a user