Skip to content

Commit

Permalink
set the graphics context width and height by the Vizkit3DWidget const…
Browse files Browse the repository at this point in the history
…ructor
  • Loading branch information
gustavoneves12 committed Apr 18, 2016
1 parent 551e425 commit 2621981
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Vizkit3DWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ void Vizkit3DConfig::setCameraManipulator(QStringList const& manipulator)
return getWidget()->setCameraManipulator(id);
}

Vizkit3DWidget::Vizkit3DWidget( QWidget* parent,const QString &world_name,bool auto_update)
Vizkit3DWidget::Vizkit3DWidget( QWidget* parent,int width,int height,const QString &world_name,bool auto_update)
: QWidget(parent)
, env_plugin(NULL)
{
Expand Down Expand Up @@ -233,7 +233,7 @@ Vizkit3DWidget::Vizkit3DWidget( QWidget* parent,const QString &world_name,bool a
root = createSceneGraph(world_name);

// create osg widget
QWidget* widget = addViewWidget(createGraphicsWindow(0,0,800,600), root);
QWidget* widget = addViewWidget(createGraphicsWindow(0,0,width,height), root);
widget->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
widget->setObjectName(QString("View Widget"));
splitter->addWidget(widget);
Expand Down
3 changes: 2 additions & 1 deletion src/Vizkit3DWidget.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ namespace vizkit3d
static osg::Vec3d const DEFAULT_UP;

friend class VizPluginBase;
Vizkit3DWidget(QWidget* parent = 0,const QString &world_name = "world_osg",bool auto_update = true);
Vizkit3DWidget(QWidget* parent = 0, int width = 800, int height = 600,
const QString &world_name = "world_osg",bool auto_update = true);

/** Defined to avoid unnecessary dependencies in the headers
*
Expand Down

0 comments on commit 2621981

Please sign in to comment.