28 #include "../Rocsurf/include/surfbasic.h"
46 int read_mesh(
const char *fname,
const std::string &wname) {
47 std::ifstream is( fname);
49 std::cerr <<
"Error: Could not open file " << fname << std::endl;
57 std::cout <<
"Reading file " << fname << std::endl;
61 std::sscanf(
buf,
"%d %d", &nn, &ne);
63 std::cout <<
"Reading " << nn <<
" nodes and "
64 << ne <<
" triangles " << std::endl;
74 if ( is.eof()) {
return; }
81 SURF::Point_3<double> *ps;
84 for (
int i=0;
i<nn; ++
i) {
86 std::sscanf(
buf,
"%lf %lf %lf", &ps[
i][0], &ps[i][1], &ps[i][2]);
94 SURF::Vector_3<int> *es;
97 for (
int i=0;
i<ne; ++
i) {
99 std::sscanf(
buf,
"%d %d %d", &es[
i][0], &es[i][1], &es[i][2]);
void COM_set_size(const char *wa_str, int pane_id, int size, int ng=0)
Set sizes of for a specific attribute.
void get_nextline(std::istream &is, char *str)
void read_pane_coors(std::istream &is, const std::string &wname, int nn)
void read_pane_elems(std::istream &is, const std::string &wname, int ne)
void COM_new_window(const char *wname, MPI_Comm c=MPI_COMM_NULL)
void COM_allocate_array(const char *wa_str, int pane_id=0, void **addr=NULL, int strd=0, int cap=0)
Allocate space for an attribute on a specific pane and return the address by setting addr...
int COM_get_window_handle(const char *wname)
int read_mesh(const char *fname, const std::string &wname)
#define COM_EXTERN_MODULE(moduleName)