From a9a578b60205d7129b13213432c705e5464aabe0 Mon Sep 17 00:00:00 2001 From: dkv Date: Sat, 13 Nov 2010 08:27:42 +0000 Subject: [PATCH] porting to OOCT 6.4.0 --- src/GEOM/GEOM_Engine.cxx | 47 +++++++++++++++++++-- src/GEOM/GEOM_Engine.hxx | 34 ++++++++++++++- src/GEOMAlgo/BlockFix_UnionFaces.cxx | 14 ++++++ src/GEOMGUI/GEOM_Displayer.cxx | 18 +++++++- src/GEOMGUI/GeometryGUI.cxx | 21 ++++++++- src/GEOMGUI/GeometryGUI.h | 20 ++++++++- src/GEOMImpl/GEOMImpl_IInsertOperations.cxx | 36 +++++++++++++--- src/GEOMImpl/GEOMImpl_IInsertOperations.hxx | 21 +++++++++ src/GEOMToolsGUI/GEOMToolsGUI_1.cxx | 23 +++++++++- src/GEOMToolsGUI/GEOMToolsGUI_MarkerDlg.cxx | 11 +++++ src/GEOM_I/GEOM_IInsertOperations_i.cc | 24 +++++++++++ 11 files changed, 251 insertions(+), 18 deletions(-) diff --git a/src/GEOM/GEOM_Engine.cxx b/src/GEOM/GEOM_Engine.cxx index b0ea5a0c2..8f361f38a 100644 --- a/src/GEOM/GEOM_Engine.cxx +++ b/src/GEOM/GEOM_Engine.cxx @@ -45,7 +45,11 @@ #include #include #include +#if OCC_VERSION_LARGE >= 0x06030100 +#include +#else #include +#endif #include #include #include @@ -60,7 +64,11 @@ #include #include +#if OCC_VERSION_LARGE >= 0x06030100 +#include +#else #include +#endif #include #include @@ -195,8 +203,13 @@ GEOM_Engine::~GEOM_Engine() } //Close all documents not closed +#if OCC_VERSION_LARGE >= 0x06030100 + for(TColStd_DataMapIteratorOfDataMapOfIntegerTransient anItr(_mapIDDocument); anItr.More(); anItr.Next()) + Close(anItr.Key()); +#else for(Interface_DataMapIteratorOfDataMapOfIntegerTransient anItr(_mapIDDocument); anItr.More(); anItr.Next()) Close(anItr.Key()); +#endif _mapIDDocument.Clear(); _objects.Clear(); @@ -230,8 +243,13 @@ Handle(TDocStd_Document) GEOM_Engine::GetDocument(int theDocID, bool force) int GEOM_Engine::GetDocID(Handle(TDocStd_Document) theDocument) { if(theDocument.IsNull()) return -1; +#if OCC_VERSION_LARGE >= 0x06030100 + for(TColStd_DataMapIteratorOfDataMapOfIntegerTransient anItr(_mapIDDocument); anItr.More(); anItr.Next()) + if(anItr.Value() == theDocument) return anItr.Key(); +#else for(Interface_DataMapIteratorOfDataMapOfIntegerTransient anItr(_mapIDDocument); anItr.More(); anItr.Next()) if(anItr.Value() == theDocument) return anItr.Key(); +#endif return -1; @@ -744,7 +762,11 @@ Handle(TColStd_HSequenceOfAsciiString) GEOM_Engine::GetAllDumpNames() const #define TEXTURE_LABEL_DATA 5 int GEOM_Engine::addTexture(int theDocID, int theWidth, int theHeight, - const Handle(TDataStd_HArray1OfByte)& theTexture, +#if OCC_VERSION_LARGE >= 0x06030100 + const Handle(TColStd_HArray1OfByte)& theTexture, +#else + const Handle(TDataStd_HArray1OfByte)& theTexture, +#endif const TCollection_AsciiString& theFileName) { Handle(TDocStd_Document) aDoc = GetDocument(theDocID); @@ -789,11 +811,20 @@ int GEOM_Engine::addTexture(int theDocID, int theWidth, int theHeight, return aTextureID; } -Handle(TDataStd_HArray1OfByte) GEOM_Engine::getTexture(int theDocID, int theTextureID, +#if OCC_VERSION_LARGE >= 0x06030100 +Handle(TColStd_HArray1OfByte) +#else +Handle(TDataStd_HArray1OfByte) +#endif +GEOM_Engine::getTexture(int theDocID, int theTextureID, int& theWidth, int& theHeight, TCollection_AsciiString& theFileName) { +#if OCC_VERSION_LARGE >= 0x06030100 + Handle(TColStd_HArray1OfByte) anArray; +#else Handle(TDataStd_HArray1OfByte) anArray; +#endif theWidth = theHeight = 0; Handle(TDocStd_Document) aDoc = GetDocument(theDocID); @@ -1418,7 +1449,13 @@ void AddObjectColors (int theDocID, } } -static TCollection_AsciiString pack_data(const Handle(TDataStd_HArray1OfByte)& aData ) +static TCollection_AsciiString pack_data(const +#if OCC_VERSION_LARGE >= 0x06030100 +Handle(TColStd_HArray1OfByte)& +#else +Handle(TDataStd_HArray1OfByte)& +#endif +aData ) { TCollection_AsciiString stream; if (!aData.IsNull()) { @@ -1446,7 +1483,11 @@ void AddTextures (int theDocID, TCollection_AsciiString& theScript) if (*it <= 0) continue; Standard_Integer aWidth, aHeight; TCollection_AsciiString aFileName; +#if OCC_VERSION_LARGE >= 0x06030100 + Handle(TColStd_HArray1OfByte) aTexture = engine->getTexture(theDocID, *it, aWidth, aHeight, aFileName); +#else Handle(TDataStd_HArray1OfByte) aTexture = engine->getTexture(theDocID, *it, aWidth, aHeight, aFileName); +#endif if (aWidth > 0 && aHeight > 0 && !aTexture.IsNull() && aTexture->Length() > 0 ) { TCollection_AsciiString aCommand = "\n\t"; aCommand += "texture_map["; aCommand += *it; aCommand += "] = "; diff --git a/src/GEOM/GEOM_Engine.hxx b/src/GEOM/GEOM_Engine.hxx index 5a0d1176a..f25ba4aa1 100644 --- a/src/GEOM/GEOM_Engine.hxx +++ b/src/GEOM/GEOM_Engine.hxx @@ -27,7 +27,18 @@ #include "GEOM_Object.hxx" #include "GEOM_DataMapOfAsciiStringTransient.hxx" -#include +#include +#ifdef OCC_VERSION_SERVICEPACK +#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8 | OCC_VERSION_SERVICEPACK) +#else +#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8) +#endif + +#if OCC_VERSION_LARGE >= 0x06030100 +#include +#else +#include +#endif #include #include #include @@ -38,7 +49,12 @@ #include #include +#if OCC_VERSION_LARGE >= 0x06030100 +class Handle_TColStd_HArray1OfByte; +#else class Handle_TDataStd_HArray1OfByte; +#endif + struct TVariable{ TCollection_AsciiString myVariable; @@ -133,13 +149,23 @@ class GEOM_Engine Standard_EXPORT Handle(TColStd_HSequenceOfAsciiString) GetAllDumpNames() const; +#if OCC_VERSION_LARGE >= 0x06030100 Standard_EXPORT int addTexture(int theDocID, int theWidth, int theHeight, + const Handle(TColStd_HArray1OfByte)& theTexture, + const TCollection_AsciiString& theFileName = ""); + + Standard_EXPORT Handle(TColStd_HArray1OfByte) getTexture(int theDocID, int theTextureID, + int& theWidth, int& theHeight, + TCollection_AsciiString& theFileName); +#else + Standard_EXPORT int addTexture(int theDocID, int theWidth, int theHeight, const Handle(TDataStd_HArray1OfByte)& theTexture, const TCollection_AsciiString& theFileName = ""); - Standard_EXPORT Handle(TDataStd_HArray1OfByte) getTexture(int theDocID, int theTextureID, + Standard_EXPORT Handle(TDataStd_HArray1OfByte) getTexture(int theDocID, int theTextureID, int& theWidth, int& theHeight, TCollection_AsciiString& theFileName); +#endif Standard_EXPORT std::list getAllTextures(int theDocID); @@ -151,7 +177,11 @@ class GEOM_Engine private: Handle(GEOM_Application) _OCAFApp; +#if OCC_VERSION_LARGE >= 0x06030100 + TColStd_DataMapOfIntegerTransient _mapIDDocument; +#else Interface_DataMapOfIntegerTransient _mapIDDocument; +#endif int _UndoLimit; GEOM_DataMapOfAsciiStringTransient _objects; diff --git a/src/GEOMAlgo/BlockFix_UnionFaces.cxx b/src/GEOMAlgo/BlockFix_UnionFaces.cxx index c610a4f7e..45b1963e3 100644 --- a/src/GEOMAlgo/BlockFix_UnionFaces.cxx +++ b/src/GEOMAlgo/BlockFix_UnionFaces.cxx @@ -42,7 +42,17 @@ #include #include +#ifdef OCC_VERSION_SERVICEPACK +#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8 | OCC_VERSION_SERVICEPACK) +#else +#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8) +#endif + +#if OCC_VERSION_LARGE < 0x06040000 #include +#else +#include +#endif #include #include @@ -617,7 +627,11 @@ Standard_Boolean BlockFix_UnionFaces::IsSameDomain(const TopoDS_Face& aFace, #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 OCC_CATCH_SIGNALS; #endif +#if OCC_VERSION_LARGE < 0x06040000 IntPatch_TheIIIntOfIntersection anIIInt (aGA1, aTT1, aGA2, aTT2, aPrec, aPrec); +#else + IntPatch_ImpImpIntersection anIIInt (aGA1, aTT1, aGA2, aTT2, aPrec, aPrec); +#endif if (!anIIInt.IsDone() || anIIInt.IsEmpty()) return false; diff --git a/src/GEOMGUI/GEOM_Displayer.cxx b/src/GEOMGUI/GEOM_Displayer.cxx index 3196289e5..012b9ab45 100644 --- a/src/GEOMGUI/GEOM_Displayer.cxx +++ b/src/GEOMGUI/GEOM_Displayer.cxx @@ -66,6 +66,12 @@ #include // OCCT Includes +#include +#ifdef OCC_VERSION_SERVICEPACK +#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8 | OCC_VERSION_SERVICEPACK) +#else +#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8) +#endif #include #include #include @@ -93,7 +99,11 @@ #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) #include +#if OCC_VERSION_LARGE >= 0x06030100 +#include +#else #include +#endif //================================================================ @@ -788,8 +798,12 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs ) Quantity_Color aQuanColor = SalomeApp_Tools::color( aResMgr->colorValue( "Geometry", "point_color", QColor( 255, 255, 0 ) ) ); if ( hasColor ) aQuanColor = Quantity_Color( aSColor.R, aSColor.G, aSColor.B, Quantity_TOC_RGB ); Standard_Integer aWidth, aHeight; - Handle(Graphic3d_HArray1OfBytes) aTexture = GeometryGUI::getTexture( getStudy(), aTextureId, aWidth, aHeight ); - if ( !aTexture.IsNull() ) { +#if OCC_VERSION_LARGE >= 0x06030100 + Handle(TColStd_HArray1OfByte) aTexture = GeometryGUI::getTexture( getStudy(), aTextureId, aWidth, aHeight ); +#else + Handle(Graphic3d_HArray1OfBytes) aTexture = GeometryGUI::getTexture( getStudy(), aTextureId, aWidth, aHeight ); +#endif + if ( !aTexture.IsNull() ) { static int TextureId = 0; Handle(Prs3d_PointAspect) aTextureAspect = new Prs3d_PointAspect(aQuanColor, ++TextureId, diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index 3ee06d2df..37edd9adc 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -83,7 +83,11 @@ #include #include #include +#if OCC_VERSION_LARGE >= 0x06030100 +#include +#else #include +#endif #include @@ -1428,10 +1432,19 @@ QString GeometryGUI::engineIOR() const return ""; } -Handle(Graphic3d_HArray1OfBytes) GeometryGUI::getTexture( SalomeApp_Study* theStudy, int theId, int& theWidth, int& theHeight ) +#if OCC_VERSION_LARGE >= 0x06030100 +Handle(TColStd_HArray1OfByte) +#else +Handle(Graphic3d_HArray1OfBytes) +#endif +GeometryGUI::getTexture( SalomeApp_Study* theStudy, int theId, int& theWidth, int& theHeight ) { theWidth = theHeight = 0; +#if OCC_VERSION_LARGE >= 0x06030100 + Handle(TColStd_HArray1OfByte) aTexture; +#else Handle(Graphic3d_HArray1OfBytes) aTexture; +#endif if ( theStudy ) { TextureMap aTextureMap = myTextureMap[ theStudy->studyDS()->StudyId() ]; aTexture = aTextureMap[ theId ]; @@ -1443,7 +1456,11 @@ Handle(Graphic3d_HArray1OfBytes) GeometryGUI::getTexture( SalomeApp_Study* theSt if ( aWidth > 0 && aHeight > 0 && aStream->length() > 0 ) { theWidth = aWidth; theHeight = aHeight; - aTexture = new Graphic3d_HArray1OfBytes( 1, aStream->length() ); +#if OCC_VERSION_LARGE >= 0x06030100 + aTexture = new TColStd_HArray1OfByte( 1, aStream->length() ); +#else + aTexture = new Graphic3d_HArray1OfBytes( 1, aStream->length() ); +#endif for ( int i = 0; i < aStream->length(); i++ ) aTexture->SetValue( i+1, (Standard_Byte)aStream[i] ); aTextureMap[ theId ] = aTexture; diff --git a/src/GEOMGUI/GeometryGUI.h b/src/GEOMGUI/GeometryGUI.h index 4e4dd3921..7eeb29962 100644 --- a/src/GEOMGUI/GeometryGUI.h +++ b/src/GEOMGUI/GeometryGUI.h @@ -41,8 +41,18 @@ #include // OCCT Includes +#include +#ifdef OCC_VERSION_SERVICEPACK +#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8 | OCC_VERSION_SERVICEPACK) +#else +#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8) +#endif #include +#if OCC_VERSION_LARGE >= 0x06030100 +#include +#else #include +#endif // IDL headers #include "SALOMEconfig.h" @@ -77,8 +87,11 @@ public: virtual LightApp_Displayer* displayer(); virtual void initialize( CAM_Application* ); virtual QString engineIOR() const; - +#if OCC_VERSION_LARGE >= 0x06030100 + static Handle(TColStd_HArray1OfByte) getTexture( SalomeApp_Study*, int, int&, int& ); +#else static Handle(Graphic3d_HArray1OfBytes) getTexture( SalomeApp_Study*, int, int&, int& ); +#endif static bool InitGeomGen(); @@ -162,8 +175,11 @@ public: static GEOM::GEOM_Gen_var myComponentGeom; // GEOM engine!!! private: - +#if OCC_VERSION_LARGE >= 0x06030100 + typedef QMap TextureMap; +#else typedef QMap TextureMap; +#endif typedef QMap StudyTextureMap; typedef QMap GUIMap; diff --git a/src/GEOMImpl/GEOMImpl_IInsertOperations.cxx b/src/GEOMImpl/GEOMImpl_IInsertOperations.cxx index efb8255fa..8b78ff439 100644 --- a/src/GEOMImpl/GEOMImpl_IInsertOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IInsertOperations.cxx @@ -49,7 +49,13 @@ #include #include #include + + +#if OCC_VERSION_LARGE >= 0x06030100 +#include +#else #include +#endif #include #include // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC @@ -551,8 +557,12 @@ int GEOMImpl_IInsertOperations::LoadTexture(const TCollection_AsciiString& theTe SetErrorCode(KO); if (theTextureFile.IsEmpty()) return 0; - +#if OCC_VERSION_LARGE >= 0x06030100 + Handle(TColStd_HArray1OfByte) aTexture; +#else Handle(TDataStd_HArray1OfByte) aTexture; +#endif + FILE* fp = fopen(theTextureFile.ToCString(), "r"); if (!fp) return 0; @@ -593,8 +603,11 @@ int GEOMImpl_IInsertOperations::LoadTexture(const TCollection_AsciiString& theTe if (bytedata.empty() || bytedata.size() != lines.size()*lenbytes) return 0; - +#if OCC_VERSION_LARGE >= 0x06030100 + aTexture = new TColStd_HArray1OfByte(1, lines.size()*lenbytes); +#else aTexture = new TDataStd_HArray1OfByte(1, lines.size()*lenbytes); +#endif std::list::iterator bdit; int i; for (i = 1, bdit = bytedata.begin(); bdit != bytedata.end(); ++bdit, ++i) @@ -606,7 +619,12 @@ int GEOMImpl_IInsertOperations::LoadTexture(const TCollection_AsciiString& theTe } int GEOMImpl_IInsertOperations::AddTexture(int theWidth, int theHeight, - const Handle(TDataStd_HArray1OfByte)& theTexture) +#if OCC_VERSION_LARGE >= 0x06030100 + const Handle(TColStd_HArray1OfByte)& +#else + const Handle(TDataStd_HArray1OfByte)& +#endif + theTexture) { SetErrorCode(KO); int aTextureId = GetEngine()->addTexture(GetDocID(), theWidth, theHeight, theTexture); @@ -614,12 +632,20 @@ int GEOMImpl_IInsertOperations::AddTexture(int theWidth, int theHeight, return aTextureId; } -Handle(TDataStd_HArray1OfByte) GEOMImpl_IInsertOperations::GetTexture(int theTextureId, +#if OCC_VERSION_LARGE >= 0x06030100 +Handle(TColStd_HArray1OfByte) +#else +Handle(TDataStd_HArray1OfByte) +#endif +GEOMImpl_IInsertOperations::GetTexture(int theTextureId, int& theWidth, int& theHeight) { SetErrorCode(KO); - +#if OCC_VERSION_LARGE >= 0x06030100 + Handle(TColStd_HArray1OfByte) aTexture; +#else Handle(TDataStd_HArray1OfByte) aTexture; +#endif theWidth = theHeight = 0; TCollection_AsciiString aFileName; diff --git a/src/GEOMImpl/GEOMImpl_IInsertOperations.hxx b/src/GEOMImpl/GEOMImpl_IInsertOperations.hxx index 691594fb4..1e9707ec4 100644 --- a/src/GEOMImpl/GEOMImpl_IInsertOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IInsertOperations.hxx @@ -33,7 +33,18 @@ #include #include +#include +#ifdef OCC_VERSION_SERVICEPACK +#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8 | OCC_VERSION_SERVICEPACK) +#else +#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8) +#endif + +#if OCC_VERSION_LARGE >= 0x06030100 +class Handle_TColStd_HArray1OfByte; +#else class Handle_TDataStd_HArray1OfByte; +#endif class GEOMImpl_IInsertOperations : public GEOM_IOperations { public: @@ -62,11 +73,21 @@ class GEOMImpl_IInsertOperations : public GEOM_IOperations { Standard_EXPORT int LoadTexture(const TCollection_AsciiString& theTextureFile); +#if OCC_VERSION_LARGE >= 0x06030100 + Standard_EXPORT int AddTexture(int theWidth, int theHeight, + const Handle(TColStd_HArray1OfByte)& theTexture); + + Standard_EXPORT Handle(TColStd_HArray1OfByte) GetTexture(int theTextureId, + int& theWidth, int& theHeight); +#else Standard_EXPORT int AddTexture(int theWidth, int theHeight, const Handle(TDataStd_HArray1OfByte)& theTexture); Standard_EXPORT Handle(TDataStd_HArray1OfByte) GetTexture(int theTextureId, int& theWidth, int& theHeight); +#endif + + Standard_EXPORT std::list GetAllTextures(); diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx index 7706ab3c9..75eeac642 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx @@ -70,11 +70,22 @@ #include "utilities.h" // OCCT Includes +#include +#ifdef OCC_VERSION_SERVICEPACK +#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8 | OCC_VERSION_SERVICEPACK) +#else +#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8) +#endif #include #include #include #include +#if OCC_VERSION_LARGE >= 0x06030100 +#include +#else #include +#endif + // QT Includes #include @@ -256,7 +267,11 @@ void GEOMToolsGUI::OnAutoColor() else { Standard_Integer aWidth, aHeight; aCurPointAspect->GetTextureSize( aWidth, aHeight ); - Handle(Graphic3d_HArray1OfBytes) aTexture = aCurPointAspect->GetTexture(); +#if OCC_VERSION_LARGE >= 0x06030100 + Handle(TColStd_HArray1OfByte) aTexture = aCurPointAspect->GetTexture(); +#else + Handle(Graphic3d_HArray1OfBytes) aTexture = aCurPointAspect->GetTexture(); +#endif aCurDrawer->SetPointAspect( new Prs3d_PointAspect( aQuanColor, 1, aWidth, aHeight, aTexture ) ); } ic->SetLocalAttributes( io, aCurDrawer ); @@ -359,7 +374,11 @@ void GEOMToolsGUI::OnColor() else { Standard_Integer aWidth, aHeight; aCurPointAspect->GetTextureSize( aWidth, aHeight ); - Handle(Graphic3d_HArray1OfBytes) aTexture = aCurPointAspect->GetTexture(); +#if OCC_VERSION_LARGE >= 0x06030100 + Handle(TColStd_HArray1OfByte) aTexture = aCurPointAspect->GetTexture(); +#else + Handle(Graphic3d_HArray1OfBytes) aTexture = aCurPointAspect->GetTexture(); +#endif aCurDrawer->SetPointAspect(new Prs3d_PointAspect(aColor, 1, aWidth, aHeight, aTexture)); } ic->SetLocalAttributes(io, aCurDrawer); diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_MarkerDlg.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_MarkerDlg.cxx index 7da155b55..b7d83ede4 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_MarkerDlg.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_MarkerDlg.cxx @@ -34,6 +34,13 @@ #include #include +#include +#ifdef OCC_VERSION_SERVICEPACK +#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8 | OCC_VERSION_SERVICEPACK) +#else +#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8) +#endif + #include #include #include @@ -320,7 +327,11 @@ void GEOMToolsGUI_MarkerDlg::addTexture( int id, bool select ) const { if ( id > 0 && myCustomTypeCombo->index( id ) == -1 ) { int tWidth, tHeight; +#if OCC_VERSION_LARGE >= 0x06030100 + Handle(TColStd_HArray1OfByte) texture = GeometryGUI::getTexture( getStudy(), id, tWidth, tHeight ); +#else Handle(Graphic3d_HArray1OfBytes) texture = GeometryGUI::getTexture( getStudy(), id, tWidth, tHeight ); +#endif if ( !texture.IsNull() && texture->Length() == tWidth*tHeight/8 ) { QImage image( tWidth, tHeight, QImage::Format_Mono ); image.setColor( 0, qRgba( 0, 0, 0, 0 ) ); diff --git a/src/GEOM_I/GEOM_IInsertOperations_i.cc b/src/GEOM_I/GEOM_IInsertOperations_i.cc index 382465d83..f3f30d350 100644 --- a/src/GEOM_I/GEOM_IInsertOperations_i.cc +++ b/src/GEOM_I/GEOM_IInsertOperations_i.cc @@ -35,8 +35,20 @@ #include "GEOM_Engine.hxx" #include "GEOM_Object.hxx" + +#include +#ifdef OCC_VERSION_SERVICEPACK +#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8 | OCC_VERSION_SERVICEPACK) +#else +#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8) +#endif + #include +#if OCC_VERSION_LARGE >= 0x06030100 +#include +#else #include +#endif //============================================================================= /*! @@ -228,9 +240,17 @@ CORBA::Long GEOM_IInsertOperations_i::AddTexture(CORBA::Long theWidth, CORBA::Lo const SALOMEDS::TMPFile& theTexture) { GetOperations()->SetNotDone(); +#if OCC_VERSION_LARGE >= 0x06030100 + Handle(TColStd_HArray1OfByte) aTexture; +#else Handle(TDataStd_HArray1OfByte) aTexture; +#endif if ( theTexture.length() > 0 ) { +#if OCC_VERSION_LARGE >= 0x06030100 + aTexture = new TColStd_HArray1OfByte( 1, theTexture.length() ); +#else aTexture = new TDataStd_HArray1OfByte( 1, theTexture.length() ); +#endif for ( int i = 0; i < theTexture.length(); i++ ) aTexture->SetValue( i+1, (Standard_Byte)theTexture[i] ); } @@ -242,7 +262,11 @@ SALOMEDS::TMPFile* GEOM_IInsertOperations_i::GetTexture(CORBA::Long theID, CORBA::Long& theHeight) { int aWidth, aHeight; +#if OCC_VERSION_LARGE >= 0x06030100 + Handle(TColStd_HArray1OfByte) aTextureImpl = GetOperations()->GetTexture( theID, aWidth, aHeight ); +#else Handle(TDataStd_HArray1OfByte) aTextureImpl = GetOperations()->GetTexture( theID, aWidth, aHeight ); +#endif theWidth = aWidth; theHeight = aHeight; SALOMEDS::TMPFile_var aTexture; -- 2.39.2