#include <OBJ_Reader.h>
Definition at line 39 of file OBJ_Reader.h.
void get_nextline |
( |
std::istream & |
is, |
|
|
char * |
str |
|
) |
| |
|
inlineprivate |
int read_mesh |
( |
const char * |
fname, |
|
|
const std::string & |
wname |
|
) |
| |
|
inline |
Definition at line 46 of file OBJ_Reader.h.
References buf, COM_get_window_handle(), COM_new_window(), get_nextline(), 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;
61 std::sscanf(
buf,
"%d %d", &nn, &ne);
63 std::cout <<
"Reading " << nn <<
" nodes and "
64 << ne <<
" triangles " << std::endl;
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)
int COM_get_window_handle(const char *wname)
void read_pane_coors |
( |
std::istream & |
is, |
|
|
const std::string & |
wname, |
|
|
int |
nn |
|
) |
| |
|
inlineprivate |
Definition at line 79 of file OBJ_Reader.h.
References buf, COM_allocate_array(), COM_set_size(), get_nextline(), and i.
Referenced by read_mesh().
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]);
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 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, |
|
|
int |
ne |
|
) |
| |
|
inlineprivate |
Definition at line 91 of file OBJ_Reader.h.
References buf, COM_allocate_array(), COM_set_size(), get_nextline(), and i.
Referenced by read_mesh().
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 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: