Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ ENDIF()
## GUI specifics
##

FIND_PACKAGE(SalomeSIP REQUIRED) # should come after Python and before PyQt
#FIND_PACKAGE(SalomeSIP REQUIRED) # should come after Python and before PyQt

# Build with GUI observers feature
IF(SALOME_GUI_USE_OBSERVERS)
Expand Down
4 changes: 4 additions & 0 deletions src/LightApp/LightApp_ExtInfoDlg.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,11 @@ QByteArray LightApp_ExtInfoDlg::renderExtTreeGraph(const GraphWrapper& graph) co

MESSAGE("Render dependency tree...\n");
char* buffer = nullptr;
#if defined(__APPLE__)
size_t bufferLength = 0;
#else
unsigned int bufferLength = 0;
#endif
res = gvRenderData(gvc, extTreeGraph, "svg", &buffer, &bufferLength);
if (res)
{
Expand Down
3 changes: 2 additions & 1 deletion src/OpenGLUtils/OpenGLUtils_FrameBuffer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,10 @@ OpenGLUtils_FrameBuffer::~OpenGLUtils_FrameBuffer()
release();
}


bool OpenGLUtils_FrameBuffer::init( const GLsizei& xSize, const GLsizei& ySize )
{
#if defined(VTK_OPENGL2) && ! defined(WIN32)
#if defined(VTK_OPENGL2) && ! defined(WIN32) && !defined(__APPLE__)
int n = 0;
std::ostringstream strm;
glGetIntegerv(GL_NUM_EXTENSIONS, &n);
Expand Down
1 change: 0 additions & 1 deletion src/PV3DViewer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ SET(_link_LIBRARIES
${KERNEL_SALOMELocalTrace}
${KERNEL_OpUtil}
suit
PV3DViewer
PVViewer
PVServerService
ParaView::pqApplicationComponents
Expand Down
23 changes: 13 additions & 10 deletions src/PVViewer/PVViewer_Core.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

#include <string>

#include <pqOptions.h>
//#include <pqOptions.h>
#include <pqSettings.h>
#include <pqPVApplicationCore.h>
#include <pqTabbedMultiViewWidget.h>
Expand All @@ -44,6 +44,8 @@
#include <pqPipelineBrowserWidget.h>
#include <pqServerDisconnectReaction.h>

#include <vtkProcessModule.h>
#include <vtkCLIOptions.h>
//---------- Static init -----------------
pqPVApplicationCore* PVViewer_Core::MyCoreApp = nullptr;
bool PVViewer_Core::MyPqTabWidSingletonLoaded = false;
Expand Down Expand Up @@ -94,15 +96,16 @@ bool PVViewer_Core::ParaViewInitAppCore()
}
//
MyCoreApp = new pqPVApplicationCore (argc, argv);
for (int i = 0; i < argc; i++)
free(argv[i]);
delete[] argv;
if (MyCoreApp->getOptions()->GetHelpSelected() ||
MyCoreApp->getOptions()->GetUnknownArgument() ||
MyCoreApp->getOptions()->GetErrorMessage() ||
MyCoreApp->getOptions()->GetTellVersion()) {
return false;
}
// for (int i = 0; i < argc; i++)
// free(argv[i]);
// delete[] argv;
// vtkPVOptions* options = vtkProcessModule::GetProcessModule()->GetOptions();
// if (options->GetHelpSelected() ||
// options->GetUnknownArgument() ||
// options->GetErrorMessage() ||
// options->GetTellVersion()) {
// return false;
// }
}
return true;
}
Expand Down
3 changes: 2 additions & 1 deletion src/Plot2d/Plot2d_Curve.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ void Plot2d_Curve::updatePlotItem( QwtPlotItem* theItem )
aCurve->clearDeviationData();
}
} else {
aCurve->setSamples( NULL, NULL, 0 );
aCurve->setSamples(static_cast<const double*>(nullptr),
static_cast<const double*>(nullptr), 0);
}
}

Expand Down
7 changes: 7 additions & 0 deletions src/Plot2d/Plot2d_Histogram.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@

#include <qwt_plot_curve.h>


#if QWT_VERSION >= 0x060200
#include <QVector>

template<class T> using QwtArray = QVector<T>;
#endif

const int MAX_ATTEMPTS = 10; // max attempts

/*!
Expand Down
6 changes: 6 additions & 0 deletions src/Plot2d/Plot2d_PlotItems.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@
#include <qwt_legend.h>
#include <qwt_legend_label.h>
#include <qwt_plot_dict.h>
#include <qwt_graphic.h>


#if QWT_VERSION >= 0x060200
#define qwtMin qMin
#endif

const int SPACING = 10;
const int SYMBOL_SIZE = 13;
Expand Down
9 changes: 8 additions & 1 deletion src/Plot2d/Plot2d_PlotItems.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,14 @@
#include <qwt_plot_curve.h>
#include <qwt_plot.h>
#include <qwt_series_data.h>
#include <qwt_compat.h>
#include <qwt_global.h>
#if defined(QWT_VERSION) && (QWT_VERSION < 0x060200)
#include <qwt_compat.h>
#endif

#if QWT_VERSION >= 0x060200
typedef QRectF QwtDoubleRect;
#endif

class PLOT2D_EXPORT Plot2d_QwtLegendLabel : public QwtLegendLabel
{
Expand Down
23 changes: 19 additions & 4 deletions src/Plot2d/Plot2d_ViewFrame.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
#include <QLocale>
#include <QXmlStreamWriter>
#include <QXmlStreamReader>
#include <QList>
#include <QVector>

#include <qwt_math.h>
#include <qwt_plot_layout.h>
Expand All @@ -77,6 +79,13 @@
#include <qwt_plot_renderer.h>
#include <qwt_legend.h>
#include <qwt_scale_widget.h>
#include <qwt_scale_map.h>



#if QWT_VERSION >= 0x060200
typedef QList<double> QwtValueList;
#endif

#include <stdlib.h>
#include <limits>
Expand Down Expand Up @@ -2862,10 +2871,16 @@ void Plot2d_ViewFrame::setCurveType( QwtPlotCurve* curve, int /*curveType*/ )
}
else if ( myCurveType == 2 ) {
curve->setStyle( QwtPlotCurve::Lines );
QwtSplineCurveFitter* fitter = new QwtSplineCurveFitter();
fitter->setSplineSize( 250 );
curve->setCurveAttribute( QwtPlotCurve::Fitted, true );
curve->setCurveFitter( fitter );
#if QWT_VERSION < 0x060200
QwtSplineCurveFitter* fitter = new QwtSplineCurveFitter();
fitter->setSplineSize(250);
curve->setCurveAttribute( QwtPlotCurve::Fitted, true );
curve->setCurveFitter(fitter);
#else
// Qwt >= 6.2: class removed, use built-in fitting flag
curve->setCurveAttribute(QwtPlotCurve::Fitted, true);
#endif

}
}

Expand Down
2 changes: 2 additions & 0 deletions src/Plot2d/Plot2d_ViewFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
#include <qwt_plot_canvas.h>
#include <qwt_legend.h>



#include <iostream>
#include <ostream>

Expand Down
6 changes: 6 additions & 0 deletions src/SALOME_PYQT/SALOME_PYQT_GUILight/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ SET(SalomePyQtGUILight_SOURCES ${_other_SOURCES} ${_moc_SOURCES} ${_sip_SOURCES}

ADD_LIBRARY(SalomePyQtGUILight ${SalomePyQtGUILight_SOURCES})
TARGET_LINK_LIBRARIES(SalomePyQtGUILight ${_link_LIBRARIES})
target_include_directories(SalomePyQtGUILight
PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/_sip_SOURCES_sipbuild
${CMAKE_CURRENT_BINARY_DIR}/_sip_SOURCES_sipbuild/SalomePyQtGUILight
)

INSTALL(TARGETS SalomePyQtGUILight DESTINATION ${SALOME_INSTALL_LIBS})

INSTALL(FILES ${SalomePyQtGUILight_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
Expand Down
7 changes: 7 additions & 0 deletions src/SALOME_PYQT/SalomePyQt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ SET(SalomePyQt_SOURCES ${_other_SOURCES} ${_moc_SOURCES} ${_sip_SOURCES})

# --- rules ---

add_definitions(-Dprotected=public -DSIP_PROTECTED_IS_PUBLIC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dprotected=public -DSIP_PROTECTED_IS_PUBLIC")

INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}/_sip_SOURCES_sipbuild
)

ADD_LIBRARY(SalomePyQt MODULE ${SalomePyQt_SOURCES})
TARGET_LINK_LIBRARIES(SalomePyQt ${_link_LIBRARIES})
INSTALL(TARGETS SalomePyQt DESTINATION ${SALOME_INSTALL_LIBS})
Expand Down
21 changes: 20 additions & 1 deletion src/VTKViewer/VTKViewer_GeometryFilter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,20 @@ VTKViewer_GeometryFilter
static inline bool toShowEdge( vtkIdType id1, vtkIdType id2, vtkIdType cellId, vtkUnstructuredGrid* input )
{
// return true if the given cell is the 1st among cells including the edge
#if VTK_VERSION_NUMBER >= VTK_VERSION_CHECK(9,0,0)
vtkStaticCellLinks * links = static_cast<vtkStaticCellLinks *>(input->GetLinks());
if ( !links ) {
input->BuildLinks();
links = static_cast<vtkStaticCellLinks *>(input->GetLinks());
}
#else
vtkStaticCellLinks * links = static_cast<vtkStaticCellLinks *>(input->GetCellLinks());
if ( !links ) {
input->BuildLinks();
links = static_cast<vtkStaticCellLinks *>(input->GetCellLinks());
}
#endif

if ( id1 < id2 )
std::swap( id1, id2 );
vtkIdType *cells = links->GetCells( id1 );
Expand Down Expand Up @@ -463,8 +472,13 @@ ::UnstructuredGridExecute(vtkDataSet *dataSetInput,
}//for all cells
}//if not all visible

#if VTK_VERSION_NUMBER >= VTK_VERSION_CHECK(9,0,0)
if ( input->GetLinks() )
input->BuildLinks();
#else
if ( input->GetCellLinks() )
input->BuildLinks();
#endif

// Loop over all cells now that visibility is known
// (Have to compute visibility first for 3D cell boundaries)
Expand Down Expand Up @@ -1324,11 +1338,16 @@ ::UnstructuredGridExecute(vtkDataSet *dataSetInput,
{
delete [] cellVis;
}

#if VTK_VERSION_NUMBER >= VTK_VERSION_CHECK(9,0,0)
if ( input->GetLinks() ){
input->GetLinks()->Initialize();
}
#else
if ( input->GetCellLinks() )
{
input->GetCellLinks()->Initialize(); // free memory
}
#endif

// fill myVTK2ObjIds vector in ascending cell dimension order
myVTK2ObjIds.clear();
Expand Down
26 changes: 18 additions & 8 deletions src/VTKViewer/VTKViewer_OpenGLHelper.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,30 @@
#include "VTKViewer_OpenGLHelper.h"
#include <Basics_Utils.hxx>


#ifndef WIN32
# ifndef GLX_GLXEXT_LEGACY
# define GLX_GLXEXT_LEGACY
# endif
# include <GL/glx.h>
#ifdef __APPLE__
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>
#endif
# include <dlfcn.h>
#else
# include <wingdi.h>
#endif



#ifndef WIN32
#define GL_GetProcAddress( x ) glXGetProcAddressARB( (const GLubyte*)x )
#else
#define GL_GetProcAddress( x ) wglGetProcAddress( (const LPCSTR)x )
#endif


// ============================================================================
// function : VTKViewer_OpenGLHelper
// purpose :
Expand Down Expand Up @@ -97,7 +105,7 @@ void VTKViewer_OpenGLHelper::Init()
{
if (mIsInitialized)
return;

#if !defined(__APPLE__) // GL function exposed directly
vglShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)GL_GetProcAddress( "glShaderSourceARB" );
if( !vglShaderSourceARB )
return;
Expand Down Expand Up @@ -158,6 +166,7 @@ void VTKViewer_OpenGLHelper::Init()
if(!vglDisableVertexAttribArrayARB)
return;


#ifdef VTK_OPENGL2
vglDetachObjectARB = (PFNGLDETACHOBJECTARBPROC)GL_GetProcAddress( "glDetachObjectARB" );
if( !vglDetachObjectARB )
Expand Down Expand Up @@ -210,6 +219,7 @@ void VTKViewer_OpenGLHelper::Init()
vglUniform1iARB = (PFNGLUNIFORM1IARBPROC)GL_GetProcAddress( "glUniform1i" );
if( !vglUniform1iARB )
return;
#endif
#endif

mIsInitialized = true;
Expand Down Expand Up @@ -280,13 +290,13 @@ bool VTKViewer_OpenGLHelper::CreateShaderProgram (const std::string& theFilePath

free( shaderContent );

vglGetShaderivARB (theVertexShader, GL_COMPILE_STATUS, &compileStatus);
vglGetShaderivARB (GLcast(theVertexShader), GL_COMPILE_STATUS, &compileStatus);
if (compileStatus != GL_TRUE)
{
GLint size;
GLcharARB info[1024];

vglGetShaderInfoLogARB (theVertexShader, 1024, &size, info);
vglGetShaderInfoLogARB (GLcast(theVertexShader), 1024, &size, info);
std::cerr << "Can't compile vertex shader." << std::endl;
std::cerr << info << std::endl;

Expand All @@ -304,13 +314,13 @@ bool VTKViewer_OpenGLHelper::CreateShaderProgram (const std::string& theFilePath

free (shaderContent);

vglGetShaderivARB (theFragmentShader, GL_COMPILE_STATUS, &compileStatus);
vglGetShaderivARB (GLcast(theFragmentShader), GL_COMPILE_STATUS, &compileStatus);
if (compileStatus != GL_TRUE)
{
GLint size;
GLcharARB info[1024];

vglGetShaderInfoLogARB (theVertexShader, 1024, &size, info);
vglGetShaderInfoLogARB (GLcast(theVertexShader), 1024, &size, info);
std::cerr << "Can't compile fragment shader." << std::endl;
std::cerr << info << std::endl;
return false;
Expand All @@ -321,15 +331,15 @@ bool VTKViewer_OpenGLHelper::CreateShaderProgram (const std::string& theFilePath
vglAttachObjectARB (theProgram, theFragmentShader);
vglLinkProgramARB (theProgram);

vglGetProgramivARB (theProgram, GL_LINK_STATUS, &linked);
vglGetProgramivARB (GLcast(theProgram), GL_LINK_STATUS, &linked);
if (!linked)
{
std::cerr << "Can't link program." << std::endl;
return false;
}

vglValidateProgramARB (theProgram);
vglGetProgramivARB (theProgram, GL_VALIDATE_STATUS, &validateStatus);
vglGetProgramivARB (GLcast(theProgram), GL_VALIDATE_STATUS, &validateStatus);

if (validateStatus != GL_TRUE)
{
Expand Down
10 changes: 8 additions & 2 deletions src/VTKViewer/VTKViewer_OpenGLHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,14 @@
#include <windows.h>
#endif

#include <GL/gl.h>

#ifdef __APPLE__
#include <OpenGL/gl.h>
#define GLcast(X) (GLuint)(uintptr_t)X
#define GLcastInv(X) (GLhandleARB)(uintptr_t)X
#else
#include <GL/gl.h>
#define GLcast(X) X
#endif

#ifndef GL_ARB_shader_objects
typedef GLuint GLhandleARB;
Expand Down
Loading