Giter Club home page Giter Club logo

quarter's Introduction

Coin3D Quarter

Introduction

Quarter is a light-weight glue library that provides seamless integration between Systems in Motions's Coin high-level 3D visualization library and Trolltech's Qt 2D user interface library.

Qt and Coin is a perfect match since they are both open source, widely portable and easy to use. Quarter has evolved from Systems in Motion's own experiences using Coin and Qt together in our applications.

The functionality in Quarter revolves around QuarterWidget, a subclass of QGLWidget. This widget provides functionality for rendering of Coin scenegraphs and translation of QEvents into SoEvents. Using this widget is as easy as using any other QWidget.

How to install

See the file INSTALL for installation instructions, and the README.* files for platform-specific notes.

How to use

See Doxygen documentation: https://coin3d.github.io/quarter/

Release history

Quarter 1.0.0 (2009-01-26):

  • first proper release.
  • is only usable with Coin-3.x and Qt-4.x

Quarter 1.1.0 (2019-12-25):

  • new:

    • Kongsberg Oil & Gas Technologies AS ended SoWin as a commercial product and re-licensed it under the BSD 3-clause license as a service to the user community.
    • The build system has been migrated from GNU Autotools to CMake
    • Added support for Qt5
    • Added support for high DPI displays in Qt5
    • New 3DConnexion Space Navigator support using the Spacenav opensource library
    • Support for BitBucket and AppVeyor as continuous integration service providers
  • bugfixes:

    • Always reinitialize SoRenderManager when GL context is (re-)initialized
    • Avoid unnecessary redraws when moving window around. Fixes COIN-173
    • Handle double click events
    • Buffer went out of scope, while a reference was still held

quarter's People

Contributors

dornhege avatar ggabbiani avatar githubuser0xffff avatar kintel avatar luzpaz avatar podsvirov avatar reavertm avatar tuhtah avatar unril avatar vanuan avatar veelo avatar volkerenderlein avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

quarter's Issues

The problem of creating a QuarterWidget in a multi-monitor environment.

Hello gentlemen,

I have two monitors with the following parameters.

OS version: Win 11 22H2 (Win 10 has the same problem)

First display: (DELL P2419H)
Display resolution: 1920*1080
Zoom factor: 100%

Second monitor: (DELL D2421DS)
Display resolution: 2560*1440
Zoom factor: 125%

Both monitors are Dell's, but there are some differences in hardware parameters.

Next, I went to run the official Demo ‘MDIExample’.

image

When I create a new window on the main monitor, there is no problem.

image

However, when I create a new window on the secondary display, there will be a misalignment of the OpenGL display area, which will even affect the use of other controls.

image

I encountered this headache when actually using Quarter, which is reflected in my software as follows, and Windows cannot be adapted。

image

This causes the following concurrency issues:
For example, if I create a cube with 100 sides and click on the point (100, 100, 100), it is possible to end up giving me feedback to the point of (100, 100, 80) in a certain perspective.

My preliminary research found that this problem has nothing to do with the location of the main window, but with the location of the mouse. When creating a new QuarterWidget, the mouse is on the main monitor, and the created QuarterWidget has no problem. But when the mouse is on a secondary monitor, the QuarterWidget created will be misaligned. My current solution is to use code to temporarily move the mouse to the main monitor when creating the QuarterWidget, and then move the mouse to the original location when the creation is complete.

Could have solved my problem temporarily, but it felt a bit funny. I would like to ask if there is a better way to solve this problem. What about making Quarter more compatible with multiple monitors?

Viewer becomes unresponsive after long application execution

Original report by Anonymous.


On a Coin/Quarter application I'm building I have noticed that if I leave the application running for a long time, it becomes unstable and the viewer becomes unresponsive. In fact, the viewer doesn't seem to update, say rotation events, until a menu item on the Qt window becomes active. It is almost like the underlying widget just isn't getting time to update.
I will add that the application has an additional thread that connects to a database.

Any ideas on what I'm doing wrong?

Thanks,

-Brian

quarter 1.2

Do you plan to release a version of quarter 1.2 so that it can be compiled with qt6?

Segmentation fault when running the minimal.cpp example

I got the following error when running a basic minimal.cpp.

Thread 1 "Example" received signal SIGSEGV, Segmentation fault.
0x00007ffff6ae5d72 in QOpenGLContext::makeCurrent(QSurface*) () from /lib/x86_64-linux-gnu/libQt5Gui.so.5
(gdb) bt
#0  0x00007ffff6ae5d72 in QOpenGLContext::makeCurrent(QSurface*) () at /lib/x86_64-linux-gnu/libQt5Gui.so.5
#1  0x00007ffff769bb49 in QGLContext::makeCurrent() () at /lib/x86_64-linux-gnu/libQt5OpenGL.so.5
#2  0x00007ffff76a1a21 in QGLWidgetPrivate::makeCurrent() () at /lib/x86_64-linux-gnu/libQt5OpenGL.so.5
#3  0x00007ffff7fbfb88 in SIM::Coin3D::Quarter::QuarterWidgetP::removeFromCacheContext(QuarterWidgetP_cachecontext*, QGLWidget const*) () at /home/rvbust/Rvbust/Sources/quarter/Build/lib/libQuarter.so.20
#4  0x00007ffff7fbfc20 in SIM::Coin3D::Quarter::QuarterWidgetP::~QuarterWidgetP() ()
    at /home/rvbust/Rvbust/Sources/quarter/Build/lib/libQuarter.so.20
#5  0x00007ffff7fbe738 in SIM::Coin3D::Quarter::QuarterWidget::~QuarterWidget() ()
--Type <RET> for more, q to quit, c to continue without paging--
    at /home/rvbust/Rvbust/Sources/quarter/Build/lib/libQuarter.so.20
#6  0x00007ffff7fbe769 in SIM::Coin3D::Quarter::QuarterWidget::~QuarterWidget() ()
    at /home/rvbust/Rvbust/Sources/quarter/Build/lib/libQuarter.so.20
#7  0x0000000000401381 in main ()

the source code of minimal.cpp is

#include <Inventor/nodes/SoCone.h>
#include <Inventor/nodes/SoBaseColor.h>
#include <Inventor/nodes/SoSeparator.h>

#include <Quarter/Quarter.h>
#include <Quarter/QuarterWidget.h>

#include <QApplication>
#include <QMainWindow>
#include <memory>

using namespace SIM::Coin3D::Quarter;

int
main(int argc, char ** argv)
{
  // Initializes Quarter (and implicitly also Coin and Qt
  QApplication app(argc, argv);
  Quarter::init();

  // Make a dead simple scene graph by using the Coin library, only
  // containing a single yellow cone under the scenegraph root.
  SoSeparator * root = new SoSeparator;
  root->ref();

  SoBaseColor * col = new SoBaseColor;
  col->rgb = SbColor(1, 1, 0);
  root->addChild(col);

  root->addChild(new SoCone);

  QMainWindow * mainwin = new QMainWindow();

  // Create a QuarterWidget for displaying a Coin scene graph
  QuarterWidget * viewer = new QuarterWidget(mainwin);
  //set default navigation mode file
  viewer->setNavigationModeFile();
  mainwin->setCentralWidget(viewer);
  viewer->setSceneGraph(root);

  // Pop up the QuarterWidget
  mainwin->show();
  // Loop until exit.
  app.exec();
  // Clean up resources.
  delete viewer;
  root->unref();
  delete mainwin;

  Quarter::clean();

  return 0;
}

Could anyone know something about how to fix it? Thanks very much.

macOS Qt compilation errors apparently due to incorrect C++ standard

I'm trying to get Quarter to compile under macOS 10.15.7 (after running into X11 library issues with SoXt).

I have Coin3d installed via Homebrew, apparently version 4.0.0_1. I first tried automake configure, but that failed, then cmake. Cmake gets further, but I get a ton of Qt related compilation errors (see below) which appear to be due to the use of recent c++ language features. I tried setting the CXX_STANDARD in the CMakeLists.txt file and also setting the c++ standard also in Qmake .pro files but neither had any effect.

Any guidance would be much appreciated. Thanks!

make
[ 1%] Generating moc_SignalThread.cpp
[ 2%] Generating //include/Quarter/eventhandlers/moc_DragDropHandler.cpp
[ 4%] Generating //include/Quarter/eventhandlers/moc_EventFilter.cpp
[ 5%] Generating //include/Quarter/eventhandlers/moc_FocusHandler.cpp
[ 7%] Generating //include/Quarter/moc_QuarterWidget.cpp
[ 8%] Generating moc_ContextMenu.cpp
[ 10%] Generating moc_InteractionMode.cpp
[ 11%] Generating moc_SensorManager.cpp
[ 13%] Building CXX object src/Quarter/CMakeFiles/Quarter.dir/ContextMenu.cpp.o
In file included from /Users//Packages/src/quarter/src/Quarter/ContextMenu.cpp:34:
In file included from /Users//Packages/src/quarter/src/Quarter/ContextMenu.h:36:
In file included from /Users//Packages/homebrew/Cellar/qt@5/5.15.2/lib/QtCore.framework/Headers/QObject:1:
In file included from /Users//Packages/homebrew/Cellar/qt@5/5.15.2/lib/QtCore.framework/Headers/qobject.h:46:
In file included from /Users//Packages/homebrew/include/QtCore/qobjectdefs.h:48:
In file included from /Users//Packages/homebrew/include/QtCore/qnamespace.h:44:
/Users//Packages/homebrew/include/QtCore/qglobal.h:675:26: error: no template named 'enable_if_t' in namespace 'std'; did you mean
'enable_if'?
typename = std::enable_if_t<std::is_arithmetic_v && std::is_arithmetic_v &&
~~~~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits:451:63: note: 'enable_if'
declared here
template <bool, class _Tp = void> struct _LIBCPP_TEMPLATE_VIS enable_if {};
^
In file included from /Users//Packages/src/quarter/src/Quarter/ContextMenu.cpp:34:
In file included from /Users//Packages/src/quarter/src/Quarter/ContextMenu.h:36:
In file included from /Users//Packages/homebrew/Cellar/qt@5/5.15.2/lib/QtCore.framework/Headers/QObject:1:
In file included from /Users//Packages/homebrew/Cellar/qt@5/5.15.2/lib/QtCore.framework/Headers/qobject.h:46:
In file included from /Users//Packages/homebrew/include/QtCore/qobjectdefs.h:48:
In file included from /Users//Packages/homebrew/include/QtCore/qnamespace.h:44:
/Users//Packages/homebrew/include/QtCore/qglobal.h:675:43: error: no template named 'is_arithmetic_v' in namespace 'std'; did you mean
'is_arithmetic'?
typename = std::enable_if_t<std::is_arithmetic_v && std::is_arithmetic_v &&

Runtime error "recursive redraw"

Original report by Nikolay Fedorov (Bitbucket: Unril, GitHub: Unril).


It happens when link against Qt built with default configuration. All OK when Qt is built with "-opengl dynamic -no-angle" options. I think that it should be noted somewhere in readme or install files.

Build issue of qthelp documentation if Qt binaries are not in PATH

We encountered an issue with building the QtHelp documentation, if the Qt related binaries are not available in PATH[1]:

-- Found Doxygen: /usr/bin/doxygen (found version "1.9.3") found components: doxygen missing components: dot
CMake Error at CMakeLists.txt:213 (message):
  Missing program Qt qhelpgenerator


-- Configuring incomplete, errors occurred!

As a patch[2], I'm using qmake to get the location of Qt binaries and successfully configure the package.

WDYT?

[1] https://bugs.gentoo.org/836340
[2] https://github.com/gentoo/gentoo/pull/24866/files#diff-09795807d0be82f2cc9b7d3c5c6fc1e66ff899bbdfd580bd56490579c4bfb055

QuarterWidget destructor crashes when a GLRenderAction is set

Original report by Giampiero Gabbiani (Bitbucket: ggabbiani, GitHub: ggabbiani).

Attachments: example.cpp


Hi all,

I have a problem with the QuarterWidget destructor: after setting a GLRenderAction it crashes.

The call stack of the attached example is the following:

libc.so.6!raise (Unknown Source:0)
libc.so.6!abort (Unknown Source:0)
libc.so.6!__assert_fail_base.cold.0 (Unknown Source:0)
libc.so.6!__assert_fail (Unknown Source:0)
libCoin.so.80!cc_glglue_instance(int contextid) (/usr/src/debug/Coin4-4.0.0-11514.fc29.x86_64/runtime/src_0/src/glue/gl.cpp:2354) assert()
libQuarter.so.20!SIM::Coin3D::Quarter::QuarterWidgetP::removeFromCacheContext(QuarterWidgetP_cachecontext * context, const QGLWidget *      widget) (/usr/src/debug/Quarter-1.0.1-513.fc29.x86_64/runtime/src_0/src/Quarter/QuarterWidgetP.cpp:164) cc_glglue_instance(context->id);
libQuarter.so.20!SIM::Coin3D::Quarter::QuarterWidgetP::~QuarterWidgetP(SIM::Coin3D::Quarter::QuarterWidgetP * const this) (/usr/src/debug/Quarter-1.0.1-513.fc29.x86_64/runtime/src_0/src/Quarter/QuarterWidgetP.cpp:99) removeFromCacheContext(this->cachecontext, this->master);
libQuarter.so.20!SIM::Coin3D::Quarter::QuarterWidget::~QuarterWidget(SIM::Coin3D::Quarter::QuarterWidget * const this) (/usr/src/debug/Quarter-1.0.1-513.fc29.x86_64/runtime/src_0/src/Quarter/QuarterWidget.cpp:203) delete PRIVATE(this);
libQuarter.so.20!SIM::Coin3D::Quarter::QuarterWidget::~QuarterWidget(SIM::Coin3D::Quarter::QuarterWidget * const this) (/usr/src/debug/Quarter-1.0.1-513.fc29.x86_64/runtime/src_0/src/Quarter/QuarterWidget.cpp:204)
main(int argc, char ** argv) (/home/giampa/projects/coin3d/Coin3D-Tools/ivx/example.cpp:55)

/src/glue/gl.cpp:2354: const cc_glglue* cc_glglue_instance(int): Assertion `current_ctx && "Must have a current GL context when instantiating cc_glglue!! (Note: if you are using an old Mesa GL version, set the environment variable COIN_GL_NO_CURRENT_CONTEXT_CHECK to get around what may be a Mesa bug.)"' failed.

I suspect the problem be the commit 30d08ea in the QuarterWidgetP::removeFromCacheContext() method implementing a workaround for a Coin issue fixed in svn r12818 (probably the hg commit caacaf7).

In detail the call to cc_glglue_instance() added by the workaround fails because the dictionary - under some circumstances - has been already flushed.

Removing the Quarter workaround 30d08ea seems to solve but there are a number of things that are stopping me from proposing a PR:

  1. the regression is really old and the example is really ‘basic’: strange that nobody noticed before
  2. the comment inside the workaround is referring to a subversion release number that has been lost during mercurial import, so concretely I cannot be sure that svn r12818 is the hg caacaf7
  3. the Coin fix caacaf7 (22/01/2009) is older then Quarter workaround 30d08ea (25/01/2009): why writing 30d08ea if already fixed in caacaf7?

As a final consideration, the same code implemented in the ‘legacy’ So[Qt,Xt] libs doesn’t crash.

Regards

Giampiero

Failed configuration of quarter - missing coin-config

Original report by Tom F (Bitbucket: tflynn, GitHub: tflynn).


Hi,

Compiling Coin and Quarter from the latest branches fails for me, with a message about the coin-config program.

I am able to compile and install coin using cmake. However when I try to ./configure quarter, I got a message that coin-config is not available. After copying it to /usr/local/bin, I get this message:

checking for coin-config... /usr/local/bin/coin-config
coin-config: no default Coin config available in /usr/local/share/Coin/conf/
configure: WARNING: cannot find 'coin-config' at any of these locations:
 -> /home/tom/anaconda2/bin/coin-config
 -> /usr/local/bin/coin-config
 -> /usr/bin/coin-config
 -> /bin/coin-config
 -> /usr/games/coin-config
 -> /usr/local/bin/coin-config
configure: WARNING:
Need to be able to run 'coin-config' to figure out how to build and link
against the Coin library. To rectify this problem, you most likely need
to a) install Coin if it has not been installed, b) add the Coin install
bin/ directory to your PATH environment variable.

configure: error: couldn't compile and link against Coin

Any tips?

CMake Don't include qt5 when built as static lib

Original report by Nikolay Fedorov (Bitbucket: Unril, GitHub: Unril).


Can be fixed by changing \src\Quarter\CMakeLists.txt

...
IF(Quarter_BUILD_STATIC_LIBRARY)
  ADD_LIBRARY(${Library} STATIC ${AllSources})
  TARGET_LINK_LIBRARIES(${Library} ${AllLibs})
ELSE(Quarter_BUILD_STATIC_LIBRARY)
  ADD_LIBRARY(${Library} SHARED ${AllSources})
  TARGET_LINK_LIBRARIES(${Library} ${AllLibs})
ENDIF(Quarter_BUILD_STATIC_LIBRARY)
...

QT5 support

Is there no Qt5 support? Or is the README just outdated?

Release build links with debug Qt on Windows.

Original report by Bastiaan Veelo (Bitbucket: veelo, GitHub: veelo).



Built with this sequence of commands against Qt 5.13.0:

hg clone https://bitbucket.org/Coin3D/quarter Quarter_source
cmake -SQuarter_source -BQuarter_build -G "Visual Studio 15 2017" -DCMAKE_INSTALL_PREFIX=C:\Coin\Coin_install\Coin3D
cmake --build Quarter_build --target ALL_BUILD --config Release -- /nologo /verbosity:minimal /maxcpucount
cmake --build Quarter_build --target INSTALL --config Release -- /nologo /verbosity:minimal /maxcpucount
cmake --build Quarter_build --target ALL_BUILD --config Debug -- /nologo /verbosity:minimal /maxcpucount
cmake --build Quarter_build --target INSTALL --config Debug -- /nologo /verbosity:minimal /maxcpucount

Error compiling

Original report by Jon Ander Monleón Besteiro (Bitbucket: [Jon Ander Monleón Besteiro](https://bitbucket.org/Jon Ander Monleón Besteiro), ).


Hi!

I’m trying to compile quarter for ubuntu 16.04, so this is what I did:

1. Installed qt and all the needed dependencies (might happen to be some extra deps probably):

apt install qt4-default qt4-dev-tools libqt4-designer

2. Installed Coin3D and dependencies:

apt install libcoin80-dev

3. Downloaded Quarter, unzipped:

./configure

Quarter configuration settings:
Qt version: 4.8.7
Coin version: 4.0.0a
Quarter version: 1.0.1a
Quarter installation prefix: /usr/local
Qt Designer plugin path: /usr/lib/x86_64-linux-gnu/qt4/plugins/designer

Now, run 'make' and 'make install' to install Quarter

make:

Making all in plugins
make[3]: Entering directory '/home/jonander/quarter/Coin3D-quarter-8bce79edac16/src/plugins'
/usr/lib/x86_64-linux-gnu/qt4/bin/moc -o moc_QuarterWidgetPlugin.cpp echo ./QuarterWidgetPlugin.h -I../../include -I../../src/Quarter -Iecho /usr/include/qt4/QtDesigner
./QuarterWidgetPlugin.h:52: Error: Undefined interface
Makefile:882: recipe for target 'moc_QuarterWidgetPlugin.cpp' failed
make[3]: *** [moc_QuarterWidgetPlugin.cpp] Error 1
make[3]: Leaving directory '/home/jonander/quarter/Coin3D-quarter-8bce79edac16/src/plugins'
Makefile:309: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/jonander/quarter/Coin3D-quarter-8bce79edac16/src'
Makefile:427: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/jonander/quarter/Coin3D-quarter-8bce79edac16'
Makefile:337: recipe for target 'all' failed
make: *** [all] Error 2

I get it’s some error when it tries to compile the plugins, but I’m lost here.

Hoping you guys can help me find the way to finish compiling it.

thanks!

Review older FIXME's in the code

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.