Standard_EXPORT SALOME_AISShape(const TopoDS_Shape& shape);
Standard_EXPORT virtual Handle_SALOME_InteractiveObject getIO() = 0;
Standard_EXPORT virtual Standard_Boolean hasIO() = 0;
+Standard_EXPORT virtual Standard_Boolean isTopLevel() = 0;
+Standard_EXPORT virtual void setTopLevel(Standard_Boolean) = 0;
Standard_EXPORT virtual Standard_CString getName() = 0;
Standard_EXPORT virtual void setName(const Standard_CString aName) = 0;
Standard_EXPORT virtual void highlightSubShapes(const TColStd_IndexedMapOfInteger& aIndexMap, const Standard_Boolean aHighlight ) = 0;
// Fields PRIVATE
//
-
+
};
#include <Visual3d_View.hxx>
+#include <Basics_OCCTVersion.hxx>
+
/*!
Get data for supported background modes: gradient types, identifiers and supported image formats
*/
: SUIT_ViewModel(),
myBackgrounds(4, Qtx::BackgroundData( Qt::black )),
myIsRelative(true),
+ myTopLayerId( 0 ),
myTrihedronSize(100)
{
// init CasCade viewers
emit selectionChanged();
}
+int OCCViewer_Viewer::getTopLayerId()
+{
+#if OCC_VERSION_LARGE > 0x06050200
+ if ( myTopLayerId == 0 && !myAISContext->CurrentViewer().IsNull() )
+ myAISContext->CurrentViewer()->AddZLayer( myTopLayerId );
+#endif
+
+ return myTopLayerId;
+}
+
/*!
\return interaction style
*/
Handle(AIS_InteractiveContext) getAISContext() const { return myAISContext; }
Handle(AIS_Trihedron) getTrihedron() const { return myTrihedron; }
+ int getTopLayerId();
+
int interactionStyle() const;
void setInteractionStyle( const int );
Handle(V3d_Viewer) myV3dCollector;
Handle(AIS_Trihedron) myTrihedron;
- Handle(AIS_InteractiveContext) myAISContext;
+ Handle(AIS_InteractiveContext) myAISContext;
int myInteractionStyle;
int myZoomingStyle;
bool myMultiSelectionEnabled;
bool myIsRelative;
+ int myTopLayerId;
+
//QColor myBgColor;
QPoint myStartPnt, myEndPnt;
//#include "SALOMEDSClient.hxx"
//#include "SALOMEDS_StudyManager.hxx"
+#include <Basics_OCCTVersion.hxx>
#include <AIS_TypeOfIso.hxx>
#include <Precision.hxx>
}
ic->Display( anAIS, false );
-
+
+#if OCC_VERSION_LARGE > 0x06050200
+ Handle(SALOME_AISShape) aSh = Handle(SALOME_AISShape)::DownCast(anAIS);
+ if ( !aSh.IsNull() ) {
+ ic->SetZLayer( aSh, aSh->isTopLevel() ? getTopLayerId() : 0 );
+ }
+#endif
//Register anAIS (if it has an entry) in entry2aisobjects map
Handle(SALOME_InteractiveObject) anObj = Handle(SALOME_InteractiveObject)::DownCast( anAIS->GetOwner() );
if ( !anObj.IsNull() && anObj->hasEntry())