C# does not support macros - so it is a problem
here are soime suggestions:
http://stackoverflow.com/q
http://stackoverflow.com/q
http://www.gamedev.net/top
struct should be translated as a class - seems reasonable
/* macros */
#define gaiaGetPoint(xy,v,x,y) \
{*x = xy[(v) * 2]; \
*y = xy[(v) * 2 + 1];}
#define gaiaSetPoint(xy,v,x,y) \
{xy[(v) * 2] = x; \
xy[(v) * 2 + 1] = y;}
typedef struct gaiaPointStruct
{
/* an OpenGis POINT */
double X; /* X,Y coordinates */
double Y;
double Z; /* Z coordinate */
double M; /* M measure */
int DimensionModel; /* (x,y), (x,y,z), (x,y,m) or (x,y,z,m) */
struct gaiaPointStruct *Next; /* for double-linked list */
struct gaiaPointStruct *Prev; /* for double-linked list */
} gaiaPoint;[i] [b]//What is this piece[/b][/i]
typedef gaiaPoint *gaiaPointPtr;[i] [b]//What is this piece[/b][/i]
public class gaiaPointStruct
{
/* an OpenGis POINT */
public double X; /* X,Y coordinates */
public double Y;
public double Z; /* Z coordinate */
public double M; /* M measure */
public int DimensionModel; /* (x,y), (x,y,z), (x,y,m) or (x,y,z,m) */
public gaiaPointStruct Next; /* for double-linked list */
public gaiaPointStruct Prev; /* for double-linked list */
} gaiaPoint;
typedef gaiaPoint *gaiaPointPtr;
using System;
using MyApplication1;
namespace MyApplication1
{
public class gaiaPoint
{
/* an OpenGis POINT */
public double X; /* X,Y coordinates */
public double Y;
public double Z; /* Z coordinate */
public double M; /* M measure */
public int DimensionModel; /* (x,y), (x,y,z), (x,y,m) or (x,y,z,m) */
public gaiaPoint Next; /* for double-linked list */
public gaiaPoint Prev; /* for double-linked list */
public static void gaiaSetPoint(double [] xy, int v, double x, double y) {
xy[(v) * 2] = x;
xy[(v) * 2 + 1] = y;
}
public static double gaiaGetPointX(double [] xy, int v){
return (xy[(v) * 2]);
}
public static double gaiaGetPointY(double [] xy, int v){
return (xy[(v) * 2 + 1]);
}
}
}
class MyProgram
{
static void Main(string[] args)
{
gaiaPoint gaiaPointPtr;
}
}
public static void gaiaGetPoint(ref double [] xy, int v, double x, double y)
{
xy[(v) * 2] = x;
xy[(v) * 2 + 1] = y;
}
public static void gaiaSetPoint(double [] xy, int v, ref double x, ref double y)
{
x = (xy[(v) * 2]);
y = (xy[(v) * 2 + 1]);
}
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
13 Experts available now in Live!