Commit 923fd54a authored by Alexander Wiebel's avatar Alexander Wiebel
Browse files

[MERGE]

parents e37a6943 ed8d7bfc
......@@ -236,9 +236,26 @@ ADD_CUSTOM_TARGET( fixtures
)
#-------------------------------------------------------------------------------------------------------------
# Makes many special make targets in comination.
# Makes many special make targets in comination. Default number of cores is 1.
SET( NUM_CORES_DIR ${PROJECT_SOURCE_DIR}/../tools/numCores )
SET( NUM_CORES_BIN ${NUM_CORES_DIR}/numCores )
EXECUTE_PROCESS( COMMAND ${CMAKE_COMMAND} . WORKING_DIRECTORY ${NUM_CORES_DIR} OUTPUT_QUIET )
EXECUTE_PROCESS( COMMAND make WORKING_DIRECTORY ${NUM_CORES_DIR} OUTPUT_QUIET )
IF( EXISTS ${NUM_CORES_BIN} )
EXECUTE_PROCESS( COMMAND ${NUM_CORES_BIN} OUTPUT_VARIABLE CORES OUTPUT_STRIP_TRAILING_WHITESPACE )
ELSE()
MESSAGE( STATUS "WARNING: No binary for #cores found: ${NUM_CORES_BIN}" )
SET( CORES 1 )
ENDIF()
# remove everything afterwards since, it not needs to be checked in and distrubs when calling "hg st"
EXECUTE_PROCESS( COMMAND ${CMAKE_COMMAND} -E remove -f ${NUM_CORES_DIR}/CMakeCache.txt
${NUM_CORES_DIR}/numCores
${NUM_CORES_DIR}/Makefile
${NUM_CORES_DIR}/cmake_install.cmake )
EXECUTE_PROCESS( COMMAND ${CMAKE_COMMAND} -E remove_directory ${NUM_CORES_DIR}/CMakeFiles )
MESSAGE( STATUS "Using ${CORES} cores" )
ADD_CUSTOM_TARGET( many
cmake . && make all -j4 && make fixtures && make stylecheck && make test && make doc
cmake . && make all -j${CORES} && make fixtures && make stylecheck && make test && make doc
COMMENT "Make many special make targets in combination."
)
......
......@@ -30,6 +30,8 @@
#include <osg/Geometry>
#include "../../common/WColor.h"
#include "../../common/WCondition.h"
#include "../../common/WFlag.h"
#include "../../common/WLogger.h"
#include "../../dataHandler/WDataSetFibers.h"
#include "../../dataHandler/WSubject.h"
......@@ -41,7 +43,7 @@
WMFiberDisplay::WMFiberDisplay()
: WModule(),
m_globalColoring( true )
m_globalColoring( new WCondition(), true )
{
}
......@@ -98,6 +100,7 @@ void WMFiberDisplay::moduleMain()
{
// additional fire-condition: "data changed" flag
m_moduleState.add( m_fiberInput->getDataChangedCondition() );
m_moduleState.add( m_globalColoring.getCondition() );
ready();
......@@ -113,10 +116,10 @@ void WMFiberDisplay::moduleMain()
update();
m_moduleState.wait(); // waits for firing of m_moduleState ( dataChanged, shutdown, etc. )
// May be called twice
WKernel::getRunningKernel()->getGraphicsEngine()->getScene()->remove( m_osgNode );
}
// May be called twice
WKernel::getRunningKernel()->getGraphicsEngine()->getScene()->remove( m_osgNode );
}
void WMFiberDisplay::update()
......@@ -126,7 +129,7 @@ void WMFiberDisplay::update()
// create new node
m_osgNode = osg::ref_ptr< WGEGroupNode >( new WGEGroupNode );
m_osgNode->insert( genFiberGeode( m_dataset, m_globalColoring ) );
m_osgNode->insert( genFiberGeode( m_dataset, m_globalColoring.get() ) );
m_osgNode->getOrCreateStateSet()->setMode( GL_LIGHTING, osg::StateAttribute::OFF );
WKernel::getRunningKernel()->getGraphicsEngine()->getScene()->insert( m_osgNode );
}
......@@ -154,7 +157,8 @@ void WMFiberDisplay::slotPropertyChanged( std::string propertyName )
{
if( propertyName == "active" )
{
if ( m_properties->getValue< bool >( propertyName ) )
// We don't need an OSG Node Callback here, since if the NodeMask is set to 0x0 then the node is not visited anymore either
if( m_properties->getValue< bool >( propertyName ) )
{
m_osgNode->setNodeMask( 0xFFFFFFFF );
}
......@@ -165,10 +169,9 @@ void WMFiberDisplay::slotPropertyChanged( std::string propertyName )
}
else if ( propertyName == "Local Color" )
{
if( m_properties->getValue< bool >( propertyName ) != m_globalColoring )
if( m_properties->getValue< bool >( propertyName ) != m_globalColoring.get() )
{
m_globalColoring = m_properties->getValue< bool >( propertyName );
update();
m_globalColoring.set( m_properties->getValue< bool >( propertyName ) );
}
}
else
......
......@@ -29,6 +29,7 @@
#include <osg/Geode>
#include "../../common/WFlag.h"
#include "../../dataHandler/WDataSetFibers.h"
#include "../../graphicsEngine/WGEGroupNode.h"
#include "../../kernel/WModule.h"
......@@ -114,10 +115,7 @@ protected:
*/
void update();
/**
* If the fibers have to be drawn in global coloring mode this is true, otherwise false.
*/
bool m_globalColoring;
WBoolFlag m_globalColoring; //!< If True the fibers have to be drawn in global coloring mode, otherwise false.
private:
/**
......
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
SET( Boost_USE_MULTITHREAD ON )
FIND_PACKAGE( Boost REQUIRED program_options thread filesystem date_time system signals regex )
INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIR} )
ADD_EXECUTABLE( numCores WNumCores.cpp )
TARGET_LINK_LIBRARIES( numCores ${Boost_LIBRARIES} )
//---------------------------------------------------------------------------
//
// 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 <iostream>
#include <boost/thread.hpp>
int main()
{
std::cout << boost::thread::hardware_concurrency() << std::endl;
return 0;
}
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