Commit 36fc86cd authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum

[FIX #297] needed to remove several functions which use per-primitive-binding...

[FIX #297] needed to remove several functions which use per-primitive-binding as this kind of binding is no longer supported in OSG. Several function still use this ... to be continued
parent cdd38608
......@@ -103,12 +103,18 @@ osg::ref_ptr< osg::Geometry > wge::createUnitCube( const WColor& color )
osg::ref_ptr< osg::Vec3Array > normals = osg::ref_ptr< osg::Vec3Array >( new osg::Vec3Array );
osg::ref_ptr< osg::Vec4Array > colors = osg::ref_ptr< osg::Vec4Array >( new osg::Vec4Array );
// NOTE: as the OSG 3.2 does not allow binding normals/colors and other arrays on a per-primitive basis, we bind the normals per vertex
// This means we add four normals per face
// front face
vertices->push_back( osg::Vec3( 0.0, 0.0, 0.0 ) );
vertices->push_back( osg::Vec3( 1.0, 0.0, 0.0 ) );
vertices->push_back( osg::Vec3( 1.0, 1.0, 0.0 ) );
vertices->push_back( osg::Vec3( 0.0, 1.0, 0.0 ) );
normals->push_back( osg::Vec3( 0.0, 0.0, -1.0 ) );
normals->push_back( osg::Vec3( 0.0, 0.0, -1.0 ) );
normals->push_back( osg::Vec3( 0.0, 0.0, -1.0 ) );
normals->push_back( osg::Vec3( 0.0, 0.0, -1.0 ) );
// back face
vertices->push_back( osg::Vec3( 0.0, 0.0, 1.0 ) );
......@@ -116,6 +122,9 @@ osg::ref_ptr< osg::Geometry > wge::createUnitCube( const WColor& color )
vertices->push_back( osg::Vec3( 1.0, 1.0, 1.0 ) );
vertices->push_back( osg::Vec3( 0.0, 1.0, 1.0 ) );
normals->push_back( osg::Vec3( 0.0, 0.0, 1.0 ) );
normals->push_back( osg::Vec3( 0.0, 0.0, 1.0 ) );
normals->push_back( osg::Vec3( 0.0, 0.0, 1.0 ) );
normals->push_back( osg::Vec3( 0.0, 0.0, 1.0 ) );
// left
vertices->push_back( osg::Vec3( 0.0, 0.0, 0.0 ) );
......@@ -123,6 +132,9 @@ osg::ref_ptr< osg::Geometry > wge::createUnitCube( const WColor& color )
vertices->push_back( osg::Vec3( 0.0, 1.0, 1.0 ) );
vertices->push_back( osg::Vec3( 0.0, 0.0, 1.0 ) );
normals->push_back( osg::Vec3( -1.0, 0.0, 0.0 ) );
normals->push_back( osg::Vec3( -1.0, 0.0, 0.0 ) );
normals->push_back( osg::Vec3( -1.0, 0.0, 0.0 ) );
normals->push_back( osg::Vec3( -1.0, 0.0, 0.0 ) );
// right
vertices->push_back( osg::Vec3( 1.0, 0.0, 0.0 ) );
......@@ -130,6 +142,9 @@ osg::ref_ptr< osg::Geometry > wge::createUnitCube( const WColor& color )
vertices->push_back( osg::Vec3( 1.0, 1.0, 1.0 ) );
vertices->push_back( osg::Vec3( 1.0, 0.0, 1.0 ) );
normals->push_back( osg::Vec3( 1.0, 0.0, 0.0 ) );
normals->push_back( osg::Vec3( 1.0, 0.0, 0.0 ) );
normals->push_back( osg::Vec3( 1.0, 0.0, 0.0 ) );
normals->push_back( osg::Vec3( 1.0, 0.0, 0.0 ) );
// bottom
vertices->push_back( osg::Vec3( 0.0, 0.0, 0.0 ) );
......@@ -137,6 +152,9 @@ osg::ref_ptr< osg::Geometry > wge::createUnitCube( const WColor& color )
vertices->push_back( osg::Vec3( 1.0, 0.0, 1.0 ) );
vertices->push_back( osg::Vec3( 0.0, 0.0, 1.0 ) );
normals->push_back( osg::Vec3( 0.0, -1.0, 0.0 ) );
normals->push_back( osg::Vec3( 0.0, -1.0, 0.0 ) );
normals->push_back( osg::Vec3( 0.0, -1.0, 0.0 ) );
normals->push_back( osg::Vec3( 0.0, -1.0, 0.0 ) );
// top
vertices->push_back( osg::Vec3( 0.0, 1.0, 0.0 ) );
......@@ -144,6 +162,9 @@ osg::ref_ptr< osg::Geometry > wge::createUnitCube( const WColor& color )
vertices->push_back( osg::Vec3( 1.0, 1.0, 1.0 ) );
vertices->push_back( osg::Vec3( 0.0, 1.0, 1.0 ) );
normals->push_back( osg::Vec3( 0.0, 1.0, 0.0 ) );
normals->push_back( osg::Vec3( 0.0, 1.0, 0.0 ) );
normals->push_back( osg::Vec3( 0.0, 1.0, 0.0 ) );
normals->push_back( osg::Vec3( 0.0, 1.0, 0.0 ) );
// set it up and set arrays
cube->addPrimitiveSet( new osg::DrawArrays( osg::PrimitiveSet::QUADS, 0, vertices->size() ) );
......@@ -154,7 +175,7 @@ osg::ref_ptr< osg::Geometry > wge::createUnitCube( const WColor& color )
// set normals
cube->setNormalArray( normals );
cube->setNormalBinding( osg::Geometry::BIND_PER_PRIMITIVE );
cube->setNormalBinding( osg::Geometry::BIND_PER_VERTEX );
// finally, the colors
colors->push_back( color );
......@@ -340,62 +361,6 @@ osg::ref_ptr< osg::Geometry > wge::convertToOsgGeometry( WTriangleMesh::SPtr mes
return geometry;
}
osg::ref_ptr< osg::Geometry > wge::convertMeshToOsgGeometryFlat( WTriangleMesh::SPtr mesh,
const WColor& color )
{
osg::ref_ptr< osg::Geometry> geometry( new osg::Geometry );
geometry->setVertexArray( mesh->getVertexArray() );
osg::DrawElementsUInt* surfaceElement;
surfaceElement = new osg::DrawElementsUInt( osg::PrimitiveSet::TRIANGLES, 0 );
std::vector< size_t > tris = mesh->getTriangles();
surfaceElement->reserve( tris.size() );
for( unsigned int vertId = 0; vertId < tris.size(); ++vertId )
{
surfaceElement->push_back( tris[vertId] );
}
geometry->addPrimitiveSet( surfaceElement );
{
osg::ref_ptr< osg::Vec4Array > colors = osg::ref_ptr< osg::Vec4Array >( new osg::Vec4Array );
colors->push_back( color );
geometry->setColorArray( colors );
geometry->setColorBinding( osg::Geometry::BIND_OVERALL );
}
// ------------------------------------------------
// normals
{
geometry->setNormalArray( mesh->getTriangleNormalArray() );
geometry->setNormalBinding( osg::Geometry::BIND_PER_PRIMITIVE );
// if normals are specified, we also setup a default lighting.
osg::StateSet* state = geometry->getOrCreateStateSet();
osg::ref_ptr<osg::LightModel> lightModel = new osg::LightModel();
lightModel->setTwoSided( true );
state->setAttributeAndModes( lightModel.get(), osg::StateAttribute::ON );
state->setMode( GL_BLEND, osg::StateAttribute::ON );
{
osg::ref_ptr< osg::Material > material = new osg::Material();
material->setDiffuse( osg::Material::FRONT, osg::Vec4( 1.0, 1.0, 1.0, 1.0 ) );
material->setSpecular( osg::Material::FRONT, osg::Vec4( 0.0, 0.0, 0.0, 1.0 ) );
material->setAmbient( osg::Material::FRONT, osg::Vec4( 0.1, 0.1, 0.1, 1.0 ) );
material->setEmission( osg::Material::FRONT, osg::Vec4( 0.0, 0.0, 0.0, 1.0 ) );
material->setShininess( osg::Material::FRONT, 0.0 );
state->setAttribute( material );
}
}
// enable VBO
geometry->setUseDisplayList( false );
geometry->setUseVertexBufferObjects( true );
return geometry;
}
osg::ref_ptr< osg::Geometry > wge::convertToOsgGeometryLines( WTriangleMesh::SPtr mesh,
const WColor& defaultColor,
bool useMeshColor )
......@@ -441,47 +406,6 @@ osg::ref_ptr< osg::Geometry > wge::convertToOsgGeometryLines( WTriangleMesh::SPt
return geometry;
}
osg::ref_ptr< osg::Geode > wge::generateLineStripGeode( const WLine& line, const float thickness, const WColor& color )
{
using osg::ref_ptr;
ref_ptr< osg::Vec3Array > vertices = ref_ptr< osg::Vec3Array >( new osg::Vec3Array );
ref_ptr< osg::Vec4Array > colors = ref_ptr< osg::Vec4Array >( new osg::Vec4Array );
ref_ptr< osg::Geometry > geometry = ref_ptr< osg::Geometry >( new osg::Geometry );
for( size_t i = 1; i < line.size(); ++i )
{
vertices->push_back( osg::Vec3( line[i-1][0], line[i-1][1], line[i-1][2] ) );
colors->push_back( wge::getRGBAColorFromDirection( line[i-1], line[i] ) );
}
vertices->push_back( osg::Vec3( line.back()[0], line.back()[1], line.back()[2] ) );
colors->push_back( colors->back() );
geometry->addPrimitiveSet( new osg::DrawArrays( osg::PrimitiveSet::LINE_STRIP, 0, line.size() ) );
geometry->setVertexArray( vertices );
if( color != WColor( 0, 0, 0, 0 ) )
{
colors->clear();
colors->push_back( color );
geometry->setColorArray( colors );
geometry->setColorBinding( osg::Geometry::BIND_OVERALL );
}
else
{
geometry->setColorArray( colors );
geometry->setColorBinding( osg::Geometry::BIND_PER_VERTEX );
}
// line width
osg::StateSet* stateset = geometry->getOrCreateStateSet();
stateset->setAttributeAndModes( new osg::LineWidth( thickness ), osg::StateAttribute::ON );
stateset->setMode( GL_LIGHTING, osg::StateAttribute::OFF );
osg::ref_ptr< osg::Geode > geode = osg::ref_ptr< osg::Geode >( new osg::Geode );
geode->addDrawable( geometry );
return geode;
}
osg::ref_ptr< osg::PositionAttitudeTransform > wge::addLabel( osg::Vec3 position, std::string text )
{
osg::ref_ptr< osgText::Text > label = osg::ref_ptr< osgText::Text >( new osgText::Text() );
......@@ -603,58 +527,6 @@ osg::ref_ptr< osg::Geode > wge::genFinitePlane( osg::Vec3 const& base, osg::Vec3
return geode;
}
osg::ref_ptr< WGESubdividedPlane > wge::genUnitSubdividedPlane( size_t resX, size_t resY, double spacing )
{
WAssert( resX > 0 && resY > 0, "A Plane with no quad is not supported, use another datatype for that!" );
double dx = ( resX > 1 ? 1.0 / ( resX - 1 ) : 1.0 );
double dy = ( resY > 1 ? 1.0 / ( resY - 1 ) : 1.0 );
size_t numQuads = resX * resY;
using osg::ref_ptr;
ref_ptr< osg::Vec3Array > vertices = ref_ptr< osg::Vec3Array >( new osg::Vec3Array( numQuads * 4 ) );
ref_ptr< osg::Vec3Array > centers = ref_ptr< osg::Vec3Array >( new osg::Vec3Array( numQuads ) );
ref_ptr< osg::Vec4Array > colors = ref_ptr< osg::Vec4Array >( new osg::Vec4Array( numQuads ) );
for( size_t yQuad = 0; yQuad < resY; ++yQuad )
{
for( size_t xQuad = 0; xQuad < resX; ++xQuad )
{
size_t qIndex = yQuad * resX + xQuad;
size_t vIndex = qIndex * 4; // since there are 4 corners
vertices->at( vIndex ) = osg::Vec3( xQuad * dx + spacing, yQuad * dy + spacing, 0.0 );
vertices->at( vIndex + 1 ) = osg::Vec3( xQuad * dx + dx - spacing, yQuad * dy + spacing, 0.0 );
vertices->at( vIndex + 2 ) = osg::Vec3( xQuad * dx + dx - spacing, yQuad * dy + dy - spacing, 0.0 );
vertices->at( vIndex + 3 ) = osg::Vec3( xQuad * dx + spacing, yQuad * dy + dy - spacing, 0.0 );
centers->at( qIndex ) = osg::Vec3( xQuad * dx + dx / 2.0, yQuad * dy + dy / 2.0, 0.0 );
colors->at( qIndex ) = osg::Vec4( 0.1 + static_cast< double >( qIndex ) / numQuads * 0.6,
0.1 + static_cast< double >( qIndex ) / numQuads * 0.6,
1.0, 1.0 );
}
}
ref_ptr< osg::Geometry > geometry = ref_ptr< osg::Geometry >( new osg::Geometry );
geometry->addPrimitiveSet( new osg::DrawArrays( osg::PrimitiveSet::QUADS, 0, vertices->size() ) );
geometry->setVertexArray( vertices );
geometry->setColorArray( colors );
geometry->setColorBinding( osg::Geometry::BIND_PER_PRIMITIVE );
ref_ptr< osg::Vec3Array > normals = ref_ptr< osg::Vec3Array >( new osg::Vec3Array );
normals->push_back( osg::Vec3( 0.0, 0.0, 1.0 ) );
geometry->setNormalArray( normals );
geometry->setNormalBinding( osg::Geometry::BIND_OVERALL );
osg::ref_ptr< WGESubdividedPlane > geode = osg::ref_ptr< WGESubdividedPlane >( new WGESubdividedPlane );
geode->addDrawable( geometry );
geode->setCenterArray( centers );
// we need to disable light, since the order of the vertices may be wrong and with lighting you won't see anything but black surfaces
osg::StateSet* state = geode->getOrCreateStateSet();
state->setMode( GL_BLEND, osg::StateAttribute::ON );
state->setMode( GL_LIGHTING, osg::StateAttribute::OFF | osg::StateAttribute::PROTECTED );
return geode;
}
osg::ref_ptr< osg::Group > wge::creatCoordinateSystem(
osg::Vec3 middle,
double sizeX,
......
......@@ -128,18 +128,6 @@ namespace wge
bool lighting = false
);
/**
* Extract the vertices and triangles from a WTriangleMesh and save them
* into an osg::Geometry. It uses per triangle normals.
*
* \param mesh the WTriangleMesh used as input
* \param color This color is used for all vertices
* \return an osg::Geometry containing the mesh
* \note mesh cannot be const since osg::Geometry needs non-const pointers to the contained arrays
*/
osg::ref_ptr< osg::Geometry > convertMeshToOsgGeometryFlat( WTriangleMesh::SPtr mesh,
const WColor& color = WColor( 1.0, 1.0, 1.0, 1.0 ) );
/**
* Convert triangle mesh to lines representing it. Draws lines twice (ATM).
*
......@@ -153,20 +141,6 @@ namespace wge
const WColor& defaultColor = WColor( 1.0, 1.0, 1.0, 1.0 ),
bool useMeshColor = true );
/**
* Generates a line geode with thickness and color as parameters.
*
* \param line sequence of points
* \param thickness How thick the line strip should be
* \param color If present this color is used for the whole line, otherwise local coloring is used
*
* \return The new assembled geode for this line
*/
osg::ref_ptr< osg::Geode > generateLineStripGeode( const WLine& line,
const float thickness = 3.0f,
const WColor& color = WColor( 0, 0, 0, 0 ) );
/**
* helper function to add a label somewhere
*
......@@ -229,72 +203,6 @@ namespace wge
* \return the geode
*/
osg::ref_ptr< osg::Geode > genFinitePlane( osg::Vec3 const& base, osg::Vec3 const& a, osg::Vec3 const& b );
/**
* Generates a plane subdivided into quads.
*
* \param resX How many quads in x-direction
* \param resY How many quads in y-direction
* \param spacing Not implement yet
*
* \return The new uncolored plane geode
*/
osg::ref_ptr< WGESubdividedPlane > genUnitSubdividedPlane( size_t resX, size_t resY, double spacing = 0.01 );
/**
* For each points in the STL container generate small cubes.
*
* \param points Center point of the cubes
* \param size The size of the cubes
* \param color The color of the cubes
* \tparam An STL container with WPositions as elements ( don't try it with different than vector, set, list or queue )
*
* \return Geode with as many cubes as points in the container where each cube is around a certain position.
*/
template< class Container > osg::ref_ptr< osg::Geode > genPointBlobs( boost::shared_ptr< Container > points,
double size,
const WColor& color = WColor( 1.0, 0.0, 0.0, 1.0 ) );
} // end of namespace wge
template< class Container > inline osg::ref_ptr< osg::Geode > wge::genPointBlobs( boost::shared_ptr< Container > points,
double size,
const WColor& color )
{
osg::ref_ptr< osg::Vec3Array > vertices = osg::ref_ptr< osg::Vec3Array >( new osg::Vec3Array );
osg::ref_ptr< osg::Vec4Array > colors = osg::ref_ptr< osg::Vec4Array >( new osg::Vec4Array );
osg::ref_ptr< osg::Geometry > geometry = osg::ref_ptr< osg::Geometry >( new osg::Geometry );
osg::ref_ptr< osg::Vec3Array > normals = osg::ref_ptr< osg::Vec3Array >( new osg::Vec3Array );
for( typename Container::const_iterator point = points->begin(); point != points->end(); ++point )
{
const WPosition& pos = *point;
std::vector< WPosition > corners;
corners.reserve( 8 );
double halfSize = size / 2.0;
corners.push_back( WPosition( pos[0] - halfSize, pos[1] - halfSize, pos[2] - halfSize ) );
corners.push_back( WPosition( pos[0] + halfSize, pos[1] - halfSize, pos[2] - halfSize ) );
corners.push_back( WPosition( pos[0] + halfSize, pos[1] - halfSize, pos[2] + halfSize ) );
corners.push_back( WPosition( pos[0] - halfSize, pos[1] - halfSize, pos[2] + halfSize ) );
corners.push_back( WPosition( pos[0] - halfSize, pos[1] + halfSize, pos[2] - halfSize ) );
corners.push_back( WPosition( pos[0] + halfSize, pos[1] + halfSize, pos[2] - halfSize ) );
corners.push_back( WPosition( pos[0] + halfSize, pos[1] + halfSize, pos[2] + halfSize ) );
corners.push_back( WPosition( pos[0] - halfSize, pos[1] + halfSize, pos[2] + halfSize ) );
osg::ref_ptr< osg::Vec3Array > ver = generateCuboidQuads( corners );
vertices->insert( vertices->end(), ver->begin(), ver->end() );
osg::ref_ptr< osg::Vec3Array > nor = generateCuboidQuadNormals( corners );
normals->insert( normals->end(), nor->begin(), nor->end() );
geometry->addPrimitiveSet( new osg::DrawArrays( osg::PrimitiveSet::QUADS, vertices->size() - ver->size(), ver->size() ) );
}
geometry->setVertexArray( vertices );
colors->push_back( color );
geometry->setColorArray( colors );
geometry->setColorBinding( osg::Geometry::BIND_OVERALL );
geometry->setNormalArray( normals );
geometry->setNormalBinding( osg::Geometry::BIND_PER_PRIMITIVE );
osg::ref_ptr< osg::Geode > geode = osg::ref_ptr< osg::Geode >( new osg::Geode );
geode->addDrawable( geometry );
return geode;
}
#endif // WGEGEODEUTILS_H
......@@ -163,7 +163,7 @@ void WROIArbitrary::updateGFX()
// ------------------------------------------------
// normals
surfaceGeometry->setNormalArray( m_triMesh->getTriangleNormalArray() );
surfaceGeometry->setNormalBinding( osg::Geometry::BIND_PER_PRIMITIVE );
// surfaceGeometry->setNormalBinding( osg::Geometry::BIND_PER_PRIMITIVE );
// ------------------------------------------------
// colors
......
......@@ -199,7 +199,7 @@ WROIBox::WROIBox( WPosition minPos, WPosition maxPos ) :
osg::ref_ptr<osg::Vec3Array> normals = osg::ref_ptr<osg::Vec3Array>( new osg::Vec3Array );
setNormals( normals );
m_surfaceGeometry->setNormalArray( normals );
m_surfaceGeometry->setNormalBinding( osg::Geometry::BIND_PER_PRIMITIVE );
// m_surfaceGeometry->setNormalBinding( osg::Geometry::BIND_PER_PRIMITIVE );
m_not->set( false );
......
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------
#ifndef WGEGEODEUTILS_TEST_H
#define WGEGEODEUTILS_TEST_H
#include <cxxtest/ValueTraits.h>
#include <cxxtest/TestSuite.h>
#include <osg/io_utils>
#include "../../common/WStringUtils.h"
#include "WVec3Traits.h"
#include "../WGEGeodeUtils.h"
/**
* Testsuite for the WGEGeode utils.
*/
class WGEGeodeUtilsTest : public CxxTest::TestSuite
{
public:
/**
* A unit subdivided plane with resolution width_x_height has width*height many quads.
*/
void testNumQuadsAndTheirVerticesWithoutSpacing( void )
{
double spacing = 0.0;
osg::ref_ptr< WGESubdividedPlane > g = wge::genUnitSubdividedPlane( 2, 2, spacing );
osg::Geometry *geo = dynamic_cast< osg::Geometry* >( g->getDrawable( 0 ) );
if( !geo )
{
TS_FAIL( "The drawable inside the WGESubdividedPlane geode is not a geometry" );
}
TS_ASSERT( geo );
osg::Vec3Array* verts = dynamic_cast< osg::Vec3Array* >( geo->getVertexArray() );
if( !verts )
{
TS_FAIL( "The vertex array inside is not a osg::Vec3Array" );
}
osg::ref_ptr< osg::Vec3Array > expected = osg::ref_ptr< osg::Vec3Array >( new osg::Vec3Array );
expected->push_back( osg::Vec3( 0.0, 0.0, 0.0 ) );
expected->push_back( osg::Vec3( 1.0, 0.0, 0.0 ) );
expected->push_back( osg::Vec3( 1.0, 1.0, 0.0 ) );
expected->push_back( osg::Vec3( 0.0, 1.0, 0.0 ) );
expected->push_back( osg::Vec3( 1.0, 0.0, 0.0 ) );
expected->push_back( osg::Vec3( 2.0, 0.0, 0.0 ) );
expected->push_back( osg::Vec3( 2.0, 1.0, 0.0 ) );
expected->push_back( osg::Vec3( 1.0, 1.0, 0.0 ) );
expected->push_back( osg::Vec3( 0.0, 1.0, 0.0 ) );
expected->push_back( osg::Vec3( 1.0, 1.0, 0.0 ) );
expected->push_back( osg::Vec3( 1.0, 2.0, 0.0 ) );
expected->push_back( osg::Vec3( 0.0, 2.0, 0.0 ) );
expected->push_back( osg::Vec3( 1.0, 1.0, 0.0 ) );
expected->push_back( osg::Vec3( 2.0, 1.0, 0.0 ) );
expected->push_back( osg::Vec3( 2.0, 2.0, 0.0 ) );
expected->push_back( osg::Vec3( 1.0, 2.0, 0.0 ) );
TS_ASSERT_EQUALS( verts->asVector(), expected->asVector() );
}
/**
* For each quad there is a center point defined in the center point array.
*/
void testCenterPoints( void )
{
osg::ref_ptr< WGESubdividedPlane > g = wge::genUnitSubdividedPlane( 2, 2 );
osg::ref_ptr< osg::Vec3Array > expected = osg::ref_ptr< osg::Vec3Array >( new osg::Vec3Array );
expected->push_back( osg::Vec3( 0.5, 0.5, 0.0 ) );
expected->push_back( osg::Vec3( 1.5, 0.5, 0.0 ) );
expected->push_back( osg::Vec3( 0.5, 1.5, 0.0 ) );
expected->push_back( osg::Vec3( 1.5, 1.5, 0.0 ) );
TS_ASSERT_EQUALS( g->getCenterArray()->asVector(), expected->asVector() );
}
};
#endif // WGEGEODEUTILS_TEST_H
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