Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

Commit f639e248 authored by Kenneth Vanhoey's avatar Kenneth Vanhoey
Browse files

Merge cgogn:~thery/CGoGN

Resolved Conflicts:
	src/Algo/Import/ply.c
parents e3c67250 64fa7f53
......@@ -29,9 +29,11 @@
#include "Algo/Import/import.h"
#include "Algo/Export/export.h"
using namespace CGoGN ;
int main(int argc, char **argv)
{
// // interface
......@@ -198,7 +200,7 @@ void MyQT::createMap(int n)
{
if (dm.isMarked(d) && (!myMap.isBoundaryMarked(d)))
{
int n = random();
int n = rand();
float r = float(n&0x7f)/255.0f + 0.25f;
float g = float((n>>8)&0x7f)/255.0f + 0.25f;
float b = float((n>>16)&0x7f)/255.0 + 0.25f;
......@@ -276,7 +278,7 @@ void MyQT::cb_keyPress(int keycode)
{
if (!myMap.isBoundaryMarked(d))
{
int n = random();
int n = rand();
float r = float(n&0x7f)/255.0f + 0.25f;
float g = float((n>>8)&0x7f)/255.0f + 0.25f;
float b = float((n>>16)&0x7f)/255.0 + 0.25f;
......@@ -391,7 +393,7 @@ void MyQT::importMesh(std::string& filename)
{
if (dm.isMarked(d) && (!myMap.isBoundaryMarked(d)))
{
int n = random();
int n = rand();
float r = float(n&0x7f)/255.0f + 0.25f;
float g = float((n>>8)&0x7f)/255.0f + 0.25f;
float b = float((n>>16)&0x7f)/255.0 + 0.25f;
......
......@@ -121,6 +121,8 @@ protected:
int per_vertex_color_float32, per_vertex_color_uint8 ;
int has_normals;
char *old_locale;
};
} // namespace CGoGN
......
......@@ -25,6 +25,7 @@
#include "Utils/os_spec.h"
#include "Algo/Import/importPlyData.h"
#include <stdlib.h>
#include <locale.h>
namespace CGoGN
{
......@@ -64,6 +65,8 @@ PlyImportData::PlyImportData():
per_vertex_color_uint8(0),
has_normals(0)
{
old_locale = setlocale(LC_NUMERIC, NULL);
setlocale(LC_NUMERIC, "C");
}
PlyImportData::~PlyImportData()
......@@ -89,6 +92,7 @@ PlyImportData::~PlyImportData()
// }
// need to free *vert_other,*face_other ????
setlocale(LC_NUMERIC, old_locale);
}
......
......@@ -2070,12 +2070,14 @@ void get_binary_item(
{
char c[8];
void *ptr;
short word;
char *byte;
int my_endianness;
ptr = (void *) c;
short int word = 1 ;
char *byte = (char *) &word ;
int my_endianness = byte[0] ? PLY_BINARY_LE : PLY_BINARY_BE ;
ptr = c;
word = 1 ;
byte = (char *) &word ;
my_endianness = byte[0] ? PLY_BINARY_LE : PLY_BINARY_BE ;
switch (type) {
case PLY_Int8:
......@@ -2095,9 +2097,11 @@ void get_binary_item(
case PLY_Int16:
if (my_endianness != file_type)
{
if (fread (ptr+1, 1, 1, fp) != 1)
unsigned char *cptr;
cptr = (unsigned char*) ptr;
if (fread (cptr+1, 1, 1, fp) != 1)
fprintf (stderr, "get_binary_item: problem occured in fread in switch(%d)\n", type);
if (fread (ptr, 1, 1, fp) != 1)
if (fread (cptr, 1, 1, fp) != 1)
fprintf (stderr, "get_binary_item: problem occured in fread in switch(%d)\n", type);
}
else
......@@ -2110,9 +2114,11 @@ void get_binary_item(
case PLY_Uint16:
if (my_endianness != file_type)
{
if (fread (ptr+1, 1, 1, fp) != 1)
unsigned char *cptr;
cptr = (unsigned char*) ptr;
if (fread (cptr+1, 1, 1, fp) != 1)
fprintf (stderr, "get_binary_item: problem occured in fread in switch(%d)\n", type);
if (fread (ptr, 1, 1, fp) != 1)
if (fread (cptr, 1, 1, fp) != 1)
fprintf (stderr, "get_binary_item: problem occured in fread in switch(%d)\n", type);
}
else
......@@ -2125,13 +2131,15 @@ void get_binary_item(
case PLY_Int32:
if (my_endianness != file_type)
{
if (fread (ptr+3, 1, 1, fp) != 1)
unsigned char *cptr;
cptr = (unsigned char*) ptr;
if (fread (cptr+3, 1, 1, fp) != 1)
fprintf (stderr, "get_binary_item: problem occured in fread in switch(%d)\n", type);
if (fread (ptr+2, 1, 1, fp) != 1)
if (fread (cptr+2, 1, 1, fp) != 1)
fprintf (stderr, "get_binary_item: problem occured in fread in switch(%d)\n", type);
if (fread (ptr+1, 1, 1, fp) != 1)
if (fread (cptr+1, 1, 1, fp) != 1)
fprintf (stderr, "get_binary_item: problem occured in fread in switch(%d)\n", type);
if (fread (ptr, 1, 1, fp) != 1)
if (fread (cptr, 1, 1, fp) != 1)
fprintf (stderr, "get_binary_item: problem occured in fread in switch(%d)\n", type);
}
else
......@@ -2144,13 +2152,15 @@ void get_binary_item(
case PLY_Uint32:
if (my_endianness != file_type)
{
if (fread (ptr+3, 1, 1, fp) != 1)
unsigned char *cptr;
cptr = (unsigned char*) ptr;
if (fread (cptr+3, 1, 1, fp) != 1)
fprintf (stderr, "get_binary_item: problem occured in fread in switch(%d)\n", type);
if (fread (ptr+2, 1, 1, fp) != 1)
if (fread (cptr+2, 1, 1, fp) != 1)
fprintf (stderr, "get_binary_item: problem occured in fread in switch(%d)\n", type);
if (fread (ptr+1, 1, 1, fp) != 1)
if (fread (cptr+1, 1, 1, fp) != 1)
fprintf (stderr, "get_binary_item: problem occured in fread in switch(%d)\n", type);
if (fread (ptr, 1, 1, fp) != 1)
if (fread (cptr, 1, 1, fp) != 1)
fprintf (stderr, "get_binary_item: problem occured in fread in switch(%d)\n", type);
}
else
......@@ -2163,13 +2173,15 @@ void get_binary_item(
case PLY_Float32:
if (my_endianness != file_type)
{
if (fread (ptr+3, 1, 1, fp) != 1)
unsigned char *cptr;
cptr = (unsigned char*) ptr;
if (fread (cptr+3, 1, 1, fp) != 1)
fprintf (stderr, "get_binary_item: problem occured in fread in switch(%d)\n", type);
if (fread (ptr+2, 1, 1, fp) != 1)
if (fread (cptr+2, 1, 1, fp) != 1)
fprintf (stderr, "get_binary_item: problem occured in fread in switch(%d)\n", type);
if (fread (ptr+1, 1, 1, fp) != 1)
if (fread (cptr+1, 1, 1, fp) != 1)
fprintf (stderr, "get_binary_item: problem occured in fread in switch(%d)\n", type);
if (fread (ptr, 1, 1, fp) != 1)
if (fread (cptr, 1, 1, fp) != 1)
fprintf (stderr, "get_binary_item: problem occured in fread in switch(%d)\n", type);
}
else
......@@ -2182,21 +2194,23 @@ void get_binary_item(
case PLY_Float64:
if (my_endianness != file_type)
{
if (fread (ptr+7, 1, 1, fp) != 1)
unsigned char *cptr;
cptr = (unsigned char*) ptr;
if (fread (cptr+7, 1, 1, fp) != 1)
fprintf (stderr, "get_binary_item: problem occured in fread in switch(%d)\n", type);
if (fread (ptr+6, 1, 1, fp) != 1)
if (fread (cptr+6, 1, 1, fp) != 1)
fprintf (stderr, "get_binary_item: problem occured in fread in switch(%d)\n", type);
if (fread (ptr+5, 1, 1, fp) != 1)
if (fread (cptr+5, 1, 1, fp) != 1)
fprintf (stderr, "get_binary_item: problem occured in fread in switch(%d)\n", type);
if (fread (ptr+4, 1, 1, fp) != 1)
if (fread (cptr+4, 1, 1, fp) != 1)
fprintf (stderr, "get_binary_item: problem occured in fread in switch(%d)\n", type);
if (fread (ptr+3, 1, 1, fp) != 1)
if (fread (cptr+3, 1, 1, fp) != 1)
fprintf (stderr, "get_binary_item: problem occured in fread in switch(%d)\n", type);
if (fread (ptr+2, 1, 1, fp) != 1)
if (fread (cptr+2, 1, 1, fp) != 1)
fprintf (stderr, "get_binary_item: problem occured in fread in switch(%d)\n", type);
if (fread (ptr+1, 1, 1, fp) != 1)
if (fread (cptr+1, 1, 1, fp) != 1)
fprintf (stderr, "get_binary_item: problem occured in fread in switch(%d)\n", type);
if (fread (ptr, 1, 1, fp) != 1)
if (fread (cptr, 1, 1, fp) != 1)
fprintf (stderr, "get_binary_item: problem occured in fread in switch(%d)\n", type);
}
else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment