mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-13 02:00:35 +05:00
porting to OOCT 6.4.0
This commit is contained in:
parent
23164dcedd
commit
a9a578b602
@ -45,7 +45,11 @@
|
||||
#include <TDataStd_ChildNodeIterator.hxx>
|
||||
#include <TFunction_Driver.hxx>
|
||||
#include <TFunction_DriverTable.hxx>
|
||||
#if OCC_VERSION_LARGE >= 0x06030100
|
||||
#include <TColStd_HArray1OfByte.hxx>
|
||||
#else
|
||||
#include <TDataStd_HArray1OfByte.hxx>
|
||||
#endif
|
||||
#include <TDataStd_ByteArray.hxx>
|
||||
#include <TDataStd_UAttribute.hxx>
|
||||
#include <TDF_ChildIterator.hxx>
|
||||
@ -60,7 +64,11 @@
|
||||
#include <TColStd_MapOfTransient.hxx>
|
||||
#include <TColStd_HSequenceOfInteger.hxx>
|
||||
|
||||
#if OCC_VERSION_LARGE >= 0x06030100
|
||||
#include <TColStd_DataMapIteratorOfDataMapOfIntegerTransient.hxx>
|
||||
#else
|
||||
#include <Interface_DataMapIteratorOfDataMapOfIntegerTransient.hxx>
|
||||
#endif
|
||||
#include <Resource_DataMapIteratorOfDataMapOfAsciiStringAsciiString.hxx>
|
||||
|
||||
#include <set>
|
||||
@ -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 += "] = ";
|
||||
|
@ -27,7 +27,18 @@
|
||||
#include "GEOM_Object.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 <TDocStd_Document.hxx>
|
||||
#include <TColStd_HArray1OfInteger.hxx>
|
||||
@ -38,7 +49,12 @@
|
||||
#include <list>
|
||||
#include <vector>
|
||||
|
||||
#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<int> 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;
|
||||
|
||||
|
@ -42,7 +42,17 @@
|
||||
#include <ShapeFix_Wire.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>
|
||||
#else
|
||||
#include <IntPatch_ImpImpIntersection.hxx>
|
||||
#endif
|
||||
|
||||
#include <BRep_Tool.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
|
||||
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;
|
||||
|
||||
|
@ -66,6 +66,12 @@
|
||||
#include <SVTK_ViewModel.h>
|
||||
|
||||
// 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_ListIteratorOfListOfInteractive.hxx>
|
||||
#include <Prs3d_IsoAspect.hxx>
|
||||
@ -93,7 +99,11 @@
|
||||
#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
|
||||
|
||||
#include <GEOMImpl_Types.hxx>
|
||||
#if OCC_VERSION_LARGE >= 0x06030100
|
||||
#include <TColStd_HArray1OfByte.hxx>
|
||||
#else
|
||||
#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 ) ) );
|
||||
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,
|
||||
|
@ -83,7 +83,11 @@
|
||||
#include <Aspect_TypeOfMarker.hxx>
|
||||
#include <OSD_SharedLibrary.hxx>
|
||||
#include <NCollection_DataMap.hxx>
|
||||
#if OCC_VERSION_LARGE >= 0x06030100
|
||||
#include <TColStd_HArray1OfByte.hxx>
|
||||
#else
|
||||
#include <Graphic3d_HArray1OfBytes.hxx>
|
||||
#endif
|
||||
|
||||
#include <utilities.h>
|
||||
|
||||
@ -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;
|
||||
|
@ -41,8 +41,18 @@
|
||||
#include <QMap>
|
||||
|
||||
// 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>
|
||||
#if OCC_VERSION_LARGE >= 0x06030100
|
||||
#include <TColStd_HArray1OfByte.hxx>
|
||||
#else
|
||||
#include <Graphic3d_HArray1OfBytes.hxx>
|
||||
#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<long, Handle(TColStd_HArray1OfByte)> TextureMap;
|
||||
#else
|
||||
typedef QMap<long, Handle(Graphic3d_HArray1OfBytes)> TextureMap;
|
||||
#endif
|
||||
typedef QMap<long, TextureMap> StudyTextureMap;
|
||||
typedef QMap<QString, GEOMGUI*> GUIMap;
|
||||
|
||||
|
@ -49,7 +49,13 @@
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
|
||||
|
||||
#if OCC_VERSION_LARGE >= 0x06030100
|
||||
#include <TColStd_HArray1OfByte.hxx>
|
||||
#else
|
||||
#include <TDataStd_HArray1OfByte.hxx>
|
||||
#endif
|
||||
|
||||
#include <Standard_Failure.hxx>
|
||||
#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);
|
||||
|
||||
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<unsigned char>::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;
|
||||
|
||||
|
@ -33,7 +33,18 @@
|
||||
#include <Resource_Manager.hxx>
|
||||
#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;
|
||||
#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<int> GetAllTextures();
|
||||
|
||||
|
@ -70,11 +70,22 @@
|
||||
#include "utilities.h"
|
||||
|
||||
// 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 <Prs3d_IsoAspect.hxx>
|
||||
#include <Prs3d_PointAspect.hxx>
|
||||
#include <Graphic3d_AspectMarker3d.hxx>
|
||||
#if OCC_VERSION_LARGE >= 0x06030100
|
||||
#include <TColStd_HArray1OfByte.hxx>
|
||||
#else
|
||||
#include <Graphic3d_HArray1OfBytes.hxx>
|
||||
#endif
|
||||
|
||||
|
||||
// QT Includes
|
||||
#include <QColorDialog>
|
||||
@ -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);
|
||||
|
@ -34,6 +34,13 @@
|
||||
#include <SALOME_ListIO.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 <QGridLayout>
|
||||
#include <QHBoxLayout>
|
||||
@ -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 ) );
|
||||
|
@ -35,8 +35,20 @@
|
||||
#include "GEOM_Engine.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>
|
||||
#if OCC_VERSION_LARGE >= 0x06030100
|
||||
#include <TColStd_HArray1OfByte.hxx>
|
||||
#else
|
||||
#include <TDataStd_HArray1OfByte.hxx>
|
||||
#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;
|
||||
|
Loading…
Reference in New Issue
Block a user