34 #ifndef AIMS_IO_PLYW_H
35 #define AIMS_IO_PLYW_H
50 template<
long D,
typename T>
54 PlyWriter(
const std::string& name,
bool ascii =
false )
55 : _name( name ), _ascii( ascii )
69 template <
long D,
typename T>
73 writer.
write( thing );
78 template <
long D,
typename T>
92 hdr.
setProperty(
"file_type", std::string(
"PLY" ) );
109 if( thing.size() > 1 )
110 std::cout <<
"PlyWriter warning: only the first timestep of the "
111 <<
"surface will be writen" << std::endl;
113 const std::vector<Point3df> & vert = thing.
vertex();
114 const std::vector<Point3df> &
norm = thing.
normal();
115 const std::vector<AimsVector<uint, D> > & poly = thing.
polygon();
116 unsigned i, j, n = vert.size(), np = poly.size();
117 bool normal = (n <=
norm.size() );
153 for( i=0; i<np; ++i )
158 if( !
ply_write( ply, rint( poly[i][j] ) ) )
The template class to manage a mesh with time if needed.
const std::vector< AimsVector< uint, D > > & polygon() const
Get a const reference to the vector of polygons of the 0 surface.
const aims::PythonHeader & header() const
Get the header.
const std::vector< Point3df > & normal() const
Get a const reference to the vector of normals of the 0 surface.
const std::vector< Point3df > & vertex() const
Get a const reference to the vector of verteces of the surface of index 0.
std::string removeExtension(const std::string &name) const
Return a name without .ply extension.
PlyWriter(const std::string &name, bool ascii=false)
void write(const AimsTimeSurface< D, T > &thing)
static std::string dirname(const std::string &)
static std::string removeExtension(const std::string &)
virtual bool removeProperty(const std::string &)
virtual void setProperty(const std::string &, Object)
virtual bool hasProperty(const std::string &) const
static void launchErrnoExcept(const std::string &filename="")
The class for EcatSino data write operation.
MotionWriter & operator<<(MotionWriter &writer, const AffineTransformation3d &thing) __attribute__((__deprecated__("OBSOLETE")))
— OBSOLETE —
int ply_write_header(p_ply ply)
enum e_ply_storage_mode_ e_ply_storage_mode
int ply_add_list_property(p_ply ply, const char *name, e_ply_type length_type, e_ply_type value_type)
int ply_add_scalar_property(p_ply ply, const char *name, e_ply_type type)
p_ply ply_create(const char *name, e_ply_storage_mode storage_mode, p_ply_error_cb error_cb, long idata, void *pdata)
int ply_write(p_ply ply, double value)
int ply_add_element(p_ply ply, const char *name, long ninstances)
AIMSDATA_API float norm(const Tensor &thing)