#include <GEOM_OCCFilter.h>
#include <GEOM_Actor.h>
-#include <GEOM_AISShape.hxx>
#include <GEOM_AISDimension.hxx>
#include <GEOM_TopWireframeShape.hxx>
#include <GEOM_AISVector.hxx>
#include <AIS_AngleDimension.hxx>
#include <AIS_ListIteratorOfListOfInteractive.hxx>
#include <Aspect_PolygonOffsetMode.hxx>
-#include <Aspect_ColorScale.hxx>
+#if OCC_VERSION_MAJOR < 7
+ #include <Aspect_ColorScale.hxx>
+#endif
#include <Prs3d_IsoAspect.hxx>
#include <Prs3d_PointAspect.hxx>
#include <StdSelect_TypeOfEdge.hxx>
#include <Geom_Axis2Placement.hxx>
#include <Graphic3d_AspectFillArea3d.hxx>
#include <gp_Pln.hxx>
-#include <TColStd_MapOfInteger.hxx>
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
#include <TopoDS_Iterator.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
myViewFrame = 0;
+#if OCC_VERSION_MAJOR >= 7
+ myColorScale = new AIS_ColorScale;
+ myColorScale->SetZLayer (Graphic3d_ZLayerId_TopOSD);
+ myColorScale->SetTransformPersistence (Graphic3d_TMF_2d, gp_Pnt (-1,-1,0));
+#endif
+
myFieldDataType = GEOM::FDT_Double;
myFieldDimension = 0;
myFieldStepRangeMin = 0;
return aResultList;
}
-// Note: the method is copied from Aspect_ColorScale class
+// Note: the method is copied from AIS_ColorScale class
Standard_Integer GEOM_Displayer::HueFromValue( const Standard_Integer aValue,
const Standard_Integer aMin,
const Standard_Integer aMax )
return aHue;
}
-// Note: the method is copied from Aspect_ColorScale class
+// Note: the method is copied from AIS_ColorScale class
Standard_Boolean GEOM_Displayer::FindColor( const Standard_Real aValue,
const Standard_Real aMin,
const Standard_Real aMax,
if( !aViewModel )
return;
+#if OCC_VERSION_MAJOR < 7
Handle(V3d_Viewer) aViewer = aViewModel->getViewer3d();
if( aViewer.IsNull() )
return;
Handle(V3d_View) aView = aViewer->ActiveView();
if( aView.IsNull() )
return;
+#endif
Standard_Boolean anIsDisplayColorScale = Standard_False;
TCollection_AsciiString aColorScaleTitle;
if( anIsDisplayColorScale )
{
- Handle(Aspect_ColorScale) aColorScale = aView->ColorScale();
- if( !aColorScale.IsNull() )
+ SUIT_Session* session = SUIT_Session::session();
+ SUIT_ResourceMgr* resMgr = session->resourceMgr();
+
+ Standard_Real anXPos = resMgr->doubleValue( "Geometry", "scalar_bar_x_position", 0.05 );
+ Standard_Real anYPos = resMgr->doubleValue( "Geometry", "scalar_bar_y_position", 0.1 );
+ Standard_Real aWidth = resMgr->doubleValue( "Geometry", "scalar_bar_width", 0.2 );
+ Standard_Real aHeight = resMgr->doubleValue( "Geometry", "scalar_bar_height", 0.5 );
+ Standard_Integer aTextHeight = resMgr->integerValue( "Geometry", "scalar_bar_text_height", 14 );
+ Standard_Integer aNbIntervals = resMgr->integerValue( "Geometry", "scalar_bar_nb_intervals", 20 );
+
+#if OCC_VERSION_MAJOR < 7
+ Handle(Aspect_ColorScale) myColorScale = aView->ColorScale();
+ if( !myColorScale.IsNull() )
{
- SUIT_Session* session = SUIT_Session::session();
- SUIT_ResourceMgr* resMgr = session->resourceMgr();
-
- Standard_Real anXPos = resMgr->doubleValue( "Geometry", "scalar_bar_x_position", 0.05 );
- Standard_Real anYPos = resMgr->doubleValue( "Geometry", "scalar_bar_y_position", 0.1 );
- Standard_Real aWidth = resMgr->doubleValue( "Geometry", "scalar_bar_width", 0.2 );
- Standard_Real aHeight = resMgr->doubleValue( "Geometry", "scalar_bar_height", 0.5 );
- Standard_Integer aTextHeight = resMgr->integerValue( "Geometry", "scalar_bar_text_height", 14 );
- Standard_Integer aNbIntervals = resMgr->integerValue( "Geometry", "scalar_bar_nb_intervals", 20 );
-
- aColorScale->SetXPosition( anXPos );
- aColorScale->SetYPosition( anYPos );
- aColorScale->SetWidth( aWidth );
- aColorScale->SetHeight( aHeight );
-
- aColorScale->SetTextHeight( aTextHeight );
- aColorScale->SetNumberOfIntervals( anIsBoolean ? 2 : aNbIntervals );
-
- aColorScale->SetTitle( aColorScaleTitle );
- aColorScale->SetRange( aColorScaleMin, aColorScaleMax );
+#endif
+
+ myColorScale->SetXPosition( anXPos );
+ myColorScale->SetYPosition( anYPos );
+ myColorScale->SetWidth( aWidth );
+ myColorScale->SetHeight( aHeight );
+
+ myColorScale->SetTextHeight( aTextHeight );
+ myColorScale->SetNumberOfIntervals( anIsBoolean ? 2 : aNbIntervals );
+
+ myColorScale->SetTitle( aColorScaleTitle );
+ myColorScale->SetRange( aColorScaleMin, aColorScaleMax );
+
+#if OCC_VERSION_MAJOR < 7
}
if( !aView->ColorScaleIsDisplayed() )
aView->ColorScaleDisplay();
}
else
- {
if( aView->ColorScaleIsDisplayed() )
aView->ColorScaleErase();
+#else
+ if( !aViewModel->getAISContext()->IsDisplayed( myColorScale ) )
+ aViewModel->getAISContext()->Display( myColorScale );
}
+ else
+ if( aViewModel->getAISContext()->IsDisplayed( myColorScale ) )
+ aViewModel->getAISContext()->Erase( myColorScale );
+#endif
if( theIsRedisplayFieldSteps )
{