Commit 79b9b857 by Mathias Goldau

[CHANGE] now the WMLIC takes the first vector dataset at hand, so no project…

[CHANGE] now the WMLIC takes the first vector dataset at hand, so no project file is needed since the inVectorIC is disabled ATM
parent 2fac7e6d
......@@ -74,10 +74,10 @@ void WMLIC::connectors()
// Alternatively the vector dataset is choosen from first subject dataset containing evec in its file name, see moduleMain
// for more informations.
//
m_vectorIC = boost::shared_ptr< WModuleInputData < WDataSetVector > >(
new WModuleInputData< WDataSetVector >( shared_from_this(),
"inVectorDS", "The vectors used for computing the Streamlines used for the LIC" )
);
// m_vectorIC = boost::shared_ptr< WModuleInputData < WDataSetVector > >(
// new WModuleInputData< WDataSetVector >( shared_from_this(),
// "inVectorDS", "The vectors used for computing the Streamlines used for the LIC" )
// );
// TODO(math): ATM we are unsure about providing an output. Caution the input mesh is modified!
// m_meshOC = boost::shared_ptr< WModuleOutputData < WTriangleMesh2 > >(
......@@ -86,7 +86,7 @@ void WMLIC::connectors()
// );
addConnector( m_meshIC );
addConnector( m_vectorIC );
// addConnector( m_vectorIC );
// addConnector( m_meshOC );
WModule::connectors();
}
......@@ -156,7 +156,7 @@ void WMLIC::moduleMain()
{
m_moduleState.setResetable( true, true );
m_moduleState.add( m_meshIC->getDataChangedCondition() );
m_moduleState.add( m_vectorIC->getDataChangedCondition() );
// m_moduleState.add( m_vectorIC->getDataChangedCondition() );
ready();
......@@ -171,26 +171,29 @@ void WMLIC::moduleMain()
boost::shared_ptr< WTriangleMesh2 > newMesh = m_meshIC->getData();
// TODO(math): if the vector input is available again please enable this again too
boost::shared_ptr< WDataSetVector > newVector = m_vectorIC->getData();
bool dataChanged = ( m_inMesh != newMesh ) || ( m_inVector != newVector );
bool dataValid = ( newMesh.get() && newVector.get() );
// boost::shared_ptr< WDataSetVector > newVector = m_vectorIC->getData();
// bool dataChanged = ( m_inMesh != newMesh ) || ( m_inVector != newVector );
// bool dataValid = ( newMesh.get() && newVector.get() );
// bool dataChanged = ( m_inMesh != newMesh );
// bool dataValid = newMesh.get();
bool dataChanged = ( m_inMesh != newMesh );
bool dataValid = newMesh.get();
if ( dataChanged && dataValid )
{
debugLog() << "Received Data.";
m_inMesh = newMesh;
m_inVector = newVector;
// m_inVector = searchVectorDS();
// m_inVector = newVector;
WAssert( m_inVector = searchVectorDS(), "There was no vector dataset loaded, please load it first!" );
m_inMesh->doLoopSubD();
m_inMesh->doLoopSubD();
SurfaceLIC lic( m_inVector, m_inMesh );
lic.execute();
lic.updateMeshColor( m_inMesh );
// m_meshOC.updateData( m_inMesh );
debugLog() << "Start rendering LIC";
renderMesh( m_inMesh );
debugLog() << "Rendering done";
}
}
}
......@@ -217,13 +220,10 @@ boost::shared_ptr< WDataSetVector > WMLIC::searchVectorDS() const
for( std::vector< boost::shared_ptr< WDataSet > >::iterator it = da->get().begin(); it != da->get().end(); ++it )
{
if( ( *it )->isTexture() )
if( ( *it )->isVectorDataSet() )
{
da->endRead();
// dataSetAccess->beginWrite();
// dataSetAccess->get().insert( dataSetAccess->get().begin(), *it );
// dataSetAccess->endWrite();
da->beginRead();
return ( *it )->isVectorDataSet();
}
}
da->endRead();
......
......@@ -108,7 +108,7 @@ private:
boost::shared_ptr< WDataSetVector > searchVectorDS() const;
boost::shared_ptr< WModuleInputData< WTriangleMesh2 > > m_meshIC; //!< The InputConnector for the mesh on which to paint
boost::shared_ptr< WModuleInputData< WDataSetVector > > m_vectorIC; //!< The InputConnector for the vectors that are used to build the streamlines
// boost::shared_ptr< WModuleInputData< WDataSetVector > > m_vectorIC; //!< The InputConnector for the vectors that are used to build the streamlines
boost::shared_ptr< WTriangleMesh2 > m_inMesh; //!< The mesh given from the input connector
boost::shared_ptr< WDataSetVector > m_inVector; //!< The vector field used to compute the LIC given from the input connector
......
......@@ -62,16 +62,13 @@ FStreamlineOnSurfaceEuler::FStreamlineOnSurfaceEuler( boost::shared_ptr< WDataSe
FArray mean;
FTensor tensortensor;
// m_dh->printDebug(_T("interpolate vectors..."), 1);
for (unsigned int i = 0; i < nbTriangles; ++i)
{
Vector center( m_mesh->getTriangleCenter(i) );
FTensor t = m_tensorField->getInterpolatedVector(center.x, center.y, center.z);
// std::cout << "interpolat: " << t << std::endl;
cell_vectors[i] = FArray(t).normalize();
}
// m_dh->printDebug(_T("done"), 1);
#ifdef __DEBUG__
std::cout << "FStreamlineOnSurfaceEuler: exit" << std::endl
......
......@@ -52,10 +52,6 @@ FTensor TensorField::getInterpolatedVector(float x, float y, float z)
WAssert( grid->encloses( pos ), "Grid does not enclose position to interpolate" );
std::vector< size_t > vertexIds = grid->getCellVertexIds( grid->getCellId( pos ) );
// wmath::WPosition localPos = pos - grid->getPosition( vertexIds[0] );
// double xMult = localPos[0] / grid->getOffsetX();
// double yMult = localPos[1] / grid->getOffsetY();
// double zMult = localPos[2] / grid->getOffsetZ();
float xMult = x - (int)x;
float yMult = y - (int)y;
float zMult = z - (int)z;
......@@ -69,16 +65,6 @@ FTensor TensorField::getInterpolatedVector(float x, float y, float z)
FTensor txy1z1 = FTensor( m_vectors->getVectorAt( vertexIds[6] ) );
FTensor tx1y1z1 = FTensor( m_vectors->getVectorAt( vertexIds[7] ) );
// std::cout << pos << "::" << grid->getCellId( pos ) << " ";
// std::cout << txyz << "::" << vertexIds[0] << " ";
// std::cout << tx1yz << "::" << vertexIds[1] << " ";
// std::cout << txy1z << "::" << vertexIds[2] << " ";
// std::cout << tx1y1z << "::" << vertexIds[3] << " ";
// std::cout << txyz1 << "::" << vertexIds[4] << " ";
// std::cout << tx1yz1 << "::" << vertexIds[5] << " ";
// std::cout << txy1z1 << "::" << vertexIds[6] << " ";
// std::cout << tx1y1z1 << "::" << vertexIds[7] << std::endl;
FMatrix matxyz = createMatrix(txyz, txyz);
FMatrix matx1yz = createMatrix(tx1yz, tx1yz);
FMatrix matxy1z = createMatrix(txy1z, txy1z);
......
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