34#ifndef AIMS_IO_AIMSGRAPHW_D_H
35#define AIMS_IO_AIMSGRAPHW_D_H
42#include <graph/graph/graph.h>
43#include <cartobase/smart/rcptr.h>
44#include <cartobase/stream/fileutil.h>
83 std::map<std::string,AimsGraphWriter::Wrapper *>::iterator i, e
93 template<
typename T>
bool
94 AimsGraphWriter::ObjectWrapper<T>::write(
const AimsGraphWriter & wp )
const
96 return wp.write( *data );
100 template<
typename T>
int
101 AimsGraphWriter::ObjectWrapper<T>::freeindex()
const
103 typename T::const_iterator i = data->begin(), e = data->end();
105 if( i != e && i->first == 0 )
107 for ( ; i!=e && i->first==n; ++i, ++n ) {}
112 template<
typename T> std::string
115 return ::carto::DataTypeCode<T>().objectType();
119 template<
typename T> std::string
126 template <
typename T>
148 bool AimsGraphWriter::write(
const T & obj )
const
157 == std::string::npos )
163 return w.write( obj );
169 Wrapper *& glob = d->globalobjects[ d->elemcode.global_filename ];
173 carto::rc_ptr<T> gobject;
174 if ( !d->elemcode.global_attribute.empty()
175 && info.graph->getProperty( d->elemcode.global_attribute,
186 if( !d->delayindex && d->mode ==
Global )
209 if ( !info.element->getProperty( info.attribute, obj ) )
211 carto::Object o = info.element->getProperty( info.attribute );
217 catch( std::exception & e )
219 std::cerr << e.what() << std::endl;
static bool defaultTakeObject(Process &, const std::string &, Finder &)
static bool isEmpty(const T &obj)
friend struct ObjectWrapper
AimsGraphWriter(const std::string &filename)
Generic finder / checker for all data objects and file formats This will replace the old AimsFinder.
Process()
Attempts to read the header of filename and, if successful, calls the operator() of the process \proc...
static std::string dirname(const std::string &)
static std::string fileStat(const std::string &)
void insertElement(T &dest, int index, const T &src)
insert a sub-element in a container data (time bucket/mesh/texture, or volume of labels....
void adjustVoxelSize(T &, const T &)
utility function to copy voxel sizes from an object to another (if applicable)
void setHeaderInfo(T &obj, const carto::GenericObject &srcheader)
The class for EcatSino data write operation.
virtual std::string objectType() const
virtual std::string dataType() const
GraphElementCode elemcode
AimsGraphWriter::SavingMode mode
~AimsGraphWriter_Private()
AimsGraphWriter::SavingMode newmode
std::map< std::string, AimsGraphWriter::Wrapper * > globalobjects
AimsGraphWriter::SavingMode oldmode
std::map< std::string, bool > globalmodified
AimsGraphWriter_Private()
carto::rc_ptr< std::map< std::string, std::vector< int > > > colors
AimsGraphWriter::SavingMode prevmode
Describe how Aims objects are stored in graph objects.