X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FVTKViewer%2FVTKViewer_PolyDataMapper.cxx;h=8071540037eae583e63a350f81af3887cded6407;hb=refs%2Fheads%2Fngr%2Fpython3_dev_pv5.4;hp=3f08ccfbbd793f83ee677e11f5a5f8d2f74a61a5;hpb=e4de1ecd1242ddd90a60bc87beefc8d2af6020db;p=modules%2Fgui.git diff --git a/src/VTKViewer/VTKViewer_PolyDataMapper.cxx b/src/VTKViewer/VTKViewer_PolyDataMapper.cxx index 3f08ccfbb..807154003 100644 --- a/src/VTKViewer/VTKViewer_PolyDataMapper.cxx +++ b/src/VTKViewer/VTKViewer_PolyDataMapper.cxx @@ -46,7 +46,27 @@ # ifndef GLX_GLXEXT_LEGACY # define GLX_GLXEXT_LEGACY # endif +#ifdef __APPLE__ +#import +#import +#import +void * glXGetProcAddressARB (const GLubyte *name) + +{ + NSSymbol symbol; + char *symbolName; + symbolName = (char *)malloc (strlen ((const char *)name) + 2); // 1 + strcpy(symbolName + 1, (const char *)name); // 2 + symbolName[0] = '_'; // 3 + symbol = NULL; + if (NSIsSymbolNameDefined (symbolName)) // 4 + symbol = NSLookupAndBindSymbol (symbolName); + free (symbolName); // 5 + return symbol ? NSAddressOfSymbol (symbol) : NULL; // 6 +} +#else # include +#endif # include #else # include @@ -136,7 +156,7 @@ int VTKViewer_PolyDataMapper::InitShader() std::string fileName = std::string( getenv( "GUI_ROOT_DIR") ) + "/share/salome/resources/gui/Vertex_Program_ARB.txt"; - char* shader = readFromFile( fileName ); + char* shader = GUI_OPENGL::readFromFile( fileName ); GLhandleARB VertexShader = this->OpenGLHelper.vglCreateShaderObjectARB( GL_VERTEX_SHADER_ARB ); this->OpenGLHelper.vglShaderSourceARB( VertexShader, 1, (const GLcharARB**)&shader, NULL ); @@ -593,6 +613,8 @@ namespace VTK virtual void get( TVertex& theVertex, vtkIdType thePointId, vtkIdType theCellId ) = 0; + + virtual ~TColorFunctorBase() {} }; //----------------------------------------------------------------------------- @@ -840,7 +862,6 @@ void VTKViewer_PolyDataMapper::InternalDraw(vtkRenderer* ren, vtkActor* act ) { } int* aSize = this->ImageData->GetDimensions(); - //glPointSize( std::max( aSize[0], aSize[1] ) ); int aMode = 0; // to remove { @@ -945,7 +966,7 @@ void VTKViewer_PolyDataMapper::InternalDraw(vtkRenderer* ren, vtkActor* act ) { #else GLuint aBufferObjectID, aDiamsID = 0; GLint attribute_diams = -1; - + glPointSize( std::max( aSize[0], aSize[1] ) ); this->OpenGLHelper.vglGenBuffersARB( 1, &aBufferObjectID ); this->OpenGLHelper.vglBindBufferARB( GL_ARRAY_BUFFER_ARB, aBufferObjectID ); @@ -974,7 +995,7 @@ void VTKViewer_PolyDataMapper::InternalDraw(vtkRenderer* ren, vtkActor* act ) { this->OpenGLHelper.vglBindBufferARB( GL_ARRAY_BUFFER_ARB, 0 ); this->OpenGLHelper.vglBindBufferARB( GL_ARRAY_BUFFER_ARB, aDiamsID ); - attribute_diams = vglGetAttribLocationARB(this->PointProgram, "diameter"); + attribute_diams = this->OpenGLHelper.vglGetAttribLocationARB(this->PointProgram, "diameter"); this->OpenGLHelper.vglEnableVertexAttribArrayARB(attribute_diams); this->OpenGLHelper.vglBindBufferARB(GL_ARRAY_BUFFER_ARB, aDiamsID); this->OpenGLHelper.vglVertexAttribPointerARB(