#include <SMF_Reader.h>
Definition at line 39 of file SMF_Reader.h.
void get_nextline |
( |
std::istream & |
is, |
|
|
char * |
str |
|
) |
| |
|
inlineprivate |
Definition at line 66 of file SMF_Reader.h.
References MAXLEN.
Referenced by read_pane_coors(), and read_pane_elems().
67 char accpet[]={
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
71 if ( is.eof()) { str[0] =
'\0';
return; }
72 str[0] =
'\1'; str[1] =
'\0';
74 if ( str[0] ==
'\1')
return;
75 }
while ( (str[0]!=
'v' && str[0]!=
'f') || strpbrk( str,accpet)==NULL);
int read_mesh |
( |
const char * |
fname, |
|
|
const std::string & |
wname |
|
) |
| |
|
inline |
Definition at line 46 of file SMF_Reader.h.
References COM_get_window_handle(), COM_new_window(), read_pane_coors(), and read_pane_elems().
Referenced by main().
47 std::ifstream is( fname);
49 std::cerr <<
"Error: Could not open file " << fname << std::endl;
57 std::cout <<
"Reading file " << fname << std::endl;
void read_pane_elems(std::istream &is, const std::string &wname)
void COM_new_window(const char *wname, MPI_Comm c=MPI_COMM_NULL)
int COM_get_window_handle(const char *wname)
void read_pane_coors(std::istream &is, const std::string &wname)
void read_pane_coors |
( |
std::istream & |
is, |
|
|
const std::string & |
wname |
|
) |
| |
|
inlineprivate |
Definition at line 79 of file SMF_Reader.h.
References buf, COM_allocate_array(), COM_assertion_msg, COM_set_size(), copy, get_nextline(), and n.
Referenced by read_mesh().
80 std::vector<SURF::Point_3<double> > coors;
87 if (
buf[1] ==
't' ||
buf[1] ==
'n')
continue;
88 SURF::Point_3<double> p;
90 std::sscanf( &
buf[2],
"%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);
#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.
void get_nextline(std::istream &is, char *str)
*********************************************************************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_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...
void read_pane_elems |
( |
std::istream & |
is, |
|
|
const std::string & |
wname |
|
) |
| |
|
inlineprivate |
Definition at line 109 of file SMF_Reader.h.
References buf, COM_allocate_array(), COM_assertion_msg, COM_set_size(), copy, get_nextline(), and n.
Referenced by read_mesh().
110 std::vector<SURF::Vector_3<int> > elems;
115 if (
buf[0] ==
'f') {
116 if (
buf[1] !=
't' &&
buf[1] !=
'n') {
117 SURF::Vector_3<int> p;
119 std::sscanf( &
buf[2],
"%d %d %d", &p[0], &p[1], &p[2]);
129 std::cout <<
"Read in " << n <<
" faces" << std::endl;
132 SURF::Vector_3<int> *p;
135 std::copy( elems.begin(), elems.end(), p);
#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.
void get_nextline(std::istream &is, char *str)
*********************************************************************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_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...
The documentation for this class was generated from the following file: