Fixed seg fault on start with >= VTK9.1, MACOSX: fixed bundle with homebrew

This commit is contained in:
matlabbe
2023-03-25 22:41:28 -07:00
parent fc7a6708c5
commit 6dca8ab0f3
4 changed files with 31 additions and 17 deletions

View File

@@ -82,7 +82,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <vtkOpenGLRenderer.h>
#endif
#if VTK_MAJOR_VERSION >= 8
#include <vtkGenericOpenGLRenderWindow.h>
#endif
@@ -140,11 +139,8 @@ CloudViewer::CloudViewer(QWidget *parent, CloudViewerInteractorStyle * style) :
_intensityAbsMax(100.0f),
_coordinateFrameScale(1.0)
{
UDEBUG("");
this->setMinimumSize(200, 200);
vtkObject::GlobalWarningDisplayOff();
int argc = 0;
UASSERT(style!=0);
style->setCloudViewer(this);
@@ -208,12 +204,13 @@ CloudViewer::CloudViewer(QWidget *parent, CloudViewerInteractorStyle * style) :
this->SetRenderWindow(_visualizer->getRenderWindow());
#endif
// Replaced by the second line, to avoid a crash in Mac OS X on close, as well as
// the "Invalid drawable" warning when the view is not visible.
//_visualizer->setupInteractor(this->GetInteractor(), this->GetRenderWindow());
// Replaced by the second line, to avoid a crash in Mac OS X on close, as well as
// the "Invalid drawable" warning when the view is not visible.
#if VTK_MAJOR_VERSION > 8
//_visualizer->setupInteractor(this->interactor(), this->renderWindow());
this->interactor()->SetInteractorStyle (_visualizer->getInteractorStyle());
#else
//_visualizer->setupInteractor(this->GetInteractor(), this->GetRenderWindow());
this->GetInteractor()->SetInteractorStyle (_visualizer->getInteractorStyle());
#endif
// setup a simple point picker
@@ -1502,11 +1499,11 @@ bool CloudViewer::addTextureMesh (
// Save the viewpoint transformation matrix to the global actor map
(*_visualizer->getCloudActorMap())[id].viewpoint_transformation_ = transformation;
#endif
#if VTK_MAJOR_VERSION >= 7
actor->GetProperty()->SetAmbient(0.1);
#else
actor->GetProperty()->SetAmbient(0.5);
actor->GetProperty()->SetAmbient(0.1);
#else
actor->GetProperty()->SetAmbient(0.5);
#endif
actor->GetProperty()->SetLighting(_aSetLighting->isChecked());
actor->GetProperty()->SetInterpolation(_aSetFlatShading->isChecked()?VTK_FLAT:VTK_PHONG);