bool EnhanceNet::Connectivity_Processing (Db_File *fh) { Connect_File *file; bool stat; stat = Network_Service::Connectivity_Processing (fh); file = (Connect_File *) fh; if (!stat) { if (file->Node () == 0) return (false); } else if (type_flag || Connect_Code (file->Type ()) == NO_TYPE) { Connect_Data *connect_ptr = connect_data.New_Record (); connect_ptr->Type (NO_TYPE); } //---- save the record to the database ---- if (First_Record ()) { if (!connect_db.Max_Records (file->Num_Records ())) { Error ("Insufficient Memory for Lane Connectivity Database"); } } connect_db.Copy_Fields (file); if (!connect_db.Add_Record ()) { Error ("Writing Lane Connectivity Database"); } return (stat); }
bool SubareaNet::Connectivity_Processing (Db_File *fh) { static Connect_File *new_file; int node; Node_Data *node_ptr; Connect_File *file = (Connect_File *) fh; if (First_Record ()) { new_file = (Connect_File *) Network_Db_Base (NEW_LANE_CONNECTIVITY); } //---- read and save the data ---- node = file->Node (); if (node == 0) return (false); node_ptr = node_data.Get (node); if (node_ptr == NULL) { Warning ("Connection Node %d was Not Found", node); return (false); } //---- check the node number ---- if (node_ptr->Type () == 1) { //---- copy the fields to the subarea file ---- new_file->Copy_Fields (file); if (!new_file->Write ()) { Error ("Writing %s", new_file->File_Type ()); } nconnect++; } //---- don't save the record ---- return (false); }