37 #ifndef AIMS_MESH_TEXTURE_H 38 #define AIMS_MESH_TEXTURE_H 52 template <
class T =
float >
class Texture;
79 const std::vector<T> &
data()
const {
return(
_data ); }
86 std::ostream& operator << <>( std::ostream& out,
95 template <
class T >
inline 96 std::ostream& operator << ( std::ostream& out, const Texture< T >& thing )
98 out <<
"{nItem=" << thing.nItem() <<
", data=(";
99 for (
size_t n = 0; n < thing.nItem(); n++ )
100 out << thing.item( n ) <<
", ";
114 std::ostream& operator << ( std::ostream& out, const TimeTexture< T >& thing );
118 public std::map< int, Texture< T > >
129 for(
int i=0; i<ntimes; ++i )
135 for(
int i=0; i<ntimes; ++i )
151 T&
item(
int n ) {
return (*
this)[0].item( n ); }
153 void reserve(
size_t size ) { (*this)[0].reserve( size ); }
161 if( _header != x.
header() )
return false;
162 for(
int i=0; i<
nItem(); ++i )
163 if(
item(i) != x.
item(i) )
return false;
168 std::ostream& operator << <>( std::ostream& out,
178 #ifndef DOXYGEN_HIDE_INTERNAL_CLASSES 187 {
return "Texture"; }
198 #endif // DOXYGEN_HIDE_INTERNAL_CLASSES 201 template <
class T >
inline 205 for ( it = this->begin(); it != this->end(); it++ )
206 (it->second).erase();
207 std::map< int, Texture< T > >
::erase( this->begin(), this->end() );
211 template <
class T >
inline 212 std::ostream& operator << ( std::ostream& out, const TimeTexture< T >& thing )
218 for ( it = thing.begin(); it != thing.end(); it++ )
221 out <<
"t=" << (*it).first <<
",";
222 out << (*it).second <<
"},";
225 return out <<
"NULL}" << std::flush;
246 #define _TMP_ TimeTexture< AimsVector< short, 2 > > 258 #define _TMP_ rc_ptr< TimeTexture< AimsVector< short, 2 > > > #define DECLARE_GENERIC_OBJECT_TYPE(T)
TimeTexture(int ntimes, size_t nitems, const T &value)
std::map< int, Texture< T > >::iterator iterator
const T & operator[](int n) const
void push_back(const T &item)
std::map< int, Texture< T > >::const_iterator const_iterator
Texture(size_t n, const T &value)
TimeTexture(int ntimes, size_t nitems)
aims::PythonHeader _header
Header.
const T & item(int n) const
void reserve(size_t size)
static std::string objectType()
void reserve(size_t size)
static std::string dataType()
bool operator==(const Texture< T > &x) const
const T & item(int n) const
static std::string name()
std::vector< T > & data()
const std::vector< T > & data() const
AIMSDATA_API TimeTexture< Point2df > Texture2d
AIMSDATA_API std::ostream & operator<<(std::ostream &out, const Texture< T > &thing)
AIMSDATA_API TimeTexture< float > Texture1d
aims::PythonHeader & header()
void setHeader(const aims::PythonHeader &hdr)
Set the header.
void push_back(const T &item)
const aims::PythonHeader & header() const
Get the header.