Commit edd88492 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum

[FIX #538] off-by one problem caused grid to be smaller than bbox. Fixed now.

parent b6fa78ee
...@@ -269,9 +269,9 @@ void WGEGridNode::callback( osg::Node* /*node*/ ) ...@@ -269,9 +269,9 @@ void WGEGridNode::callback( osg::Node* /*node*/ )
{ {
size_t id = vertIdX + vertIdY * sx + vertIdZ * sx * sy; size_t id = vertIdX + vertIdY * sx + vertIdZ * sx * sy;
( *vertArray )[id][0] = static_cast< float >( vertIdX ) / static_cast< float >( sx ); ( *vertArray )[id][0] = static_cast< float >( vertIdX ) / static_cast< float >( sx - 1 );
( *vertArray )[id][1] = static_cast< float >( vertIdY ) / static_cast< float >( sy ); ( *vertArray )[id][1] = static_cast< float >( vertIdY ) / static_cast< float >( sy - 1 );
( *vertArray )[id][2] = static_cast< float >( vertIdZ ) / static_cast< float >( sz ); ( *vertArray )[id][2] = static_cast< float >( vertIdZ ) / static_cast< float >( sz - 1 );
if( vertIdX < sx - 1 ) if( vertIdX < sx - 1 )
{ {
......
...@@ -79,8 +79,6 @@ public: ...@@ -79,8 +79,6 @@ public:
*/ */
WGridRegular3D::ConstSPtr getGrid() const; WGridRegular3D::ConstSPtr getGrid() const;
// TODO(all): add setter and getter for boundary colors and so on.
/** /**
* Returns whether labels on the corners are enabled or not. * Returns whether labels on the corners are enabled or not.
* *
...@@ -151,7 +149,6 @@ public: ...@@ -151,7 +149,6 @@ public:
*/ */
void setGridColor( const WColor& color ); void setGridColor( const WColor& color );
protected: protected:
private: private:
......
...@@ -131,7 +131,7 @@ void WMainWindow::setupGUI() ...@@ -131,7 +131,7 @@ void WMainWindow::setupGUI()
WSettingAction* mtViews = new WSettingAction( this, "qt4gui/ge/multiThreadedViewer", WSettingAction* mtViews = new WSettingAction( this, "qt4gui/ge/multiThreadedViewer",
"Multi-threaded Views", "Multi-threaded Views",
"If enabled, the graphic windows are rendered in different threads. This can speed-up " "If enabled, the graphic windows are rendered in different threads. This can speed-up "
"rendering on machines with multiple cores.", "rendering on machines with multiple cores. WARNING: can lead to crashes sometimes.",
false, false,
true // require restart true // require restart
); );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment