00001 /*------------------------------------------------------------------------*/ 00002 /* file: CheckTicksProperty.h */ 00003 /* Copyright INRIA 2006 */ 00004 /* Authors : Jean-Baptiste Silvy */ 00005 /* desc : generic function to retrieve the assigned x_ticks, y_ticks or */ 00006 /* z_ticks property */ 00007 /*------------------------------------------------------------------------*/ 00008 00009 #include "CheckTicksProperty.h" 00010 00011 /*----------------------------------------------------------------------------------*/ 00012 AssignedList * createTlistForTicks( void ) 00013 { 00014 AssignedList * tlist = NULL ; 00015 int nbRowLoc = 0 ; 00016 int nbColLoc = 0 ; 00017 int nbRowLab = 0 ; 00018 int nbColLab = 0 ; 00019 00020 tlist = createAssignedList( 3, 2 ) ; 00021 00022 if( !isListCurrentElementDoubleMatrix( tlist ) ) 00023 { 00024 sciprint("locations should be a vector of double.\n") ; 00025 return NULL ; 00026 } 00027 00028 getCurrentDoubleMatrixFromList( tlist, &nbRowLoc, &nbColLoc ) ; 00029 00030 if ( nbRowLoc * nbColLoc == 0 ) 00031 { 00032 /* labels should also be an empty matrix */ 00033 if ( !isListCurrentElementEmptyMatrix( tlist ) ) 00034 { 00035 sciprint( "Ticks location and label vectors must have the same size.\r\n" ) ; 00036 return NULL ; 00037 } 00038 } 00039 else 00040 { 00041 if ( !isListCurrentElementStringMatrix( tlist ) ) 00042 { 00043 sciprint("labels should be a string vector.\n") ; 00044 return NULL ; 00045 } 00046 00047 getCurrentStringMatrixFromList( tlist, &nbRowLab, &nbColLab ) ; 00048 00049 if ( nbRowLoc != nbRowLab || nbColLoc != nbColLab ) 00050 { 00051 sciprint( "Ticks location and label vectors must have the same size.\r\n" ) ; 00052 return NULL ; 00053 } 00054 } 00055 00056 rewindAssignedList( tlist ) ; 00057 00058 return tlist ; 00059 00060 } 00061 /*----------------------------------------------------------------------------------*/
1.5.1