porting to OOCT 6.4.0

This commit is contained in:
dkv 2010-11-13 08:27:42 +00:00
parent 23164dcedd
commit a9a578b602
11 changed files with 251 additions and 18 deletions

View File

@ -45,7 +45,11 @@
#include <TDataStd_ChildNodeIterator.hxx> #include <TDataStd_ChildNodeIterator.hxx>
#include <TFunction_Driver.hxx> #include <TFunction_Driver.hxx>
#include <TFunction_DriverTable.hxx> #include <TFunction_DriverTable.hxx>
#if OCC_VERSION_LARGE >= 0x06030100
#include <TColStd_HArray1OfByte.hxx>
#else
#include <TDataStd_HArray1OfByte.hxx> #include <TDataStd_HArray1OfByte.hxx>
#endif
#include <TDataStd_ByteArray.hxx> #include <TDataStd_ByteArray.hxx>
#include <TDataStd_UAttribute.hxx> #include <TDataStd_UAttribute.hxx>
#include <TDF_ChildIterator.hxx> #include <TDF_ChildIterator.hxx>
@ -60,7 +64,11 @@
#include <TColStd_MapOfTransient.hxx> #include <TColStd_MapOfTransient.hxx>
#include <TColStd_HSequenceOfInteger.hxx> #include <TColStd_HSequenceOfInteger.hxx>
#if OCC_VERSION_LARGE >= 0x06030100
#include <TColStd_DataMapIteratorOfDataMapOfIntegerTransient.hxx>
#else
#include <Interface_DataMapIteratorOfDataMapOfIntegerTransient.hxx> #include <Interface_DataMapIteratorOfDataMapOfIntegerTransient.hxx>
#endif
#include <Resource_DataMapIteratorOfDataMapOfAsciiStringAsciiString.hxx> #include <Resource_DataMapIteratorOfDataMapOfAsciiStringAsciiString.hxx>
#include <set> #include <set>
@ -195,8 +203,13 @@ GEOM_Engine::~GEOM_Engine()
} }
//Close all documents not closed //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()) for(Interface_DataMapIteratorOfDataMapOfIntegerTransient anItr(_mapIDDocument); anItr.More(); anItr.Next())
Close(anItr.Key()); Close(anItr.Key());
#endif
_mapIDDocument.Clear(); _mapIDDocument.Clear();
_objects.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) int GEOM_Engine::GetDocID(Handle(TDocStd_Document) theDocument)
{ {
if(theDocument.IsNull()) return -1; 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()) for(Interface_DataMapIteratorOfDataMapOfIntegerTransient anItr(_mapIDDocument); anItr.More(); anItr.Next())
if(anItr.Value() == theDocument) return anItr.Key(); if(anItr.Value() == theDocument) return anItr.Key();
#endif
return -1; return -1;
@ -744,7 +762,11 @@ Handle(TColStd_HSequenceOfAsciiString) GEOM_Engine::GetAllDumpNames() const
#define TEXTURE_LABEL_DATA 5 #define TEXTURE_LABEL_DATA 5
int GEOM_Engine::addTexture(int theDocID, int theWidth, int theHeight, 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) const TCollection_AsciiString& theFileName)
{ {
Handle(TDocStd_Document) aDoc = GetDocument(theDocID); Handle(TDocStd_Document) aDoc = GetDocument(theDocID);
@ -789,11 +811,20 @@ int GEOM_Engine::addTexture(int theDocID, int theWidth, int theHeight,
return aTextureID; 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, int& theWidth, int& theHeight,
TCollection_AsciiString& theFileName) TCollection_AsciiString& theFileName)
{ {
#if OCC_VERSION_LARGE >= 0x06030100
Handle(TColStd_HArray1OfByte) anArray;
#else
Handle(TDataStd_HArray1OfByte) anArray; Handle(TDataStd_HArray1OfByte) anArray;
#endif
theWidth = theHeight = 0; theWidth = theHeight = 0;
Handle(TDocStd_Document) aDoc = GetDocument(theDocID); 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; TCollection_AsciiString stream;
if (!aData.IsNull()) { if (!aData.IsNull()) {
@ -1446,7 +1483,11 @@ void AddTextures (int theDocID, TCollection_AsciiString& theScript)
if (*it <= 0) continue; if (*it <= 0) continue;
Standard_Integer aWidth, aHeight; Standard_Integer aWidth, aHeight;
TCollection_AsciiString aFileName; 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); Handle(TDataStd_HArray1OfByte) aTexture = engine->getTexture(theDocID, *it, aWidth, aHeight, aFileName);
#endif
if (aWidth > 0 && aHeight > 0 && !aTexture.IsNull() && aTexture->Length() > 0 ) { if (aWidth > 0 && aHeight > 0 && !aTexture.IsNull() && aTexture->Length() > 0 ) {
TCollection_AsciiString aCommand = "\n\t"; TCollection_AsciiString aCommand = "\n\t";
aCommand += "texture_map["; aCommand += *it; aCommand += "] = "; aCommand += "texture_map["; aCommand += *it; aCommand += "] = ";

View File

@ -27,7 +27,18 @@
#include "GEOM_Object.hxx" #include "GEOM_Object.hxx"
#include "GEOM_DataMapOfAsciiStringTransient.hxx" #include "GEOM_DataMapOfAsciiStringTransient.hxx"
#include <Interface_DataMapOfIntegerTransient.hxx> #include <Standard_Version.hxx>
#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 <TColStd_DataMapOfIntegerTransient.hxx>
#else
#include <Interface_DataMapOfIntegerTransient.hxx>
#endif
#include <Resource_DataMapOfAsciiStringAsciiString.hxx> #include <Resource_DataMapOfAsciiStringAsciiString.hxx>
#include <TDocStd_Document.hxx> #include <TDocStd_Document.hxx>
#include <TColStd_HArray1OfInteger.hxx> #include <TColStd_HArray1OfInteger.hxx>
@ -38,7 +49,12 @@
#include <list> #include <list>
#include <vector> #include <vector>
#if OCC_VERSION_LARGE >= 0x06030100
class Handle_TColStd_HArray1OfByte;
#else
class Handle_TDataStd_HArray1OfByte; class Handle_TDataStd_HArray1OfByte;
#endif
struct TVariable{ struct TVariable{
TCollection_AsciiString myVariable; TCollection_AsciiString myVariable;
@ -133,13 +149,23 @@ class GEOM_Engine
Standard_EXPORT Handle(TColStd_HSequenceOfAsciiString) GetAllDumpNames() const; Standard_EXPORT Handle(TColStd_HSequenceOfAsciiString) GetAllDumpNames() const;
#if OCC_VERSION_LARGE >= 0x06030100
Standard_EXPORT int addTexture(int theDocID, int theWidth, int theHeight, 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 Handle(TDataStd_HArray1OfByte)& theTexture,
const TCollection_AsciiString& theFileName = ""); 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, int& theWidth, int& theHeight,
TCollection_AsciiString& theFileName); TCollection_AsciiString& theFileName);
#endif
Standard_EXPORT std::list<int> getAllTextures(int theDocID); Standard_EXPORT std::list<int> getAllTextures(int theDocID);
@ -151,7 +177,11 @@ class GEOM_Engine
private: private:
Handle(GEOM_Application) _OCAFApp; Handle(GEOM_Application) _OCAFApp;
#if OCC_VERSION_LARGE >= 0x06030100
TColStd_DataMapOfIntegerTransient _mapIDDocument;
#else
Interface_DataMapOfIntegerTransient _mapIDDocument; Interface_DataMapOfIntegerTransient _mapIDDocument;
#endif
int _UndoLimit; int _UndoLimit;
GEOM_DataMapOfAsciiStringTransient _objects; GEOM_DataMapOfAsciiStringTransient _objects;

View File

@ -42,7 +42,17 @@
#include <ShapeFix_Wire.hxx> #include <ShapeFix_Wire.hxx>
#include <ShapeFix_Edge.hxx> #include <ShapeFix_Edge.hxx>
#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 <IntPatch_TheIIIntOfIntersection.hxx> #include <IntPatch_TheIIIntOfIntersection.hxx>
#else
#include <IntPatch_ImpImpIntersection.hxx>
#endif
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <BRep_Builder.hxx> #include <BRep_Builder.hxx>
@ -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 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS; OCC_CATCH_SIGNALS;
#endif #endif
#if OCC_VERSION_LARGE < 0x06040000
IntPatch_TheIIIntOfIntersection anIIInt (aGA1, aTT1, aGA2, aTT2, aPrec, aPrec); 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()) if (!anIIInt.IsDone() || anIIInt.IsEmpty())
return false; return false;

View File

@ -66,6 +66,12 @@
#include <SVTK_ViewModel.h> #include <SVTK_ViewModel.h>
// OCCT Includes // OCCT Includes
#include <Standard_Version.hxx>
#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 <AIS_Drawer.hxx> #include <AIS_Drawer.hxx>
#include <AIS_ListIteratorOfListOfInteractive.hxx> #include <AIS_ListIteratorOfListOfInteractive.hxx>
#include <Prs3d_IsoAspect.hxx> #include <Prs3d_IsoAspect.hxx>
@ -93,7 +99,11 @@
#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
#include <GEOMImpl_Types.hxx> #include <GEOMImpl_Types.hxx>
#if OCC_VERSION_LARGE >= 0x06030100
#include <TColStd_HArray1OfByte.hxx>
#else
#include <Graphic3d_HArray1OfBytes.hxx> #include <Graphic3d_HArray1OfBytes.hxx>
#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 ) ) ); 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 ); if ( hasColor ) aQuanColor = Quantity_Color( aSColor.R, aSColor.G, aSColor.B, Quantity_TOC_RGB );
Standard_Integer aWidth, aHeight; Standard_Integer aWidth, aHeight;
Handle(Graphic3d_HArray1OfBytes) aTexture = GeometryGUI::getTexture( getStudy(), aTextureId, aWidth, aHeight ); #if OCC_VERSION_LARGE >= 0x06030100
if ( !aTexture.IsNull() ) { 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; static int TextureId = 0;
Handle(Prs3d_PointAspect) aTextureAspect = new Prs3d_PointAspect(aQuanColor, Handle(Prs3d_PointAspect) aTextureAspect = new Prs3d_PointAspect(aQuanColor,
++TextureId, ++TextureId,

View File

@ -83,7 +83,11 @@
#include <Aspect_TypeOfMarker.hxx> #include <Aspect_TypeOfMarker.hxx>
#include <OSD_SharedLibrary.hxx> #include <OSD_SharedLibrary.hxx>
#include <NCollection_DataMap.hxx> #include <NCollection_DataMap.hxx>
#if OCC_VERSION_LARGE >= 0x06030100
#include <TColStd_HArray1OfByte.hxx>
#else
#include <Graphic3d_HArray1OfBytes.hxx> #include <Graphic3d_HArray1OfBytes.hxx>
#endif
#include <utilities.h> #include <utilities.h>
@ -1428,10 +1432,19 @@ QString GeometryGUI::engineIOR() const
return ""; 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; theWidth = theHeight = 0;
#if OCC_VERSION_LARGE >= 0x06030100
Handle(TColStd_HArray1OfByte) aTexture;
#else
Handle(Graphic3d_HArray1OfBytes) aTexture; Handle(Graphic3d_HArray1OfBytes) aTexture;
#endif
if ( theStudy ) { if ( theStudy ) {
TextureMap aTextureMap = myTextureMap[ theStudy->studyDS()->StudyId() ]; TextureMap aTextureMap = myTextureMap[ theStudy->studyDS()->StudyId() ];
aTexture = aTextureMap[ theId ]; aTexture = aTextureMap[ theId ];
@ -1443,7 +1456,11 @@ Handle(Graphic3d_HArray1OfBytes) GeometryGUI::getTexture( SalomeApp_Study* theSt
if ( aWidth > 0 && aHeight > 0 && aStream->length() > 0 ) { if ( aWidth > 0 && aHeight > 0 && aStream->length() > 0 ) {
theWidth = aWidth; theWidth = aWidth;
theHeight = aHeight; 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++ ) for ( int i = 0; i < aStream->length(); i++ )
aTexture->SetValue( i+1, (Standard_Byte)aStream[i] ); aTexture->SetValue( i+1, (Standard_Byte)aStream[i] );
aTextureMap[ theId ] = aTexture; aTextureMap[ theId ] = aTexture;

View File

@ -41,8 +41,18 @@
#include <QMap> #include <QMap>
// OCCT Includes // OCCT Includes
#include <Standard_Version.hxx>
#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 <gp_Ax3.hxx> #include <gp_Ax3.hxx>
#if OCC_VERSION_LARGE >= 0x06030100
#include <TColStd_HArray1OfByte.hxx>
#else
#include <Graphic3d_HArray1OfBytes.hxx> #include <Graphic3d_HArray1OfBytes.hxx>
#endif
// IDL headers // IDL headers
#include "SALOMEconfig.h" #include "SALOMEconfig.h"
@ -77,8 +87,11 @@ public:
virtual LightApp_Displayer* displayer(); virtual LightApp_Displayer* displayer();
virtual void initialize( CAM_Application* ); virtual void initialize( CAM_Application* );
virtual QString engineIOR() const; 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& ); static Handle(Graphic3d_HArray1OfBytes) getTexture( SalomeApp_Study*, int, int&, int& );
#endif
static bool InitGeomGen(); static bool InitGeomGen();
@ -162,8 +175,11 @@ public:
static GEOM::GEOM_Gen_var myComponentGeom; // GEOM engine!!! static GEOM::GEOM_Gen_var myComponentGeom; // GEOM engine!!!
private: private:
#if OCC_VERSION_LARGE >= 0x06030100
typedef QMap<long, Handle(TColStd_HArray1OfByte)> TextureMap;
#else
typedef QMap<long, Handle(Graphic3d_HArray1OfBytes)> TextureMap; typedef QMap<long, Handle(Graphic3d_HArray1OfBytes)> TextureMap;
#endif
typedef QMap<long, TextureMap> StudyTextureMap; typedef QMap<long, TextureMap> StudyTextureMap;
typedef QMap<QString, GEOMGUI*> GUIMap; typedef QMap<QString, GEOMGUI*> GUIMap;

View File

@ -49,7 +49,13 @@
#include <TopoDS_Vertex.hxx> #include <TopoDS_Vertex.hxx>
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <gp_Pnt.hxx> #include <gp_Pnt.hxx>
#if OCC_VERSION_LARGE >= 0x06030100
#include <TColStd_HArray1OfByte.hxx>
#else
#include <TDataStd_HArray1OfByte.hxx> #include <TDataStd_HArray1OfByte.hxx>
#endif
#include <Standard_Failure.hxx> #include <Standard_Failure.hxx>
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC #include <Standard_ErrorHandler.hxx> // 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); SetErrorCode(KO);
if (theTextureFile.IsEmpty()) return 0; if (theTextureFile.IsEmpty()) return 0;
#if OCC_VERSION_LARGE >= 0x06030100
Handle(TColStd_HArray1OfByte) aTexture;
#else
Handle(TDataStd_HArray1OfByte) aTexture; Handle(TDataStd_HArray1OfByte) aTexture;
#endif
FILE* fp = fopen(theTextureFile.ToCString(), "r"); FILE* fp = fopen(theTextureFile.ToCString(), "r");
if (!fp) return 0; if (!fp) return 0;
@ -593,8 +603,11 @@ int GEOMImpl_IInsertOperations::LoadTexture(const TCollection_AsciiString& theTe
if (bytedata.empty() || bytedata.size() != lines.size()*lenbytes) if (bytedata.empty() || bytedata.size() != lines.size()*lenbytes)
return 0; return 0;
#if OCC_VERSION_LARGE >= 0x06030100
aTexture = new TColStd_HArray1OfByte(1, lines.size()*lenbytes);
#else
aTexture = new TDataStd_HArray1OfByte(1, lines.size()*lenbytes); aTexture = new TDataStd_HArray1OfByte(1, lines.size()*lenbytes);
#endif
std::list<unsigned char>::iterator bdit; std::list<unsigned char>::iterator bdit;
int i; int i;
for (i = 1, bdit = bytedata.begin(); bdit != bytedata.end(); ++bdit, ++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, 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); SetErrorCode(KO);
int aTextureId = GetEngine()->addTexture(GetDocID(), theWidth, theHeight, theTexture); int aTextureId = GetEngine()->addTexture(GetDocID(), theWidth, theHeight, theTexture);
@ -614,12 +632,20 @@ int GEOMImpl_IInsertOperations::AddTexture(int theWidth, int theHeight,
return aTextureId; 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) int& theWidth, int& theHeight)
{ {
SetErrorCode(KO); SetErrorCode(KO);
#if OCC_VERSION_LARGE >= 0x06030100
Handle(TColStd_HArray1OfByte) aTexture;
#else
Handle(TDataStd_HArray1OfByte) aTexture; Handle(TDataStd_HArray1OfByte) aTexture;
#endif
theWidth = theHeight = 0; theWidth = theHeight = 0;
TCollection_AsciiString aFileName; TCollection_AsciiString aFileName;

View File

@ -33,7 +33,18 @@
#include <Resource_Manager.hxx> #include <Resource_Manager.hxx>
#include <list> #include <list>
#include <Standard_Version.hxx>
#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; class Handle_TDataStd_HArray1OfByte;
#endif
class GEOMImpl_IInsertOperations : public GEOM_IOperations { class GEOMImpl_IInsertOperations : public GEOM_IOperations {
public: public:
@ -62,11 +73,21 @@ class GEOMImpl_IInsertOperations : public GEOM_IOperations {
Standard_EXPORT int LoadTexture(const TCollection_AsciiString& theTextureFile); 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, Standard_EXPORT int AddTexture(int theWidth, int theHeight,
const Handle(TDataStd_HArray1OfByte)& theTexture); const Handle(TDataStd_HArray1OfByte)& theTexture);
Standard_EXPORT Handle(TDataStd_HArray1OfByte) GetTexture(int theTextureId, Standard_EXPORT Handle(TDataStd_HArray1OfByte) GetTexture(int theTextureId,
int& theWidth, int& theHeight); int& theWidth, int& theHeight);
#endif
Standard_EXPORT std::list<int> GetAllTextures(); Standard_EXPORT std::list<int> GetAllTextures();

View File

@ -70,11 +70,22 @@
#include "utilities.h" #include "utilities.h"
// OCCT Includes // OCCT Includes
#include <Standard_Version.hxx>
#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 <AIS_Drawer.hxx> #include <AIS_Drawer.hxx>
#include <Prs3d_IsoAspect.hxx> #include <Prs3d_IsoAspect.hxx>
#include <Prs3d_PointAspect.hxx> #include <Prs3d_PointAspect.hxx>
#include <Graphic3d_AspectMarker3d.hxx> #include <Graphic3d_AspectMarker3d.hxx>
#if OCC_VERSION_LARGE >= 0x06030100
#include <TColStd_HArray1OfByte.hxx>
#else
#include <Graphic3d_HArray1OfBytes.hxx> #include <Graphic3d_HArray1OfBytes.hxx>
#endif
// QT Includes // QT Includes
#include <QColorDialog> #include <QColorDialog>
@ -256,7 +267,11 @@ void GEOMToolsGUI::OnAutoColor()
else { else {
Standard_Integer aWidth, aHeight; Standard_Integer aWidth, aHeight;
aCurPointAspect->GetTextureSize( 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 ) ); aCurDrawer->SetPointAspect( new Prs3d_PointAspect( aQuanColor, 1, aWidth, aHeight, aTexture ) );
} }
ic->SetLocalAttributes( io, aCurDrawer ); ic->SetLocalAttributes( io, aCurDrawer );
@ -359,7 +374,11 @@ void GEOMToolsGUI::OnColor()
else { else {
Standard_Integer aWidth, aHeight; Standard_Integer aWidth, aHeight;
aCurPointAspect->GetTextureSize( 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)); aCurDrawer->SetPointAspect(new Prs3d_PointAspect(aColor, 1, aWidth, aHeight, aTexture));
} }
ic->SetLocalAttributes(io, aCurDrawer); ic->SetLocalAttributes(io, aCurDrawer);

View File

@ -34,6 +34,13 @@
#include <SALOME_ListIO.hxx> #include <SALOME_ListIO.hxx>
#include <SALOME_ListIteratorOfListIO.hxx> #include <SALOME_ListIteratorOfListIO.hxx>
#include <Standard_Version.hxx>
#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 <QButtonGroup> #include <QButtonGroup>
#include <QGridLayout> #include <QGridLayout>
#include <QHBoxLayout> #include <QHBoxLayout>
@ -320,7 +327,11 @@ void GEOMToolsGUI_MarkerDlg::addTexture( int id, bool select ) const
{ {
if ( id > 0 && myCustomTypeCombo->index( id ) == -1 ) { if ( id > 0 && myCustomTypeCombo->index( id ) == -1 ) {
int tWidth, tHeight; 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 ); Handle(Graphic3d_HArray1OfBytes) texture = GeometryGUI::getTexture( getStudy(), id, tWidth, tHeight );
#endif
if ( !texture.IsNull() && texture->Length() == tWidth*tHeight/8 ) { if ( !texture.IsNull() && texture->Length() == tWidth*tHeight/8 ) {
QImage image( tWidth, tHeight, QImage::Format_Mono ); QImage image( tWidth, tHeight, QImage::Format_Mono );
image.setColor( 0, qRgba( 0, 0, 0, 0 ) ); image.setColor( 0, qRgba( 0, 0, 0, 0 ) );

View File

@ -35,8 +35,20 @@
#include "GEOM_Engine.hxx" #include "GEOM_Engine.hxx"
#include "GEOM_Object.hxx" #include "GEOM_Object.hxx"
#include <Standard_Version.hxx>
#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 <TColStd_HSequenceOfAsciiString.hxx> #include <TColStd_HSequenceOfAsciiString.hxx>
#if OCC_VERSION_LARGE >= 0x06030100
#include <TColStd_HArray1OfByte.hxx>
#else
#include <TDataStd_HArray1OfByte.hxx> #include <TDataStd_HArray1OfByte.hxx>
#endif
//============================================================================= //=============================================================================
/*! /*!
@ -228,9 +240,17 @@ CORBA::Long GEOM_IInsertOperations_i::AddTexture(CORBA::Long theWidth, CORBA::Lo
const SALOMEDS::TMPFile& theTexture) const SALOMEDS::TMPFile& theTexture)
{ {
GetOperations()->SetNotDone(); GetOperations()->SetNotDone();
#if OCC_VERSION_LARGE >= 0x06030100
Handle(TColStd_HArray1OfByte) aTexture;
#else
Handle(TDataStd_HArray1OfByte) aTexture; Handle(TDataStd_HArray1OfByte) aTexture;
#endif
if ( theTexture.length() > 0 ) { if ( theTexture.length() > 0 ) {
#if OCC_VERSION_LARGE >= 0x06030100
aTexture = new TColStd_HArray1OfByte( 1, theTexture.length() );
#else
aTexture = new TDataStd_HArray1OfByte( 1, theTexture.length() ); aTexture = new TDataStd_HArray1OfByte( 1, theTexture.length() );
#endif
for ( int i = 0; i < theTexture.length(); i++ ) for ( int i = 0; i < theTexture.length(); i++ )
aTexture->SetValue( i+1, (Standard_Byte)theTexture[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) CORBA::Long& theHeight)
{ {
int aWidth, aHeight; 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 ); Handle(TDataStd_HArray1OfByte) aTextureImpl = GetOperations()->GetTexture( theID, aWidth, aHeight );
#endif
theWidth = aWidth; theWidth = aWidth;
theHeight = aHeight; theHeight = aHeight;
SALOMEDS::TMPFile_var aTexture; SALOMEDS::TMPFile_var aTexture;