Commit f44818a7 by Sebastian Eichelbaum

[REMOVE] - removed old geometry based glyphs

parent 14b509ea
......@@ -49,7 +49,6 @@
#include "../modules/fiberSelection/WMFiberSelection.h"
#include "../modules/fiberTransform/WMFiberTransform.h"
#include "../modules/gaussFiltering/WMGaussFiltering.h"
#include "../modules/geometryGlyphs/WMGeometryGlyphs.h"
#include "../modules/hud/WMHud.h"
#include "../modules/lic/WMLIC.h"
#include "../modules/marchingCubes/WMMarchingCubes.h"
......@@ -118,7 +117,6 @@ void WModuleFactory::load()
m_prototypeAccess->get().insert( boost::shared_ptr< WModule >( new WMSurfaceParticles() ) );
m_prototypeAccess->get().insert( boost::shared_ptr< WModule >( new WMClusterSlicer() ) );
m_prototypeAccess->get().insert( boost::shared_ptr< WModule >( new WMVectorPlot() ) );
m_prototypeAccess->get().insert( boost::shared_ptr< WModule >( new WMGeometryGlyphs() ) );
m_prototypeAccess->get().insert( boost::shared_ptr< WModule >( new WMArbitraryRois() ) );
m_prototypeAccess->get().insert( boost::shared_ptr< WModule >( new WMMeshReader() ) );
m_prototypeAccess->get().insert( boost::shared_ptr< WModule >( new WMFiberTransform() ) );
......
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV-Leipzig and CNCF-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 WMGEOMETRYGLYPHS_H
#define WMGEOMETRYGLYPHS_H
#include <string>
#include <osg/Node>
#include <osg/Geode>
#include <osg/Uniform>
#include "../../kernel/WModule.h"
#include "../../kernel/WModuleInputData.h"
#include "../../kernel/WModuleOutputData.h"
#include "../../dataHandler/WDataSetSingle.h"
#include "../../dataHandler/WDataSetVector.h"
#include "../../graphicsEngine/WGEGroupNode.h"
#include "../../graphicsEngine/WTriangleMesh2.h"
/**
* Someone should add some documentation here.
* Probably the best person would be the module's
* creator, i.e. "schurade".
*
* This is only an empty template for a new module. For
* an example module containing many interesting concepts
* and extensive documentation have a look at "src/modules/template"
*
* \ingroup modules
*/
class WMGeometryGlyphs: public WModule
{
public:
/**
*
*/
WMGeometryGlyphs();
/**
*
*/
virtual ~WMGeometryGlyphs();
/**
* Gives back the name of this module.
* \return the module's name.
*/
virtual const std::string getName() const;
/**
* Gives back a description of this module.
* \return description to module.
*/
virtual const std::string getDescription() const;
/**
* Due to the prototype design pattern used to build modules, this method returns a new instance of this method. NOTE: it
* should never be initialized or modified in some other way. A simple new instance is required.
*
* \return the prototype used to create every module in OpenWalnut.
*/
virtual boost::shared_ptr< WModule > factory() const;
protected:
/**
* Entry point after loading the module. Runs in separate thread.
*/
virtual void moduleMain();
/**
* Initialize the connectors this module is using.
*/
virtual void connectors();
/**
* Initialize the properties for this module.
*/
virtual void properties();
private:
void prepareGlyphes(); //!< initial creation of glyphs
/**
* render function
* \param mesh
*/
void renderMesh( boost::shared_ptr< WTriangleMesh2 > mesh );
WPropBool m_useTextureProp; //!< Property indicating whether to use texturing with scalar data sets.
osg::ref_ptr< WGEGroupNode > m_moduleNode; //!< Pointer to the modules group node. We need it to be able to update it when callback is invoked.
osg::ref_ptr< osg::Geode > m_outputGeode; //!< Pointer to geode containing the glpyhs
boost::shared_ptr< WModuleInputData< WDataSetSingle > > m_input; //!< Input connector required by this module.
boost::shared_ptr< const WDataSetSingle > m_dataSet; //!< pointer to dataSet to be able to access it throughout the whole module.
boost::shared_ptr< WTriangleMesh2 > m_triMesh; //!< This triangle mesh is provided as output through the connector.
WPropInt m_xPos; //!< x posistion of the slice
WPropInt m_yPos; //!< y posistion of the slice
WPropInt m_zPos; //!< z posistion of the slice
WPropBool m_showonX; //!< in dicates whether the vector should be shown on slice X
WPropBool m_showonY; //!< in dicates whether the vector should be shown on slice Y
WPropBool m_showonZ; //!< in dicates whether the vector should be shown on slice Z
};
#endif // WMGEOMETRYGLYPHS_H
//---------------------------------------------------------------------------
//
// 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/>.
//
//---------------------------------------------------------------------------
#include "WSphereCreator.h"
WSphereCreator::WSphereCreator()
{
}
WSphereCreator::~WSphereCreator()
{
}
boost::shared_ptr<WTriangleMesh2>WSphereCreator::createSphere( int resolution, float zoom, float xOff, float yOff, float zOff )
{
boost::shared_ptr<WTriangleMesh2>sphere = createIcosahedronSphere( resolution );
for ( size_t i = 0; i < sphere->vertSize(); ++i )
{
osg::Vec3 v = sphere->getVertex( i );
v.normalize();
osg::Vec4 c( fabs( v[0] ), fabs( v[1] ), fabs( v[2] ), 1.0 );
sphere->setVertexColor( i, c );
}
sphere->zoomMesh( zoom );
sphere->translateMesh( xOff, yOff, zOff );
return sphere;
}
boost::shared_ptr<WTriangleMesh2>WSphereCreator::createIcosahedronSphere( int iterations )
{
float t = ( 1 + sqrt( 5.0 ) ) / 2;
float tau = t / sqrt( 1 + t * t );
float one = 1 / sqrt( 1 + t * t );
boost::shared_ptr<WTriangleMesh2>sphere = boost::shared_ptr<WTriangleMesh2>( new WTriangleMesh2( 12, 20 ) );
sphere->addVertex( tau, one, 0.0 );
sphere->addVertex( -tau, one, 0.0 );
sphere->addVertex( -tau, -one, 0.0 );
sphere->addVertex( tau, -one, 0.0 );
sphere->addVertex( one, 0.0, tau );
sphere->addVertex( one, 0.0, -tau );
sphere->addVertex( -one, 0.0, -tau );
sphere->addVertex( -one, 0.0, tau );
sphere->addVertex( 0.0, tau, one );
sphere->addVertex( 0.0, -tau, one );
sphere->addVertex( 0.0, -tau, -one );
sphere->addVertex( 0.0, tau, -one );
sphere->addTriangle( 4, 8, 7 );
sphere->addTriangle( 4, 7, 9 );
sphere->addTriangle( 5, 6, 11 );
sphere->addTriangle( 5, 10, 6 );
sphere->addTriangle( 0, 4, 3 );
sphere->addTriangle( 0, 3, 5 );
sphere->addTriangle( 2, 7, 1 );
sphere->addTriangle( 2, 1, 6 );
sphere->addTriangle( 8, 0, 11 );
sphere->addTriangle( 8, 11, 1 );
sphere->addTriangle( 9, 10, 3 );
sphere->addTriangle( 9, 2, 10 );
sphere->addTriangle( 8, 4, 0 );
sphere->addTriangle( 11, 0, 5 );
sphere->addTriangle( 4, 9, 3 );
sphere->addTriangle( 5, 3, 10 );
sphere->addTriangle( 7, 8, 1 );
sphere->addTriangle( 6, 1, 11 );
sphere->addTriangle( 7, 2, 9 );
sphere->addTriangle( 6, 10, 2 );
for ( int i = 0; i < iterations; ++i )
{
sphere->doLoopSubD();
}
return sphere;
}
//---------------------------------------------------------------------------
//
// 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 WSPHERECREATOR_H
#define WSPHERECREATOR_H
#include <boost/shared_ptr.hpp>
#include "../../graphicsEngine/WTriangleMesh2.h"
/**
* TODO(schurade): Document this!
*/
class WSphereCreator
{
public:
/**
* constructor, does nothing
*/
WSphereCreator();
/**
* destructor
*/
~WSphereCreator();
/**
* creates a sphere mesh by executing a given number of loopsubd on a
*
* \param resolution
* \param zoom
* \param xOff
* \param yOff
* \param zOff
*/
boost::shared_ptr<WTriangleMesh2>createSphere( int resolution, float zoom = 1., float xOff = 0., float yOff = 0., float zOff = 0. );
protected:
private:
/**
* creates a sphere mesh by executing a given number of loopsubd on a icosahedrom
*
* \param iterations
*/
boost::shared_ptr<WTriangleMesh2>createIcosahedronSphere( int iterations );
};
#endif // WSPHERECREATOR_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