From: Paul C. <pa...@us...> - 2005-03-23 00:22:38
|
Update of /cvsroot/emc/emc2/src/emc/nml_intf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23717 Modified Files: Tag: bdi-4 Makefile emcpos.h initraj.cc Log Message: Overloaded some of the operators so that we can do array addressing and simple math on EmcPose. Index: emcpos.h =================================================================== RCS file: /cvsroot/emc/emc2/src/emc/nml_intf/emcpos.h,v retrieving revision 1.2.14.1 retrieving revision 1.2.14.2 diff -C2 -d -r1.2.14.1 -r1.2.14.2 *** emcpos.h 20 Feb 2005 03:43:53 -0000 1.2.14.1 --- emcpos.h 23 Mar 2005 00:22:10 -0000 1.2.14.2 *************** *** 5,13 **** #include "posemath.h" /* PmCartesian */ ! typedef struct _EmcPose { ! PmCartesian tran; ! double a,b,c; ! } EmcPose; #endif --- 5,29 ---- #include "posemath.h" /* PmCartesian */ ! #ifdef __cplusplus ! class EmcPose ! { ! public: ! ! EmcPose() {tran.x = tran.y = tran.z = a = b = c = 0;} + PmCartesian tran; + double a,b,c; + double & operator[](int i); + EmcPose operator - (EmcPose v1); + EmcPose operator + (EmcPose v1); + bool operator == (EmcPose v1); + bool operator != (EmcPose v1); + }; + #else + typedef struct _EmcPose { + PmCartesian tran; + double a,b,c; + } EmcPose; + #endif #endif Index: Makefile =================================================================== RCS file: /cvsroot/emc/emc2/src/emc/nml_intf/Makefile,v retrieving revision 1.5.14.4 retrieving revision 1.5.14.5 diff -C2 -d -r1.5.14.4 -r1.5.14.5 *** Makefile 16 Mar 2005 12:09:49 -0000 1.5.14.4 --- Makefile 23 Mar 2005 00:22:10 -0000 1.5.14.5 *************** *** 29,32 **** --- 29,33 ---- interpl.cc \ emcops.cc \ + emcpos.cc \ OBJS = emc.o \ *************** *** 43,46 **** --- 44,48 ---- interpl.o \ emcops.o \ + emcpos.o RT_OBJS = *************** *** 81,85 **** $(TMP_DIR)/iniaux.o \ $(TMP_DIR)/interpl.o \ ! $(TMP_DIR)/emcops.o rm -f $@ ar rc $@ $^ --- 83,88 ---- $(TMP_DIR)/iniaux.o \ $(TMP_DIR)/interpl.o \ ! $(TMP_DIR)/emcops.o \ ! $(TMP_DIR)/emcpos.o rm -f $@ ar rc $@ $^ Index: initraj.cc =================================================================== RCS file: /cvsroot/emc/emc2/src/emc/nml_intf/Attic/initraj.cc,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** initraj.cc 20 Feb 2005 03:43:53 -0000 1.1.2.1 --- initraj.cc 23 Mar 2005 00:22:10 -0000 1.1.2.2 *************** *** 79,83 **** char homes[INIFILE_MAX_LINELEN]; char home[INIFILE_MAX_LINELEN]; ! EmcPose homePose ={ { 0.0, 0.0, 0.0 } , 0.0, 0.0, 0.0}; double d; int index; --- 79,83 ---- char homes[INIFILE_MAX_LINELEN]; char home[INIFILE_MAX_LINELEN]; ! EmcPose homePose;// ={ { 0.0, 0.0, 0.0 } , 0.0, 0.0, 0.0}; double d; int index; |