Backward compatibility with OCCT 6.5.3

This commit is contained in:
vsr 2012-11-08 10:25:59 +00:00
parent 241153143e
commit 04858cf024

View File

@ -26,7 +26,8 @@
#include "EntityGUI_3DSketcherDlg.h" #include "EntityGUI_3DSketcherDlg.h"
#include "EntityGUI_Widgets.h" #include "EntityGUI_Widgets.h"
#include <SalomeApp_DoubleSpinBox.h>
#include <Basics_OCCTVersion.hxx>
#include <GEOMBase.h> #include <GEOMBase.h>
#include <GeometryGUI.h> #include <GeometryGUI.h>
@ -42,6 +43,7 @@
#include <SOCC_Prs.h> #include <SOCC_Prs.h>
#include <SOCC_ViewModel.h> #include <SOCC_ViewModel.h>
#include <SalomeApp_Application.h> #include <SalomeApp_Application.h>
#include <SalomeApp_DoubleSpinBox.h>
#include <LightApp_Application.h> #include <LightApp_Application.h>
#include <LightApp_SelectionMgr.h> #include <LightApp_SelectionMgr.h>
@ -65,15 +67,15 @@
#include <Prs3d_AngleAspect.hxx> #include <Prs3d_AngleAspect.hxx>
#include <Prs3d_LineAspect.hxx> #include <Prs3d_LineAspect.hxx>
#include <Prs3d_LengthAspect.hxx> #include <Prs3d_LengthAspect.hxx>
#if OCC_VERSION_LARGE > 0x06050300
#include <Prs3d_TextAspect.hxx> #include <Prs3d_TextAspect.hxx>
#include <Prs3d_Presentation.hxx> #include <Prs3d_Presentation.hxx>
#include <Prs3d_Text.hxx> #include <Prs3d_Text.hxx>
#include <Graphic3d_VerticalTextAlignment.hxx> #include <Graphic3d_VerticalTextAlignment.hxx>
#include <Graphic3d_HorizontalTextAlignment.hxx> #include <Graphic3d_HorizontalTextAlignment.hxx>
#include <Graphic3d_AspectText3d.hxx> #include <Graphic3d_AspectText3d.hxx>
#include <Font_FontAspect.hxx> #include <Font_FontAspect.hxx>
#endif // OCC_VERSION_LARGE > 0x06050300
// This include must be *AFTER* SOCC_ViewModel.h because // This include must be *AFTER* SOCC_ViewModel.h because
// of the constant ROTATE which is a #define in // of the constant ROTATE which is a #define in
@ -101,6 +103,7 @@ private:
bool& myLock; bool& myLock;
}; };
#if OCC_VERSION_LARGE > 0x06050300
DEFINE_STANDARD_HANDLE(AIS_Text, AIS_InteractiveObject) DEFINE_STANDARD_HANDLE(AIS_Text, AIS_InteractiveObject)
class AIS_Text:public AIS_InteractiveObject class AIS_Text:public AIS_InteractiveObject
@ -194,6 +197,7 @@ void AIS_Text::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentation
asp->Aspect()->SetTextFontAspect(aFontAspect); asp->Aspect()->SetTextFontAspect(aFontAspect);
Prs3d_Text::Draw(aPresentation, asp, aText, aPosition); Prs3d_Text::Draw(aPresentation, asp, aText, aPosition);
}; };
#endif // OCC_VERSION_LARGE > 0x06050300
bool isSame (double d1, double d2) bool isSame (double d1, double d2)
{ {
@ -325,7 +329,9 @@ void EntityGUI_3DSketcherDlg::Init()
SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow(); SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
myAnglePrs = dynamic_cast<SOCC_Prs*>(((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs(0)); myAnglePrs = dynamic_cast<SOCC_Prs*>(((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs(0));
myLengthPrs = dynamic_cast<SOCC_Prs*>(((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs(0)); myLengthPrs = dynamic_cast<SOCC_Prs*>(((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs(0));
#if OCC_VERSION_LARGE > 0x06050300
myTextPrs = dynamic_cast<SOCC_Prs*>(((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs(0)); myTextPrs = dynamic_cast<SOCC_Prs*>(((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs(0));
#endif // OCC_VERSION_LARGE > 0x06050300
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX); localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
@ -1588,6 +1594,7 @@ void EntityGUI_3DSketcherDlg::displayText ( std::string theText,
gp_Pnt P, gp_Pnt P,
bool store ) bool store )
{ {
#if OCC_VERSION_LARGE > 0x06050300
SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow(); SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
Handle(AIS_Text) anIO = new AIS_Text(TCollection_ExtendedString(theText.c_str()), P); Handle(AIS_Text) anIO = new AIS_Text(TCollection_ExtendedString(theText.c_str()), P);
@ -1611,6 +1618,7 @@ void EntityGUI_3DSketcherDlg::displayText ( std::string theText,
GEOMBase_Helper::displayPreview(aSPrs, true, true); GEOMBase_Helper::displayPreview(aSPrs, true, true);
} }
} }
#endif // OCC_VERSION_LARGE > 0x06050300
} }
//================================================================ //================================================================
@ -1851,4 +1859,4 @@ double EntityGUI_3DSketcherDlg::height (gp_Pnt thePnt) const
gp_Pnt aPnt = thePnt.Transformed(aTrsf); gp_Pnt aPnt = thePnt.Transformed(aTrsf);
return aPnt.Z(); return aPnt.Z();
} }