00001
00002
00003
00004
00005
00006
00007
00008 #ifndef V_VEdges_h
00009 #define V_VEdges_h 1
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "viaio/Vlib.h"
00027 #include "viaio/file.h"
00028
00029
00030 #include <X11/Xfuncproto.h>
00031
00032 #ifdef __cplusplus
00033 extern "C" {
00034 #endif
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 typedef struct V_EdgesRec {
00047 int nrows;
00048 int ncolumns;
00049 VAttrList attributes;
00050 int nedge_fields;
00051 int npoint_fields;
00052 int nedges;
00053 int npoints;
00054 struct VEdgeStruct *first;
00055 struct VEdgeStruct *last;
00056 VPointer free;
00057 } VEdgesRec;
00058
00059
00060 typedef struct VEdgeStruct {
00061 struct VEdgeStruct *next;
00062 VFloat *edge_fields;
00063 VBoolean closed;
00064 int npoints;
00065 VFloat **point_index;
00066 VPointer free;
00067 } VEdgeRec, *VEdge;
00068
00069
00070
00071
00072
00073
00074
00075
00076 #define VEdgesAttr "edges"
00077 #define VNEdgeFieldsAttr "nedge_fields"
00078 #define VNPointFieldsAttr "npoint_fields"
00079 #define VNEdgesAttr "nedges"
00080 #define VNPointsAttr "npoints"
00081
00082
00083
00084
00085
00086
00087
00088 #define VEdgesNRows(edges) ((edges)->nrows)
00089
00090 #define VEdgesNColumns(edges) ((edges)->ncolumns)
00091
00092 #define VEdgesAttrList(edges) ((edges)->attributes)
00093
00094 #define VNEdgeFields(edges) ((edges)->nedge_fields)
00095
00096 #define VNPointFields(edges) ((edges)->npoint_fields)
00097
00098 #define VNEdges(edges) ((edges)->nedges)
00099
00100 #define VFirstEdge(edges) ((edges)->first)
00101
00102 #define VNextEdge(edge) ((edge)->next)
00103
00104 #define VEdgeExists(edge) ((edge) != NULL)
00105
00106 #define VEdgeFields(edge) ((edge)->edge_fields)
00107
00108 #define VEdgeNPoints(edge) ((edge)->npoints)
00109
00110 #define VEdgeClosed(edge) ((edge)->closed)
00111
00112 #define VEdgePointArray(edge) ((edge)->point_index)
00113
00114
00115
00116
00117 #define VEdgesCount(edges) ((edges)->nedges)
00118 #define VEdgePoints(edge) ((edge)->point_index)
00119 #define VEdgesEdgeFields(edges) ((edges)->nedge_fields)
00120 #define VEdgesPointFields(edges) ((edges)->npoint_fields)
00121 #define VEdgesRows(edges) ((edges)->nrows)
00122 #define VEdgesColumns(edges) ((edges)->ncolumns)
00123 #define VEdgePointCount(edge) ((edge)->npoints)
00124
00125
00126
00127
00128
00129
00130
00131
00132 extern VEdges VCreateEdges (
00133 #if NeedFunctionPrototypes
00134 int ,
00135 int ,
00136 int ,
00137 int
00138 #endif
00139 );
00140
00141 extern VEdge VAddEdge (
00142 #if NeedFunctionPrototypes
00143 VEdges ,
00144 VFloat * ,
00145 int ,
00146 VFloat * ,
00147 VBooleanPromoted ,
00148 VBooleanPromoted
00149 #endif
00150 );
00151
00152
00153 extern VEdges VCopyEdges (
00154 #if NeedFunctionPrototypes
00155 VEdges
00156 #endif
00157 );
00158
00159 extern void VDestroyEdges (
00160 #if NeedFunctionPrototypes
00161 VEdges
00162 #endif
00163 );
00164
00165
00166
00167 extern int VReadEdges (
00168 #if NeedFunctionPrototypes
00169 FILE * ,
00170 VAttrList * ,
00171 VEdges **
00172 #endif
00173 );
00174
00175 extern VBoolean VWriteEdges (
00176 #if NeedFunctionPrototypes
00177 FILE * ,
00178 VAttrList ,
00179 int ,
00180 VEdges *
00181 #endif
00182 );
00183
00184
00185
00186 extern VBoolean VEdgesToPS (
00187 #if NeedFunctionPrototypes
00188 FILE * ,
00189 VEdges ,
00190 VBooleanPromoted
00191 #endif
00192 );
00193
00194
00195
00196 extern VEdges VLinkImage (
00197 #if NeedFunctionPrototypes
00198 VImage ,
00199 int ,
00200 int ,
00201 int
00202 #endif
00203 );
00204
00205
00206
00207 extern VEdges VSegEdgesIntoLines (
00208 #if NeedFunctionPrototypes
00209 VEdges ,
00210 double ,
00211 int ,
00212 double ,
00213 int
00214 #endif
00215 );
00216
00217 #ifdef __cplusplus
00218 }
00219 #endif
00220
00221 #endif