74{
75 char *cname,*cname2,*ccomment;
76 int cname_len,cname_len1,ccomment_len;
77 int i,cpt_size;
78 float node[3];
79 H3D_ID node_id;
80 unsigned int elem_count = 1;
81
82 cname_len = *size1 + 1;
83 cname=(char*) malloc(sizeof(char)*cname_len);
84 for(i=0;i<*size1;i++) cname[i] = name1[i];
85
86 cpt_size = 0;
87 for(i=0;i<*size1;i++)
88 {
89 if(name1[i] != ' ') cpt_size = i;
90 }
91 cname[cpt_size+1]='\0';
92
93 ccomment_len = *s_comment + 1;
94 ccomment=(char*) malloc(sizeof(char)*ccomment_len);
95 for(i=0;i<*s_comment;i++) ccomment[i] = comment[i];
96 ccomment[*s_comment]='\0';
97
98 if( strncmp(cname,
"Strain",6) == 0 )
tensor_type = H3D_DS_STRAIN;
99 if( strncmp(cname,
"Strn rate",9) == 0 )
tensor_type = H3D_DS_STRAIN;
100
101 char * LAYERPOOL = new char [100];
102 LAYERPOOL[0] ='\0';
103 char * LAYER_STRING = new char [100];
104 LAYER_STRING[0] ='\0';
105 char * NUVAR_STRING = new char [100];
106 NUVAR_STRING[0] ='\0';
107 char * IR_STRING = new char [100];
108 IR_STRING[0] ='\0';
109 char * IS_STRING = new char [100];
110 IS_STRING[0] ='\0';
111 char * IT_STRING = new char [100];
112 IT_STRING[0] ='\0';
113 char * MID_STRING = new char [100];
114 MID_STRING[0] ='\0';
115
116 H3D_ID layer_pool_id = H3D_NULL_ID;
117 if(*layer > 0 || *nuvar > 0 || *ir > 0 || *is > 0 || *it > 0 )
118 {
119 if(*ir > 0 && *is > 0)
120 {
121 sprintf(LAYER_STRING, "IR IS %d %d" ,*ir,*is);
122#ifdef _WIN64
123 strcat_s(LAYERPOOL,100,LAYER_STRING);
124#else
125 LAYERPOOL = strcat(LAYERPOOL,LAYER_STRING);
126#endif
127
128 }
129 }
130 else
131 {
132 sprintf(LAYER_STRING, "Mid" );
133#ifdef _WIN64
134 strcat_s(LAYERPOOL,100,LAYER_STRING);
135#else
136 LAYERPOOL = strcat(LAYERPOOL,LAYER_STRING);
137#endif
138
139 }
140
142
143 try {
144
146
149
152
154
157
161
162 if (strlen(ccomment) != 0)
163 {
166 }
167
171
174
175 }
176
177 catch(...) {
179 }
180 delete [] LAYERPOOL;
181 delete [] LAYER_STRING;
182 delete [] NUVAR_STRING;
183 delete [] IR_STRING;
184 delete [] IS_STRING;
185 delete [] IT_STRING;
186 delete [] MID_STRING;
187 free(cname);
188 free(ccomment);
189
190}
H3D_TENSOR_TYPE tensor_type
bool Hyper3DDatatypePools(H3DFileInfo *h3d_file, H3D_ID dt_id, H3D_ID poolname_id, unsigned int num_layers, H3D_ID *layername_ids, bool corners, H3D_TENSOR_TYPE tensor_type, float poisson)
bool Hyper3DAddString(H3DFileInfo *h3d_file, const char *const string, H3D_ID *const str_id)
bool Hyper3DDatatypeEnd(H3DFileInfo *h3d_file)
bool Hyper3DExportClearError(H3DFileInfo *h3d_file)
bool Hyper3DDatatypeDescriptionWrite(H3DFileInfo *h3d_file, H3D_ID dt_id, const char *description)
bool Hyper3DDatatypeWrite(H3DFileInfo *h3d_file, const char *label, H3D_ID dt_id, H3D_DS_FORMAT format, H3D_DS_TYPE type, unsigned int num_pools)
bool Hyper3DDatatypeBegin(H3DFileInfo *h3d_file, unsigned int count)