Changeset 8737


Ignore:
Timestamp:
06/28/11 10:24:16 (14 years ago)
Author:
jschierm
Message:

DomainOutlineRead.cpp: Added closed flag for return and modified functions that called it.

Location:
issm/trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified issm/trunk/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp

    r8716 r8737  
    3131        int     *pnvert=NULL;
    3232        double  **pprofx=NULL,**pprofy=NULL;
     33        bool    *closed=NULL;
    3334        double  *lat=NULL,*lon=NULL;
    3435
     
    5253/*  read exp file  */
    5354
    54         if (!DomainOutlineRead(&nprof,&pnvert,&pprofx,&pprofy,filexp))
     55        if (!DomainOutlineRead(&nprof,&pnvert,&pprofx,&pprofy,&closed,filexp))
    5556                _error_("Error reading exp file.");
    5657
  • TabularUnified issm/trunk/src/c/shared/Exp/DomainOutlineRead.cpp

    r8301 r8737  
    1111#include "../Exceptions/exceptions.h"
    1212
    13 int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,char* domainname){
     13int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname){
    1414
    1515       
     
    2929        double** pprofx=NULL; //array of profiles x coordinates
    3030        double** pprofy=NULL; //array of profiles y coordinates
     31        bool* closed=NULL; //array holding closed flags for the nprof profiles
    3132
    3233        /*For each profile: */
     
    3435        double* x=NULL;
    3536        double* y=NULL;
     37        bool cl;
    3638
    3739        /*open domain outline file for reading: */
     
    6870                pprofy[i]=NULL;
    6971        }
     72        closed=(bool*)xmalloc(nprof*sizeof(bool));
    7073
    7174        /*Reaset file pointer to beginning of file: */
     
    97100
    98101                /*Now check that we are dealing with open contours: */
     102                cl=false;
    99103                if((x[0]==x[n-1]) && (y[0]==y[n-1])){
    100104                        n=n-1;
     105                        cl=true;
    101106                }
    102107
     
    105110                pprofx[counter]=x;
    106111                pprofy[counter]=y;
     112                closed[counter]=cl;
    107113        }
    108114
     
    123129        *ppprofx=pprofx;
    124130        *ppprofy=pprofy;
     131        if(pclosed)*pclosed=closed;
     132        else       xfree((void**)&closed);
    125133        return noerr;
    126134}
  • TabularUnified issm/trunk/src/c/shared/Exp/exp.h

    r8301 r8737  
    1212int IsOutsidePoly(Vec in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue);
    1313int IsInPolySerial(double* in,double* xc,double* yc,int numvertices,double* x,double* y,int nods, int edgevalue);
    14 int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,char* domainname);
     14int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname);
    1515int pnpoly(int npol, double *xp, double *yp, double x, double y, int edgevalue);
    1616
  • TabularUnified issm/trunk/src/mex/TriMesh/TriMesh.cpp

    r8306 r8737  
    9696       
    9797        /*Start reading the domain outline file: */
    98         if(!DomainOutlineRead(&nprof,&profnvertices,&pprofx,&pprofy,domainname)){
     98        if(!DomainOutlineRead(&nprof,&profnvertices,&pprofx,&pprofy,NULL,domainname)){
    9999                printf("%s%s%s\n",__FUNCT__," error message reading domain outline ",domainname);
    100100                mexErrMsgTxt(" ");
     
    103103        /*Read rifts file if present: */
    104104        if(riftname){
    105                 if(!DomainOutlineRead(&numrifts,&riftsnumvertices,&riftsverticesx,&riftsverticesy,riftname)){
     105                if(!DomainOutlineRead(&numrifts,&riftsnumvertices,&riftsverticesx,&riftsverticesy,NULL,riftname)){
    106106                        printf("%s%s%s\n",__FUNCT__," error message reading rifts outline ",riftname);
    107107                        mexErrMsgTxt(" ");
  • TabularUnified issm/trunk/src/mex/TriMeshNoDensity/TriMeshNoDensity.cpp

    r8306 r8737  
    8686       
    8787        /*Start reading the domain outline file: */
    88         if(!DomainOutlineRead(&nprof,&profnvertices,&pprofx,&pprofy,domainname)){
     88        if(!DomainOutlineRead(&nprof,&profnvertices,&pprofx,&pprofy,NULL,domainname)){
    8989                printf("%s%s%s\n",__FUNCT__," error message reading domain outline ",domainname);
    9090                mexErrMsgTxt(" ");
     
    9393        /*Read rifts file if present: */
    9494        if(riftname){
    95                 if(!DomainOutlineRead(&numrifts,&riftsnumvertices,&riftsverticesx,&riftsverticesy,riftname)){
     95                if(!DomainOutlineRead(&numrifts,&riftsnumvertices,&riftsverticesx,&riftsverticesy,NULL,riftname)){
    9696                        printf("%s%s%s\n",__FUNCT__," error message reading rifts outline ",riftname);
    9797                        mexErrMsgTxt(" ");
Note: See TracChangeset for help on using the changeset viewer.