28 #include "../Rocsurf/include/surfbasic.h"
47 int read_mesh(
const char *fname,
const std::string &wname) {
48 std::ifstream is( fname);
50 std::cerr <<
"Error: Could not open file " << fname << std::endl;
58 std::cout <<
"Reading file " << fname << std::endl;
69 if ( is.eof()) {
return; }
75 std::vector<SURF::Point_3<double> > coors;
82 if ( s.find(
"Vertices",0)!=std::string::npos)
break;
89 for (
int i=0;
i<
n; ++
i) {
92 SURF::Point_3<double> p;
94 std::sscanf(
buf,
"%lf %lf %lf", &p[0], &p[1], &p[2]);
99 std::cout <<
"Read in " << n <<
" nodes" << std::endl;
102 SURF::Point_3<double> *p;
105 std::copy( coors.begin(), coors.end(), p);
110 std::vector<SURF::Vector_3<int> > elems;
117 if ( s.find(
"Triangles",0)!=std::string::npos)
break;
125 for (
int i=0;
i<
n; ++
i) {
128 SURF::Vector_3<int> p;
129 std::sscanf(
buf,
"%d %d %d", &p[0], &p[1], &p[2]);
134 std::cout <<
"Read in " << n <<
" triangles" << std::endl;
137 SURF::Vector_3<int> *p;
140 std::copy( elems.begin(), elems.end(), p);
int read_mesh(const char *fname, const std::string &wname)
#define COM_assertion_msg(EX, msg)
void COM_set_size(const char *wa_str, int pane_id, int size, int ng=0)
Set sizes of for a specific attribute.
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to ** copy
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)
void read_pane_coors(std::istream &is, const std::string &wname)
void read_pane_elems(std::istream &is, const std::string &wname)
void get_nextline(std::istream &is, char *str)
#define COM_EXTERN_MODULE(moduleName)