Remove old Coin code <=3
ubuntu 22.04 use libcoin v 4. https://launchpad.net/ubuntu/jammy/+package/libcoin-dev
This commit is contained in:
@@ -76,9 +76,7 @@
|
||||
#include <QWindow>
|
||||
|
||||
#include <Inventor/C/basic.h>
|
||||
#if COIN_MAJOR_VERSION >= 4
|
||||
#include <Inventor/SbByteBuffer.h>
|
||||
#endif
|
||||
|
||||
#include <Inventor/SbColor.h>
|
||||
#include <Inventor/SbViewportRegion.h>
|
||||
@@ -1245,11 +1243,7 @@ QuarterWidget::setNavigationModeFile(const QUrl & url)
|
||||
QFile file(filenametmp);
|
||||
if (file.open(QIODevice::ReadOnly)){
|
||||
QByteArray fileContents = file.readAll();
|
||||
#if COIN_MAJOR_VERSION >= 4
|
||||
stateMachine = ScXML::readBuffer(SbByteBuffer(fileContents.size(), fileContents.constData()));
|
||||
#else
|
||||
stateMachine = ScXML::readBuffer(fileContents.constData());
|
||||
#endif
|
||||
file.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,12 +51,7 @@
|
||||
#include <Inventor/elements/SoViewingMatrixElement.h>
|
||||
#include <Inventor/elements/SoViewportRegionElement.h>
|
||||
#include <Inventor/elements/SoViewVolumeElement.h>
|
||||
|
||||
#if COIN_MAJOR_VERSION > 3
|
||||
#include <Inventor/elements/SoMultiTextureEnabledElement.h>
|
||||
#else
|
||||
#include <Inventor/elements/SoGLTexture3EnabledElement.h>
|
||||
#endif
|
||||
|
||||
#include "SoTextLabel.h"
|
||||
#include "SoFCInteractiveElement.h"
|
||||
@@ -65,31 +60,6 @@
|
||||
|
||||
using namespace Gui;
|
||||
|
||||
/*!
|
||||
\code
|
||||
|
||||
s="""
|
||||
#Inventor V2.1 ascii
|
||||
|
||||
Annotation {
|
||||
Translation { translation 4 0 0 }
|
||||
FontStyle {
|
||||
size 20
|
||||
style BOLD
|
||||
}
|
||||
BaseColor {
|
||||
rgb 0.0 0.0 0.0
|
||||
}
|
||||
|
||||
|
||||
SoTextLabel { string ["Text label", "Second line"] backgroundColor 1.0 0.447059 0.337255}
|
||||
}
|
||||
"""
|
||||
|
||||
App.ActiveDocument.addObject("App::InventorObject","iv").Buffer=s
|
||||
|
||||
\endcode
|
||||
*/
|
||||
|
||||
SO_NODE_SOURCE(SoTextLabel)
|
||||
|
||||
@@ -215,11 +185,7 @@ void SoTextLabel::GLRender(SoGLRenderAction *action)
|
||||
|
||||
// disable textures for all units
|
||||
SoGLTextureEnabledElement::set(state, this, false);
|
||||
#if COIN_MAJOR_VERSION > 3
|
||||
SoMultiTextureEnabledElement::set(state, this, false);
|
||||
#else
|
||||
SoGLTexture3EnabledElement::set(state, this, false);
|
||||
#endif
|
||||
|
||||
glPushAttrib(GL_ENABLE_BIT | GL_PIXEL_MODE_BIT | GL_COLOR_BUFFER_BIT);
|
||||
glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
|
||||
|
||||
@@ -1707,16 +1707,11 @@ void View3DInventorViewer::savePicture(int width, int height, int sample, const
|
||||
auto root = new SoSeparator;
|
||||
root->ref();
|
||||
|
||||
#if (COIN_MAJOR_VERSION >= 4)
|
||||
// The behaviour in Coin4 has changed so that when using the same instance of 'SoFCOffscreenRenderer'
|
||||
// multiple times internally the biggest viewport size is stored and set to the SoGLRenderAction.
|
||||
// The trick is to add a callback node and override the viewport size with what we want.
|
||||
if (useCoinOffscreenRenderer) {
|
||||
auto cbvp = new SoCallback;
|
||||
cbvp->setCallback(setViewportCB);
|
||||
root->addChild(cbvp);
|
||||
}
|
||||
#endif
|
||||
|
||||
SoCamera* camera = getSoRenderManager()->getCamera();
|
||||
|
||||
@@ -3524,7 +3519,6 @@ void View3DInventorViewer::viewSelection()
|
||||
float(bbox.MaxX),
|
||||
float(bbox.MaxY),
|
||||
float(bbox.MaxZ));
|
||||
#if (COIN_MAJOR_VERSION >= 4)
|
||||
float aspectratio = getSoRenderManager()->getViewportRegion().getViewportAspectRatio();
|
||||
switch (cam->viewportMapping.getValue()) {
|
||||
case SoCamera::CROP_VIEWPORT_FILL_FRAME:
|
||||
@@ -3536,27 +3530,6 @@ void View3DInventorViewer::viewSelection()
|
||||
break;
|
||||
}
|
||||
cam->viewBoundingBox(box,aspectratio,1.0);
|
||||
#else
|
||||
SoTempPath path(2);
|
||||
path.ref();
|
||||
auto pcGroup = new SoGroup;
|
||||
pcGroup->ref();
|
||||
auto pcTransform = new SoTransform;
|
||||
pcGroup->addChild(pcTransform);
|
||||
pcTransform->translation = box.getCenter();
|
||||
auto *pcCube = new SoCube;
|
||||
pcGroup->addChild(pcCube);
|
||||
float sizeX,sizeY,sizeZ;
|
||||
box.getSize(sizeX,sizeY,sizeZ);
|
||||
pcCube->width = sizeX;
|
||||
pcCube->height = sizeY;
|
||||
pcCube->depth = sizeZ;
|
||||
path.append(pcGroup);
|
||||
path.append(pcCube);
|
||||
cam->viewAll(&path,getSoRenderManager()->getViewportRegion());
|
||||
path.unrefNoDelete();
|
||||
pcGroup->unref();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -248,15 +248,8 @@ void ViewProviderAnnotation::updateData(const App::Property* prop)
|
||||
const char* cs = line.c_str();
|
||||
if (line.empty())
|
||||
cs = " "; // empty lines make coin crash, we use a space instead
|
||||
#if (COIN_MAJOR_VERSION <= 3)
|
||||
QByteArray latin1str;
|
||||
latin1str = (QString::fromUtf8(cs)).toLatin1();
|
||||
pLabel->string.set1Value(index, SbString(latin1str.constData()));
|
||||
pLabel3d->string.set1Value(index, SbString(latin1str.constData()));
|
||||
#else
|
||||
pLabel->string.set1Value(index, SbString(cs));
|
||||
pLabel3d->string.set1Value(index, SbString(cs));
|
||||
#endif
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -454,11 +454,7 @@ GraphicsScene::setNavigationModeFile(const QUrl & url)
|
||||
QFile file(QString::fromLatin1(filenametmp));
|
||||
if (file.open(QIODevice::ReadOnly)) {
|
||||
QByteArray fileContents = file.readAll();
|
||||
#if COIN_MAJOR_VERSION >= 4
|
||||
stateMachine = ScXML::readBuffer(SbByteBuffer(fileContents.size(), fileContents.constData()));
|
||||
#else
|
||||
stateMachine = ScXML::readBuffer(fileContents.constData());
|
||||
#endif
|
||||
file.close();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user