Changeset 5030


Ignore:
Timestamp:
08/06/10 14:47:17 (15 years ago)
Author:
Eric.Larour
Message:

Choice between contours as filename or as matlab structure.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/mex/ContourToNodes/ContourToNodes.cpp

    r5019 r5030  
    5050        CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&ContourToNodesUsage);
    5151
    52         /*First, call expread on filename to build a contour array in the matlab workspace: */
    53         mexCallMATLAB( 1, &matlabstructure, 1, (mxArray**)&FILENAME, "expread");
    54 
     52       
    5553        /*Fetch inputs: */
    5654        FetchData(&x,&nods,NULL,XHANDLE);
     
    5957
    6058        //Fetch contours
     59
     60        if(mxIsChar(FILENAME)){
     61                /*Call expread on filename to build a contour array in the matlab workspace: */
     62                mexCallMATLAB( 1, &matlabstructure, 1, (mxArray**)&FILENAME, "expread");
     63        }
     64        else{
     65                /*FILENAME is actually a structure, coming directly from expread: */
     66                matlabstructure=(mxArray*)FILENAME;
     67        }
     68
    6169        numcontours=mxGetNumberOfElements(matlabstructure);
    6270        contours=(Contour**)xmalloc(numcontours*sizeof(Contour*));
     
    99107        printf("   where:\n");
    100108        printf("      x,y: list of nodes.\n");
    101         printf("      contourname: name of .exp file containing the contours.\n");
     109        printf("      contourname: name of .exp file containing the contours, or resulting structure from call to expread.\n");
    102110        printf("      interptype: string definining type of interpolation ('element', or 'node').\n");
    103111        printf("      edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons.\n");
Note: See TracChangeset for help on using the changeset viewer.