1
//---------------------------------------------------------------------------
3
// Project: OpenWalnut ( http://www.openwalnut.org )
5
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6
// For more information see http://www.openwalnut.org/copying
8
// This file is part of OpenWalnut.
10
// OpenWalnut is free software: you can redistribute it and/or modify
11
// it under the terms of the GNU Lesser General Public License as published by
12
// the Free Software Foundation, either version 3 of the License, or
13
// (at your option) any later version.
15
// OpenWalnut is distributed in the hope that it will be useful,
16
// but WITHOUT ANY WARRANTY; without even the implied warranty of
17
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
// GNU Lesser General Public License for more details.
20
// You should have received a copy of the GNU Lesser General Public License
21
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
23
//---------------------------------------------------------------------------
30
#include <boost/shared_ptr.hpp>
31
#include <boost/enable_shared_from_this.hpp>
33
#include <osg/ref_ptr>
35
#include "../common/WDefines.h"
36
#include "../common/WProperties.h"
37
#include "../common/WTransferable.h"
38
#include "WDataTexture3D.h"
39
#include "WExportDataHandler.h"
45
* Base class for all data set types. This class has a number of subclasses
46
* specifying the different types of data sets. Two of the dataset types
47
* represent single and time-dependent datasets (compound of several time
48
* steps) respectively.
49
* \ingroup dataHandler
51
class OWDATAHANDLER_EXPORT WDataSet: public WTransferable, public boost::enable_shared_from_this< WDataSet > // NOLINT
55
* This constructor should be used if a dataSet does not stem from a file.
56
* It presets the its correpsonding fileName as empty string.
61
* Since WDataSet is a base class and thus should be polymorphic we add
69
* Set the name of the file that this data set stems from.
70
* \param fileName the string representing the name
72
void setFileName( const std::string fileName );
75
* Get the name of the file that this data set stems from.
77
* \return the filename.
79
std::string getFileName() const;
82
* Determines whether this dataset can be used as a texture.
84
* \return true if usable as texture.
86
virtual bool isTexture() const;
89
* Checks if this dataset is a vector dataset.
91
* \return Returns a nonempty shared_ptr to it if it is a vector dataset, otherwise the pointer is empty!
93
virtual boost::shared_ptr< WDataSetVector > isVectorDataSet();
96
* Returns the texture- representation of the dataset. May throw an exception if no texture is available.
98
* \return The texture.
101
virtual osg::ref_ptr< WDataTexture3D > getTexture() const;
104
* Gets the name of this prototype.
108
virtual const std::string getName() const;
111
* Gets the description for this prototype.
113
* \return the description
115
virtual const std::string getDescription() const;
118
* Returns a prototype instantiated with the true type of the deriving class.
120
* \return the prototype.
122
static boost::shared_ptr< WPrototyped > getPrototype();
125
* Return a pointer to the properties object of the dataset. Add all the modifiable settings here. This allows the user to modify several
126
* properties of a dataset.
128
* \return the properties.
130
boost::shared_ptr< WProperties > getProperties() const;
133
* Return a pointer to the information properties object of the dataset. The dataset intends these properties to not be modified.
135
* \return the properties.
137
boost::shared_ptr< WProperties > getInformationProperties() const;
142
* The prototype as singleton.
144
static boost::shared_ptr< WPrototyped > m_prototype;
147
* The property object for the dataset.
149
boost::shared_ptr< WProperties > m_properties;
152
* The property object for the dataset containing only props whose purpose is "PV_PURPOSE_INFORMNATION". It is useful to define some property
153
* to only be of informational nature. The GUI does not modify them. As it is a WProperties instance, you can use it the same way as
156
boost::shared_ptr< WProperties > m_infoProperties;
160
* Name of the file this data set was loaded from. This information
161
* may allow hollowing data sets later. DataSets that were not loaded
162
* from a file should have the empty string stored here.
164
std::string m_fileName;