Changeset 17982
- Timestamp:
- 05/12/14 14:08:03 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
r17976 r17982 1217 1217 void Penta::InputExtrude(int enum_type){/*{{{*/ 1218 1218 1219 int i,num_inputs;1220 Penta *penta = NULL;1221 Input *copy = NULL;1222 Input **base_inputs = NULL;1223 1224 1219 /*Are we on the base, not on the surface?:*/ 1225 1220 if(!IsOnBase()) return; 1226 1221 1227 1222 /*Step1: Get and Extrude original input: */ 1228 num_inputs=1; 1229 base_inputs=xNew<Input*>(num_inputs); 1230 base_inputs[0]=(Input*)this->inputs->GetInput(enum_type); 1231 for(i=0;i<num_inputs;i++){ 1232 if(!base_inputs[i]) _error_("could not find input with enum " << EnumToStringx(enum_type)); 1233 base_inputs[i]->Extrude(); 1234 } 1223 Input* base_input=(Input*)this->inputs->GetInput(enum_type); 1224 if(!base_input) _error_("could not find input with enum " << EnumToStringx(enum_type)); 1225 base_input->Extrude(); 1235 1226 1236 1227 /*Stop if there is only one layer of element*/ 1237 if 1228 if(this->IsOnSurface()) return; 1238 1229 1239 1230 /*Step 2: this input has been extruded for this element, now follow the upper element*/ 1240 penta=this;1231 Penta* penta=this; 1241 1232 for(;;){ 1242 1233 /* get upper Penta*/ … … 1245 1236 1246 1237 /*Add input of the basal element to penta->inputs*/ 1247 for(i=0;i<num_inputs;i++){ 1248 copy=(Input*)base_inputs[i]->copy(); 1249 penta->inputs->AddInput((Input*)copy); 1250 } 1238 Input* copy=(Input*)base_input->copy(); 1239 penta->inputs->AddInput((Input*)copy); 1251 1240 1252 1241 /*Stop if we have reached the surface*/ 1253 if (penta->IsOnSurface()) break; 1254 } 1255 1256 /*clean-up and return*/ 1257 xDelete<Input*>(base_inputs); 1242 if(penta->IsOnSurface()) break; 1243 } 1258 1244 } 1259 1245 /*}}}*/
Note:
See TracChangeset
for help on using the changeset viewer.