 |
FrontISTR
5.7.0
Large-scale structural analysis program with finit element method
|
Go to the documentation of this file.
24 : position_of_lights(0), interval_mapping(0) {
69 const char *fmt, ...) {
74 sprintf(buff,
"!%s", name);
81 for (
int i = 0; i < n; i++) {
87 strcat(buff, va_arg(va,
char *));
91 sprintf(ss,
"%d", va_arg(va,
int));
96 sprintf(ss,
"%lg", va_arg(va,
double));
110 char type,
int n,
void *p) {
115 sprintf(buff,
"!%s", name);
124 for (
int i = 0; i < n; i++) {
129 sprintf(ss,
"%d", *ip);
135 sprintf(ss,
"%lg", *dp);
198 const char *delim =
", \t\r\n";
200 char *token = strtok(s, delim);
202 while (token && i < n) {
203 if (sscanf(token, fmt, &value[i]) != 1)
return -(i + 1);
205 token = strtok(0, delim);
213 return ReadVisValueT<int>(s, n, value,
"%d");
217 return ReadVisValueT<double>(s, n, value,
"%lf");
224 if (len > n)
return 0;
232 const int max_data_n = 200;
234 const char *delim =
", \t\r\n";
237 char *token = strtok(s, delim);
240 if (max_data_n >= i) assert(0);
244 if (sscanf(token, fmt, &x) != 1) {
249 token = strtok(0, delim);
256 for (i = 0; i < n; i++) {
266 char *header = strtok(buff,
" =,\r\n\t");
268 if (header[0] == 0 || header[0] !=
'!')
return false;
271 #define GENERATE_CODE(x, n, fg) \
272 else if (strcmp(#x, header) == 0) { \
273 int r = ReadVisValue(0, n, &x); \
277 #define GENERATE_CODEA(x, n, fg) \
278 else if (strcmp(#x, header) == 0) { \
279 int r = ReadVisValue(0, n, x); \
309 #undef GENERATE_CODEA
310 #define GENERATE_CODE(x, n, type, fmt) \
311 else if (strcmp(#x, header) == 0) { \
314 x = ReadVisPArry<type>(0, n, fmt); \
386 for (
int i = 0; i < 10; i++)
coef[i] = 0;
397 hecd->
WriteLine(
"!!common of PSR ----------------------------------");
430 hecd->
WriteLine(
"!!for equivalent value surface -------------------");
440 hecd->
WriteLine(
"!!for surface of user defined equation -----------");
448 hecd->
WriteLine(
"!!for BMP output ---------------------------------");
462 char *header = strtok(buff,
" =,\r\n\t");
464 if (header[0] == 0 || header[0] !=
'!')
return false;
467 #define GENERATE_CODE(x, n, fg) \
468 else if (strcmp(#x, header) == 0) { \
469 int r = ReadVisValue(0, n, &x); \
473 #define GENERATE_CODEA(x, n, fg) \
474 else if (strcmp(#x, header) == 0) { \
475 int r = ReadVisValue(0, n, x); \
518 #undef GENERATE_CODEA
561 hecd->
WriteLine(
"!!for dividing -----------------------------------");
577 hecd->
WriteLine(
"!!for opacity ------------------------------------");
588 hecd->
WriteLine(
"!!view params ------------------------------------");
601 char *header = strtok(buff,
" =,\r\n\t");
603 if (header[0] == 0 || header[0] !=
'!')
return false;
606 #define GENERATE_CODE(x, n, fg) \
607 else if (strcmp(#x, header) == 0) { \
608 int r = ReadVisValue(0, n, &x); \
612 #define GENERATE_CODEA(x, n, fg) \
613 else if (strcmp(#x, header) == 0) { \
614 int r = ReadVisValue(0, n, x); \
641 #undef GENERATE_CODEA
642 #define GENERATE_CODE(x, n, type, fmt) \
643 else if (strcmp(#x, header) == 0) { \
646 x = ReadVisPArry<type>(0, n, fmt); \
680 vector<CVis_PSR *>::iterator is;
682 for (is =
psr.begin(); is !=
psr.end(); is++) {
695 hecd->
WriteHeader(
"!VISUAL",
"SIII",
"method",
"PSR",
"visual_start_step",
699 vector<CVis_PSR *>::iterator is;
701 for (is =
psr.begin(); is !=
psr.end(); is++) {
708 hecd->
WriteHeader(
"!VISUAL",
"SIII",
"method",
"PVR",
"visual_start_step",
720 if (!hecd->
ParseHeader(header_line, rcode,
"SIII",
"method", s,
728 bool fg_psr = (strcmp(
"PSR", method_s) == 0);
735 if (!hecd->
ReadLine(s))
return false;
740 if (strcmp(
"!SURFACE", s) != 0)
return false;
744 if (!vis_psr->
Read(hecd)) {
749 psr.push_back(vis_psr);
static void WriteVisPArry(class CHECData *hecd, const char *name, char type, int n, void *p)
virtual bool ParseHeader(char *header_line, int *rcode, const char *fmt,...)
static T * ReadVisPArry(char *s, int &n, const char *fmt)
std::vector< CVis_PSR * > psr
@ color_system_type_blue_red
virtual bool ReadData(const char *line)
int transfer_function_type
double deform_line_color[3]
double initial_line_color[3]
virtual bool Read(class CHECData *hecd, char *header_line)
virtual void PushReadLine(const char *s)
void cleanup_token(char *s)
virtual void Write(class CHECData *hecd)
virtual bool ReadLine(char *s, int size=256)
@ color_mapping_style_linear
virtual bool ReadData(const char *line)
virtual bool Read(class CHECData *hecd)
virtual bool ReadData(const char *line)
virtual bool ReadParameter(int *rcode, const char *fmt,...)
static void WriteVisParam(class CHECData *hecd, const char *name, const char *fmt,...)
virtual void Write(class CHECData *hecd)
double * interval_mapping
virtual void Write(class CHECData *hecd)
virtual void WriteHeader(const char *name, const char *fmt="",...)
char color_comp_name[100]
static int ReadVisValueT(char *s, int n, T *value, const char *fmt)
static int ReadVisValue(char *s, int n, int *value)
char deform_comp_name[100]
virtual void WriteLine(const char *s)
#define GENERATE_CODE(x, n, fg)
char data_subcomp_name[4]
#define GENERATE_CODEA(x, n, fg)
double * position_of_lights
virtual void Write(class CHECData *hecd)
char color_subcomp_name[4]
double background_color[3]
virtual ~CVis_ViewParams()