/*!******************************************************************/ /* File: ig34.c */ /* ============ */ /* */ /* This file includes: */ /* */ /* igedst(); Edit MBS statement */ /* */ /* This file is part of the VARKON IG Library. */ /* URL: http://www.varkon.com */ /* */ /* This library is free software; you can redistribute it and/or */ /* modify it under the terms of the GNU Library General Public */ /* License as published by the Free Software Foundation; either */ /* version 2 of the License, or (at your option) any later */ /* version. */ /* */ /* This library is distributed in the hope that it will be */ /* useful, but WITHOUT ANY WARRANTY; without even the implied */ /* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR */ /* PURPOSE. See the GNU Library General Public License for more */ /* details. */ /* */ /* You should have received a copy of the GNU Library General */ /* Public License along with this library; if not, write to the */ /* Free Software Foundation, Inc., 675 Mass Ave, Cambridge, */ /* MA 02139, USA. */ /* */ /* (C)Microform AB 1984-1999, Johan Kjellander, johan@microform.se */ /* */ /********************************************************************/ #include "../../DB/include/DB.h" #include "../include/IG.h" #include "../../AN/include/AN.h" #include "../../EX/include/EX.h" #include "../../GP/include/GP.h" #include extern short modtyp,ialx,ialy; extern DBptr lsysla; extern char actcnm[]; extern struct ANSYREC sy; /*!******************************************************/ short igedst() /* Varkonfunktion för att editera en geometri- * eller part-sats på MBS-format. * * In: Inget. * * Ut: Inget. * * FV: 0 = OK, REJECT = avsluta, GOMAIN = huvudmenyn * * (C)microform ab 22/1/92 J. Kjellander * ******************************************************!*/ { char oldstr[V3STRLEN+1],newstr[V3STRLEN+1]; char oldpar[V3STRLEN+1],newpar[V3STRLEN+1]; char promt[V3STRLEN+1]; short status,nid,i,ntkn; DBetype typv[1]; DBptr csyla; pm_ptr slstla,lstla,nextla,statla,retla; PMMONO *np; DBId idmat[1][MXINIV]; ANFSET set; GMCSY csy; V2NAPA oldnap; /* ***Hämta storhetens id. */ nid = 1; igptma(268,IG_MESS); typv[0] = ALLTYP; status = getmid(idmat,typv,&nid); igrsma(); if ( status < 0 ) { gphgal(0); return(status); } else { idmat[0][0].ord_val = 1; idmat[0][0].p_nextre = NULL; } /* ***Ta reda på det koordinatsystem ***som var aktivt när den skapades. */ status = EXgatt((DBId *)idmat,&oldnap,&csyla); if ( status < 0 ) goto exit; /* ***Om csyla = DBNULL var inget lokalt system aktivt. ***Om lsysla = DBNULL är inget lokalt system aktivt. ***Jämför dom med varandra och meddela vilket som gäller ***under ändringen. */ strcpy(promt,iggtts(116)); if ( csyla != lsysla ) { if ( csyla != DBNULL ) { DBread_csys(&csy,NULL,csyla); strcat(promt,csy.name_pl); } else strcat(promt,iggtts(223)); } else strcat(promt,actcnm); igplma(promt,IG_INP); /* ***Var i PM ligger satsen ? Först en C-pekare till aktiv modul. ***Sen en PM-pekare till list-noden för utpekad sats. ***Sen en PM-pekare till själva satsen. */ np = (PMMONO *)pmgadr((pm_ptr)0); slstla = np->pstl_; if ( (status=pmlges((DBId *)idmat,&slstla,&lstla)) < 0 ) goto exit; if ( lstla == (pm_ptr)NULL ) goto exit; if ( (status=pmglin(lstla,&nextla,&statla)) < 0 ) goto exit; /* ***De-kompilera dito till en sträng. */ if ( (status=pprsts(statla,modtyp,oldstr,V3STRLEN)) < 0 ) goto exit; /* ***Klipp ut allt fram till 1:a parametern och gör det ***till promt, resten blir default-värde. */ edit: for ( i=0; i