[GRASS-SVN] r33441 - grass/trunk/swig/python/interfaces

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Sep 14 03:03:46 EDT 2008


Author: hamish
Date: 2008-09-14 03:03:46 -0400 (Sun, 14 Sep 2008)
New Revision: 33441

Modified:
   grass/trunk/swig/python/interfaces/imagedefs.i
   grass/trunk/swig/python/interfaces/imagery.i
Log:
trac #308. make PySwig build again (but still needs work): cluster fns moved out of imagery lib; indent (merge from devbr6)

Modified: grass/trunk/swig/python/interfaces/imagedefs.i
===================================================================
--- grass/trunk/swig/python/interfaces/imagedefs.i	2008-09-14 06:59:56 UTC (rev 33440)
+++ grass/trunk/swig/python/interfaces/imagedefs.i	2008-09-14 07:03:46 UTC (rev 33441)
@@ -9,15 +9,19 @@
 int I_free_double2(double **);
 double ***I_alloc_double3(int, int, int);
 int I_free_double3(double ***);
+
 /* ask_group.c */
 int I_ask_group_old(char *, char *);
+
 /* eol.c */
 int I_get_to_eol(char *, int, FILE *);
+
 /* find.c */
 int I_find_group(char *);
 int I_find_group_file(char *, char *);
 int I_find_subgroup(char *, char *);
 int I_find_subgroup_file(char *, char *, char *);
+
 /* fopen.c */
 FILE *I_fopen_group_file_new(char *, char *);
 FILE *I_fopen_group_file_append(char *, char *);
@@ -25,9 +29,12 @@
 FILE *I_fopen_subgroup_file_new(char *, char *, char *);
 FILE *I_fopen_subgroup_file_append(char *, char *, char *);
 FILE *I_fopen_subgroup_file_old(char *, char *, char *);
+
 /* georef.c */
-int I_compute_georef_equations(struct Control_Points *, double [3], double [3], double [3], double [3]);
-int I_georef(double, double, double *, double *, double [3], double [3]);
+int I_compute_georef_equations(struct Control_Points *, double[3], double[3],
+			       double[3], double[3]);
+int I_georef(double, double, double *, double *, double[3], double[3]);
+
 /* group.c */
 int I_get_group(char *);
 int I_put_group(char *);
@@ -42,26 +49,34 @@
 int I_transfer_group_ref_file(struct Ref *, int, struct Ref *);
 int I_init_group_ref(struct Ref *);
 int I_free_group_ref(struct Ref *);
+
 /* list_gp.c */
 int I_list_group(char *, struct Ref *, FILE *);
 int I_list_group_simple(struct Ref *, FILE *);
+
 /* list_subgp.c */
 int I_list_subgroup(char *, char *, struct Ref *, FILE *);
 int I_list_subgroup_simple(struct Ref *, FILE *);
+
 /* loc_info.c */
 int I_location_info(char *, char *);
+
 /* ls_groups.c */
 int I_list_groups(int);
 int I_list_subgroups(char *, int);
+
 /* points.c */
-int I_new_control_point(struct Control_Points *, double, double, double, double, int);
+int I_new_control_point(struct Control_Points *, double, double, double,
+			double, int);
 int I_get_control_points(char *, struct Control_Points *);
 int I_put_control_points(char *, struct Control_Points *);
+
 /* ref.c */
 FILE *I_fopen_group_ref_new(char *);
 FILE *I_fopen_group_ref_old(char *);
 FILE *I_fopen_subgroup_ref_new(char *, char *);
 FILE *I_fopen_subgroup_ref_old(char *, char *);
+
 /* sig.c */
 int I_init_signatures(struct Signature *, int);
 int I_new_signature(struct Signature *);
@@ -69,9 +84,11 @@
 int I_read_one_signature(FILE *, struct Signature *);
 int I_read_signatures(FILE *, struct Signature *);
 int I_write_signatures(FILE *, struct Signature *);
+
 /* sigfile.c */
 FILE *I_fopen_signature_file_new(char *, char *, char *);
 FILE *I_fopen_signature_file_old(char *, char *, char *);
+
 /* sigset.c */
 int I_SigSetNClasses(struct SigSet *);
 struct ClassData *I_AllocClassData(struct SigSet *, struct ClassSig *, int);
@@ -85,50 +102,19 @@
 int I_SetClassTitle(struct ClassSig *, char *);
 char *I_GetClassTitle(struct ClassSig *);
 int I_WriteSigSet(FILE *, struct SigSet *);
+
 /* sigsetfile.c */
 FILE *I_fopen_sigset_file_new(char *, char *, char *);
 FILE *I_fopen_sigset_file_old(char *, char *, char *);
+
 /* target.c */
 int I_get_target(char *, char *, char *);
 int I_put_target(char *, char *, char *);
+
 /* title.c */
 int I_get_group_title(char *, char *, int);
 int I_put_group_title(char *, char *);
+
 /* var.c */
 double I_variance(double, double, int);
 double I_stddev(double, double, int);
-
-/* c_assign.c */
-int I_cluster_assign(struct Cluster *, int *);
-/* c_begin.c */
-int I_cluster_begin(struct Cluster *, int);
-/* c_clear.c */
-int I_cluster_clear(struct Cluster *);
-/* c_distinct.c */
-int I_cluster_distinct(struct Cluster *, double);
-/* c_exec.c */
-int I_cluster_exec(struct Cluster *, int, int, double, double, int, int (*)(), int *);
-/* c_execmem.c */
-int I_cluster_exec_allocate(struct Cluster *);
-int I_cluster_exec_free(struct Cluster *);
-/* c_means.c */
-int I_cluster_means(struct Cluster *);
-/* c_merge.c */
-int I_cluster_merge(struct Cluster *);
-/* c_nclasses.c */
-int I_cluster_nclasses(struct Cluster *, int);
-/* c_point.c */
-int I_cluster_point(struct Cluster *, CELL *);
-int I_cluster_begin_point_set(struct Cluster *, int);
-int I_cluster_point_part(struct Cluster *, register CELL, int, int);
-int I_cluster_end_point_set(struct Cluster *, int);
-/* c_reassign.c */
-int I_cluster_reassign(struct Cluster *, int *);
-/* c_reclass.c */
-int I_cluster_reclass(struct Cluster *, int);
-/* c_sep.c */
-double I_cluster_separation(struct Cluster *, int, int);
-/* c_sig.c */
-int I_cluster_signatures(struct Cluster *);
-/* c_sum2.c */
-int I_cluster_sum2(struct Cluster *);

Modified: grass/trunk/swig/python/interfaces/imagery.i
===================================================================
--- grass/trunk/swig/python/interfaces/imagery.i	2008-09-14 06:59:56 UTC (rev 33440)
+++ grass/trunk/swig/python/interfaces/imagery.i	2008-09-14 07:03:46 UTC (rev 33441)
@@ -1,17 +1,19 @@
+#include <grass/cluster.h>
+
 #define INAME_LEN 30
 struct Ref_Files
 {
-    char name[30]; 
+    char name[30];
     char mapset[30];
 };
 struct Ref_Color
 {
-    unsigned char *table      ;  
-    unsigned char *index      ;  
-    unsigned char *buf        ;  
-    int fd                    ;  
-    CELL min, max             ;  
-    int n                     ;  
+    unsigned char *table;
+    unsigned char *index;
+    unsigned char *buf;
+    int fd;
+    CELL min, max;
+    int n;
 };
 
 struct Ref
@@ -19,34 +21,34 @@
     int nfiles;
     struct Ref_Files *file;
     struct Ref_Color red, grn, blu;
-} ;
+};
 
 struct Tape_Info
 {
     char title[75];
     char id[2][75];
     char desc[5][75];
-} ;
+};
 
 struct Control_Points
 {
-    int  count;
+    int count;
     double *e1;
     double *n1;
     double *e2;
     double *n2;
     int *status;
-} ;
-    struct One_Sig
-    {
-	char desc[100];
-	int npoints;
-	double *mean;	
-	double **var;   
-	int status;     
-	float r,g,b;	
-	int have_color;
-    }; 
+};
+struct One_Sig
+{
+    char desc[100];
+    int npoints;
+    double *mean;
+    double **var;
+    int status;
+    float r, g, b;
+    int have_color;
+};
 struct Signature
 {
     int nbands;
@@ -54,61 +56,36 @@
     char title[100];
     struct One_Sig *sig;
 
-} ;
+};
 
-struct Cluster
+struct SubSig
 {
-    int nbands;
-    int npoints;
-    CELL **points ;
-    int np;
+    double N;
+    double pi;
+    double *means;
+    double **R;
+    double **Rinv;
+    double cnst;
+    int used;
+};
+struct ClassData
+{
+    int npixels;
+    int count;
+    double **x;
+    double **p;
+};
 
-    double *band_sum     ; 
-    double *band_sum2    ; 
-
-    int    *class        ; 
-    int    *reclass      ; 
-    int    *count        ; 
-    int    *countdiff    ; 
-    double **sum         ; 
-    double **sumdiff     ; 
-    double **sum2        ; 
-    double **mean        ; 
-    struct Signature S   ; 
-
-    int nclasses;
-    int merge1, merge2;
-    int iteration;
-    double percent_stable;
-} ;
-    struct SubSig
-        {
-            double N;
-	    double pi;
-            double *means;
-            double **R;
-            double **Rinv;
-	    double cnst;
-            int used;
-        } ;
-        struct ClassData
-        {
-	    int npixels;
-	    int count;
-	    double **x;   
-	    double **p;   
-        };
-
-    struct ClassSig
-    {
-	long classnum;
-        char *title;
-        int used;
-	int type;
-        int nsubclasses;
+struct ClassSig
+{
+    long classnum;
+    char *title;
+    int used;
+    int type;
+    int nsubclasses;
     struct SubSig *SubSig;
-        struct ClassData ClassData;
-    };
+    struct ClassData ClassData;
+};
 
 struct SigSet
 {



More information about the grass-commit mailing list