OpenWalnut 1.2.5
|
00001 //--------------------------------------------------------------------------- 00002 // 00003 // Project: OpenWalnut ( http://www.openwalnut.org ) 00004 // 00005 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS 00006 // For more information see http://www.openwalnut.org/copying 00007 // 00008 // This file is part of OpenWalnut. 00009 // 00010 // OpenWalnut is free software: you can redistribute it and/or modify 00011 // it under the terms of the GNU Lesser General Public License as published by 00012 // the Free Software Foundation, either version 3 of the License, or 00013 // (at your option) any later version. 00014 // 00015 // OpenWalnut is distributed in the hope that it will be useful, 00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 // GNU Lesser General Public License for more details. 00019 // 00020 // You should have received a copy of the GNU Lesser General Public License 00021 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>. 00022 // 00023 //--------------------------------------------------------------------------- 00024 00025 #include <string> 00026 00027 #include "../common/WAssert.h" 00028 #include "../common/WCondition.h" 00029 #include "../common/WTransferable.h" 00030 #include "exceptions/WDHException.h" 00031 #include "WDataSet.h" 00032 #include "WDataSetVector.h" 00033 #include "WDataTexture3D.h" 00034 00035 // prototype instance as singleton 00036 boost::shared_ptr< WPrototyped > WDataSet::m_prototype = boost::shared_ptr< WPrototyped >(); 00037 00038 WDataSet::WDataSet() 00039 : WTransferable(), 00040 m_properties( boost::shared_ptr< WProperties >( new WProperties( "Data-Set Properties", "Properties of a data-set" ) ) ), 00041 m_infoProperties( boost::shared_ptr< WProperties >( new WProperties( "Data-Set Info Properties", "Data-set's information properties" ) ) ), 00042 m_fileName( "" ) 00043 { 00044 m_infoProperties->setPurpose( PV_PURPOSE_INFORMATION ); 00045 } 00046 00047 void WDataSet::setFileName( const std::string fileName ) 00048 { 00049 WAssert( fileName != "", "No filename set for data set." ); 00050 m_fileName = fileName; 00051 } 00052 00053 std::string WDataSet::getFileName() const 00054 { 00055 return m_fileName; 00056 } 00057 00058 bool WDataSet::isTexture() const 00059 { 00060 return false; 00061 } 00062 00063 osg::ref_ptr< WDataTexture3D > WDataSet::getTexture() const 00064 { 00065 throw WDHException( std::string( "This dataset does not provide a texture." ) ); 00066 } 00067 00068 const std::string WDataSet::getName() const 00069 { 00070 return "WDataSet"; 00071 } 00072 00073 const std::string WDataSet::getDescription() const 00074 { 00075 return "Encapsulates the whole common feature set of all datasets."; 00076 } 00077 00078 boost::shared_ptr< WPrototyped > WDataSet::getPrototype() 00079 { 00080 if( !m_prototype ) 00081 { 00082 m_prototype = boost::shared_ptr< WPrototyped >( new WDataSet() ); 00083 } 00084 00085 return m_prototype; 00086 } 00087 00088 boost::shared_ptr< WDataSetVector > WDataSet::isVectorDataSet() 00089 { 00090 return boost::shared_ptr< WDataSetVector >(); 00091 } 00092 00093 boost::shared_ptr< WProperties > WDataSet::getProperties() const 00094 { 00095 return m_properties; 00096 } 00097 00098 boost::shared_ptr< WProperties > WDataSet::getInformationProperties() const 00099 { 00100 return m_infoProperties; 00101 } 00102