Re: [osg-users] [build] Particular Build Problems with OSG.

2019-03-27 Thread Zachary1234


> To build OSG you need to manually direct the cygwin installer to load version 
> 3.3.3 of the gcc compiler family.


-By doing this, will I be then building a compiler which will be incompatible
with 64 bit Windows C++ TDM compiling, or in fact not?

-I had been under the impression that the only way to build these sorts of 
things while remaining (native win64 TDM compatible) was to use the 

64 bit mingw g++

compiler, and not the

gnu g++ 

compiler, on its own.  When building things in the cygwin environment to be 
used outside of it.  Is this view of things accurate, or not?

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=75737#75737





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [build] Particular Build Problems with OSG.

2019-03-27 Thread Robert Osfield
On Wed, 27 Mar 2019 at 16:34, Trajce Nikolov NICK
 wrote:
> osg is cmake based for configuration. so instead of ./configure;make;make 
> install you should do something like
>
> cmake .
> make
> make install

The old Cygwin install docs was out of date and referred to pre
OSG-2.0 build.  I've updated removing the old mentions of the separate
Producer/OpenThreads builds.   I added mention the standard cmake
based build.

I don't have an Cygwin expertise though so don't know how close it
will be to working correctly.  If others have Cygwin expertise please
edit the page or suggest amendments.

Cheers,
Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [build] Particular Build Problems with OSG.

2019-03-27 Thread Trajce Nikolov NICK
Hi Zachary,

osg is cmake based for configuration. so instead of ./configure;make;make
install you should do something like

cmake .
make
make install

cmake will generate the Makefiles

On Wed, Mar 27, 2019 at 5:23 PM Robert Osfield 
wrote:

> Hi Zachary,
>
> You will need to post us the errors you are seeing without this there
> is no way for us to know what is wrong.
>
> Robert.
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>


-- 
trajce nikolov nick
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [build] Particular Build Problems with OSG.

2019-03-27 Thread Robert Osfield
Hi Zachary,

You will need to post us the errors you are seeing without this there
is no way for us to know what is wrong.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osgText::Text dissapears when reparent container window on qt

2019-03-27 Thread Diego Mancilla
Hello,

 This is a mixed OSG/Qt question. I asked first here due to previous 
experiences with the community. 

 I'm following a minimal example of embedding OSG into a Qt5 application from 
https://gist.github.com/vicrucann/874ec3c0a7ba4a814bd84756447bc798. When I 
modify that example, and add a simple osgText::Text to the base Geode 
everything works as expected. But If I ,additionally, encapsulate the OSG 
Widget (a widget derived from QOpenGLWidget) on a QDockWidget and undock it, 
the text dissapears.

 Can someone point me out what could be the problem?

The code:


Code:
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include

#include
#include
#include
#include
#include
#include
#include
#include
#include
#include

#include 
#include 

class QtOSGWidget : public QOpenGLWidget
{
public:
  QtOSGWidget(qreal scaleX, qreal scaleY, QWidget* parent = 0)
  : QOpenGLWidget(parent)
, _mGraphicsWindow(new osgViewer::GraphicsWindowEmbedded( this->x(), 
this->y(),
 this->width(), 
this->height() ) )
, _mViewer(new osgViewer::Viewer)
  , m_scaleX(scaleX)
  , m_scaleY(scaleY)
  {
osg::Cylinder* cylinder= new osg::Cylinder( osg::Vec3( 0.f, 0.f, 
0.f ), 0.25f, 0.5f );
osg::ShapeDrawable* sd = new osg::ShapeDrawable( cylinder );
sd->setColor( osg::Vec4( 0.8f, 0.5f, 0.2f, 1.f ) );
osg::Geode* geode = new osg::Geode;
geode->addDrawable(sd);

// adding text to the visualization
osgText::Text * test = new osgText::Text();
test->setDataVariance(osg::Object::DYNAMIC);

test->setCharacterSize(1.0);
test->setColor(osg::Vec4(0.0, 0.0, 0.0, 1.0));
test->setAlignment(osgText::Text::CENTER_BOTTOM);
test->setAxisAlignment(osgText::TextBase::SCREEN);
test->setCharacterSizeMode(osgText::Text::OBJECT_COORDS);
test->setText("CYLINDER");
geode->addDrawable(test);
// end adding text

osg::Camera* camera = new osg::Camera;
camera->setViewport( 0, 0, this->width(), this->height() );
camera->setClearColor( osg::Vec4( 0.9f, 0.9f, 1.f, 1.f ) );
float aspectRatio = static_cast( this->width()) / 
static_cast( this->height() );
camera->setProjectionMatrixAsPerspective( 30.f, aspectRatio, 1.f, 
1000.f );
camera->setGraphicsContext( _mGraphicsWindow );

_mViewer->setCamera(camera);
_mViewer->setSceneData(geode);
osgGA::TrackballManipulator* manipulator = new 
osgGA::TrackballManipulator;
manipulator->setAllowThrow( false );
this->setMouseTracking(true);
_mViewer->setCameraManipulator(manipulator);
_mViewer->setThreadingModel(osgViewer::Viewer::SingleThreaded);
   // _mViewer->realize();
  }


  virtual ~QtOSGWidget(){}

  void setScale(qreal X, qreal Y)
  {
  m_scaleX = X;
  m_scaleY = Y;
  this->resizeGL(this->width(), this->height());
  }

protected:

  virtual void paintGL() {
_mViewer->frame();
  }

  virtual void resizeGL( int width, int height ) 
  {
  this->getEventQueue()->windowResize(this->x()*m_scaleX, this->y() * 
m_scaleY, width*m_scaleX, height*m_scaleY);
  _mGraphicsWindow->resized(this->x()*m_scaleX, this->y() * m_scaleY, 
width*m_scaleX, height*m_scaleY);
  osg::Camera* camera = _mViewer->getCamera();
  camera->setViewport(0, 0, this->width()*m_scaleX, this->height()* 
m_scaleY);
  }

  virtual void initializeGL(){
  osg::Geode* geode = dynamic_cast(_mViewer->getSceneData());
  osg::StateSet* stateSet = geode->getOrCreateStateSet();
  osg::Material* material = new osg::Material;
  material->setColorMode( osg::Material::AMBIENT_AND_DIFFUSE );
  stateSet->setAttributeAndModes( material, osg::StateAttribute::ON );
  stateSet->setMode( GL_DEPTH_TEST, osg::StateAttribute::ON );
  }

  virtual void mouseMoveEvent(QMouseEvent* event)
  {
  this->getEventQueue()->mouseMotion(event->x()*m_scaleX, 
event->y()*m_scaleY);
  }

  virtual void mousePressEvent(QMouseEvent* event)
  {
  unsigned int button = 0;
  switch (event->button()){
  case Qt::LeftButton:
  button = 1;
  break;
  case Qt::MiddleButton:
  button = 2;
  break;
  case Qt::RightButton:
  button = 3;
  break;
  default:
  break;
  }
  this->getEventQueue()->mouseButtonPress(event->x()*m_scaleX, 
event->y()*m_scaleY, button);
  }

  virtual void mouseReleaseEvent(QMouseEvent* event)
  {
  unsigned int button = 0;
  switch (event->button()){
  case Qt::LeftButton:
  button = 1;
  break;
  case Qt::MiddleButton:
  button = 2;
  break;
  case Qt::RightButton:
  button = 3;
  

[osg-users] [build] Particular Build Problems with OSG.

2019-03-27 Thread Zachary1234
I am attempting to build 64 bit OSG 3.6.3 for Windows using the GNU compiler, 
to keep my end result operable with 64 bit TDM.

I am in the 64 bit Cygwin Environment.

I have installed the dependencies mentioned as necessary at the top of the 
tutorial

[url]
http://www.openscenegraph.org/index.php/documentation/platform-specifics/windows/112-compiling-with-cygwin[/url]

and have even managed to separately build OpenThreads successfully.

I am up to the point where I am to 

make, make install upon OpenSceneGraph version 3.6.3 and am finding
there is no make file to start by.  

I have taken the source code version of OSG from 
https://github.com/openscenegraph/OpenSceneGraph/tree/OpenSceneGraph-3.6.3

and have updated ~/.bashrc with links and references as needed.  Do I have the 
right source code download of OSG, why won't configure make install detected 
the needed file for me, at least according to the later part of the tutorial?

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=75732#75732





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org