Merged master

This commit is contained in:
Jan Möbius
2021-09-21 09:50:16 +02:00
8 changed files with 22 additions and 9 deletions

View File

@@ -241,13 +241,13 @@ find_writer(const std::string& _format)
{
using std::string;
string::size_type dot = _format.rfind('.');
string::size_type dotpos = _format.rfind('.');
string ext;
if (dot == string::npos)
if (dotpos == string::npos)
ext = _format;
else
ext = _format.substr(dot+1,_format.length()-(dot+1));
ext = _format.substr(dotpos+1,_format.length()-(dotpos+1));
std::set<BaseWriter*>::const_iterator it = writer_modules_.begin();
std::set<BaseWriter*>::const_iterator it_end = writer_modules_.end();

View File

@@ -111,7 +111,8 @@ public:
ColorAlpha = 0x0800, ///< Has (r) / store (w) alpha values for colors
ColorFloat = 0x1000, ///< Has (r) / store (w) float values for colors (currently only implemented for PLY and OFF files)
Custom = 0x2000, ///< Has (r) custom properties (currently only implemented in PLY Reader ASCII version)
Status = 0x4000 ///< Has (r) / store (w) status properties
Status = 0x4000, ///< Has (r) / store (w) status properties
TexCoordST = 0x8000 ///< Write texture coordinates as ST instead of UV
};
public:
@@ -212,6 +213,7 @@ public:
bool face_has_status() const { return check(Status); }
bool color_has_alpha() const { return check(ColorAlpha); }
bool color_is_float() const { return check(ColorFloat); }
bool use_st_coordinates() const { return check(TexCoordST); }
/// Returns true if _rhs has the same options enabled.

View File

@@ -327,7 +327,7 @@ write(std::ostream& _out, BaseExporter& _be, Options _opt, std::streamsize _prec
{
if (useMatrial && _opt.check(Options::FaceColor) ){
size_t material = std::numeric_limits<std::size_t>::max();
size_t material;
//color with alpha
if ( _opt.color_has_alpha() ){

View File

@@ -278,8 +278,13 @@ void _PLYWriter_::write_header(std::ostream& _out, BaseExporter& _be, Options& _
}
if ( _opt.vertex_has_texcoord() ){
_out << "property float u" << '\n';
_out << "property float v" << '\n';
if ( _opt.use_st_coordinates() ){
_out << "property float s" << '\n';
_out << "property float t" << '\n';
} else {
_out << "property float u" << '\n';
_out << "property float v" << '\n';
}
}
if ( _opt.vertex_has_color() ){