Commit e166ebd4 authored by Franziska Jacob's avatar Franziska Jacob
Browse files

[CHANGE][STYLE]

- began new code structuring (not finished)
- one ray gets sampled
- corrected bounding box calculation
- adapted trilinear interpolation for not uniform grids
- made m_dataSet and m_grid member variables
- stylecheck
parent 152154d4
[Dolphin]
ShowPreview=true
Timestamp=2012,5,10,21,58,16
Timestamp=2012,5,16,21,37,57
Version=2
[Settings]
......
[Dolphin]
Timestamp=2012,5,10,21,58,5
Timestamp=2012,5,16,21,37,16
Version=2
//---------------------------------------------------------------------------
//
// 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 <boost/shared_ptr.hpp>
#include <core/kernel/WModule.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/>.
//
//---------------------------------------------------------------------------
#ifndef WTOOLKIT_H
#define WTOOLKIT_H
......
......@@ -24,7 +24,10 @@
#include "WRay.h"
WRay::WRay() {}
WRay::WRay()
{
// constructor
}
WRay::WRay( WVector4d st, WVector4d dir ) :
m_start( st ),
......@@ -34,9 +37,12 @@ WRay::WRay( WVector4d st, WVector4d dir ) :
m_direction *= ( 1/n );
}
WRay::~WRay() {}
WRay::~WRay()
{
// destructor
}
WVector4d WRay::getSpot( double t )
{
return m_start + m_direction * t;
}
\ No newline at end of file
}
......@@ -34,12 +34,11 @@
class WRay
{
public:
/**
* Standard Constructor
*/
WRay();
/**
* constructor -
* normalizes direction
......@@ -53,7 +52,7 @@ public:
* destructor
*/
virtual ~WRay();
/**
* Calculates a spot on the ray with given parameter t
* ray = start + t * direction
......@@ -70,12 +69,11 @@ private:
* origin of the ray
*/
WVector4d m_start;
/**
* direction of the ray
*/
WVector4d m_direction;
};
#endif // WRAY_H
......@@ -22,6 +22,7 @@
//
//---------------------------------------------------------------------------
#include "core/kernel/WKernel.h"
#include "core/common/WAssert.h"
#include "WRayProfile.h"
......@@ -31,7 +32,9 @@ WRayProfile::WRayProfile( size_t nbSamples )
// initialize members
// reserve some space for all the profiles.
m_profile.resize( nbSamples );
m_profile.resize( nbSamples, WRaySample() );
// wlog::debug( "WRayProfile" ) << "Size of RayProfile: " << m_profile.size();
// NOTE: the number of samples does not need to be stored as it is the number of elements in m_profile.
}
......@@ -41,19 +44,14 @@ WRayProfile::~WRayProfile()
// cleanup
}
// void WRayProfile::addSample( WRaySample smp )
// {
// m_profile.push_back( smp );
// }
const WRaySample& WRayProfile::operator[]( size_t sampleID ) const
{
WAssert( sampleID >= m_profile.size(), "Invalid sample ID." );
WAssert( sampleID < m_profile.size(), "Invalid sample ID." ); // assert was wrong in the beginning
return m_profile[ sampleID ];
}
WRaySample& WRayProfile::operator[]( size_t sampleID )
{
WAssert( sampleID >= m_profile.size(), "Invalid sample ID." );
WAssert( sampleID < m_profile.size(), "Invalid sample ID." );
return m_profile[ sampleID ];
}
......@@ -58,14 +58,6 @@ public:
* Destructor.
*/
virtual ~WRayProfile();
// /**
// * Adds a new sample to the profile.
// *
// * \param smp sample which shall be added
// *
// */
// void addSample( WRaySample smp );
/**
* Access the specified ray sample. Provide a valid ray sample ID. Invalid IDs cause an exception.
......
......@@ -30,11 +30,6 @@ WRaySample::WRaySample():
// initialize members
}
WRaySample::WRaySample( double value )
{
m_value = value;
}
WRaySample::~WRaySample()
{
// cleanup
......
......@@ -35,13 +35,6 @@ public:
* Default constructor.
*/
WRaySample();
/**
* Constructor with direct value initialization.
*
* \param value Value of this sample point.
*/
WRaySample( double value );
/**
* Destructor.
......
......@@ -125,7 +125,6 @@ protected:
osg::ref_ptr< osg::Geode > m_geode;
private:
/**
* Trilinear interpolation within the grid for a given position
*
......@@ -134,8 +133,8 @@ private:
*
* \return interpolated value
*/
virtual double interpolate( WVector4d position, boost::shared_ptr<WGridRegular3D> grid );
virtual double interpolate( WVector4d position );
/**
* Calculating a WVector3d out of a given WVector4d
*
......@@ -154,36 +153,36 @@ private:
* A condition used to notify about changes in several properties.
*/
boost::shared_ptr< WCondition > m_propCondition;
/**
* All profiles of the current dataset.
*/
std::vector<WRayProfile> m_dataRays;
// /**
// * All profiles of the current dataset.
// */
// std::vector<WRayProfile> m_dataRays;
/**
* x position of the ray origin.
* Current dataset
*/
WPropInt m_xPos;
boost::shared_ptr< WDataSetScalar > m_dataSet;
/**
* y position of the ray origin.
* Current grid
*/
WPropInt m_yPos;
boost::shared_ptr< WGridRegular3D > m_grid;
/**
* The iso value to be rendered.
* x position of the ray origin.
*/
WPropDouble m_isoValue;
WPropInt m_xPos;
/**
* Epsilon value to define the range for the iso value.
* y position of the ray origin.
*/
WPropDouble m_epsilon;
WPropInt m_yPos;
/**
* A color.
*/
WPropColor m_color;
WPropColor m_color;
/**
* Node callback to change the color of the shapes inside the root node. For more details on this class, refer to the documentation in
......@@ -222,7 +221,6 @@ private:
*/
bool m_initialUpdate;
};
};
#endif // WMTRANSFERCALC_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