Changeset 8265
- Timestamp:
- 30/11/11 12:15:57 (6 months ago)
- Location:
- trunk/EDIT4
- Files:
-
- 3 modified
-
ED4_base.cxx (modified) (1 diff)
-
ED4_manager.cxx (modified) (2 diffs)
-
ed4_class.hxx (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/EDIT4/ED4_base.cxx
r8133 r8265 1241 1241 1242 1242 ED4_multi_species_manager *multi_species_manager = NULL; 1243 1244 1245 #if defined(LIMIT_TOP_AREA_SPACE)1246 int nr_of_visible_species = 0;1247 int nr_of_children_in_group = 0;1248 ED4_AREA_LEVEL level = temp_parent->get_area_level(&multi_species_manager);1249 if (level==ED4_A_TOP_AREA || level==ED4_A_BOTTOM_AREA) { // check if there are any unfolding restrictions1250 nr_of_visible_species = multi_species_manager->count_visible_children();1251 1252 if (nr_of_visible_species >= MAX_TOP_AREA_SIZE) {1253 aw_message("Top area limited to " MAX_TOP_AREA_SIZE " species\n"1254 "Advice: Move group to main area and try again");1255 return ED4_R_IMPOSSIBLE;1256 }1257 1258 nr_of_children_in_group = temp_parent->get_defined_level(ED4_L_MULTI_SPECIES)->to_multi_species_manager()->count_visible_children();1259 1260 if (nr_of_children_in_group + nr_of_visible_species - 1 > MAX_TOP_AREA_SIZE) {1261 aw_message("Top area limited to " MAX_TOP_AREA_SIZE " species\n"1262 "Advice: Move group to main area and try again");1263 return ED4_R_IMPOSSIBLE;1264 }1265 }1266 #else // LIMIT_TOP_AREA_SPACE1267 1243 temp_parent->get_area_level(&multi_species_manager); 1268 #endif1269 1244 1270 1245 for (i=0; i < temp_parent->children->members(); i++) { -
trunk/EDIT4/ED4_manager.cxx
r8264 r8265 510 510 ED4_extension loc; 511 511 512 #if defined(LIMIT_TOP_AREA_SPACE)513 int nr_of_visible_species = 0;514 int nr_of_children_in_group = 0;515 #endif516 517 512 if ((mi == NULL) || (mi->object->spec->level <= spec->level)) { 518 513 return (ED4_R_IMPOSSIBLE); … … 551 546 552 547 old_parent = object->parent; 553 554 #if defined(LIMIT_TOP_AREA_SPACE)555 if (old_parent->get_area_level() != level) { // when moving between two different areas we have to556 if (level == ED4_A_TOP_AREA || level == ED4_A_BOTTOM_AREA) { // check restrictions557 nr_of_visible_species = multi_species_manager->count_visible_children();558 559 if (nr_of_visible_species >= MAX_TOP_AREA_SIZE) {560 return ED4_R_IMPOSSIBLE;561 }562 563 if (object->is_group_manager()) {564 ED4_group_manager *group_manager = object->to_group_manager();565 566 if (object->dynamic_prop & ED4_P_IS_FOLDED) {567 nr_of_children_in_group = 1;568 }569 else {570 nr_of_children_in_group = group_manager->get_defined_level(ED4_L_MULTI_SPECIES)->to_multi_species_manager()->count_visible_children();571 }572 573 if (nr_of_children_in_group + nr_of_visible_species > MAX_TOP_AREA_SIZE) {574 return ED4_R_IMPOSSIBLE;575 }576 }577 }578 }579 #endif // LIMIT_TOP_AREA_SPACE580 548 581 549 x_off = 0; -
trunk/EDIT4/ed4_class.hxx
r8264 r8265 10 10 #ifdef DEBUG 11 11 # define IMPLEMENT_DUMP // comment out this line to skip compilation of the dump() methods 12 #endif13 14 // #define LIMIT_TOP_AREA_SPACE // // if defined, top area is size-limited // @@@ remove this15 #ifdef LIMIT_TOP_AREA_SPACE16 #define MAX_TOP_AREA_SIZE 10 // size limit for top-area17 12 #endif 18 13
