You can subscribe to this list here.
| 2000 |
Jan
(7) |
Feb
(5) |
Mar
(4) |
Apr
(5) |
May
(8) |
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <joh...@ve...> - 2002-05-17 20:57:53
|
Patch: vhclmaps-020517-johnston-033
For: vhclmaps-0.7.5
Author: joh...@us...
Subject: a bunch of work to bring up to gcc-3.* and ivtools-1.0.*
Requires:
This is an intermediate patch to vhclmaps-0.7.5. To apply, cd to the
top-level directory of the vhclmaps source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- a bunch of work to bring up to gcc-3.* and ivtools-1.0.*
(not finished yet, just want to commit to cvs)
Index: top_vhclmaps/MANIFEST
diff -c top_vhclmaps/MANIFEST:1.1 top_vhclmaps/MANIFEST:1.2
*** top_vhclmaps/MANIFEST:1.1 Thu Dec 20 10:49:17 2001
--- ./MANIFEST Fri May 17 13:46:31 2002
***************
*** 257,262 ****
--- 257,264 ----
vhclmaps-0.7/src/MapServ/mapfunc.h
vhclmaps-0.7/src/MapServ/maphandler.c
vhclmaps-0.7/src/MapServ/maphandler.h
+ vhclmaps-0.7/src/MapServ/mapprojfunc.c
+ vhclmaps-0.7/src/MapServ/mapprojfunc.h
vhclmaps-0.7/src/MapServ/mapservdef.h
vhclmaps-0.7/src/MapUnidraw/Imakefile
vhclmaps-0.7/src/MapUnidraw/Makefile
Index: src_vhclmaps/Imakefile
diff -c src_vhclmaps/Imakefile:1.1 src_vhclmaps/Imakefile:1.2
*** src_vhclmaps/Imakefile:1.1 Thu Dec 20 10:49:19 2001
--- src/Imakefile Fri May 17 13:46:32 2002
***************
*** 94,100 ****
utmviewer \
Los \
LosServ \
- losserv \
ProjServ \
projserv \
ProjUnidraw \
--- 94,99 ----
***************
*** 125,131 ****
utmviewer \
Los \
LosServ \
- losserv \
ProjServ \
projserv \
ProjUnidraw \
--- 124,129 ----
Index: Map/mapcov.h
diff -c Map/mapcov.h:1.1 Map/mapcov.h:1.2
*** Map/mapcov.h:1.1 Thu Dec 20 10:49:24 2001
--- src/Map/mapcov.h Fri May 17 13:46:33 2002
***************
*** 26,31 ****
--- 26,33 ----
#ifndef mapcov_h
#define mapcov_h
+ #include <iosfwd>
+
#include <Map/mapfiles.h>
class MapEdge;
***************
*** 33,39 ****
class MapFeatureClass;
class MapLibrary;
class MapNode;
- class ostream;
class MapCoverage : public MapFiles {
protected:
--- 35,40 ----
Index: Map/mapdb.h
diff -c Map/mapdb.h:1.1 Map/mapdb.h:1.2
*** Map/mapdb.h:1.1 Thu Dec 20 10:49:24 2001
--- src/Map/mapdb.h Fri May 17 13:46:33 2002
***************
*** 26,35 ****
#ifndef mapdb_h
#define mapdb_h
#include <Map/mapfiles.h>
class MapLibrary;
- class ostream;
class MapDatabase : public MapFiles {
protected:
--- 26,36 ----
#ifndef mapdb_h
#define mapdb_h
+ #include <iosfwd>
+
#include <Map/mapfiles.h>
class MapLibrary;
class MapDatabase : public MapFiles {
protected:
Index: Map/mapfclass.h
diff -c Map/mapfclass.h:1.1 Map/mapfclass.h:1.2
*** Map/mapfclass.h:1.1 Thu Dec 20 10:49:24 2001
--- src/Map/mapfclass.h Fri May 17 13:46:33 2002
***************
*** 27,32 ****
--- 27,34 ----
#ifndef mapfclass_h
#define mapfclass_h
+ #include <iosfwd>
+
#include <Map/mapfiles.h>
#include <OS/table.h>
***************
*** 34,40 ****
class MapCoverage;
class MapFeature;
class MapFeatureClass;
- class ostream;
declareTable(MapFeatureTable,int,MapFeature*)
--- 36,41 ----
Index: Map/mapfeature.h
diff -c Map/mapfeature.h:1.1 Map/mapfeature.h:1.2
*** Map/mapfeature.h:1.1 Thu Dec 20 10:49:24 2001
--- src/Map/mapfeature.h Fri May 17 13:46:33 2002
***************
*** 29,34 ****
--- 29,36 ----
#ifndef mapfeature_h
#define mapfeature_h
+ #include <iosfwd>
+
#include <OS/enter-scope.h>
class AttributeList;
***************
*** 43,49 ****
class MapProjection;
class MapRaster;
class MapText;
- class ostream;
class MapFeature {
public:
--- 45,50 ----
Index: Map/mapfiles.h
diff -c Map/mapfiles.h:1.1 Map/mapfiles.h:1.2
*** Map/mapfiles.h:1.1 Thu Dec 20 10:49:24 2001
--- src/Map/mapfiles.h Fri May 17 13:46:33 2002
***************
*** 26,34 ****
#ifndef mapfile_h
#define mapfile_h
! #include <OS/types.h>
! class ostream;
class MapFiles {
protected:
--- 26,34 ----
#ifndef mapfile_h
#define mapfile_h
! #include <iosfwd>
! #include <OS/types.h>
class MapFiles {
protected:
Index: Map/maplib.h
diff -c Map/maplib.h:1.1 Map/maplib.h:1.2
*** Map/maplib.h:1.1 Thu Dec 20 10:49:24 2001
--- src/Map/maplib.h Fri May 17 13:46:33 2002
***************
*** 26,36 ****
#ifndef maplib_h
#define maplib_h
#include <Map/mapfiles.h>
class MapDatabase;
class MapCoverage;
- class ostream;
class MapLibrary : public MapFiles {
protected:
--- 26,37 ----
#ifndef maplib_h
#define maplib_h
+ #include <iosfwd>
+
#include <Map/mapfiles.h>
class MapDatabase;
class MapCoverage;
class MapLibrary : public MapFiles {
protected:
Index: VpfUtil/vpfdraw.h
diff -c VpfUtil/vpfdraw.h:1.1 VpfUtil/vpfdraw.h:1.2
*** VpfUtil/vpfdraw.h:1.1 Thu Dec 20 10:49:30 2001
--- src/VpfUtil/vpfdraw.h Fri May 17 13:46:35 2002
***************
*** 55,58 ****
int inner );
! #endif
\ No newline at end of file
--- 55,58 ----
int inner );
! #endif
Index: Vpf/vpffeature.h
diff -c Vpf/vpffeature.h:1.1 Vpf/vpffeature.h:1.2
*** Vpf/vpffeature.h:1.1 Thu Dec 20 10:49:35 2001
--- src/Vpf/vpffeature.h Fri May 17 13:46:36 2002
***************
*** 26,31 ****
--- 26,33 ----
#ifndef vpf_feature_h
#define vpf_feature_h
+ #include <iosfwd>
+
#include <Map/mapfeature.h>
#include <Vpf/vpf.h>
Index: Vpf/vpflib.c
diff -c Vpf/vpflib.c:1.1 Vpf/vpflib.c:1.2
*** Vpf/vpflib.c:1.1 Thu Dec 20 10:49:35 2001
--- src/Vpf/vpflib.c Fri May 17 13:46:36 2002
***************
*** 33,38 ****
--- 33,39 ----
}
#include <fstream.h>
+ #include <iostream.h>
#include <string.h>
#include <sys/stat.h>
***************
*** 445,451 ****
point_rec = read_point(i, nodetable);
FPointObj npoint(point_rec.x, point_rec.y);
! outfile.form(",%f,%f", point_rec.x, point_rec.y);
for (int j = 1; j < fc->nfeats(); j++) { // avoid first dummy tile
VpfFeature* tile = (VpfFeature*)fc->feature(j);
--- 446,452 ----
point_rec = read_point(i, nodetable);
FPointObj npoint(point_rec.x, point_rec.y);
! out_form2(outfile, ",%f,%f", point_rec.x, point_rec.y);
for (int j = 1; j < fc->nfeats(); j++) { // avoid first dummy tile
VpfFeature* tile = (VpfFeature*)fc->feature(j);
Index: Vpf/vpftiledfc.c
diff -c Vpf/vpftiledfc.c:1.1 Vpf/vpftiledfc.c:1.2
*** Vpf/vpftiledfc.c:1.1 Thu Dec 20 10:49:35 2001
--- src/Vpf/vpftiledfc.c Fri May 17 13:46:36 2002
***************
*** 353,359 ****
long ebr_xmax_pos = table_pos("XMAX", ebrtable);
long ebr_ymax_pos = table_pos("YMAX", ebrtable);
for (i=1;i<=ebrtable.nrows;i++) {
! float fx1, fy1, fx2, fy2;
ebrrow = get_row(i,ebrtable);
get_table_element(ebr_xmin_pos,ebrrow,ebrtable,&fx1,&n);
get_table_element(ebr_ymin_pos,ebrrow,ebrtable,&fy1,&n);
--- 353,359 ----
long ebr_xmax_pos = table_pos("XMAX", ebrtable);
long ebr_ymax_pos = table_pos("YMAX", ebrtable);
for (i=1;i<=ebrtable.nrows;i++) {
! double fx1, fy1, fx2, fy2;
ebrrow = get_row(i,ebrtable);
get_table_element(ebr_xmin_pos,ebrrow,ebrtable,&fx1,&n);
get_table_element(ebr_ymin_pos,ebrrow,ebrtable,&fy1,&n);
***************
*** 459,465 ****
long ebr_xmax_pos = table_pos("XMAX", ebrtable);
long ebr_ymax_pos = table_pos("YMAX", ebrtable);
for (i=1;i<=ebrtable.nrows;i++) {
! float fx1, fy1, fx2, fy2;
ebrrow = get_row(i,ebrtable);
get_table_element(ebr_xmin_pos,ebrrow,ebrtable,&fx1,&n);
get_table_element(ebr_ymin_pos,ebrrow,ebrtable,&fy1,&n);
--- 459,465 ----
long ebr_xmax_pos = table_pos("XMAX", ebrtable);
long ebr_ymax_pos = table_pos("YMAX", ebrtable);
for (i=1;i<=ebrtable.nrows;i++) {
! double fx1, fy1, fx2, fy2;
ebrrow = get_row(i,ebrtable);
get_table_element(ebr_xmin_pos,ebrrow,ebrtable,&fx1,&n);
get_table_element(ebr_ymin_pos,ebrrow,ebrtable,&fy1,&n);
***************
*** 540,549 ****
_x1 = dx; _y1 = dy; _x2 = dx; _y2 = dy;
}
else {
! _x1 = Math::min(_x1, dx);
! _y1 = Math::min(_y1, dy);
! _x2 = Math::max(_x2, dx);
! _y2 = Math::max(_y2, dy);
}
MapPoint* mp = new MapPoint();
mp->insert_points(1, &dx, &dy);
--- 540,549 ----
_x1 = dx; _y1 = dy; _x2 = dx; _y2 = dy;
}
else {
! _x1 = Math::min(_x1, (double)dx);
! _y1 = Math::min(_y1, (double)dy);
! _x2 = Math::max(_x2, (double)dx);
! _y2 = Math::max(_y2, (double)dy);
}
MapPoint* mp = new MapPoint();
mp->insert_points(1, &dx, &dy);
***************
*** 599,608 ****
_x1 = dx; _y1 = dy; _x2 = dx; _y2 = dy;
}
else {
! _x1 = Math::min(_x1, dx);
! _y1 = Math::min(_y1, dy);
! _x2 = Math::max(_x2, dx);
! _y2 = Math::max(_y2, dy);
}
MapText* mt = new MapText();
mt->text(anno_rec.text);
--- 599,608 ----
_x1 = dx; _y1 = dy; _x2 = dx; _y2 = dy;
}
else {
! _x1 = Math::min(_x1, (double)dx);
! _y1 = Math::min(_y1, (double)dy);
! _x2 = Math::max(_x2, (double)dx);
! _y2 = Math::max(_y2, (double)dy);
}
MapText* mt = new MapText();
mt->text(anno_rec.text);
Index: Dlg/dlgfeature.h
diff -c Dlg/dlgfeature.h:1.1 Dlg/dlgfeature.h:1.2
*** Dlg/dlgfeature.h:1.1 Thu Dec 20 10:49:38 2001
--- src/Dlg/dlgfeature.h Fri May 17 13:46:37 2002
***************
*** 29,34 ****
--- 29,36 ----
#ifndef dlgfeature_h
#define dlgfeature_h
+ #include <iosfwd>
+
#include <Map/mapfeature.h>
class DlgFeatureClass;
Index: Dem/usgsdem.h
diff -c Dem/usgsdem.h:1.1 Dem/usgsdem.h:1.2
*** Dem/usgsdem.h:1.1 Thu Dec 20 10:49:53 2001
--- src/Dem/usgsdem.h Fri May 17 13:46:39 2002
***************
*** 24,29 ****
--- 24,31 ----
#ifndef usgsdem_h
#define usgsdem_h
+ #include <string.h>
+
/*
* USGS Digital Elevation Models - only handles 1-degree "DMA DEMs" for now
*/
Index: MapUnidraw/Imakefile
diff -c MapUnidraw/Imakefile:1.1 MapUnidraw/Imakefile:1.2
*** MapUnidraw/Imakefile:1.1 Thu Dec 20 10:50:04 2001
--- src/MapUnidraw/Imakefile Fri May 17 13:46:41 2002
***************
*** 33,39 ****
Obj26(mapviews)
Obj26(mapviewstate)
! #define Obj31(file) MakeObjectFromSrcFlags(file, -Uiv2_6_compatible -I$(IVTOOLSSRC)/include $(TOP_CCINCLUDES))
Obj31(geoloctool)
Obj31(gscmd)
--- 33,39 ----
Obj26(mapviews)
Obj26(mapviewstate)
! #define Obj31(file) MakeObjectFromSrcFlags(file, -Div2_6_incompatible -I$(IVTOOLSSRC)/include $(TOP_CCINCLUDES))
Obj31(geoloctool)
Obj31(gscmd)
***************
*** 52,58 ****
Obj31(thchooser)
#ifdef AceDir
! #define ObjACE(file) MakeObjectFromSrcFlags(file, -Uiv2_6_compatible -I$(TOP)/src/include $(TOP_CCINCLUDES) -D__ACE_INLINE__)
ObjACE(map-aceimport)
#endif
--- 52,58 ----
Obj31(thchooser)
#ifdef AceDir
! #define ObjACE(file) MakeObjectFromSrcFlags(file, -Div2_6_incompatible -I$(TOP)/src/include $(TOP_CCINCLUDES) -D__ACE_INLINE__)
ObjACE(map-aceimport)
#endif
Index: MapUnidraw/mapcatalog.c
diff -c MapUnidraw/mapcatalog.c:1.1 MapUnidraw/mapcatalog.c:1.2
*** MapUnidraw/mapcatalog.c:1.1 Thu Dec 20 10:50:04 2001
--- src/MapUnidraw/mapcatalog.c Fri May 17 13:46:41 2002
***************
*** 36,41 ****
--- 36,44 ----
#include <stdio.h>
#include <stream.h>
#include <ctype.h>
+ #if __GNUG__>=3
+ #include <fstream.h>
+ #endif
/*****************************************************************************/
Index: MapUnidraw/mapcatalog.h
diff -c MapUnidraw/mapcatalog.h:1.1 MapUnidraw/mapcatalog.h:1.2
*** MapUnidraw/mapcatalog.h:1.1 Thu Dec 20 10:50:04 2001
--- src/MapUnidraw/mapcatalog.h Fri May 17 13:46:41 2002
***************
*** 29,34 ****
--- 29,36 ----
#ifndef mapcatalog_h
#define mapcatalog_h
+ #include <iosfwd>
+
#include <OverlayUnidraw/ovcatalog.h>
class MapCatalog : public OverlayCatalog {
Index: MapUnidraw/mapcmds.c
diff -c MapUnidraw/mapcmds.c:1.1 MapUnidraw/mapcmds.c:1.2
*** MapUnidraw/mapcmds.c:1.1 Thu Dec 20 10:50:04 2001
--- src/MapUnidraw/mapcmds.c Fri May 17 13:46:41 2002
***************
*** 66,71 ****
--- 66,72 ----
#include <OS/math.h>
#ifdef HAVE_ACE
+ #include <signal.h>
#include <ace/SOCK_Connector.h>
#include <ace/Log_Msg.h>
#include <ace/Log_Record.h>
Index: MapUnidraw/mapcomps.h
diff -c MapUnidraw/mapcomps.h:1.1 MapUnidraw/mapcomps.h:1.2
*** MapUnidraw/mapcomps.h:1.1 Thu Dec 20 10:50:04 2001
--- src/MapUnidraw/mapcomps.h Fri May 17 13:46:41 2002
***************
*** 25,30 ****
--- 25,32 ----
#ifndef mapcomps_h
#define mapcomps_h
+ #include <iosfwd>
+
#include <OverlayUnidraw/ovcomps.h>
#include <FrameUnidraw/framecomps.h>
#include <Map/mapfeature.h>
Index: MapUnidraw/mapcreator.h
diff -c MapUnidraw/mapcreator.h:1.1 MapUnidraw/mapcreator.h:1.2
*** MapUnidraw/mapcreator.h:1.1 Thu Dec 20 10:50:04 2001
--- src/MapUnidraw/mapcreator.h Fri May 17 13:46:41 2002
***************
*** 24,29 ****
--- 24,31 ----
#ifndef mapcreator_h
#define mapcreator_h
+ #include <iosfwd>
+
#include <FrameUnidraw/framecreator.h>
class MapCreator : public FrameCreator {
Index: MapUnidraw/mapdialogs.c
diff -c MapUnidraw/mapdialogs.c:1.1 MapUnidraw/mapdialogs.c:1.2
*** MapUnidraw/mapdialogs.c:1.1 Thu Dec 20 10:50:04 2001
--- src/MapUnidraw/mapdialogs.c Fri May 17 13:46:41 2002
***************
*** 36,41 ****
--- 36,42 ----
#include <InterViews/glue.h>
#include <InterViews/matcheditor.h>
#include <InterViews/sensor.h>
+ #include <OS/math.h>
#include <stdio.h>
#include <stdlib.h>
***************
*** 83,89 ****
}
Interactor* GeoPointDialog::Interior () {
! const int space = round(.5*ivcm);
VBox* titleblock = new VBox(
new HBox(_title, new HGlue),
--- 84,90 ----
}
Interactor* GeoPointDialog::Interior () {
! const int space = Math::round(.5*ivcm);
VBox* titleblock = new VBox(
new HBox(_title, new HGlue),
Index: MapUnidraw/mapeditor.c
diff -c MapUnidraw/mapeditor.c:1.1 MapUnidraw/mapeditor.c:1.2
*** MapUnidraw/mapeditor.c:1.1 Thu Dec 20 10:50:04 2001
--- src/MapUnidraw/mapeditor.c Fri May 17 13:46:41 2002
***************
*** 77,83 ****
#include <InterViews/tray.h>
#include <InterViews/window.h>
! #include <Dispatch/rpcstream.h>
#include <ComTerp/comterpserv.h>
--- 77,83 ----
#include <InterViews/tray.h>
#include <InterViews/window.h>
! // #include <Dispatch/rpcstream.h>
#include <ComTerp/comterpserv.h>
***************
*** 144,150 ****
Interactor* MapEditor::Interior () {
HBorder* hborder = new HBorder;
VBorder* vborder = new VBorder;
! int gap = round(.1*ivcm);
_tray->HBox(_tray, _viewer, _tray);
--- 144,150 ----
Interactor* MapEditor::Interior () {
HBorder* hborder = new HBorder;
VBorder* vborder = new VBorder;
! int gap = (int)round(.1*ivcm);
_tray->HBox(_tray, _viewer, _tray);
Index: MapUnidraw/mapeditor.h
diff -c MapUnidraw/mapeditor.h:1.1 MapUnidraw/mapeditor.h:1.2
*** MapUnidraw/mapeditor.h:1.1 Thu Dec 20 10:50:04 2001
--- src/MapUnidraw/mapeditor.h Fri May 17 13:46:41 2002
***************
*** 111,117 ****
MapFClassState* _fclassstate;
MapSelectionState* _selstate;
! friend MapKit;
};
#endif
--- 111,117 ----
MapFClassState* _fclassstate;
MapSelectionState* _selstate;
! friend class MapKit;
};
#endif
Index: MapUnidraw/mapexport.c
diff -c MapUnidraw/mapexport.c:1.1 MapUnidraw/mapexport.c:1.2
*** MapUnidraw/mapexport.c:1.1 Thu Dec 20 10:50:04 2001
--- src/MapUnidraw/mapexport.c Fri May 17 13:46:41 2002
***************
*** 55,60 ****
--- 55,63 ----
#include <stream.h>
#include <stdio.h>
#include <stdlib.h>
+ #if __GNUG__>=3
+ #include <fstream.h>
+ #endif
/*****************************************************************************/
Index: MapUnidraw/mapimport.c
diff -c MapUnidraw/mapimport.c:1.1 MapUnidraw/mapimport.c:1.2
*** MapUnidraw/mapimport.c:1.1 Thu Dec 20 10:50:04 2001
--- src/MapUnidraw/mapimport.c Fri May 17 13:46:41 2002
***************
*** 54,59 ****
--- 54,62 ----
#include <InterViews/window.h>
#include <ctype.h>
#include <iostream.h>
+ #if __GNUG__>=3
+ #include <fstream.h>
+ #endif
/*****************************************************************************/
***************
*** 253,259 ****
comp = (OverlayComp*)PPM_Image(pathname);
} else {
filebuf fbuf;
! fbuf.open(pathname, "r");
istream in(&fbuf);
char ch; while (isspace(ch = in.get())); in.putback(ch);
int len = 255;
--- 256,262 ----
comp = (OverlayComp*)PPM_Image(pathname);
} else {
filebuf fbuf;
! fbuf.open(pathname, input);
istream in(&fbuf);
char ch; while (isspace(ch = in.get())); in.putback(ch);
int len = 255;
Index: MapUnidraw/mapimport.h
diff -c MapUnidraw/mapimport.h:1.1 MapUnidraw/mapimport.h:1.2
*** MapUnidraw/mapimport.h:1.1 Thu Dec 20 10:50:04 2001
--- src/MapUnidraw/mapimport.h Fri May 17 13:46:41 2002
***************
*** 28,33 ****
--- 28,35 ----
#ifndef map_import_h
#define map_import_h
+ #include <iosfwd>
+
#include <OverlayUnidraw/ovimport.h>
class MapImportCmd : public OvImportCmd {
Index: MapUnidraw/mapkit.c
diff -c MapUnidraw/mapkit.c:1.1 MapUnidraw/mapkit.c:1.2
*** MapUnidraw/mapkit.c:1.1 Thu Dec 20 10:50:04 2001
--- src/MapUnidraw/mapkit.c Fri May 17 13:46:41 2002
***************
*** 122,127 ****
--- 122,129 ----
#include <IVGlyph/exportchooser.h>
#include <IVGlyph/importchooser.h>
+ #include <string.h>
+
/******************************************************************************/
static const int unit = 15;
Index: MapUnidraw/mapproj.c
diff -c MapUnidraw/mapproj.c:1.1 MapUnidraw/mapproj.c:1.2
*** MapUnidraw/mapproj.c:1.1 Thu Dec 20 10:50:04 2001
--- src/MapUnidraw/mapproj.c Fri May 17 13:46:41 2002
***************
*** 32,37 ****
--- 32,38 ----
#include <InterViews/session.h>
#include <InterViews/window.h>
#include <stdio.h>
+ #include <string.h>
struct pnode {
char* name;
Index: MapUnidraw/mapps.h
diff -c MapUnidraw/mapps.h:1.1 MapUnidraw/mapps.h:1.2
*** MapUnidraw/mapps.h:1.1 Thu Dec 20 10:50:04 2001
--- src/MapUnidraw/mapps.h Fri May 17 13:46:41 2002
***************
*** 24,29 ****
--- 24,31 ----
#ifndef mapps_h
#define mapps_h
+ #include <iosfwd>
+
#include <OverlayUnidraw/ovpsview.h>
class MapFeatureComp;
Index: MapUnidraw/maproute.c
diff -c MapUnidraw/maproute.c:1.1 MapUnidraw/maproute.c:1.2
*** MapUnidraw/maproute.c:1.1 Thu Dec 20 10:50:04 2001
--- src/MapUnidraw/maproute.c Fri May 17 13:46:41 2002
***************
*** 149,155 ****
PSColor* col = catalog->FindColor("Red");
gs.SetColors(col, col);
! double* x, *y;
int n = feature->points(x, y);
Coord* ix = new Coord[n];
Coord* iy = new Coord[n];
--- 149,155 ----
PSColor* col = catalog->FindColor("Red");
gs.SetColors(col, col);
! const double* x, *y;
int n = feature->points(x, y);
Coord* ix = new Coord[n];
Coord* iy = new Coord[n];
***************
*** 176,182 ****
Graphic* gr = GetGraphic();
gr->SetTransformer(new Transformer(mapviewstate->deftrans()));
! double *x, *y;
int npts = element->points(x, y);
int* ix = new int[npts];
int* iy = new int[npts];
--- 176,182 ----
Graphic* gr = GetGraphic();
gr->SetTransformer(new Transformer(mapviewstate->deftrans()));
! const double *x, *y;
int npts = element->points(x, y);
int* ix = new int[npts];
int* iy = new int[npts];
***************
*** 206,212 ****
boolean MapRouteScript::Definition (ostream& out) {
MapRouteComp* comp = (MapRouteComp*)GetSubject();
! double* x, *y;
MapElement* element = (MapElement*)comp->feature();
int n = element->points(x, y);
out << "route(";
--- 206,212 ----
boolean MapRouteScript::Definition (ostream& out) {
MapRouteComp* comp = (MapRouteComp*)GetSubject();
! const double* x, *y;
MapElement* element = (MapElement*)comp->feature();
int n = element->points(x, y);
out << "route(";
***************
*** 219,225 ****
}
for (int j=i; j<i+linemax && j<n; j++) {
if (j!=i) out << ",";
! out.form( "%.6f,%.6f", x[j], y[j] );
}
}
Attributes(out);
--- 219,225 ----
}
for (int j=i; j<i+linemax && j<n; j++) {
if (j!=i) out << ",";
! out_form2( out, "%.6f,%.6f", x[j], y[j] );
}
}
Attributes(out);
Index: MapUnidraw/maproute.h
diff -c MapUnidraw/maproute.h:1.1 MapUnidraw/maproute.h:1.2
*** MapUnidraw/maproute.h:1.1 Thu Dec 20 10:50:04 2001
--- src/MapUnidraw/maproute.h Fri May 17 13:46:41 2002
***************
*** 24,29 ****
--- 24,31 ----
#ifndef routecomps_h
#define routecomps_h
+ #include <iosfwd>
+
#include <MapUnidraw/mapviews.h>
#include <MapUnidraw/mapinspect.h>
#include <MapUnidraw/mapscripts.h>
Index: MapUnidraw/mapscripts.c
diff -c MapUnidraw/mapscripts.c:1.1 MapUnidraw/mapscripts.c:1.2
*** MapUnidraw/mapscripts.c:1.1 Thu Dec 20 10:50:04 2001
--- src/MapUnidraw/mapscripts.c Fri May 17 13:46:41 2002
***************
*** 594,600 ****
fstr="point(%.2f,%.2f";
} else
fstr="point(%.6f,%.6f";
! out.form(fstr, tx, ty);
} else
out << "ellipse(" << Math::round(point->xorigin()) << ","
<< Math::round(point->yorigin()) << "10,10";
--- 594,600 ----
fstr="point(%.2f,%.2f";
} else
fstr="point(%.6f,%.6f";
! out_form2(out, fstr, tx, ty);
} else
out << "ellipse(" << Math::round(point->xorigin()) << ","
<< Math::round(point->yorigin()) << "10,10";
***************
*** 621,627 ****
fstr="(%.2f,%.2f)";
} else
fstr="(%.6f,%.6f)";
! out.form(fstr, tx, ty);
}
else
out << "(" << Math::round(fx[i]) << "," << Math::round(fy[i]) << ")";
--- 621,627 ----
fstr="(%.2f,%.2f)";
} else
fstr="(%.6f,%.6f)";
! out_form2(out, fstr, tx, ty);
}
else
out << "(" << Math::round(fx[i]) << "," << Math::round(fy[i]) << ")";
***************
*** 650,656 ****
fstr="(%.2f,%.2f)";
} else
fstr="(%.6f,%.6f)";
! out.form(fstr, tx, ty);
}
else
out << "(" << Math::round(fx[i]) << "," << Math::round(fy[i]) << ")";
--- 650,656 ----
fstr="(%.2f,%.2f)";
} else
fstr="(%.6f,%.6f)";
! out_form2(out, fstr, tx, ty);
}
else
out << "(" << Math::round(fx[i]) << "," << Math::round(fy[i]) << ")";
***************
*** 670,676 ****
fstr="text(%.2f,%.2f";
} else
fstr="text(%.6f,%.6f";
! out.form(fstr, tx, ty);
out << ", \"" << text->text() << "\"";
}
break;
--- 670,676 ----
fstr="text(%.2f,%.2f";
} else
fstr="text(%.6f,%.6f";
! out_form2(out, fstr, tx, ty);
out << ", \"" << text->text() << "\"";
}
break;
***************
*** 687,693 ****
fstr="junction(%.2f,%.2f";
} else
fstr="junction(%.6f,%.6f";
! out.form(fstr, tx, ty);
}
else
out << "ellipse(" << Math::round(node->xorigin()) << ","
--- 687,693 ----
fstr="junction(%.2f,%.2f";
} else
fstr="junction(%.6f,%.6f";
! out_form2(out, fstr, tx, ty);
}
else
out << "ellipse(" << Math::round(node->xorigin()) << ","
***************
*** 908,918 ****
float px2 = data.u;
float py2 = data.v;
}
- out.form("\n :sw_e %.6f :sw_n %.6f :ne_e %.6f :ne_n %.6f",
#if 0
px1, py1, px2, py2); // project extent
#else
! x1, y1, x2, y2); // already projected extent
#endif
}
out << "\n :mapfc \"" << fclass->name() << "\"";
--- 908,919 ----
float px2 = data.u;
float py2 = data.v;
}
#if 0
+ out_form4(out, "\n :sw_e %.6f :sw_n %.6f :ne_e %.6f :ne_n %.6f",
px1, py1, px2, py2); // project extent
#else
! out_form4(out, "\n :sw_e %.6f :sw_n %.6f :ne_e %.6f :ne_n %.6f",
! x1, y1, x2, y2); // already projected extent
#endif
}
out << "\n :mapfc \"" << fclass->name() << "\"";
Index: MapUnidraw/mapscripts.h
diff -c MapUnidraw/mapscripts.h:1.1 MapUnidraw/mapscripts.h:1.2
*** MapUnidraw/mapscripts.h:1.1 Thu Dec 20 10:50:04 2001
--- src/MapUnidraw/mapscripts.h Fri May 17 13:46:41 2002
***************
*** 24,29 ****
--- 24,31 ----
#ifndef mapscripts_h
#define mapscripts_h
+ #include <iosfwd>
+
#include <OverlayUnidraw/scriptview.h>
#include <FrameUnidraw/framescripts.h>
Index: MapUnidraw/mapstatecmds.c
diff -c MapUnidraw/mapstatecmds.c:1.1 MapUnidraw/mapstatecmds.c:1.2
*** MapUnidraw/mapstatecmds.c:1.1 Thu Dec 20 10:50:04 2001
--- src/MapUnidraw/mapstatecmds.c Fri May 17 13:46:41 2002
***************
*** 33,38 ****
--- 33,39 ----
#include <InterViews/session.h>
#include <InterViews/window.h>
#include <stdio.h>
+ #include <string.h>
ClassId MapLibCmd::GetClassId () { return MAPLIB_CMD; }
Index: MapUnidraw/mapviews.c
diff -c MapUnidraw/mapviews.c:1.1 MapUnidraw/mapviews.c:1.2
*** MapUnidraw/mapviews.c:1.1 Thu Dec 20 10:50:04 2001
--- src/MapUnidraw/mapviews.c Fri May 17 13:46:41 2002
***************
*** 62,67 ****
--- 62,69 ----
#include <Attribute/attrlist.h>
#include <Attribute/attrvalue.h>
+ #include <OS/math.h>
+
#include <iostream.h>
***************
*** 116,130 ****
data.v = fyf;
}
! ix[i] = round(data.u);
! iy[i] = round(data.v);
} else {
float fxf = fx[i];
float fyf = fy[i];
if (t && !t->identity())
t->Transform(fxf, fyf, fxf, fyf);
! ix[i] = round(fxf * scale);
! iy[i] = round(fyf * scale);
}
}
}
--- 118,132 ----
data.v = fyf;
}
! ix[i] = Math::round(data.u);
! iy[i] = Math::round(data.v);
} else {
float fxf = fx[i];
float fyf = fy[i];
if (t && !t->identity())
t->Transform(fxf, fyf, fxf, fyf);
! ix[i] = Math::round(fxf * scale);
! iy[i] = Math::round(fyf * scale);
}
}
}
***************
*** 209,216 ****
else
radius = (int)(4 * (1.0 / a00 * 0.5));
((SF_Ellipse*)gr)->SetOriginal(ix[0], iy[0],
! round(radius/mag),
! round(radius/mag));
IncurDamage(gr);
}
break;
--- 211,218 ----
else
radius = (int)(4 * (1.0 / a00 * 0.5));
((SF_Ellipse*)gr)->SetOriginal(ix[0], iy[0],
! Math::round(radius/mag),
! Math::round(radius/mag));
IncurDamage(gr);
}
break;
***************
*** 307,314 ****
else
radius = (int)(4 * (1.0 / a00 * 0.5));
((SF_Ellipse*)gr)->SetOriginal(ix[0], iy[0],
! round(radius/mag),
! round(radius/mag));
IncurDamage(gr);
}
break;
--- 309,316 ----
else
radius = (int)(4 * (1.0 / a00 * 0.5));
((SF_Ellipse*)gr)->SetOriginal(ix[0], iy[0],
! Math::round(radius/mag),
! Math::round(radius/mag));
IncurDamage(gr);
}
break;
Index: VpfUnidraw/Imakefile
diff -c VpfUnidraw/Imakefile:1.1 VpfUnidraw/Imakefile:1.2
*** VpfUnidraw/Imakefile:1.1 Thu Dec 20 10:50:08 2001
--- src/VpfUnidraw/Imakefile Fri May 17 13:46:42 2002
***************
*** 27,33 ****
Obj26(vpftilesel)
Obj26(vpfviewstate)
! #define Obj31(file) MakeObjectFromSrcFlags(file, -Uiv2_6_compatible -I$(IVTOOLSSRC)/include $(TOP_CCINCLUDES))
Obj31(vpfcmds)
Obj31(vpfgaz)
--- 27,33 ----
Obj26(vpftilesel)
Obj26(vpfviewstate)
! #define Obj31(file) MakeObjectFromSrcFlags(file, -Div2_6_incompatible -I$(IVTOOLSSRC)/include $(TOP_CCINCLUDES))
Obj31(vpfcmds)
Obj31(vpfgaz)
Index: VpfUnidraw/vpfcatalog.c
diff -c VpfUnidraw/vpfcatalog.c:1.1 VpfUnidraw/vpfcatalog.c:1.2
*** VpfUnidraw/vpfcatalog.c:1.1 Thu Dec 20 10:50:08 2001
--- src/VpfUnidraw/vpfcatalog.c Fri May 17 13:46:42 2002
***************
*** 33,38 ****
--- 33,41 ----
#include <stream.h>
#include <ctype.h>
+ #if __GNUG__>=3
+ #include <fstream.h>
+ #endif
/*****************************************************************************/
Index: VpfUnidraw/vpfcomps.h
diff -c VpfUnidraw/vpfcomps.h:1.1 VpfUnidraw/vpfcomps.h:1.2
*** VpfUnidraw/vpfcomps.h:1.1 Thu Dec 20 10:50:08 2001
--- src/VpfUnidraw/vpfcomps.h Fri May 17 13:46:42 2002
***************
*** 24,29 ****
--- 24,31 ----
#ifndef vpfcomps_h
#define vpfcomps_h
+ #include <iosfwd>
+
#include <MapUnidraw/mapcomps.h>
#include <MapUnidraw/mapviews.h>
***************
*** 55,61 ****
int _ntiles;
OverlaysComp** _tcomps;
char* _tmpname;
! friend VpfFClassScript;
protected:
ParamList* GetParamList();
void GrowParamList(ParamList*);
--- 57,63 ----
int _ntiles;
OverlaysComp** _tcomps;
char* _tmpname;
! friend class VpfFClassScript;
protected:
ParamList* GetParamList();
void GrowParamList(ParamList*);
Index: VpfUnidraw/vpfcreator.h
diff -c VpfUnidraw/vpfcreator.h:1.1 VpfUnidraw/vpfcreator.h:1.2
*** VpfUnidraw/vpfcreator.h:1.1 Thu Dec 20 10:50:08 2001
--- src/VpfUnidraw/vpfcreator.h Fri May 17 13:46:43 2002
***************
*** 24,29 ****
--- 24,31 ----
#ifndef vpfcreator_h
#define vpfcreator_h
+ #include <iosfwd>
+
#include <MapUnidraw/mapcreator.h>
class VpfCreator : public MapCreator {
Index: VpfUnidraw/vpfedtile.h
diff -c VpfUnidraw/vpfedtile.h:1.1 VpfUnidraw/vpfedtile.h:1.2
*** VpfUnidraw/vpfedtile.h:1.1 Thu Dec 20 10:50:08 2001
--- src/VpfUnidraw/vpfedtile.h Fri May 17 13:46:43 2002
***************
*** 48,54 ****
VpfFeature** _tiles;
int _ntiles;
! friend VpfTileKit;
};
#endif
--- 48,54 ----
VpfFeature** _tiles;
int _ntiles;
! friend class VpfTileKit;
};
#endif
Index: VpfUnidraw/vpfscripts.c
diff -c VpfUnidraw/vpfscripts.c:1.1 VpfUnidraw/vpfscripts.c:1.2
*** VpfUnidraw/vpfscripts.c:1.1 Thu Dec 20 10:50:08 2001
--- src/VpfUnidraw/vpfscripts.c Fri May 17 13:46:43 2002
***************
*** 594,603 ****
float px2 = data.u;
float py2 = data.v;
// }
- out.form("\n :sw_e %.4f :sw_n %.4f :ne_e %.4f :ne_n %.4f",
#if 1
px1, py1, px2, py2); // project extent
#else
x1, y1, x2, y2); // already projected extent
#endif
--- 594,604 ----
float px2 = data.u;
float py2 = data.v;
// }
#if 1
+ out_form4(out, "\n :sw_e %.4f :sw_n %.4f :ne_e %.4f :ne_n %.4f",
px1, py1, px2, py2); // project extent
#else
+ out_form4(out, "\n :sw_e %.4f :sw_n %.4f :ne_e %.4f :ne_n %.4f",
x1, y1, x2, y2); // already projected extent
#endif
Index: VpfUnidraw/vpfscripts.h
diff -c VpfUnidraw/vpfscripts.h:1.1 VpfUnidraw/vpfscripts.h:1.2
*** VpfUnidraw/vpfscripts.h:1.1 Thu Dec 20 10:50:08 2001
--- src/VpfUnidraw/vpfscripts.h Fri May 17 13:46:43 2002
***************
*** 24,29 ****
--- 24,31 ----
#ifndef vpfscripts_h
#define vpfscripts_h
+ #include <iosfwd>
+
#include <MapUnidraw/mapscripts.h>
class VpfFClassComp;
Index: VpfUnidraw/vpfviewstate.c
diff -c VpfUnidraw/vpfviewstate.c:1.1 VpfUnidraw/vpfviewstate.c:1.2
*** VpfUnidraw/vpfviewstate.c:1.1 Thu Dec 20 10:50:08 2001
--- src/VpfUnidraw/vpfviewstate.c Fri May 17 13:46:43 2002
***************
*** 36,41 ****
--- 36,42 ----
#include <InterViews/transformer.h>
#include <limits.h>
+ #include <string.h>
/****************************************************************************/
***************
*** 101,108 ****
data.u = xmin * DEG_TO_RAD;
data.v = ymin * DEG_TO_RAD;
data = pj_fwd(data, p);
! int x = round(data.u);
! int y = round(data.v);
Transformer* trans = new Transformer(scale,
0.0,
0.0,
--- 102,109 ----
data.u = xmin * DEG_TO_RAD;
data.v = ymin * DEG_TO_RAD;
data = pj_fwd(data, p);
! int x = (int)round(data.u);
! int y = (int)round(data.v);
Transformer* trans = new Transformer(scale,
0.0,
0.0,
Index: vpfviewer/main.c
diff -c vpfviewer/main.c:1.1 vpfviewer/main.c:1.2
*** vpfviewer/main.c:1.1 Thu Dec 20 10:50:10 2001
--- src/vpfviewer/main.c Fri May 17 13:46:44 2002
***************
*** 39,44 ****
--- 39,45 ----
#include <InterViews/world.h>
#ifdef HAVE_ACE
+ #include <signal.h>
#include <ace/OS.h>
#endif
Index: DlgUnidraw/Imakefile
diff -c DlgUnidraw/Imakefile:1.1 DlgUnidraw/Imakefile:1.2
*** DlgUnidraw/Imakefile:1.1 Thu Dec 20 10:50:14 2001
--- src/DlgUnidraw/Imakefile Fri May 17 13:46:45 2002
***************
*** 25,31 ****
Obj26(dlgscripts)
Obj26(dlgviewstate)
! #define Obj31(file) MakeObjectFromSrcFlags(file, -Uiv2_6_compatible -I$(IVTOOLSSRC)/include $(TOP_CCINCLUDES))
Obj31(dlgkit)
--- 25,31 ----
Obj26(dlgscripts)
Obj26(dlgviewstate)
! #define Obj31(file) MakeObjectFromSrcFlags(file, -Div2_6_incompatible -I$(IVTOOLSSRC)/include $(TOP_CCINCLUDES))
Obj31(dlgkit)
Index: DlgUnidraw/dlgcatalog.c
diff -c DlgUnidraw/dlgcatalog.c:1.1 DlgUnidraw/dlgcatalog.c:1.2
*** DlgUnidraw/dlgcatalog.c:1.1 Thu Dec 20 10:50:14 2001
--- src/DlgUnidraw/dlgcatalog.c Fri May 17 13:46:45 2002
***************
*** 33,38 ****
--- 33,41 ----
#include <stream.h>
#include <ctype.h>
+ #if __GNUG__>=3
+ #include <fstream.h>
+ #endif
/*****************************************************************************/
Index: DlgUnidraw/dlgcomps.h
diff -c DlgUnidraw/dlgcomps.h:1.1 DlgUnidraw/dlgcomps.h:1.2
*** DlgUnidraw/dlgcomps.h:1.1 Thu Dec 20 10:50:14 2001
--- src/DlgUnidraw/dlgcomps.h Fri May 17 13:46:45 2002
***************
*** 24,29 ****
--- 24,31 ----
#ifndef dlgcomps_h
#define dlgcomps_h
+ #include <iosfwd>
+
#include <MapUnidraw/mapcomps.h>
#include <MapUnidraw/mapviews.h>
Index: DlgUnidraw/dlgcreator.h
diff -c DlgUnidraw/dlgcreator.h:1.1 DlgUnidraw/dlgcreator.h:1.2
*** DlgUnidraw/dlgcreator.h:1.1 Thu Dec 20 10:50:14 2001
--- src/DlgUnidraw/dlgcreator.h Fri May 17 13:46:45 2002
***************
*** 24,29 ****
--- 24,31 ----
#ifndef dlgcreator_h
#define dlgcreator_h
+ #include <iosfwd>
+
#include <MapUnidraw/mapcreator.h>
class DlgCreator : public MapCreator {
Index: DlgUnidraw/dlgeditor.h
diff -c DlgUnidraw/dlgeditor.h:1.1 DlgUnidraw/dlgeditor.h:1.2
*** DlgUnidraw/dlgeditor.h:1.1 Thu Dec 20 10:50:14 2001
--- src/DlgUnidraw/dlgeditor.h Fri May 17 13:46:45 2002
***************
*** 48,54 ****
protected:
virtual void InitMapComp();
! friend DlgKit;
};
#endif
--- 48,54 ----
protected:
virtual void InitMapComp();
! friend class DlgKit;
};
#endif
Index: DlgUnidraw/dlgscripts.h
diff -c DlgUnidraw/dlgscripts.h:1.1 DlgUnidraw/dlgscripts.h:1.2
*** DlgUnidraw/dlgscripts.h:1.1 Thu Dec 20 10:50:14 2001
--- src/DlgUnidraw/dlgscripts.h Fri May 17 13:46:45 2002
***************
*** 24,29 ****
--- 24,31 ----
#ifndef dlgscripts_h
#define dlgscripts_h
+ #include <iosfwd>
+
#include <MapUnidraw/mapscripts.h>
class DlgFClassComp;
Index: UtmUnidraw/Imakefile
diff -c UtmUnidraw/Imakefile:1.1 UtmUnidraw/Imakefile:1.2
*** UtmUnidraw/Imakefile:1.1 Thu Dec 20 10:50:26 2001
--- src/UtmUnidraw/Imakefile Fri May 17 13:46:47 2002
***************
*** 20,30 ****
Obj26(utmcmds)
Obj26(utmeditor)
! #define Obj31(file) MakeObjectFromSrcFlags(file, -Uiv2_6_compatible -I$(IVTOOLSSRC)/include $(TOP_CCINCLUDES))
Obj31(utmkit)
! #define Obj_ACE(file) MakeObjectFromSrcFlags(file, -D__ACE_INLINE__ -Uiv2_6_compatible -I$(IVTOOLSSRC)/include $(TOP_CCINCLUDES))
Obj_ACE(utmfunc)
--- 20,30 ----
Obj26(utmcmds)
Obj26(utmeditor)
! #define Obj31(file) MakeObjectFromSrcFlags(file, -Div2_6_incompatible -I$(IVTOOLSSRC)/include $(TOP_CCINCLUDES))
Obj31(utmkit)
! #define Obj_ACE(file) MakeObjectFromSrcFlags(file, -D__ACE_INLINE__ -Div2_6_incompatible -I$(IVTOOLSSRC)/include $(TOP_CCINCLUDES))
Obj_ACE(utmfunc)
Index: ProjUnidraw/Imakefile
diff -c ProjUnidraw/Imakefile:1.1 ProjUnidraw/Imakefile:1.2
*** ProjUnidraw/Imakefile:1.1 Thu Dec 20 10:50:51 2001
--- src/ProjUnidraw/Imakefile Fri May 17 13:46:49 2002
***************
*** 20,26 ****
Obj26(projcmds)
Obj26(projeditor)
! #define Obj31(file) MakeObjectFromSrcFlags(file, -Uiv2_6_compatible -I$(IVTOOLSSRC)/include $(TOP_CCINCLUDES))
Obj31(projkit)
--- 20,26 ----
Obj26(projcmds)
Obj26(projeditor)
! #define Obj31(file) MakeObjectFromSrcFlags(file, -Div2_6_incompatible -I$(IVTOOLSSRC)/include $(TOP_CCINCLUDES))
Obj31(projkit)
Index: Vehicle/algebra3.h
diff -c Vehicle/algebra3.h:1.1 Vehicle/algebra3.h:1.2
*** Vehicle/algebra3.h:1.1 Thu Dec 20 10:50:57 2001
--- src/Vehicle/algebra3.h Fri May 17 13:46:50 2002
***************
*** 25,30 ****
--- 25,32 ----
#ifndef ALGEBRA3H
#define ALGEBRA3H
+ #include <iosfwd>
+
#include <stdlib.h>
#include <assert.h>
//#include <yvals.h>
***************
*** 132,138 ****
#ifdef ALGEBRA3IOSTREAMS
friend ostream& operator << (ostream& s, const vec2& v); // output to stream
friend istream& operator >> (istream& s, vec2& v); // input from strm.
! #endif ALGEBRA3IOSTREAMS
friend void swap(vec2& a, vec2& b); // swap v1 & v2
friend vec2 vec2min(const vec2& a, const vec2& b); // min(v1, v2)
--- 134,140 ----
#ifdef ALGEBRA3IOSTREAMS
friend ostream& operator << (ostream& s, const vec2& v); // output to stream
friend istream& operator >> (istream& s, vec2& v); // input from strm.
! #endif // ALGEBRA3IOSTREAMS
friend void swap(vec2& a, vec2& b); // swap v1 & v2
friend vec2 vec2min(const vec2& a, const vec2& b); // min(v1, v2)
Index: VhclServ/vhclcomps.h
diff -c VhclServ/vhclcomps.h:1.1 VhclServ/vhclcomps.h:1.2
*** VhclServ/vhclcomps.h:1.1 Thu Dec 20 10:51:01 2001
--- src/VhclServ/vhclcomps.h Fri May 17 13:46:52 2002
***************
*** 24,29 ****
--- 24,31 ----
#ifndef vhclcomps_h
#define vhclcomps_h
+ #include <iosfwd>
+
#include <OverlayUnidraw/ovcomps.h>
#include <OverlayUnidraw/scriptview.h>
Index: VhclServ/vhclcreator.h
diff -c VhclServ/vhclcreator.h:1.1 VhclServ/vhclcreator.h:1.2
*** VhclServ/vhclcreator.h:1.1 Thu Dec 20 10:51:01 2001
--- src/VhclServ/vhclcreator.h Fri May 17 13:46:52 2002
***************
*** 24,29 ****
--- 24,31 ----
#ifndef vhclcreator_h
#define vhclcreator_h
+ #include <iosfwd>
+
#include <OverlayUnidraw/ovcreator.h>
class VhclCreator : public OverlayCreator {
Index: VhclUnidraw/Imakefile
diff -c VhclUnidraw/Imakefile:1.1 VhclUnidraw/Imakefile:1.2
*** VhclUnidraw/Imakefile:1.1 Thu Dec 20 10:51:08 2001
--- src/VhclUnidraw/Imakefile Fri May 17 13:46:53 2002
***************
*** 20,32 ****
Obj26(vhcleditor)
Obj26(vhclmapcreator)
! #define Obj31(file) MakeObjectFromSrcFlags(file, -Uiv2_6_compatible -I$(IVTOOLSSRC)/include $(TOP_CCINCLUDES))
Obj31(vhclabout)
Obj31(vhclkit)
Obj31(vhclstates)
! #define Obj_ACE(file) MakeObjectFromSrcFlags(file, -D__ACE_INLINE__ -Uiv2_6_compatible -I$(IVTOOLSSRC)/include $(TOP_CCINCLUDES))
IncludeDependencies()
--- 20,32 ----
Obj26(vhcleditor)
Obj26(vhclmapcreator)
! #define Obj31(file) MakeObjectFromSrcFlags(file, -Div2_6_incompatible -I$(IVTOOLSSRC)/include $(TOP_CCINCLUDES))
Obj31(vhclabout)
Obj31(vhclkit)
Obj31(vhclstates)
! #define Obj_ACE(file) MakeObjectFromSrcFlags(file, -D__ACE_INLINE__ -Div2_6_incompatible -I$(IVTOOLSSRC)/include $(TOP_CCINCLUDES))
IncludeDependencies()
Index: VhclUnidraw/vhclmapcreator.h
diff -c VhclUnidraw/vhclmapcreator.h:1.1 VhclUnidraw/vhclmapcreator.h:1.2
*** VhclUnidraw/vhclmapcreator.h:1.1 Thu Dec 20 10:51:08 2001
--- src/VhclUnidraw/vhclmapcreator.h Fri May 17 13:46:53 2002
***************
*** 24,29 ****
--- 24,31 ----
#ifndef vhclmapcreator_h
#define vhclmapcreator_h
+ #include <iosfwd>
+
#include <MapUnidraw/mapcreator.h>
class VhclMapCreator : public MapCreator {
Index: config_vhclmaps/local.def
diff -c config_vhclmaps/local.def:1.1 config_vhclmaps/local.def:1.2
*** config_vhclmaps/local.def:1.1 Thu Dec 20 10:51:22 2001
--- config/local.def Fri May 17 13:46:55 2002
***************
*** 278,281 ****
--- 278,284 ----
#undef UseInstalled
+ /* substitute C compiler for makedepend */
+ #define DependCmd CCDriver -M
+
XCOMM -------------------------------------------------------------------------
Index: config_vhclmaps/params.def
diff -c config_vhclmaps/params.def:1.1 config_vhclmaps/params.def:1.2
*** config_vhclmaps/params.def:1.1 Thu Dec 20 10:51:22 2001
--- config/params.def Fri May 17 13:46:55 2002
***************
*** 443,449 ****
#ifndef AceCCDefines
#ifdef AceDir
! #define AceCCDefines -DHAVE_ACE
#else
#define AceCCDefines /**/
#endif
--- 443,449 ----
#ifndef AceCCDefines
#ifdef AceDir
! #define AceCCDefines -DHAVE_ACE -DACE_MT_SAFE=0
#else
#define AceCCDefines /**/
#endif
Index: config_vhclmaps/rules.def
diff -c config_vhclmaps/rules.def:1.1 config_vhclmaps/rules.def:1.2
*** config_vhclmaps/rules.def:1.1 Thu Dec 20 10:51:22 2001
--- config/rules.def Fri May 17 13:46:55 2002
***************
*** 441,447 ****
#ifndef DependTarget
#define DependTarget() @@\
depend:: @@\
! gcc -M $(DEPEND_CCFLAGS) $(SRCS) >Makefile.depend
#endif
/*
--- 441,447 ----
#ifndef DependTarget
#define DependTarget() @@\
depend:: @@\
! $(DEPEND) $(DEPEND_CCFLAGS) $(SRCS) >Makefile.depend
#endif
/*
*** /dev/null Fri May 17 13:46:57 PDT 2002
--- patches/vhclmaps-020517-johnston-033
*************** patches/vhclmaps-020517-johnston-033
*** 0 ****
--- 1 ----
+ vhclmaps-020517-johnston-033
|
|
From: <joh...@ie...> - 2000-06-12 18:34:32
|
Patch: vhclmaps-000611-johnston-032
For: vhclmaps-0.7.4
Author: joh...@us...
Subject: add back missing line to ProjUnidraw/projcmds.c
Requires:
This is an intermediate patch to vhclmaps-0.7.4. To apply, cd to the
top-level directory of the vhclmaps source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- add back missing line to ProjUnidraw/projcmds.c
Index: ProjUnidraw/projcmds.c
diff -c ProjUnidraw/projcmds.c:1.2 ProjUnidraw/projcmds.c:1.3
*** ProjUnidraw/projcmds.c:1.2 Sat Jun 10 01:53:52 2000
--- src/ProjUnidraw/projcmds.c Sun Jun 11 00:40:16 2000
***************
*** 75,80 ****
--- 75,82 ----
#include <ace/INET_Addr.h>
#endif
+ static const int unit = 15;
+
/*****************************************************************************/
ClassId ProjShowCmd::GetClassId () { return PROJSHOW_CMD; }
*** /dev/null Sun Jun 11 00:40:23 PDT 2000
--- patches/vhclmaps-000611-johnston-032
*************** patches/vhclmaps-000611-johnston-032
*** 0 ****
--- 1 ----
+ vhclmaps-000611-johnston-032
|
|
From: <joh...@ie...> - 2000-06-12 18:33:54
|
Patch: vhclmaps-000609-johnston-030
For: vhclmaps-0.7.4
Author: joh...@us...
Subject: fix up config and imake files for PROJ lib
Requires:
This is an intermediate patch to vhclmaps-0.7.4. To apply, cd to the
top-level directory of the vhclmaps source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- fix up the the config and imake (Imakefile) files to better locate
the include file and library file for PROJ-4.3.3. Before it required
installation under /usr/local
- disambiguate a call to ComTerp::run in MapServ/mapfunc.c
Index: top_vhclmaps/configure
diff -c top_vhclmaps/configure:1.4 top_vhclmaps/configure:1.5
*** top_vhclmaps/configure:1.4 Tue Mar 14 22:51:49 2000
--- ./configure Fri Jun 9 02:38:00 2000
***************
*** 779,785 ****
if test -f $PROJ/include/projects.h ; then
echo "$ac_t""Found projects.h in $PROJ/include " 1>&6
PROJ_LIBS=$PROJ/lib
! PROJ=$PROJ/include
else
{ echo "configure: error: Can not find projects.h in $PROJ given with option --with-proj=$PROJ " 1>&2; exit 1; }
fi
--- 779,785 ----
if test -f $PROJ/include/projects.h ; then
echo "$ac_t""Found projects.h in $PROJ/include " 1>&6
PROJ_LIBS=$PROJ/lib
! PROJ=$PROJ
else
{ echo "configure: error: Can not find projects.h in $PROJ given with option --with-proj=$PROJ " 1>&2; exit 1; }
fi
***************
*** 1584,1590 ****
else
ice_file=`grep '^# 1' conftest.ii | grep iostream.h | \
head -1 | sed 's/^.*"\(.*\)".*$/\1/'`
! ice_cv_cxx_include_dir=`echo $ice_file | sed 's%/[^/][^/]*$%%'`
fi
if test "$ice_cv_cxx_include_dir" = ""; then
ice_cv_cxx_include_dir="$prefix/include"
--- 1584,1590 ----
else
ice_file=`grep '^# 1' conftest.ii | grep iostream.h | \
head -1 | sed 's/^.*"\(.*\)".*$/\1/'`
! ice_cv_cxx_include_dir=`echo $ice_file | sed 's%iostream.h%%'`
fi
if test "$ice_cv_cxx_include_dir" = ""; then
ice_cv_cxx_include_dir="$prefix/include"
Index: top_vhclmaps/configure.in
diff -c top_vhclmaps/configure.in:1.6 top_vhclmaps/configure.in:1.7
*** top_vhclmaps/configure.in:1.6 Tue Mar 14 22:51:50 2000
--- ./configure.in Fri Jun 9 02:38:01 2000
***************
*** 188,194 ****
if test -f $PROJ/include/projects.h ; then
AC_MSG_RESULT( Found projects.h in $PROJ/include )
PROJ_LIBS=$PROJ/lib
! PROJ=$PROJ/include
else
AC_MSG_ERROR( Can not find projects.h in $PROJ given with option --with-proj=$PROJ )
fi
--- 188,194 ----
if test -f $PROJ/include/projects.h ; then
AC_MSG_RESULT( Found projects.h in $PROJ/include )
PROJ_LIBS=$PROJ/lib
! PROJ=$PROJ
else
AC_MSG_ERROR( Can not find projects.h in $PROJ given with option --with-proj=$PROJ )
fi
Index: Map/Imakefile
diff -c Map/Imakefile:1.2 Map/Imakefile:1.3
*** Map/Imakefile:1.2 Tue Jan 25 03:21:43 2000
--- src/Map/Imakefile Fri Jun 9 02:38:03 2000
***************
*** 8,13 ****
--- 8,16 ----
LIB = Map
+ OTHER_CCDEFINES = $(PROJ_CCDEFINES)
+ OTHER_CCINCLUDES = $(PROJ_CCINCLUDES)
+
Use_2_6()
MakeLibrary($(LIB),$(VERSION))
Index: Vpf/Imakefile
diff -c Vpf/Imakefile:1.2 Vpf/Imakefile:1.3
*** Vpf/Imakefile:1.2 Tue Jan 25 03:21:47 2000
--- src/Vpf/Imakefile Fri Jun 9 02:38:05 2000
***************
*** 8,13 ****
--- 8,16 ----
LIB = Vpf
+ OTHER_CCDEFINES = $(PROJ_CCDEFINES)
+ OTHER_CCINCLUDES = $(PROJ_CCINCLUDES)
+
Use_2_6()
MakeLibrary($(LIB),$(VERSION))
Index: Dlg/Imakefile
diff -c Dlg/Imakefile:1.2 Dlg/Imakefile:1.3
*** Dlg/Imakefile:1.2 Tue Jan 25 03:21:48 2000
--- src/Dlg/Imakefile Fri Jun 9 02:38:06 2000
***************
*** 8,13 ****
--- 8,16 ----
LIB = Dlg
+ OTHER_CCDEFINES = $(PROJ_CCDEFINES)
+ OTHER_CCINCLUDES = $(PROJ_CCINCLUDES)
+
Use_2_6()
MakeLibrary($(LIB),$(VERSION))
Index: Dem/Imakefile
diff -c Dem/Imakefile:1.2 Dem/Imakefile:1.3
*** Dem/Imakefile:1.2 Tue Jan 25 03:21:50 2000
--- src/Dem/Imakefile Fri Jun 9 02:38:08 2000
***************
*** 8,13 ****
--- 8,16 ----
LIB = Dem
+ OTHER_CCDEFINES = $(PROJ_CCDEFINES)
+ OTHER_CCINCLUDES = $(PROJ_CCINCLUDES)
+
Use_2_6()
MakeLibrary($(LIB),$(VERSION))
Index: dcwdemprint/Imakefile
diff -c dcwdemprint/Imakefile:1.1 dcwdemprint/Imakefile:1.2
*** dcwdemprint/Imakefile:1.1 Mon Aug 2 13:52:57 1999
--- src/utils/dcwdemprint/Imakefile Fri Jun 9 02:38:10 2000
***************
*** 11,16 ****
--- 11,20 ----
APP_CCDEPLIBS = $(DEPDEM) $(DEPTOPOFACE)
#endif
+ OTHER_CCDEFINES = $(PROJ_CCDEFINES)
+ OTHER_CCINCLUDES = $(PROJ_CCINCLUDES)
+ OTHER_CCLDLIBS = $(PROJ_CCLDLIBS)
+
Use_libUnidraw()
ComplexProgramTarget(dcwdemprint)
Index: vpftableprint/Imakefile
diff -c vpftableprint/Imakefile:1.1 vpftableprint/Imakefile:1.2
*** vpftableprint/Imakefile:1.1 Mon Aug 2 13:52:59 1999
--- src/utils/vpftableprint/Imakefile Fri Jun 9 02:38:12 2000
***************
*** 13,18 ****
--- 13,22 ----
APP_CCDEPLIBS = $(DEPVPF) $(DEPMAP) $(DEPATTRIBUTE) $(DEPCOMUTIL) $(DEPTOPOFACE) $(DEPVPFUTIL)
#endif
+ OTHER_CCDEFINES = $(PROJ_CCDEFINES)
+ OTHER_CCINCLUDES = $(PROJ_CCINCLUDES)
+ OTHER_CCLDLIBS = $(PROJ_CCLDLIBS)
+
Use_libUnidraw()
ComplexProgramTarget(vpftableprint)
Index: vpfdbprint/Imakefile
diff -c vpfdbprint/Imakefile:1.1 vpfdbprint/Imakefile:1.2
*** vpfdbprint/Imakefile:1.1 Mon Aug 2 13:53:01 1999
--- src/utils/vpfdbprint/Imakefile Fri Jun 9 02:38:13 2000
***************
*** 11,16 ****
--- 11,20 ----
APP_CCDEPLIBS = $(DEPVPF) $(DEPMAP) $(DEPATTRIBUTE) $(DEPCOMUTIL) $(DEPTOPOFACE) $(DEPVPFUTIL)
#endif
+ OTHER_CCDEFINES = $(PROJ_CCDEFINES)
+ OTHER_CCINCLUDES = $(PROJ_CCINCLUDES)
+ OTHER_CCLDLIBS = $(PROJ_CCLDLIBS)
+
Use_libUnidraw()
ComplexProgramTarget(vpfdbprint)
Index: usgsdemprint/Imakefile
diff -c usgsdemprint/Imakefile:1.1 usgsdemprint/Imakefile:1.2
*** usgsdemprint/Imakefile:1.1 Mon Aug 2 13:53:02 1999
--- src/utils/usgsdemprint/Imakefile Fri Jun 9 02:38:15 2000
***************
*** 11,16 ****
--- 11,20 ----
APP_CCDEPLIBS = $(DEPDEM) $(DEPTOPOFACE)
#endif
+ OTHER_CCDEFINES = $(PROJ_CCDEFINES)
+ OTHER_CCINCLUDES = $(PROJ_CCINCLUDES)
+ OTHER_CCLDLIBS = $(PROJ_CCLDLIBS)
+
Use_libUnidraw()
ComplexProgramTarget(usgsdemprint)
Index: MapUnidraw/Imakefile
diff -c MapUnidraw/Imakefile:1.2 MapUnidraw/Imakefile:1.3
*** MapUnidraw/Imakefile:1.2 Tue Jan 25 03:21:53 2000
--- src/MapUnidraw/Imakefile Fri Jun 9 02:38:17 2000
***************
*** 8,15 ****
LIB = MapUnidraw
! OTHER_CCDEFINES = $(CLIPPOLY_CCDEFINES) $(ACE_CCDEFINES)
! OTHER_CCINCLUDES = $(CLIPPOLY_CCINCLUDES) $(ACE_CCINCLUDES)
Use_2_6()
--- 8,15 ----
LIB = MapUnidraw
! OTHER_CCDEFINES = $(CLIPPOLY_CCDEFINES) $(ACE_CCDEFINES) $(PROJ_CCDEFINES)
! OTHER_CCINCLUDES = $(CLIPPOLY_CCINCLUDES) $(ACE_CCINCLUDES) $(PROJ_CCINCLUDES)
Use_2_6()
Index: VpfUnidraw/Imakefile
diff -c VpfUnidraw/Imakefile:1.2 VpfUnidraw/Imakefile:1.3
*** VpfUnidraw/Imakefile:1.2 Tue Jan 25 03:21:56 2000
--- src/VpfUnidraw/Imakefile Fri Jun 9 02:38:20 2000
***************
*** 8,15 ****
LIB = VpfUnidraw
! OTHER_CCDEFINES = $(CLIPPOLY_CCDEFINES) $(ACE_CCDEFINES)
! OTHER_CCINCLUDES = $(CLIPPOLY_CCINCLUDES) $(ACE_CCINCLUDES)
MakeLibrary($(LIB),$(VERSION))
--- 8,15 ----
LIB = VpfUnidraw
! OTHER_CCDEFINES = $(CLIPPOLY_CCDEFINES) $(ACE_CCDEFINES) $(PROJ_CCDEFINES)
! OTHER_CCINCLUDES = $(CLIPPOLY_CCINCLUDES) $(ACE_CCINCLUDES) $(PROJ_CCINCLUDES)
MakeLibrary($(LIB),$(VERSION))
Index: vpfviewer/Imakefile
diff -c vpfviewer/Imakefile:1.1 vpfviewer/Imakefile:1.2
*** vpfviewer/Imakefile:1.1 Mon Aug 2 13:53:14 1999
--- src/vpfviewer/Imakefile Fri Jun 9 02:38:22 2000
***************
*** 46,54 ****
$(DEPIVGLYPH)
#endif
! OTHER_CCDEFINES = $(ACE_CCDEFINES)
! OTHER_CCINCLUDES = $(ACE_CCINCLUDES)
! OTHER_CCLDLIBS = $(CLIPPOLY_CCLDLIBS) $(ACE_CCLDLIBS)
Use_libUnidraw()
Use_2_6()
--- 46,54 ----
$(DEPIVGLYPH)
#endif
! OTHER_CCDEFINES = $(ACE_CCDEFINES) $(PROJ_CCDEFINES)
! OTHER_CCINCLUDES = $(ACE_CCINCLUDES) $(PROJ_CCINCLUDES)
! OTHER_CCLDLIBS = $(CLIPPOLY_CCLDLIBS) $(ACE_CCLDLIBS) $(PROJ_CCLDLIBS)
Use_libUnidraw()
Use_2_6()
Index: DlgUnidraw/Imakefile
diff -c DlgUnidraw/Imakefile:1.2 DlgUnidraw/Imakefile:1.3
*** DlgUnidraw/Imakefile:1.2 Tue Jan 25 03:21:58 2000
--- src/DlgUnidraw/Imakefile Fri Jun 9 02:38:23 2000
***************
*** 8,15 ****
LIB = DlgUnidraw
! OTHER_CCDEFINES = $(CLIPPOLY_CCDEFINES) $(ACE_CCDEFINES)
! OTHER_CCINCLUDES = $(CLIPPOLY_CCINCLUDES) $(ACE_CCINCLUDES)
MakeLibrary($(LIB),$(VERSION))
--- 8,15 ----
LIB = DlgUnidraw
! OTHER_CCDEFINES = $(CLIPPOLY_CCDEFINES) $(ACE_CCDEFINES) $(PROJ_CCDEFINES)
! OTHER_CCINCLUDES = $(CLIPPOLY_CCINCLUDES) $(ACE_CCINCLUDES) $(PROJ_CCINCLUDES)
MakeLibrary($(LIB),$(VERSION))
Index: dlgviewer/Imakefile
diff -c dlgviewer/Imakefile:1.1 dlgviewer/Imakefile:1.2
*** dlgviewer/Imakefile:1.1 Mon Aug 2 13:53:18 1999
--- src/dlgviewer/Imakefile Fri Jun 9 02:38:25 2000
***************
*** 43,51 ****
$(DEPIVGLYPH)
#endif
! OTHER_CCDEFINES = $(ACE_CCDEFINES)
! OTHER_CCINCLUDES = $(ACE_CCINCLUDES)
! OTHER_CCLDLIBS = $(CLIPPOLY_CCLDLIBS) $(ACE_CCLDLIBS)
Use_libUnidraw()
Use_2_6()
--- 43,51 ----
$(DEPIVGLYPH)
#endif
! OTHER_CCDEFINES = $(ACE_CCDEFINES) $(PROJ_CCDEFINES)
! OTHER_CCINCLUDES = $(ACE_CCINCLUDES) $(PROJ_CCINCLUDES)
! OTHER_CCLDLIBS = $(CLIPPOLY_CCLDLIBS) $(ACE_CCLDLIBS) $(PROJ_CCLDLIBS)
Use_libUnidraw()
Use_2_6()
Index: MapServ/Imakefile
diff -c MapServ/Imakefile:1.3 MapServ/Imakefile:1.4
*** MapServ/Imakefile:1.3 Fri Apr 7 04:24:53 2000
--- src/MapServ/Imakefile Fri Jun 9 02:38:27 2000
***************
*** 8,15 ****
LIB = MapServ
! OTHER_CCDEFINES = $(CLIPPOLY_CCDEFINES) $(ACE_CCDEFINES)
! OTHER_CCINCLUDES = $(CLIPPOLY_CCINCLUDES) $(ACE_CCINCLUDES)
Use_2_6()
--- 8,15 ----
LIB = MapServ
! OTHER_CCDEFINES = $(CLIPPOLY_CCDEFINES) $(ACE_CCDEFINES) $(PROJ_CCDEFINES)
! OTHER_CCINCLUDES = $(CLIPPOLY_CCINCLUDES) $(ACE_CCINCLUDES) $(PROJ_CCINCLUDES)
Use_2_6()
Index: MapServ/mapfunc.c
diff -c MapServ/mapfunc.c:1.4 MapServ/mapfunc.c:1.5
*** MapServ/mapfunc.c:1.4 Fri Mar 24 23:20:54 2000
--- src/MapServ/mapfunc.c Fri Jun 9 02:38:27 2000
***************
*** 1574,1580 ****
for (fccomp->First(i); !fccomp->Done(i); fccomp->Next(i)) {
MapFeatureComp* fcomp = (MapFeatureComp*)fccomp->GetComp(i);
attrterp->set_attributes(fcomp->GetAttributeList());
! ComValue& value = attrterp->run(nil);
if (value.is_true()) {
MapFeature* newf = new MapFeature(*fcomp->feature());
newf->graphic((void*)new MapFeatureComp(newf));
--- 1574,1580 ----
for (fccomp->First(i); !fccomp->Done(i); fccomp->Next(i)) {
MapFeatureComp* fcomp = (MapFeatureComp*)fccomp->GetComp(i);
attrterp->set_attributes(fcomp->GetAttributeList());
! ComValue& value = attrterp->run((const char*)nil);
if (value.is_true()) {
MapFeature* newf = new MapFeature(*fcomp->feature());
newf->graphic((void*)new MapFeatureComp(newf));
***************
*** 1673,1679 ****
if (touchline) {
attrterp->set_attributes(fcomp->GetAttributeList());
! ComValue& value = attrterp->run(nil);
if (value.is_true()) {
MapFeature* newf = new MapFeature(*fcomp->feature());
newf->graphic((void*)new MapFeatureComp(newf));
--- 1673,1679 ----
if (touchline) {
attrterp->set_attributes(fcomp->GetAttributeList());
! ComValue& value = attrterp->run((const char*)nil);
if (value.is_true()) {
MapFeature* newf = new MapFeature(*fcomp->feature());
newf->graphic((void*)new MapFeatureComp(newf));
***************
*** 2268,2274 ****
attr = new Attribute(attrname.string_ptr(), val);
alist->add_attribute(attr);
}
! *val = _terp->run(nil);
}
}
--- 2268,2274 ----
attr = new Attribute(attrname.string_ptr(), val);
alist->add_attribute(attr);
}
! *val = _terp->run((const char*)nil);
}
}
Index: mapserv/Imakefile
diff -c mapserv/Imakefile:1.1 mapserv/Imakefile:1.2
*** mapserv/Imakefile:1.1 Mon Aug 2 13:53:23 1999
--- src/mapserv/Imakefile Fri Jun 9 02:38:29 2000
***************
*** 43,51 ****
$(DEPIVGLYPH)
#endif
! OTHER_CCDEFINES = $(ACE_CCDEFINES)
! OTHER_CCINCLUDES = $(ACE_CCINCLUDES)
! OTHER_CCLDLIBS = $(CLIPPOLY_CCLDLIBS) $(ACE_CCLDLIBS)
Use_libUnidraw()
Use_2_6()
--- 43,51 ----
$(DEPIVGLYPH)
#endif
! OTHER_CCDEFINES = $(ACE_CCDEFINES) $(PROJ_CCDEFINES)
! OTHER_CCINCLUDES = $(ACE_CCINCLUDES) $(PROJ_CCINCLUDES)
! OTHER_CCLDLIBS = $(CLIPPOLY_CCLDLIBS) $(ACE_CCLDLIBS) $(PROJ_CCLDLIBS)
Use_libUnidraw()
Use_2_6()
Index: UtmUnidraw/Imakefile
diff -c UtmUnidraw/Imakefile:1.2 UtmUnidraw/Imakefile:1.3
*** UtmUnidraw/Imakefile:1.2 Tue Jan 25 03:22:03 2000
--- src/UtmUnidraw/Imakefile Fri Jun 9 02:38:32 2000
***************
*** 8,15 ****
LIB = UtmUnidraw
! OTHER_CCDEFINES = $(CLIPPOLY_CCDEFINES) $(ACE_CCDEFINES)
! OTHER_CCINCLUDES = $(CLIPPOLY_CCINCLUDES) $(ACE_CCINCLUDES)
MakeLibrary($(LIB),$(VERSION))
--- 8,15 ----
LIB = UtmUnidraw
! OTHER_CCDEFINES = $(CLIPPOLY_CCDEFINES) $(ACE_CCDEFINES) $(PROJ_CCDEFINES)
! OTHER_CCINCLUDES = $(CLIPPOLY_CCINCLUDES) $(ACE_CCINCLUDES) $(PROJ_CCINCLUDES)
MakeLibrary($(LIB),$(VERSION))
Index: utmviewer/Imakefile
diff -c utmviewer/Imakefile:1.1 utmviewer/Imakefile:1.2
*** utmviewer/Imakefile:1.1 Mon Aug 2 13:53:27 1999
--- src/utmviewer/Imakefile Fri Jun 9 02:38:33 2000
***************
*** 45,53 ****
$(DEPIVGLYPH)
#endif
! OTHER_CCDEFINES = $(ACE_CCDEFINES)
! OTHER_CCINCLUDES = $(ACE_CCINCLUDES)
! OTHER_CCLDLIBS = $(CLIPPOLY_CCLDLIBS) $(ACE_CCLDLIBS)
Use_libUnidraw()
Use_2_6()
--- 45,53 ----
$(DEPIVGLYPH)
#endif
! OTHER_CCDEFINES = $(ACE_CCDEFINES) $(PROJ_CCDEFINES)
! OTHER_CCINCLUDES = $(ACE_CCINCLUDES) $(PROJ_CCINCLUDES)
! OTHER_CCLDLIBS = $(CLIPPOLY_CCLDLIBS) $(ACE_CCLDLIBS) $(PROJ_CCLDLIBS)
Use_libUnidraw()
Use_2_6()
Index: LosServ/Imakefile
diff -c LosServ/Imakefile:1.2 LosServ/Imakefile:1.3
*** LosServ/Imakefile:1.2 Tue Jan 25 03:22:07 2000
--- src/LosServ/Imakefile Fri Jun 9 02:38:37 2000
***************
*** 8,15 ****
LIB = LosServ
! OTHER_CCDEFINES = $(CLIPPOLY_CCDEFINES) $(ACE_CCDEFINES)
! OTHER_CCINCLUDES = $(CLIPPOLY_CCINCLUDES) $(ACE_CCINCLUDES)
Use_2_6()
--- 8,15 ----
LIB = LosServ
! OTHER_CCDEFINES = $(CLIPPOLY_CCDEFINES) $(ACE_CCDEFINES) $(PROJ_CCDEFINES)
! OTHER_CCINCLUDES = $(CLIPPOLY_CCINCLUDES) $(ACE_CCINCLUDES) $(PROJ_CCINCLUDES)
Use_2_6()
Index: losserv/Imakefile
diff -c losserv/Imakefile:1.1 losserv/Imakefile:1.2
*** losserv/Imakefile:1.1 Mon Aug 2 13:53:37 1999
--- src/losserv/Imakefile Fri Jun 9 02:38:39 2000
***************
*** 47,55 ****
$(DEPCOMUTIL)
#endif
! OTHER_CCDEFINES = $(ACE_CCDEFINES)
! OTHER_CCINCLUDES = $(ACE_CCINCLUDES)
! OTHER_CCLDLIBS = $(CLIPPOLY_CCLDLIBS) $(ACE_CCLDLIBS)
Use_libUnidraw()
Use_2_6()
--- 47,55 ----
$(DEPCOMUTIL)
#endif
! OTHER_CCDEFINES = $(ACE_CCDEFINES) $(PROJ_CCDEFINES)
! OTHER_CCINCLUDES = $(ACE_CCINCLUDES) $(PROJ_CCINCLUDES)
! OTHER_CCLDLIBS = $(CLIPPOLY_CCLDLIBS) $(ACE_CCLDLIBS) $(PROJ_CCLDLIBS)
Use_libUnidraw()
Use_2_6()
Index: ProjServ/Imakefile
diff -c ProjServ/Imakefile:1.2 ProjServ/Imakefile:1.3
*** ProjServ/Imakefile:1.2 Tue Jan 25 03:22:09 2000
--- src/ProjServ/Imakefile Fri Jun 9 02:38:41 2000
***************
*** 8,15 ****
LIB = ProjServ
! OTHER_CCDEFINES = $(CLIPPOLY_CCDEFINES) $(ACE_CCDEFINES)
! OTHER_CCINCLUDES = $(CLIPPOLY_CCINCLUDES) $(ACE_CCINCLUDES)
Use_2_6()
--- 8,15 ----
LIB = ProjServ
! OTHER_CCDEFINES = $(CLIPPOLY_CCDEFINES) $(ACE_CCDEFINES) $(PROJ_CCDEFINES)
! OTHER_CCINCLUDES = $(CLIPPOLY_CCINCLUDES) $(ACE_CCINCLUDES) $(PROJ_CCINCLUDES)
Use_2_6()
Index: ProjUnidraw/Imakefile
diff -c ProjUnidraw/Imakefile:1.2 ProjUnidraw/Imakefile:1.3
*** ProjUnidraw/Imakefile:1.2 Tue Jan 25 03:22:11 2000
--- src/ProjUnidraw/Imakefile Fri Jun 9 02:38:43 2000
***************
*** 8,15 ****
LIB = ProjUnidraw
! OTHER_CCDEFINES = $(CLIPPOLY_CCDEFINES) $(ACE_CCDEFINES)
! OTHER_CCINCLUDES = $(CLIPPOLY_CCINCLUDES) $(ACE_CCINCLUDES)
MakeLibrary($(LIB),$(VERSION))
--- 8,15 ----
LIB = ProjUnidraw
! OTHER_CCDEFINES = $(CLIPPOLY_CCDEFINES) $(ACE_CCDEFINES) $(PROJ_CCDEFINES)
! OTHER_CCINCLUDES = $(CLIPPOLY_CCINCLUDES) $(ACE_CCINCLUDES) $(PROJ_CCINCLUDES)
MakeLibrary($(LIB),$(VERSION))
Index: projviewer/Imakefile
diff -c projviewer/Imakefile:1.1 projviewer/Imakefile:1.2
*** projviewer/Imakefile:1.1 Mon Aug 2 13:53:45 1999
--- src/projviewer/Imakefile Fri Jun 9 02:38:44 2000
***************
*** 59,67 ****
$(DEPIVGLYPH)
#endif
! OTHER_CCDEFINES = $(ACE_CCDEFINES)
! OTHER_CCINCLUDES = $(ACE_CCINCLUDES)
! OTHER_CCLDLIBS = $(CLIPPOLY_CCLDLIBS) $(ACE_CCLDLIBS)
Use_libUnidraw()
Use_2_6()
--- 59,67 ----
$(DEPIVGLYPH)
#endif
! OTHER_CCDEFINES = $(ACE_CCDEFINES) $(PROJ_CCDEFINES)
! OTHER_CCINCLUDES = $(ACE_CCINCLUDES) $(PROJ_CCINCLUDES)
! OTHER_CCLDLIBS = $(CLIPPOLY_CCLDLIBS) $(ACE_CCLDLIBS) $(PROJ_CCLDLIBS)
Use_libUnidraw()
Use_2_6()
Index: VhclUnidraw/Imakefile
diff -c VhclUnidraw/Imakefile:1.3 VhclUnidraw/Imakefile:1.4
*** VhclUnidraw/Imakefile:1.3 Mon Feb 28 17:28:05 2000
--- src/VhclUnidraw/Imakefile Fri Jun 9 02:38:47 2000
***************
*** 8,15 ****
LIB = VhclUnidraw
! OTHER_CCDEFINES = $(CLIPPOLY_CCDEFINES) $(ACE_CCDEFINES)
! OTHER_CCINCLUDES = $(CLIPPOLY_CCINCLUDES) $(ACE_CCINCLUDES)
MakeLibrary($(LIB),$(VERSION))
--- 8,15 ----
LIB = VhclUnidraw
! OTHER_CCDEFINES = $(CLIPPOLY_CCDEFINES) $(ACE_CCDEFINES) $(PROJ_CCDEFINES)
! OTHER_CCINCLUDES = $(CLIPPOLY_CCINCLUDES) $(ACE_CCINCLUDES) $(PROJ_CCINCLUDES)
MakeLibrary($(LIB),$(VERSION))
Index: vhclviewer/Imakefile
diff -c vhclviewer/Imakefile:1.1 vhclviewer/Imakefile:1.2
*** vhclviewer/Imakefile:1.1 Mon Aug 2 13:53:54 1999
--- src/vhclviewer/Imakefile Fri Jun 9 02:38:49 2000
***************
*** 65,73 ****
$(DEPIVGLYPH)
#endif
! OTHER_CCDEFINES = $(ACE_CCDEFINES)
! OTHER_CCINCLUDES = $(ACE_CCINCLUDES)
! OTHER_CCLDLIBS = $(CLIPPOLY_CCLDLIBS) $(ACE_CCLDLIBS)
Use_libUnidraw()
Use_2_6()
--- 65,73 ----
$(DEPIVGLYPH)
#endif
! OTHER_CCDEFINES = $(ACE_CCDEFINES) $(PROJ_CCDEFINES)
! OTHER_CCINCLUDES = $(ACE_CCINCLUDES) $(PROJ_CCINCLUDES)
! OTHER_CCLDLIBS = $(CLIPPOLY_CCLDLIBS) $(ACE_CCLDLIBS) $(PROJ_CCLDLIBS)
Use_libUnidraw()
Use_2_6()
*** /dev/null Fri Jun 9 02:38:53 PDT 2000
--- patches/vhclmaps-000609-johnston-030
*************** patches/vhclmaps-000609-johnston-030
*** 0 ****
--- 1 ----
+ vhclmaps-000609-johnston-030
|
|
From: <joh...@ie...> - 2000-06-12 18:32:31
|
Patch: vhclmaps-000602-johnston-029
For: vhclmaps-0.7.4
Author: joh...@us...
Subject: add MapViewer methods to set/get magnification limits
Requires:
This is an intermediate patch to vhclmaps-0.7.4. To apply, cd to the
top-level directory of the vhclmaps source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- add MapViewer methods to set and get magnification limits
(::SetMagLimits and ::GetMagLimits). Defaults are 1./512 on the low
end, 512. on the high end.
Index: MapUnidraw/mapviewer.c
diff -c MapUnidraw/mapviewer.c:1.1 MapUnidraw/mapviewer.c:1.2
*** MapUnidraw/mapviewer.c:1.1 Mon Aug 2 13:53:08 1999
--- src/MapUnidraw/mapviewer.c Fri Jun 2 23:07:15 2000
***************
*** 55,67 ****
Alignment align, Zooming zoom
) : FrameViewer(ed, gv, page, grid, w, h, orientation, align, zoom)
{
}
float MapViewer::LimitMagnification (float desired) {
! const float lo = 1./512.;
! const float hi = 512.;
return (desired < lo) ? lo : (desired > hi) ? hi : desired;
}
void MapViewer::Draw()
--- 55,81 ----
Alignment align, Zooming zoom
) : FrameViewer(ed, gv, page, grid, w, h, orientation, align, zoom)
{
+ _lomagstop = 1./512.;
+ _himagstop = 512.;
}
float MapViewer::LimitMagnification (float desired) {
! const float lo = _lomagstop;
! const float hi = _himagstop;
return (desired < lo) ? lo : (desired > hi) ? hi : desired;
+ }
+
+ void MapViewer::SetMagLimits(float lo, float hi) {
+ if (lo<hi) {
+ _lomagstop = lo;
+ _himagstop = hi;
+ }
+ }
+
+ void MapViewer::GetMagLimits(float& lo, float& hi) {
+ lo = _lomagstop;
+ hi = _himagstop;
}
void MapViewer::Draw()
Index: MapUnidraw/mapviewer.h
diff -c MapUnidraw/mapviewer.h:1.1 MapUnidraw/mapviewer.h:1.2
*** MapUnidraw/mapviewer.h:1.1 Mon Aug 2 13:53:08 1999
--- src/MapUnidraw/mapviewer.h Fri Jun 2 23:07:15 2000
***************
*** 59,67 ****
--- 59,72 ----
void SetMapPage(OverlayComp*);
static OverlayPage* make_map_page(OverlayComp*);
+
+ void SetMagLimits(float lo, float hi);
+ void GetMagLimits(float& lo, float& hi);
protected:
virtual float LimitMagnification(float);
+ float _himagstop;
+ float _lomagstop;
};
#include <IV-2_6/_leave.h>
*** /dev/null Fri Jun 2 23:07:57 PDT 2000
--- patches/vhclmaps-000602-johnston-029
*************** patches/vhclmaps-000602-johnston-029
*** 0 ****
--- 1 ----
+ vhclmaps-000602-johnston-029
|
|
From: <joh...@ie...> - 2000-06-12 18:31:44
|
Patch: vhclmaps-000610-johnston-031
For: vhclmaps-0.7.4
Author: joh...@us...
Subject: upgrades to smoothly compile on RedHat 6.2
Requires:
This is an intermediate patch to vhclmaps-0.7.4. To apply, cd to the
top-level directory of the vhclmaps source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- upgrades to smoothly compile on RedHat 6.2
Index: MapUnidraw/mapcamera.c
diff -c MapUnidraw/mapcamera.c:1.1 MapUnidraw/mapcamera.c:1.2
*** MapUnidraw/mapcamera.c:1.1 Mon Aug 2 13:53:06 1999
--- src/MapUnidraw/mapcamera.c Sat Jun 10 01:53:44 2000
***************
*** 49,55 ****
#include <stdio.h>
! static const unit = 15;
static Coord xOpen[] = { 0, unit/2, unit/2, unit };
static Coord yOpen[] = { 0, unit/4, unit*3/4, unit };
static const int nOpen = 4;
--- 49,55 ----
#include <stdio.h>
! static const int unit = 15;
static Coord xOpen[] = { 0, unit/2, unit/2, unit };
static Coord yOpen[] = { 0, unit/4, unit*3/4, unit };
static const int nOpen = 4;
Index: MapUnidraw/mapkit.c
diff -c MapUnidraw/mapkit.c:1.5 MapUnidraw/mapkit.c:1.6
*** MapUnidraw/mapkit.c:1.5 Wed May 17 23:43:26 2000
--- src/MapUnidraw/mapkit.c Sat Jun 10 01:53:44 2000
***************
*** 124,130 ****
/******************************************************************************/
! static const unit = 15;
static int xClosed[] = { unit/5, unit, unit, unit*3/5, 0 };
static int yClosed[] = { 0, unit/5, unit*3/5, unit, unit*2/5 };
--- 124,130 ----
/******************************************************************************/
! static const int unit = 15;
static int xClosed[] = { unit/5, unit, unit, unit*3/5, 0 };
static int yClosed[] = { 0, unit/5, unit*3/5, unit, unit*2/5 };
Index: UtmUnidraw/utmcmds.c
diff -c UtmUnidraw/utmcmds.c:1.2 UtmUnidraw/utmcmds.c:1.3
*** UtmUnidraw/utmcmds.c:1.2 Thu Feb 10 04:32:35 2000
--- src/UtmUnidraw/utmcmds.c Sat Jun 10 01:53:47 2000
***************
*** 80,86 ****
#include <ace/INET_Addr.h>
#endif
! static const unit = 15;
/*****************************************************************************/
--- 80,86 ----
#include <ace/INET_Addr.h>
#endif
! static const int unit = 15;
/*****************************************************************************/
Index: ProjUnidraw/projcmds.c
diff -c ProjUnidraw/projcmds.c:1.1 ProjUnidraw/projcmds.c:1.2
*** ProjUnidraw/projcmds.c:1.1 Mon Aug 2 13:53:43 1999
--- src/ProjUnidraw/projcmds.c Sat Jun 10 01:53:52 2000
***************
*** 75,82 ****
#include <ace/INET_Addr.h>
#endif
- static const unit = 15;
-
/*****************************************************************************/
ClassId ProjShowCmd::GetClassId () { return PROJSHOW_CMD; }
--- 75,80 ----
*** /dev/null Sat Jun 10 01:53:58 PDT 2000
--- patches/vhclmaps-000610-johnston-031
*************** patches/vhclmaps-000610-johnston-031
*** 0 ****
--- 1 ----
+ vhclmaps-000610-johnston-031
|
|
From: <joh...@ie...> - 2000-05-19 05:30:37
|
Patch: vhclmaps-000519-johnston-028
For: vhclmaps-0.7.4
Author: joh...@us...
Subject: changeview utmviewer command slips in a new composite graphic
Requires:
This is an intermediate patch to vhclmaps-0.7.4. To apply, cd to the
top-level directory of the vhclmaps source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- "changeview" is a new utmviewer command for replacing the composite
graphic (the OverlaysComp/Picture) associated with a variable in the
interpreter:
compview=changeview(compview drawtoolstr) -- change composite graphic associated with a vehicle"; }
Index: UtmUnidraw/utmeditor.c
diff -c UtmUnidraw/utmeditor.c:1.5 UtmUnidraw/utmeditor.c:1.6
*** UtmUnidraw/utmeditor.c:1.5 Fri Apr 7 04:24:56 2000
--- src/UtmUnidraw/utmeditor.c Fri May 19 11:36:02 2000
***************
*** 126,131 ****
--- 126,132 ----
comterp->add_command("vhclview", new VhclViewFunc(comterp, this));
comterp->add_command("moveview", new VhclMoveToFunc(comterp, this));
+ comterp->add_command("changeview", new VhclChangeViewFunc(comterp, this));
comterp->add_command("rteview", new RteViewFunc(comterp, this));
comterp->add_command("paste", new PasteFunc(comterp, this));
Index: UtmUnidraw/utmfunc.c
diff -c UtmUnidraw/utmfunc.c:1.5 UtmUnidraw/utmfunc.c:1.6
*** UtmUnidraw/utmfunc.c:1.5 Wed May 10 03:25:10 2000
--- src/UtmUnidraw/utmfunc.c Fri May 19 11:36:02 2000
***************
*** 40,48 ****
#include <Unidraw/Graphic/graphic.h>
#include <Unidraw/Components/component.h>
#include <Unidraw/Components/compview.h>
! #include <Unidraw/Graphic/graphic.h>
#include <Unidraw/clipboard.h>
#include <Unidraw/selection.h>
#include <Unidraw/unidraw.h>
#include <Unidraw/viewer.h>
#include <ComTerp/comvalue.h>
--- 40,49 ----
#include <Unidraw/Graphic/graphic.h>
#include <Unidraw/Components/component.h>
#include <Unidraw/Components/compview.h>
! #include <Unidraw/Graphic/picture.h>
#include <Unidraw/clipboard.h>
#include <Unidraw/selection.h>
+ #include <Unidraw/ulist.h>
#include <Unidraw/unidraw.h>
#include <Unidraw/viewer.h>
#include <ComTerp/comvalue.h>
***************
*** 223,228 ****
--- 224,295 ----
#endif
}
push_stack(compval);
+ } else
+ push_stack(ComValue::nullval());
+ return;
+ }
+
+
+ /*****************************************************************************/
+
+ VhclChangeViewFunc::VhclChangeViewFunc(ComTerp* comterp, Editor* ed) : UtmFunc(comterp, ed) {
+ }
+
+ void VhclChangeViewFunc::execute() {
+ ComValue compsym(stack_arg(0, true));
+ ComValue compval(lookup_symval(compsym));
+ ComValue grstr(stack_arg(1));
+ reset_stack();
+
+ istrstream in(grstr.string_ptr());
+ const char* first_token = "drawtool";
+ int len = strlen(first_token)+1;
+ char buf[len];
+
+ char ch;
+ while (isspace(ch = in.get())); in.putback(ch);
+ ParamList::parse_token(in, buf, len);
+ if (strcmp(buf, first_token)!=0) {
+ push_stack(ComValue::nullval());
+ return;
+ }
+
+ OverlaysComp* newvhclpict = new OverlaysComp(in, nil);
+
+ OverlaysComp* oldvhclpict =
+ (OverlaysComp*)compval.geta(OverlaysComp::class_symid());
+
+ if (newvhclpict && oldvhclpict) {
+ MacroCmd* macrocmd = new MacroCmd();
+
+ Clipboard* delcb = new Clipboard;
+ delcb->Append(oldvhclpict);
+ macrocmd->Append(new DeleteCmd(GetEditor(), delcb));
+
+ Graphic* newgr = newvhclpict->GetGraphic();
+ Graphic* oldgr = oldvhclpict->GetGraphic();
+ if (oldgr && newgr) newgr->SetTransformer(oldgr->GetTransformer());
+
+ Clipboard* pastecb = new Clipboard();
+ pastecb->Append(newvhclpict);
+ macrocmd->Append(new PasteCmd(GetEditor(), pastecb));
+
+ macrocmd->Execute();
+ unidraw->Update();
+ newvhclpict->SetAttributeList(oldvhclpict->attrlist());
+ UList* vl = oldvhclpict->ViewList();
+ for (UList* u = vl->First(); u != vl->End(); ) {
+ ComponentView* oldview = oldvhclpict->View(u);
+ u = u->Next();
+ if (oldview && oldview->IsA(COMPONENT_VIEW) && !oldview->IsA(OVERLAY_VIEW)) {
+ /* this must be a variable, transfer the new value over */
+ oldvhclpict->Detach(oldview);
+ oldview->SetSubject(newvhclpict);
+ newvhclpict->Attach(oldview);
+ }
+ }
+ delete macrocmd;
+
} else
push_stack(ComValue::nullval());
return;
Index: UtmUnidraw/utmfunc.h
diff -c UtmUnidraw/utmfunc.h:1.5 UtmUnidraw/utmfunc.h:1.6
*** UtmUnidraw/utmfunc.h:1.5 Sat May 6 05:53:49 2000
--- src/UtmUnidraw/utmfunc.h Fri May 19 11:36:02 2000
***************
*** 61,66 ****
--- 61,75 ----
int _heading_symid;
};
+ class VhclChangeViewFunc : public UtmFunc {
+ public:
+ VhclChangeViewFunc(ComTerp*, Editor*);
+ virtual void execute();
+ virtual const char* docstring() {
+ return "compview=%s(compview drawtoolstr) -- change composite graphic associated with a vehicle"; }
+
+ };
+
class RteViewFunc : public UtmFunc {
public:
RteViewFunc(ComTerp*, Editor*);
*** /dev/null Fri May 19 11:36:12 PDT 2000
--- patches/vhclmaps-000519-johnston-028
*************** patches/vhclmaps-000519-johnston-028
*** 0 ****
--- 1 ----
+ vhclmaps-000519-johnston-028
|
|
From: <joh...@ie...> - 2000-05-19 05:29:57
|
Patch: vhclmaps-000517-johnston-027
For: vhclmaps-0.7.4
Author: joh...@us...
Subject: second half of patch to group page commands into View submenu
Requires: vhclmaps-000517-johnston-026
This is an intermediate patch to vhclmaps-0.7.4. To apply, cd to the
top-level directory of the vhclmaps source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- finalizes the grouping of page-related commands into a new View
submenu on the map viewers.
Index: MapUnidraw/mapkit.c
diff -c MapUnidraw/mapkit.c:1.4 MapUnidraw/mapkit.c:1.5
*** MapUnidraw/mapkit.c:1.4 Wed May 17 23:39:41 2000
--- src/MapUnidraw/mapkit.c Wed May 17 23:43:26 2000
***************
*** 631,636 ****
--- 631,637 ----
KLBL_ORIENTATION,
CODE_ORIENTATION)),
"Orientation ");
+ mbi->menu()->append_item(pagei);
MenuItem* zoomi = kit.menu_item(kit.label("Zoom "));
Menu* zoom = kit.pullright();
*** /dev/null Wed May 17 23:43:43 PDT 2000
--- patches/vhclmaps-000517-johnston-027
*************** patches/vhclmaps-000517-johnston-027
*** 0 ****
--- 1 ----
+ vhclmaps-000517-johnston-027
|
|
From: <joh...@ie...> - 2000-05-19 05:29:18
|
Patch: vhclmaps-000517-johnston-026
For: vhclmaps-0.7.4
Author: joh...@us...
Subject: first half of patch to group page commands into a View submenu
Requires:
This is an intermediate patch to vhclmaps-0.7.4. To apply, cd to the
top-level directory of the vhclmaps source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- incomplete attempt to group page commands into a View submenu.
Index: MapUnidraw/mapkit.c
diff -c MapUnidraw/mapkit.c:1.3 MapUnidraw/mapkit.c:1.4
*** MapUnidraw/mapkit.c:1.3 Sat Feb 26 03:30:44 2000
--- src/MapUnidraw/mapkit.c Wed May 17 23:39:41 2000
***************
*** 609,635 ****
"DEM View ");
mbi->menu()->append_item(kit.menu_item_separator());
#endif
! MakeMenu(mbi, new PageCmd(new ControlInfo("Page on/off",
"p", "p")),
"Page on/off ");
! MakeMenu(mbi, new PrecisePageCmd(new ControlInfo("Precise Page",
"^P", "\020")),
"Precise Page ");
! MakeMenu(mbi, new NormSizeCmd(new ControlInfo("Normal Size",
KLBL_NORMSIZE, CODE_NORMSIZE)),
"Normal Size ");
! MakeMenu(mbi, new RedToFitCmd(new ControlInfo("Reduce to Fit",
KLBL_REDTOFIT, CODE_REDTOFIT)),
"Reduce to Fit ");
! MakeMenu(mbi, new CenterCmd(new ControlInfo("Center Page",
KLBL_CENTER, CODE_CENTER)),
"Center Page ");
! MakeMenu(mbi, new OrientationCmd(new ControlInfo("Orientation",
KLBL_ORIENTATION,
CODE_ORIENTATION)),
"Orientation ");
-
- mbi->menu()->append_item(kit.menu_item_separator());
MenuItem* zoomi = kit.menu_item(kit.label("Zoom "));
Menu* zoom = kit.pullright();
--- 609,636 ----
"DEM View ");
mbi->menu()->append_item(kit.menu_item_separator());
#endif
! MenuItem* pagei = kit.menu_item(kit.label("Page Operations "));
! Menu* page = kit.pullright();
! pagei->menu(page);
! MakeMenu(pagei, new PageCmd(new ControlInfo("Page on/off",
"p", "p")),
"Page on/off ");
! MakeMenu(pagei, new PrecisePageCmd(new ControlInfo("Precise Page",
"^P", "\020")),
"Precise Page ");
! MakeMenu(pagei, new NormSizeCmd(new ControlInfo("Normal Size",
KLBL_NORMSIZE, CODE_NORMSIZE)),
"Normal Size ");
! MakeMenu(pagei, new RedToFitCmd(new ControlInfo("Reduce to Fit",
KLBL_REDTOFIT, CODE_REDTOFIT)),
"Reduce to Fit ");
! MakeMenu(pagei, new CenterCmd(new ControlInfo("Center Page",
KLBL_CENTER, CODE_CENTER)),
"Center Page ");
! MakeMenu(pagei, new OrientationCmd(new ControlInfo("Orientation",
KLBL_ORIENTATION,
CODE_ORIENTATION)),
"Orientation ");
MenuItem* zoomi = kit.menu_item(kit.label("Zoom "));
Menu* zoom = kit.pullright();
*** /dev/null Wed May 17 23:39:53 PDT 2000
--- patches/vhclmaps-000517-johnston-026
*************** patches/vhclmaps-000517-johnston-026
*** 0 ****
--- 1 ----
+ vhclmaps-000517-johnston-026
|
|
From: <joh...@ie...> - 2000-05-12 20:00:33
|
Patch: vhclmaps-000510-johnston-025
For: vhclmaps-0.7.4
Author: joh...@us...
Subject: fix bug in utmviewer moveview command
Requires:
This is an intermediate patch to vhclmaps-0.7.4. To apply, cd to the
top-level directory of the vhclmaps source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- fix bug in utmviewer "moveview" command, because of change to
ComValue::geta that made it return a Component* instead of a
ComponentView*.
Index: UtmUnidraw/utmfunc.c
diff -c UtmUnidraw/utmfunc.c:1.4 UtmUnidraw/utmfunc.c:1.5
*** UtmUnidraw/utmfunc.c:1.4 Fri Mar 24 23:20:58 2000
--- src/UtmUnidraw/utmfunc.c Wed May 10 03:25:10 2000
***************
*** 122,128 ****
PasteCmd* cmd = new PasteCmd(_ed, new Clipboard(vhclpict));
execute_log(cmd);
! ComValue result(vhclpict->classid(), (void*)new ComponentView(vhclpict));
result.object_compview(true);
push_stack(result);
--- 122,130 ----
PasteCmd* cmd = new PasteCmd(_ed, new Clipboard(vhclpict));
execute_log(cmd);
! ComponentView* view = new ComponentView(vhclpict);
! vhclpict->Attach(view);
! ComValue result(vhclpict->classid(), (void*)view);
result.object_compview(true);
push_stack(result);
***************
*** 154,163 ****
yloc = utm_yloc.float_val();
}
! ComponentView* compview =
! (ComponentView*)compval.geta(OverlaysComp::class_symid());
! OverlaysComp* vhclpict =
! compview ? (OverlaysComp*)compview->GetSubject() : nil;
if (vhclpict) {
Selection* sel = _ed->GetSelection();
sel->Clear();
--- 156,163 ----
yloc = utm_yloc.float_val();
}
! OverlaysComp* vhclpict =
! (OverlaysComp*)compval.geta(OverlaysComp::class_symid());
if (vhclpict) {
Selection* sel = _ed->GetSelection();
sel->Clear();
*** /dev/null Wed May 10 03:25:17 PDT 2000
--- patches/vhclmaps-000510-johnston-025
*************** patches/vhclmaps-000510-johnston-025
*** 0 ****
--- 1 ----
+ vhclmaps-000510-johnston-025
|
|
From: <joh...@ie...> - 2000-05-12 20:00:15
|
Patch: vhclmaps-000506-johnston-024 For: vhclmaps-0.7.4 Author: joh...@us... Subject: minor stuff Requires: This is an intermediate patch to vhclmaps-0.7.4. To apply, cd to the top-level directory of the vhclmaps source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - minor stuff Index: top_vhclmaps/INSTALL diff -c top_vhclmaps/INSTALL:1.4 top_vhclmaps/INSTALL:1.5 *** top_vhclmaps/INSTALL:1.4 Mon Jan 31 23:06:38 2000 --- ./INSTALL Sat May 6 05:53:41 2000 *************** *** 28,36 **** 0.d. You need to obtain, build, and install ivtools-0.8 (from http://www.vectaport.com/ivtools/) according to its INSTALL ! instructions before you can build vhclmaps-0.7. You can build ! ivtools with or without --enable-install-relative supplied to its ! configure script. 0.e. You need to obtain, build and install PROJ-4.3 cartographic projection library from ftp://kai.er.usgs.gov/pub/PROJ.4/PROJ.4.3.3.tar.gz. --- 28,37 ---- 0.d. You need to obtain, build, and install ivtools-0.8 (from http://www.vectaport.com/ivtools/) according to its INSTALL ! instructions before you can build vhclmaps-0.7. You can build ivtools ! with or without --enable-install-relative supplied to its configure ! script. Tips on building clippoly and ACE for use of vhclmaps and ! ivtools can be found in the ivtools INSTALL file. 0.e. You need to obtain, build and install PROJ-4.3 cartographic projection library from ftp://kai.er.usgs.gov/pub/PROJ.4/PROJ.4.3.3.tar.gz. Index: top_vhclmaps/aclocal.m4 diff -c top_vhclmaps/aclocal.m4:1.1 top_vhclmaps/aclocal.m4:1.2 *** top_vhclmaps/aclocal.m4:1.1 Mon Aug 2 13:52:36 1999 --- ./aclocal.m4 Sat May 6 05:53:41 2000 *************** *** 19,25 **** else ice_file=`grep '^# 1' conftest.ii | grep iostream.h | \ head -1 | sed 's/^.*"\(.*\)".*$/\1/'` ! ice_cv_cxx_include_dir=`echo $ice_file | sed 's%/[^/][^/]*$%%'` fi if test "$ice_cv_cxx_include_dir" = ""; then ice_cv_cxx_include_dir="$prefix/include" --- 19,25 ---- else ice_file=`grep '^# 1' conftest.ii | grep iostream.h | \ head -1 | sed 's/^.*"\(.*\)".*$/\1/'` ! ice_cv_cxx_include_dir=`echo $ice_file | sed 's%iostream.h%%'` fi if test "$ice_cv_cxx_include_dir" = ""; then ice_cv_cxx_include_dir="$prefix/include" Index: UtmUnidraw/utmfunc.h diff -c UtmUnidraw/utmfunc.h:1.4 UtmUnidraw/utmfunc.h:1.5 *** UtmUnidraw/utmfunc.h:1.4 Fri Mar 24 23:20:58 2000 --- src/UtmUnidraw/utmfunc.h Sat May 6 05:53:49 2000 *************** *** 55,61 **** VhclMoveToFunc(ComTerp*, Editor*); virtual void execute(); virtual const char* docstring() { ! return "%s(compview :heading degrees :xdir dirflt :ydir dirflt) -- move vehicle graphic to x,y location with specified heading"; } protected: int _heading_symid; --- 55,61 ---- VhclMoveToFunc(ComTerp*, Editor*); virtual void execute(); virtual const char* docstring() { ! return "%s(compview xloc yloc :heading degrees :xdir dirflt :ydir dirflt) -- move vehicle graphic to x,y location with specified heading"; } protected: int _heading_symid; Index: utmviewer/README diff -c utmviewer/README:1.1 utmviewer/README:1.2 *** utmviewer/README:1.1 Mon Aug 2 13:53:27 1999 --- src/utmviewer/README Sat May 6 05:53:50 2000 *************** *** 24,30 **** and vhclpict points to a graphic object): vhclpict=vhclview(:name namestr :gr grstr) -- create and display vehicle graphic ! moveview(vhclpict xloc yloc) -- move vehicle graphic to xloc,yloc rtepict=rteview(xypts :name namestr) -- create and display route graphic --- 24,30 ---- and vhclpict points to a graphic object): vhclpict=vhclview(:name namestr :gr grstr) -- create and display vehicle graphic ! moveview(vhclpict xloc yloc :heading degrees :xdir dirflt :ydir dirflt) -- move vehicle graphic to xloc,yloc rtepict=rteview(xypts :name namestr) -- create and display route graphic *** /dev/null Sat May 6 05:53:59 PDT 2000 --- patches/vhclmaps-000506-johnston-024 *************** patches/vhclmaps-000506-johnston-024 *** 0 **** --- 1 ---- + vhclmaps-000506-johnston-024 |
|
From: <joh...@ie...> - 2000-05-12 19:59:55
|
Patch: vhclmaps-000427-johnston-023
For: vhclmaps-0.7.4
Author: joh...@us...
Subject: don't rotate sub-vehicle co-located with composite vehicle's centroid
Requires:
This is an intermediate patch to vhclmaps-0.7.4. To apply, cd to the
top-level directory of the vhclmaps source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- don't bother to rotate a sub-vehicle which is co-located with the centroid of the composite vehicle. It will end up at Infinity.
Index: Vehicle/compositevhcl.c
diff -c Vehicle/compositevhcl.c:1.5 Vehicle/compositevhcl.c:1.6
*** Vehicle/compositevhcl.c:1.5 Mon Apr 10 22:40:59 2000
--- src/Vehicle/compositevhcl.c Thu Apr 27 03:52:40 2000
***************
*** 23,28 ****
--- 23,29 ----
*/
#include <Vehicle/compositevhcl.h>
+ #include <Vehicle/route.h>
CompositeVehicle::CompositeVehicle
(const char* name, Vehicle** vhcls, int nvhcls) : Vehicle(name) {
***************
*** 350,376 ****
}
void CompositeVehicle::rotate2d(float ang) {
! if (ang) {
defer_composite_update()=true;
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* vhcl = subvhcl(i);
! float cx = xloc();
! float cy = yloc();
! vec2 vec(vhcl->xloc()-cx, vhcl->yloc()-cy);
! float veclen=vec.length();
! if (veclen) vec.normalize();
! mat3 mat = rotation2D(vec, ang);
! vec2 newvec = vec * mat;
! if(newvec.length()!=1.0) newvec.normalize();
! newvec *= veclen;
! vhcl->xloc() = newvec[0]+cx;
! vhcl->yloc() = newvec[1]+cy;
! vec2 dirvec(vhcl->xdir(), vhcl->ydir());
! mat3 dirmat = rotation2D(dirvec, ang);
! vec2 newdirvec = dirvec * dirmat;
! vhcl->xdir() = newdirvec[0];
! vhcl->ydir() = newdirvec[1];
}
defer_composite_update()=false;
recompute();notify();
--- 351,379 ----
}
void CompositeVehicle::rotate2d(float ang) {
! if (ang && route()->curdir()) {
defer_composite_update()=true;
int nvhcls = nsubvhcls();
+ float cx = xloc();
+ float cy = yloc();
for(int i=0; i<nvhcls; i++) {
Vehicle* vhcl = subvhcl(i);
! if(vhcl->xloc()!=cx || vhcl->yloc()!=cy) {
! vec2 vec(vhcl->xloc()-cx, vhcl->yloc()-cy);
! float veclen=vec.length();
! if (veclen) vec.normalize();
! mat3 mat = rotation2D(vec, ang);
! vec2 newvec = vec * mat;
! if(newvec.length()!=1.0) newvec.normalize();
! newvec *= veclen;
! vhcl->xloc() = newvec[0]+cx;
! vhcl->yloc() = newvec[1]+cy;
! vec2 dirvec(vhcl->xdir(), vhcl->ydir());
! mat3 dirmat = rotation2D(dirvec, ang);
! vec2 newdirvec = dirvec * dirmat;
! vhcl->xdir() = newdirvec[0];
! vhcl->ydir() = newdirvec[1];
! }
}
defer_composite_update()=false;
recompute();notify();
Index: Vehicle/route.c
diff -c Vehicle/route.c:1.2 Vehicle/route.c:1.3
*** Vehicle/route.c:1.2 Mon Apr 10 22:40:59 2000
--- src/Vehicle/route.c Thu Apr 27 03:52:40 2000
***************
*** 155,161 ****
}
}
! _vhcl->jumpturn(_curx, _cury, _curz, dx, dy);
}
boolean Route::finished() {
--- 155,161 ----
}
}
! if (_curdir) _vhcl->jumpturn(_curx, _cury, _curz, dx, dy);
}
boolean Route::finished() {
Index: Vehicle/route.h
diff -c Vehicle/route.h:1.2 Vehicle/route.h:1.3
*** Vehicle/route.h:1.2 Mon Apr 10 22:40:59 2000
--- src/Vehicle/route.h Thu Apr 27 03:52:40 2000
***************
*** 57,62 ****
--- 57,64 ----
void vehicle(Vehicle* vhcl) { _vhcl = vhcl; }
+ int curdir() { return _curdir; }
+ void curdir(int dir) { _curdir = dir; }
protected:
char* _name;
Index: VhclServ/vhclfunc.c
diff -c VhclServ/vhclfunc.c:1.6 VhclServ/vhclfunc.c:1.7
*** VhclServ/vhclfunc.c:1.6 Mon Apr 10 22:41:01 2000
--- src/VhclServ/vhclfunc.c Thu Apr 27 03:52:43 2000
***************
*** 130,137 ****
int nvhcls = -1;
ComValue namestr(stack_arg(0, true));
! ComValue& vhclvect = stack_arg(1, true);
! if (vhclvect.is_type(ComValue::ArrayType)) {
nvhcls = vhclvect.array_len();
vhcls = new Vehicle*[nvhcls];
ALIterator i;
--- 130,142 ----
int nvhcls = -1;
ComValue namestr(stack_arg(0, true));
! ComValue vhclvect(stack_arg(1, true));
! if (vhclvect.is_symbol()) {
! ComValue newval(comterp()->lookup_symval(vhclvect.symbol_val()));
! if (newval.is_array())
! vhclvect.assignval(newval);
! }
! if (vhclvect.is_array()) {
nvhcls = vhclvect.array_len();
vhcls = new Vehicle*[nvhcls];
ALIterator i;
***************
*** 374,383 ****
return;
}
if (abs.is_true())
! vhclcomp->vehicle()->jump(xcoord.float_val(), ycoord.float_val());
else
! vhclcomp->vehicle()->move(xcoord.float_val(), ycoord.float_val());
return;
}
--- 379,391 ----
return;
}
+ float x = xcoord.float_val();
+ float y = ycoord.float_val();
+
if (abs.is_true())
! vhclcomp->vehicle()->jump(x, y);
else
! vhclcomp->vehicle()->move(x, y);
return;
}
*** /dev/null Thu Apr 27 03:52:46 PDT 2000
--- patches/vhclmaps-000427-johnston-023
*************** patches/vhclmaps-000427-johnston-023
*** 0 ****
--- 1 ----
+ vhclmaps-000427-johnston-023
|
|
From: <joh...@ie...> - 2000-05-12 19:59:35
|
Patch: vhclmaps-000425-johnston-022
For: vhclmaps-0.7.4
Author: joh...@us...
Subject:
Requires: incorporate new files into MapServ directory
This is an intermediate patch to vhclmaps-0.7.4. To apply, cd to the
top-level directory of the vhclmaps source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- add MapServ/mapprojfunc.[ch], which contains utmzone, geotoutm, and
utmtogeo commands.
Index: MapServ/mapprojfunc.c
diff -c /dev/null MapServ/mapprojfunc.c:1.1
*** /dev/null Tue Apr 25 22:08:12 2000
--- src/MapServ/mapprojfunc.c Tue Apr 25 22:08:11 2000
***************
*** 0 ****
--- 1,124 ----
+ /*
+ * Copyright (c) 2000 IET Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the names of the copyright holders not be used in
+ * advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. The copyright holders make
+ * no representations about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL,
+ * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+ #include <MapServ/mapprojfunc.h>
+ #include <Map/mapproject.h>
+ #include <Unidraw/iterator.h>
+ #include <Attribute/attrlist.h>
+ extern "C" {
+ #include <projects.h>
+ }
+
+ /*****************************************************************************/
+
+
+ UtmZoneFunc::UtmZoneFunc(ComTerp* comterp) : ComFunc(comterp) {
+ }
+
+ void UtmZoneFunc::execute() {
+ ComValue longv(stack_arg(0));
+ reset_stack();
+ ComValue retval(MapProjection::utmzone(longv.float_val()));
+ push_stack(retval);
+ }
+
+ /*****************************************************************************/
+
+ UtmToGeoFunc::UtmToGeoFunc(ComTerp* comterp) : ComFunc(comterp) {
+ }
+
+ void UtmToGeoFunc::execute() {
+ ComValue utmsv(stack_arg(0));
+ ComValue zonev(stack_arg(1));
+ reset_stack();
+ char zs[40];
+ sprintf(zs, "zone=%d", zonev.int_val());
+ char* parms[4];
+ parms[0] = "proj=utm";
+ parms[1] = "ellps=WGS84";
+ parms[2] = zs;
+ parms[3] = "no_defs";
+ PJ* proj= pj_init(4, parms);
+ AttributeValueList *avl = utmsv.is_type(ComValue::ArrayType)
+ ? utmsv.array_val() : nil;
+ if (avl && proj) {
+ Iterator i;
+ avl->First(i);
+ UV data;
+ data.u = avl->GetAttrVal(i)->double_val();
+ avl->Next(i);
+ data.v = avl->GetAttrVal(i)->double_val();
+ data = pj_inv(data, proj);
+ double lon = data.u * RAD_TO_DEG;
+ double lat = data.v * RAD_TO_DEG;
+ AttributeValueList* navl = new AttributeValueList();
+ navl->Append(new ComValue(lon));
+ navl->Append(new ComValue(lat));
+ ComValue retval(navl);
+ push_stack(retval);
+ }
+ delete proj;
+ }
+
+ /*****************************************************************************/
+
+ GeoToUtmFunc::GeoToUtmFunc(ComTerp* comterp) : ComFunc(comterp) {
+ }
+
+ void GeoToUtmFunc::execute() {
+ ComValue lonlatv(stack_arg(0));
+ reset_stack();
+ AttributeValueList *avl = lonlatv.is_type(ComValue::ArrayType)
+ ? lonlatv.array_val() : nil;
+ if (avl && avl->Number()==2) {
+ Iterator i;
+ avl->First(i);
+ double lon = avl->GetAttrVal(i)->double_val();
+ avl->Next(i);
+ double lat = avl->GetAttrVal(i)->double_val();
+ char ls[40];
+ sprintf(ls, "lon_0=%f", lon);
+ char* parms[4];
+ parms[0] = "proj=utm";
+ parms[1] = "ellps=WGS84";
+ parms[2] = ls;
+ parms[3] = "no_defs";
+ PJ* proj= pj_init(4, parms);
+ if (proj) {
+ UV data;
+ data.u = lon * DEG_TO_RAD;
+ data.v = lat * DEG_TO_RAD;
+ data = pj_fwd(data, proj);
+ double lat = data.v * RAD_TO_DEG;
+ AttributeValueList* navl = new AttributeValueList();
+ navl->Append(new ComValue(data.u));
+ navl->Append(new ComValue(data.v));
+ ComValue retval(navl);
+ push_stack(retval);
+ }
+ delete proj;
+ }
+ }
+
+
+
Index: MapServ/mapprojfunc.h
diff -c /dev/null MapServ/mapprojfunc.h:1.1
*** /dev/null Tue Apr 25 22:08:13 2000
--- src/MapServ/mapprojfunc.h Tue Apr 25 22:08:11 2000
***************
*** 0 ****
--- 1,59 ----
+ /*
+ * Copyright (c) 2000 IET Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the names of the copyright holders not be used in
+ * advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. The copyright holders make
+ * no representations about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL,
+ * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+ #ifndef mapprojfunc_h
+ #define mapprojfunc_h
+
+ #include <ComTerp/comfunc.h>
+ #include <ComTerp/comterp.h>
+
+ class UtmZoneFunc : public ComFunc {
+ public:
+ UtmZoneFunc(ComTerp*);
+ virtual void execute();
+ virtual const char* docstring() {
+ return "int=%s(longitude) -- return utm zone for given longitude"; }
+ };
+
+ class UtmToGeoFunc : public ComFunc {
+ public:
+ UtmToGeoFunc(ComTerp*);
+ virtual void execute();
+ virtual const char* docstring() {
+ return "long,lat=%s(utme,utmn zone) -- convert utm to geo (longitude/latitude)"; }
+ };
+
+ class GeoToUtmFunc : public ComFunc {
+ public:
+ GeoToUtmFunc(ComTerp*);
+ virtual void execute();
+ virtual const char* docstring() {
+ return "utme,utmn=%s(long,lat) -- convert geo (longitude/latitude) to utm"; }
+ };
+
+ #endif
+
+
+
+
+
*** /dev/null Tue Apr 25 22:08:18 PDT 2000
--- patches/vhclmaps-000425-johnston-022
*************** patches/vhclmaps-000425-johnston-022
*** 0 ****
--- 1 ----
+ vhclmaps-000425-johnston-022
|
|
From: <joh...@ie...> - 2000-05-12 19:59:28
|
Patch: vhclmaps-000415-johnston-021
For: vhclmaps-0.7.4
Author: joh...@us...
Subject: reinstates UTMPos tool in utmviewer and adapts to ivtools FrameEditor changes
Requires: ivtools-000415-johnston-037
This is an intermediate patch to vhclmaps-0.7.4. To apply, cd to the
top-level directory of the vhclmaps source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- reinstates UTMPos tool in utmviewer.
- adapts to ivtools FrameEditor changes.
Index: MapUnidraw/mapeditor.c
diff -c MapUnidraw/mapeditor.c:1.2 MapUnidraw/mapeditor.c:1.3
*** MapUnidraw/mapeditor.c:1.2 Sat Feb 26 03:30:44 2000
--- src/MapUnidraw/mapeditor.c Sat Apr 15 03:41:17 2000
***************
*** 111,118 ****
}
void MapEditor::Init (OverlayComp* comp, const char* name) {
- _curr_other = _prev_other = 0;
- _texteditor = nil;
if (!comp) comp = new MapIdrawComp((const char*) nil, nil);
_terp = new ComTerpServ();
_terp->add_defaults();
--- 111,116 ----
Index: VpfUnidraw/vpfeditor.c
diff -c VpfUnidraw/vpfeditor.c:1.2 VpfUnidraw/vpfeditor.c:1.3
*** VpfUnidraw/vpfeditor.c:1.2 Mon Aug 2 15:27:13 1999
--- src/VpfUnidraw/vpfeditor.c Sat Apr 15 03:41:20 2000
***************
*** 165,172 ****
}
void VpfEditor::Init (OverlayComp* comp, const char* name) {
- _curr_other = _prev_other = 0;
- _texteditor = nil;
if (!comp) comp = new VpfIdrawComp();
_overlay_kit->Init(comp, name);
InitFrame();
--- 165,170 ----
Index: DlgUnidraw/dlgeditor.c
diff -c DlgUnidraw/dlgeditor.c:1.2 DlgUnidraw/dlgeditor.c:1.3
*** DlgUnidraw/dlgeditor.c:1.2 Mon Aug 2 15:27:15 1999
--- src/DlgUnidraw/dlgeditor.c Sat Apr 15 03:41:23 2000
***************
*** 108,115 ****
}
void DlgEditor::Init (OverlayComp* comp, const char* name) {
- _curr_other = _prev_other = 0;
- _texteditor = nil;
if (!comp) comp = new DlgIdrawComp;
_overlay_kit->Init(comp, name);
InitFrame();
--- 108,113 ----
Index: UtmUnidraw/utmkit.c
diff -c UtmUnidraw/utmkit.c:1.2 UtmUnidraw/utmkit.c:1.3
*** UtmUnidraw/utmkit.c:1.2 Sat Feb 26 03:30:46 2000
--- src/UtmUnidraw/utmkit.c Sat Apr 15 03:41:27 2000
***************
*** 150,155 ****
--- 150,156 ----
ToolButton* camerapos;
ToolButton* camerapath;
#endif
+ ToolButton* utmposbutton;
ToolButton* utmdistbutton;
#ifdef HAVE_ACE
ToolButton* elevbutton;
***************
*** 182,187 ****
--- 183,189 ----
Glyph* ins = kit.label("Inspect");
Glyph* campos = kit.label("CameraPos");
Glyph* campth = kit.label("CameraPath");
+ Glyph* utmpos = kit.label("UTMPos");
Glyph* utmdist = kit.label("UTMDist");
Glyph* los = kit.label("LOS");
Glyph* elv = kit.label("Elev");
***************
*** 210,215 ****
--- 212,219 ----
maxwidth);
maxwidth = Math::max((campth->request(req), req.x_requirement().natural()),
maxwidth);
+ maxwidth = Math::max((utmpos->request(req), req.x_requirement().natural()),
+ maxwidth);
maxwidth = Math::max((utmdist->request(req), req.x_requirement().natural()),
maxwidth);
maxwidth = Math::max((los->request(req), req.x_requirement().natural()),
***************
*** 256,261 ****
--- 260,269 ----
layout.overlay(layout.hcenter(layout.hspace(maxwidth)),
layout.hcenter(campth)), tg));
#endif
+ vb->append(utmposbutton = MakeTool(new UtmPosTool(
+ new ControlInfo("UTMPos")),
+ layout.overlay(layout.hcenter(layout.hspace(maxwidth)),
+ layout.hcenter(utmpos)), tg));
vb->append(utmdistbutton = MakeTool(new UtmDistTool(
new ControlInfo("UTMDist")),
layout.overlay(layout.hcenter(layout.hspace(maxwidth)),
***************
*** 312,317 ****
--- 320,326 ----
vb->append(camerapos);
vb->append(camerapath);
#endif
+ vb->append(utmposbutton);
vb->append(utmdistbutton);
if (geolog_cmd)
vb->append(geolog);
***************
*** 356,369 ****
LayoutKit& lk = *LayoutKit::instance();
Menu* menubar_ = WidgetKit::instance()->menubar();
! menubar_->append_item(MakeFileMenu());
! menubar_->append_item(MakeEditMenu());
! menubar_->append_item(MakeStructureMenu());
! MenuItem* m = MakeFrameMenu();
if (m) menubar_->append_item(m);
! menubar_->append_item(MakeViewMenu());
#ifdef HAVE_ACE
! menubar_->append_item(MakeRouteMenu());
#endif
Resource::ref(menubar_);
return LayoutKit::instance()->vbox(lk.hnatural(menubar_, 600));
--- 365,384 ----
LayoutKit& lk = *LayoutKit::instance();
Menu* menubar_ = WidgetKit::instance()->menubar();
! MenuItem* m;
! m = MakeFileMenu();
! if (m) menubar_->append_item(m);
! m = MakeEditMenu();
! if (m) menubar_->append_item(m);
! m = MakeStructureMenu();
if (m) menubar_->append_item(m);
! m = MakeFrameMenu();
! if (m) menubar_->append_item(m);
! m = MakeViewMenu();
! if (m) menubar_->append_item(m);
#ifdef HAVE_ACE
! m = MakeRouteMenu();
! if (m) menubar_->append_item(m);
#endif
Resource::ref(menubar_);
return LayoutKit::instance()->vbox(lk.hnatural(menubar_, 600));
*** /dev/null Sat Apr 15 03:41:40 PDT 2000
--- patches/vhclmaps-000415-johnston-021
*************** patches/vhclmaps-000415-johnston-021
*** 0 ****
--- 1 ----
+ vhclmaps-000415-johnston-021
|
|
From: <joh...@ie...> - 2000-04-14 21:53:42
|
Patch: vhclmaps-000410-johnston-020
For: vhclmaps-0.7.4
Author: joh...@us...
Subject: remove Edit and Struct menus from map viewers, further composite vehicle improvements, routedist command.
Requires:
This is an intermediate patch to vhclmaps-0.7.4. To apply, cd to the
top-level directory of the vhclmaps source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- remove Edit and Struct menu from utmviewer and all derivatives.
There is a fundamental limitation with the implementation of
MapFeatureComp that disables commands like Duplicate and Group.
Originally for reasons of efficiency, the map feature component did
not have a graphic, but a MapFeature object instead. This problem
could be fixed by introducing a mostly empty Graphic placeholder in
the map feature component.
- improve the composite vehicle object to rotate them as needed when
the direction vector changes.
- add a routedist command to compute the total distance of a set of
waypoints.
Index: UtmUnidraw/utmkit.h
diff -c UtmUnidraw/utmkit.h:1.2 UtmUnidraw/utmkit.h:1.3
*** UtmUnidraw/utmkit.h:1.2 Fri Apr 7 04:24:56 2000
--- src/UtmUnidraw/utmkit.h Mon Apr 10 22:40:51 2000
***************
*** 48,53 ****
--- 48,54 ----
virtual Glyph* MakeToolbar();
virtual Glyph* MakeStates();
virtual MenuItem* MakeFileMenu();
+ virtual MenuItem* MakeEditMenu() { return nil; }
virtual MenuItem* MakeStructureMenu() { return nil; }
virtual MenuItem* MakeRouteMenu();
virtual MenuItem* MakeMapMenu();
Index: Vehicle/compositevhcl.c
diff -c Vehicle/compositevhcl.c:1.4 Vehicle/compositevhcl.c:1.5
*** Vehicle/compositevhcl.c:1.4 Fri Apr 7 04:25:03 2000
--- src/Vehicle/compositevhcl.c Mon Apr 10 22:40:59 2000
***************
*** 239,317 ****
void CompositeVehicle::jumpturn(float x, float y, float z,
float dx, float dy) {
! float angle =
! (asin(dy/sqrt(dx*dx+dy*dy)) - asin(ydir()/sqrt(xdir()*xdir()+ydir()*ydir())))*RAD_TO_DEG;
! rotate2d(angle);
!
! float cx = xloc();
! float cy = yloc();
! float cz = zloc();
! defer_composite_update()=true;
! int nvhcls = nsubvhcls();
! for(int i=0; i<nvhcls; i++) {
! Vehicle* subv = subvhcl(i);
! float xoff = subv->xloc()-cx;
! float yoff = subv->yloc()-cy;
! float zoff = subv->zloc()-cz;
! if (subv) subv->jumpturn(x+xoff, y+yoff, z+zoff, dx, dy);
}
- xdir() = dx;
- ydir() = dy;
- defer_composite_update()=false;
- recompute();notify();
}
void CompositeVehicle::jumpturn(float x, float y, float z,
float dx, float dy, float dz) {
! float angle =
! (asin(dy/sqrt(dx*dx+dy*dy)) - asin(ydir()/sqrt(xdir()*xdir()+ydir()*ydir())))*RAD_TO_DEG;
! rotate2d(angle);
!
! float cx = xloc();
! float cy = yloc();
! float cz = zloc();
! defer_composite_update()=true;
! int nvhcls = nsubvhcls();
! for(int i=0; i<nvhcls; i++) {
! Vehicle* subv = subvhcl(i);
! float xoff = subv->xloc()-cx;
! float yoff = subv->yloc()-cy;
! float zoff = subv->zloc()-cz;
! if (subv) subv->jumpturn(x+xoff, y+yoff, z+zoff, dx, dy);
}
- xdir() = dx;
- ydir() = dy;
- zdir() = dz;
- defer_composite_update()=false;
- recompute();notify();
}
void CompositeVehicle::jumpturn(float* loc, float* dir, int n) {
! float angle =
! (asin(dir[1]/sqrt(dir[0]*dir[0]+dir[1]*dir[1])) - asin(ydir()/sqrt(xdir()*xdir()+ydir()*ydir())))*RAD_TO_DEG;
! rotate2d(angle);
!
! defer_composite_update()=true;
! int nvhcls = nsubvhcls();
! float cs[n];
! if(n>0) cs[0] = xloc();
! if(n>1) cs[1] = yloc();
! if(n>2) cs[2] = zloc();
! for(int i=0; i<nvhcls; i++) {
! Vehicle* subv = subvhcl(i);
! float locoffs[n];
! if(n>0) locoffs[0] = loc[0] - (subv->xloc()-cs[0]);
! if(n>1) locoffs[1] = loc[1] - (subv->yloc()-cs[1]);
! if(n>2) locoffs[2] = loc[2] - (subv->zloc()-cs[2]);
!
! if (subv) subv->jumpturn(locoffs, dir, n);
}
- if(n>0) xdir() = dir[0];
- if(n>1) ydir() = dir[1];
- if(n>2) ydir() = dir[2];
- defer_composite_update()=false;
- recompute();notify();
}
void CompositeVehicle::forward2d(float dist) {
--- 239,326 ----
void CompositeVehicle::jumpturn(float x, float y, float z,
float dx, float dy) {
! if (dx||dy) {
! float angle =
! (asin(dy/sqrt(dx*dx+dy*dy)) - asin(ydir()/sqrt(xdir()*xdir()+ydir()*ydir())))*RAD_TO_DEG;
! rotate2d(angle);
!
! float cx = xloc();
! float cy = yloc();
! float cz = zloc();
! defer_composite_update()=true;
! int nvhcls = nsubvhcls();
! for(int i=0; i<nvhcls; i++) {
! Vehicle* subv = subvhcl(i);
! float xoff = subv->xloc()-cx;
! float yoff = subv->yloc()-cy;
! float zoff = subv->zloc()-cz;
! if (subv) subv->jumpturn(x+xoff, y+yoff, z+zoff, dx, dy);
! }
! xdir() = dx;
! ydir() = dy;
! defer_composite_update()=false;
! recompute();notify();
}
}
void CompositeVehicle::jumpturn(float x, float y, float z,
float dx, float dy, float dz) {
! if (dx||dy||dz) {
! float angle =
! (asin(dy/sqrt(dx*dx+dy*dy)) - asin(ydir()/sqrt(xdir()*xdir()+ydir()*ydir())))*RAD_TO_DEG;
! rotate2d(angle);
!
! float cx = xloc();
! float cy = yloc();
! float cz = zloc();
! defer_composite_update()=true;
! int nvhcls = nsubvhcls();
! for(int i=0; i<nvhcls; i++) {
! Vehicle* subv = subvhcl(i);
! float xoff = subv->xloc()-cx;
! float yoff = subv->yloc()-cy;
! float zoff = subv->zloc()-cz;
! if (subv) subv->jumpturn(x+xoff, y+yoff, z+zoff, dx, dy);
! }
! xdir() = dx;
! ydir() = dy;
! zdir() = dz;
! defer_composite_update()=false;
! recompute();notify();
}
}
void CompositeVehicle::jumpturn(float* loc, float* dir, int n) {
! boolean dirset = dir[0]!=0.0;
! if (n>1) dirset = dirset || dir[1]!=0.0;
! if (n>2) dirset = dirset || dir[2]!=0.0;
! if (dirset) {
! float angle =
! (asin(dir[1]/sqrt(dir[0]*dir[0]+dir[1]*dir[1])) - asin(ydir()/sqrt(xdir()*xdir()+ydir()*ydir())))*RAD_TO_DEG;
! rotate2d(angle);
! defer_composite_update()=true;
! int nvhcls = nsubvhcls();
! float cs[n];
! if(n>0) cs[0] = xloc();
! if(n>1) cs[1] = yloc();
! if(n>2) cs[2] = zloc();
! for(int i=0; i<nvhcls; i++) {
! Vehicle* subv = subvhcl(i);
!
! float locoffs[n];
! if(n>0) locoffs[0] = loc[0] - (subv->xloc()-cs[0]);
! if(n>1) locoffs[1] = loc[1] - (subv->yloc()-cs[1]);
! if(n>2) locoffs[2] = loc[2] - (subv->zloc()-cs[2]);
!
! if (subv) subv->jumpturn(locoffs, dir, n);
! }
! if(n>0) xdir() = dir[0];
! if(n>1) ydir() = dir[1];
! if(n>2) ydir() = dir[2];
! defer_composite_update()=false;
! recompute();notify();
}
}
void CompositeVehicle::forward2d(float dist) {
Index: Vehicle/route.c
diff -c Vehicle/route.c:1.1 Vehicle/route.c:1.2
*** Vehicle/route.c:1.1 Mon Aug 2 13:53:47 1999
--- src/Vehicle/route.c Mon Apr 10 22:40:59 2000
***************
*** 1,4 ****
--- 1,5 ----
/*
+ * Copyright (c) 2000 IET Inc.
* Copyright (c) 1997 Vectaport Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
***************
*** 161,164 ****
--- 162,176 ----
if (_curdir==0)
_vhcl->xdelta() = _vhcl->ydelta() = _vhcl->zdelta() = 0.0;
return _curdir == 0;
+ }
+
+ double Route::length() {
+ double alldist=0.0;
+ for(int i=0; i<npts()-1; i++) {
+ double xdist = x()[i+1]-x()[i];
+ double ydist = x()[i+1]-x()[i];
+ double zdist = x()[i+1]-x()[i];
+ alldist += sqrt(xdist*xdist+ydist*ydist+zdist*zdist);
+ }
+ return alldist;
}
Index: Vehicle/route.h
diff -c Vehicle/route.h:1.1 Vehicle/route.h:1.2
*** Vehicle/route.h:1.1 Mon Aug 2 13:53:47 1999
--- src/Vehicle/route.h Mon Apr 10 22:40:59 2000
***************
*** 1,4 ****
--- 1,5 ----
/*
+ * Copyright (c) 2000 IET Inc.
* Copyright (c) 1997 Vectaport Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
***************
*** 50,57 ****
--- 51,62 ----
void step(float meters);
boolean finished();
+ double length();
+
Vehicle* vehicle() { return _vhcl; }
void vehicle(Vehicle* vhcl) { _vhcl = vhcl; }
+
+
protected:
char* _name;
Index: VhclServ/vhclfunc.c
diff -c VhclServ/vhclfunc.c:1.5 VhclServ/vhclfunc.c:1.6
*** VhclServ/vhclfunc.c:1.5 Fri Mar 24 23:21:09 2000
--- src/VhclServ/vhclfunc.c Mon Apr 10 22:41:01 2000
***************
*** 844,846 ****
--- 844,864 ----
return;
}
+ /*****************************************************************************/
+
+ RouteDistFunc::RouteDistFunc(ComTerp* comterp) : VhclFunc(comterp) {
+ }
+
+ void RouteDistFunc::execute() {
+ ComValue rtesym(stack_arg(0, true));
+ RouteComp* rtecomp = VhclFunc::findrte(rtesym.symbol_val());
+ reset_stack();
+ if (!rtecomp) {
+ push_stack(ComValue::nullval());
+ return;
+ }
+ ComValue retval(rtecomp->route()->length());
+ push_stack(retval);
+ return;
+ }
+
Index: VhclServ/vhclfunc.h
diff -c VhclServ/vhclfunc.h:1.4 VhclServ/vhclfunc.h:1.5
*** VhclServ/vhclfunc.h:1.4 Wed Mar 29 23:08:51 2000
--- src/VhclServ/vhclfunc.h Mon Apr 10 22:41:01 2000
***************
*** 243,246 ****
--- 243,254 ----
int _speed_symid;
};
+ class RouteDistFunc : public VhclFunc {
+ public:
+ RouteDistFunc(ComTerp*);
+ virtual void execute();
+ virtual const char* docstring() {
+ return "%s(rte) -- return total route distance"; }
+ };
+
#endif
Index: VhclServ/vhclhandler.c
diff -c VhclServ/vhclhandler.c:1.2 VhclServ/vhclhandler.c:1.3
*** VhclServ/vhclhandler.c:1.2 Sat Mar 18 02:24:17 2000
--- src/VhclServ/vhclhandler.c Mon Apr 10 22:41:01 2000
***************
*** 56,61 ****
--- 56,62 ----
comterp->add_command("vhcldelta", new VhclDeltaFunc(comterp));
comterp->add_command("simroute", new SimRouteFunc(comterp));
comterp->add_command("printroute", new PrintRouteFunc(comterp));
+ comterp->add_command("routedist", new RouteDistFunc(comterp));
MapservHandler::AddCommands(comterp);
comterp->add_command("load100kdlgfc", new Load100KDLGFCFunc(comterp));
*** /dev/null Mon Apr 10 22:41:07 PDT 2000
--- patches/vhclmaps-000410-johnston-020
*************** patches/vhclmaps-000410-johnston-020
*** 0 ****
--- 1 ----
+ vhclmaps-000410-johnston-020
|
|
From: <joh...@ie...> - 2000-04-06 23:59:13
|
Patch: vhclmaps-000407-johnston-019
For: vhclmaps-0.7.4
Author: joh...@us...
Subject: move utmgeo,geoutm,utmzone commands to mapserv, more composite vehicle improvements
Requires:
This is an intermediate patch to vhclmaps-0.7.4. To apply, cd to the
top-level directory of the vhclmaps source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- migrate commands for utmtogeo(), geotoutm(), and utmzone() from
projserv to mapserv, making them accessible from more layers of
vhclmaps.
- more composite vehicle work, automating the rotating of the group of
vehicles when heading changes.
Index: MapServ/Imakefile
diff -c MapServ/Imakefile:1.2 MapServ/Imakefile:1.3
*** MapServ/Imakefile:1.2 Tue Jan 25 03:22:01 2000
--- src/MapServ/Imakefile Fri Apr 7 04:24:53 2000
***************
*** 20,25 ****
--- 20,26 ----
Obj(geomdist)
Obj(mapfunc)
Obj(maphandler)
+ Obj(mapprojfunc)
IncludeDependencies()
Index: MapServ/maphandler.c
diff -c MapServ/maphandler.c:1.2 MapServ/maphandler.c:1.3
*** MapServ/maphandler.c:1.2 Sat Mar 18 02:24:06 2000
--- src/MapServ/maphandler.c Fri Apr 7 04:24:53 2000
***************
*** 23,28 ****
--- 23,29 ----
#include <ComTerp/comterpserv.h>
#include <MapServ/mapfunc.h>
+ #include <MapServ/mapprojfunc.h>
#include <MapServ/maphandler.h>
MapservHandler::MapservHandler(void) : ComterpHandler() {
***************
*** 74,79 ****
--- 75,84 ----
comterp->add_command("exportgrtr", new ExportFCGrTrFunc(expgraphic_func));
comterp->add_command("printgr", new PrintFCGrFunc(comterp));
comterp->add_command("points", new MapPointsFunc(comterp));
+
+ comterp->add_command("utmzone", new UtmZoneFunc(comterp));
+ comterp->add_command("utmtogeo", new UtmToGeoFunc(comterp));
+ comterp->add_command("geotoutm", new GeoToUtmFunc(comterp));
#if !defined(VPF_FREE)
comterp->add_command("loadvpffc", new LoadVpfFCFunc(comterp));
Index: mapserv/README
diff -c mapserv/README:1.2 mapserv/README:1.3
*** mapserv/README:1.2 Wed Mar 29 23:08:40 2000
--- src/mapserv/README Fri Apr 7 04:24:55 2000
***************
*** 75,80 ****
--- 75,86 ----
exportgrtr(tr_str) -- default transformer string for feature classes
printgr(fclass) -- print drawtool format to stdout
+ PROJECTION COMMANDS
+
+ int=utmzone(longitude) -- return utm zone for a given longitude
+ utme,utmn=geotoutm(long,lat) -- convert geo(longitude/latitude) to utm
+ long,lat=geotoutm(utme,utmn zone) -- convert utm to geo (longitude/latitude)
+
UTILITY COMMANDS
int=utmzone(longitude) -- return utm zone for a given longitude
Index: UtmUnidraw/utmeditor.c
diff -c UtmUnidraw/utmeditor.c:1.4 UtmUnidraw/utmeditor.c:1.5
*** UtmUnidraw/utmeditor.c:1.4 Tue Mar 21 12:03:21 2000
--- src/UtmUnidraw/utmeditor.c Fri Apr 7 04:24:56 2000
***************
*** 40,45 ****
--- 40,47 ----
#include <Attribute/attrlist.h>
#include <Attribute/attrvalue.h>
+ // #define FRAME_COMMANDS /* add flipbook commands to interpeter */
+
/*****************************************************************************/
UtmEditor::UtmEditor(OverlayComp* gc, OverlayKit* ok)
***************
*** 131,137 ****
--- 133,143 ----
comterp->add_command("mapviewstate", new MapViewStateFunc(comterp, this));
comterp->add_command("utmtoscreen", new UtmToScreenFunc(comterp, this));
+ #if defined(FRAME_COMMANDS)
+ FrameEditor::AddCommands(comterp);
+ #else
ComEditor::AddCommands(comterp);
+ #endif
MapservHandler::AddCommands(comterp);
// override more generic dot func
Index: UtmUnidraw/utmkit.h
diff -c UtmUnidraw/utmkit.h:1.1 UtmUnidraw/utmkit.h:1.2
*** UtmUnidraw/utmkit.h:1.1 Mon Aug 2 13:53:25 1999
--- src/UtmUnidraw/utmkit.h Fri Apr 7 04:24:56 2000
***************
*** 1,4 ****
--- 1,5 ----
/*
+ * Copyright 2000 IET Inc.
* Copyright 1997 Vectaport Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
***************
*** 47,52 ****
--- 48,54 ----
virtual Glyph* MakeToolbar();
virtual Glyph* MakeStates();
virtual MenuItem* MakeFileMenu();
+ virtual MenuItem* MakeStructureMenu() { return nil; }
virtual MenuItem* MakeRouteMenu();
virtual MenuItem* MakeMapMenu();
virtual Glyph* MakeMenus();
Index: ProjServ/projfunc.c
diff -c ProjServ/projfunc.c:1.6 ProjServ/projfunc.c:1.7
*** ProjServ/projfunc.c:1.6 Thu Mar 30 05:30:52 2000
--- src/ProjServ/projfunc.c Fri Apr 7 04:24:58 2000
***************
*** 315,410 ****
result.object_compview(true);
push_stack(result);
}
-
- /*****************************************************************************/
-
- UtmZoneFunc::UtmZoneFunc(ComTerp* comterp) : ComFunc(comterp) {
- }
-
- void UtmZoneFunc::execute() {
- ComValue longv(stack_arg(0));
- reset_stack();
- ComValue retval(MapProjection::utmzone(longv.float_val()));
- push_stack(retval);
- }
-
- /*****************************************************************************/
-
- UtmToGeoFunc::UtmToGeoFunc(ComTerp* comterp) : ComFunc(comterp) {
- }
-
- void UtmToGeoFunc::execute() {
- ComValue utmsv(stack_arg(0));
- ComValue zonev(stack_arg(1));
- reset_stack();
- char zs[40];
- sprintf(zs, "zone=%f", zonev.float_val());
- char* parms[4];
- parms[0] = "proj=utm";
- parms[1] = "ellps=WGS84";
- parms[2] = zs;
- parms[3] = "no_defs";
- PJ* proj= pj_init(4, parms);
- AttributeValueList *avl = utmsv.is_type(ComValue::ArrayType)
- ? utmsv.array_val() : nil;
- if (avl && proj) {
- Iterator i;
- avl->First(i);
- UV data;
- data.u = avl->GetAttrVal(i)->double_val();
- avl->Next(i);
- data.v = avl->GetAttrVal(i)->double_val();
- data = pj_inv(data, proj);
- double lon = data.u * RAD_TO_DEG;
- double lat = data.v * RAD_TO_DEG;
- AttributeValueList* navl = new AttributeValueList();
- navl->Append(new ComValue(lon));
- navl->Append(new ComValue(lat));
- ComValue retval(navl);
- push_stack(retval);
- }
- delete proj;
- }
-
- /*****************************************************************************/
-
- GeoToUtmFunc::GeoToUtmFunc(ComTerp* comterp) : ComFunc(comterp) {
- }
-
- void GeoToUtmFunc::execute() {
- ComValue lonlatv(stack_arg(0));
- reset_stack();
- AttributeValueList *avl = lonlatv.is_type(ComValue::ArrayType)
- ? lonlatv.array_val() : nil;
- if (avl && avl->Number()==2) {
- Iterator i;
- avl->First(i);
- double lon = avl->GetAttrVal(i)->double_val();
- avl->Next(i);
- double lat = avl->GetAttrVal(i)->double_val();
- char ls[40];
- sprintf(ls, "lon_0=%f", lon);
- char* parms[4];
- parms[0] = "proj=utm";
- parms[1] = "ellps=WGS84";
- parms[2] = ls;
- parms[3] = "no_defs";
- PJ* proj= pj_init(4, parms);
- if (proj) {
- UV data;
- data.u = lon * DEG_TO_RAD;
- data.v = lat * DEG_TO_RAD;
- data = pj_fwd(data, proj);
- double lat = data.v * RAD_TO_DEG;
- AttributeValueList* navl = new AttributeValueList();
- navl->Append(new ComValue(data.u));
- navl->Append(new ComValue(data.v));
- ComValue retval(navl);
- push_stack(retval);
- }
- delete proj;
- }
- }
-
-
-
--- 315,317 ----
Index: ProjServ/projfunc.h
diff -c ProjServ/projfunc.h:1.3 ProjServ/projfunc.h:1.4
*** ProjServ/projfunc.h:1.3 Thu Mar 30 05:30:52 2000
--- src/ProjServ/projfunc.h Fri Apr 7 04:24:58 2000
***************
*** 66,95 ****
_spacing_symid, _resolution_symid;
};
- class UtmZoneFunc : public ComFunc {
- public:
- UtmZoneFunc(ComTerp*);
- virtual void execute();
- virtual const char* docstring() {
- return "int=%s(longitude) -- return utm zone for given longitude"; }
- };
-
- class UtmToGeoFunc : public ComFunc {
- public:
- UtmToGeoFunc(ComTerp*);
- virtual void execute();
- virtual const char* docstring() {
- return "long,lat=%s(utme,utmn zone) -- convert utm to geo (longitude/latitude)"; }
- };
-
- class GeoToUtmFunc : public ComFunc {
- public:
- GeoToUtmFunc(ComTerp*);
- virtual void execute();
- virtual const char* docstring() {
- return "utme,utmn=%s(long,lat) -- convert geo (longitude/latitude) to utm"; }
- };
-
#endif
--- 66,71 ----
Index: ProjServ/projhandler.c
diff -c ProjServ/projhandler.c:1.4 ProjServ/projhandler.c:1.5
*** ProjServ/projhandler.c:1.4 Thu Mar 30 05:30:52 2000
--- src/ProjServ/projhandler.c Fri Apr 7 04:24:58 2000
***************
*** 22,27 ****
--- 22,28 ----
*/
#include <MapServ/mapfunc.h>
+ #include <MapServ/mapprojfunc.h>
#include <UtmUnidraw/utmfunc.h>
#include <ComTerp/comterpserv.h>
#include <ProjServ/projfunc.h>
Index: projserv/README
diff -c projserv/README:1.3 projserv/README:1.4
*** projserv/README:1.3 Thu Mar 30 05:30:54 2000
--- src/projserv/README Fri Apr 7 04:25:00 2000
***************
*** 34,45 ****
fclass=graticulefc(:startlon -180.0 :endlon 180.0 :startlat -90.0 :endlat :90.0 :spacing 15.0 :resolution 5.0) -- create a graticule feature class
intlist=vpftileidsbygeo(dbpathstr libname sw_lon sw_lat ne_lon ne_lat) -- return ids of VPF tiles containing a geo rectangle
- PROJECTION COMMANDS
-
- int=utmzone(longitude) -- return utm zone for a given longitude
- utme,utmn=geotoutm(long,lat) -- convert geo(longitude/latitude) to utm
- long,lat=geotoutm(utme,utmn zone) -- convert utm to geo (longitude/latitude)
-
SEE ALSO
mapserv
--- 34,39 ----
Index: Vehicle/compositevhcl.c
diff -c Vehicle/compositevhcl.c:1.3 Vehicle/compositevhcl.c:1.4
*** Vehicle/compositevhcl.c:1.3 Wed Mar 29 23:08:49 2000
--- src/Vehicle/compositevhcl.c Fri Apr 7 04:25:03 2000
***************
*** 45,50 ****
--- 45,53 ----
_loc[0] = cx/_nvhcls;
_loc[1] = cy/_nvhcls;
_loc[2] = cz/_nvhcls;
+ _dir[0] = 0;
+ _dir[1] = 1;
+ _dir[0] = 0;
_defer_composite_update = false;
}
***************
*** 66,74 ****
--- 69,79 ----
cx /= _nvhcls;
cy /= _nvhcls;
cz /= _nvhcls;
+ #if 0
_dir[0] = cx - _loc[0];
_dir[1] = cy - _loc[1];
_dir[2] = cz - _loc[2];
+ #endif
_loc[0] = cx;
_loc[1] = cy;
_loc[2] = cz;
***************
*** 77,82 ****
--- 82,88 ----
void CompositeVehicle::update(Observable* obs) {
if (!_defer_composite_update) {
+ Vehicle::update(obs);
recompute();
notify();
}
***************
*** 233,271 ****
void CompositeVehicle::jumpturn(float x, float y, float z,
float dx, float dy) {
! if (dx || dy) {
! defer_composite_update()=true;
! int nvhcls = nsubvhcls();
! for(int i=0; i<nvhcls; i++) {
! Vehicle* subv = subvhcl(i);
! if (subv) subv->jumpturn(x, y, z, dx, dy);
! }
! defer_composite_update()=false;
! recompute();notify();
}
}
void CompositeVehicle::jumpturn(float x, float y, float z,
float dx, float dy, float dz) {
! if (dx || dy || dz) {
! defer_composite_update()=true;
! int nvhcls = nsubvhcls();
! for(int i=0; i<nvhcls; i++) {
! Vehicle* subv = subvhcl(i);
! if (subv) subv->jumpturn(x, y, z, dx, dy);
! }
! defer_composite_update()=false;
! recompute();notify();
! }
}
void CompositeVehicle::jumpturn(float* loc, float* dir, int n) {
defer_composite_update()=true;
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
! if (subv) subv->jumpturn(loc, dir, n);
! }
defer_composite_update()=false;
recompute();notify();
}
--- 239,315 ----
void CompositeVehicle::jumpturn(float x, float y, float z,
float dx, float dy) {
! float angle =
! (asin(dy/sqrt(dx*dx+dy*dy)) - asin(ydir()/sqrt(xdir()*xdir()+ydir()*ydir())))*RAD_TO_DEG;
! rotate2d(angle);
!
! float cx = xloc();
! float cy = yloc();
! float cz = zloc();
! defer_composite_update()=true;
! int nvhcls = nsubvhcls();
! for(int i=0; i<nvhcls; i++) {
! Vehicle* subv = subvhcl(i);
! float xoff = subv->xloc()-cx;
! float yoff = subv->yloc()-cy;
! float zoff = subv->zloc()-cz;
! if (subv) subv->jumpturn(x+xoff, y+yoff, z+zoff, dx, dy);
}
+ xdir() = dx;
+ ydir() = dy;
+ defer_composite_update()=false;
+ recompute();notify();
}
void CompositeVehicle::jumpturn(float x, float y, float z,
float dx, float dy, float dz) {
! float angle =
! (asin(dy/sqrt(dx*dx+dy*dy)) - asin(ydir()/sqrt(xdir()*xdir()+ydir()*ydir())))*RAD_TO_DEG;
! rotate2d(angle);
!
! float cx = xloc();
! float cy = yloc();
! float cz = zloc();
! defer_composite_update()=true;
! int nvhcls = nsubvhcls();
! for(int i=0; i<nvhcls; i++) {
! Vehicle* subv = subvhcl(i);
! float xoff = subv->xloc()-cx;
! float yoff = subv->yloc()-cy;
! float zoff = subv->zloc()-cz;
! if (subv) subv->jumpturn(x+xoff, y+yoff, z+zoff, dx, dy);
! }
! xdir() = dx;
! ydir() = dy;
! zdir() = dz;
! defer_composite_update()=false;
! recompute();notify();
}
void CompositeVehicle::jumpturn(float* loc, float* dir, int n) {
+ float angle =
+ (asin(dir[1]/sqrt(dir[0]*dir[0]+dir[1]*dir[1])) - asin(ydir()/sqrt(xdir()*xdir()+ydir()*ydir())))*RAD_TO_DEG;
+ rotate2d(angle);
+
defer_composite_update()=true;
int nvhcls = nsubvhcls();
+ float cs[n];
+ if(n>0) cs[0] = xloc();
+ if(n>1) cs[1] = yloc();
+ if(n>2) cs[2] = zloc();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
!
! float locoffs[n];
! if(n>0) locoffs[0] = loc[0] - (subv->xloc()-cs[0]);
! if(n>1) locoffs[1] = loc[1] - (subv->yloc()-cs[1]);
! if(n>2) locoffs[2] = loc[2] - (subv->zloc()-cs[2]);
!
! if (subv) subv->jumpturn(locoffs, dir, n);
! }
! if(n>0) xdir() = dir[0];
! if(n>1) ydir() = dir[1];
! if(n>2) ydir() = dir[2];
defer_composite_update()=false;
recompute();notify();
}
***************
*** 313,318 ****
--- 357,367 ----
newvec *= veclen;
vhcl->xloc() = newvec[0]+cx;
vhcl->yloc() = newvec[1]+cy;
+ vec2 dirvec(vhcl->xdir(), vhcl->ydir());
+ mat3 dirmat = rotation2D(dirvec, ang);
+ vec2 newdirvec = dirvec * dirmat;
+ vhcl->xdir() = newdirvec[0];
+ vhcl->ydir() = newdirvec[1];
}
defer_composite_update()=false;
recompute();notify();
Index: VhclUnidraw/vhclkit.c
diff -c VhclUnidraw/vhclkit.c:1.3 VhclUnidraw/vhclkit.c:1.4
*** VhclUnidraw/vhclkit.c:1.3 Mon Feb 28 17:28:05 2000
--- src/VhclUnidraw/vhclkit.c Fri Apr 7 04:25:05 2000
***************
*** 118,123 ****
--- 118,124 ----
MakeMenu(mbi, new OvQuitCmd(new ControlInfo("Quit", KLBL_QUIT, CODE_QUIT)),
"Quit ");
+
return mbi;
}
*** /dev/null Fri Apr 7 04:25:08 PDT 2000
--- patches/vhclmaps-000407-johnston-019
*************** patches/vhclmaps-000407-johnston-019
*** 0 ****
--- 1 ----
+ vhclmaps-000407-johnston-019
|
|
From: <joh...@ie...> - 2000-04-06 23:58:43
|
Patch: vhclmaps-000330-johnston-018
For: vhclmaps-0.7.4
Author: joh...@us...
Subject: add utmtogeo and geotoutm commands to projserv
Requires:
This is an intermediate patch to vhclmaps-0.7.4. To apply, cd to the
top-level directory of the vhclmaps source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- add utmtogeo and geotoutm commands to projserv
Index: ProjServ/projfunc.c
diff -c ProjServ/projfunc.c:1.5 ProjServ/projfunc.c:1.6
*** ProjServ/projfunc.c:1.5 Wed Mar 29 23:08:45 2000
--- src/ProjServ/projfunc.c Thu Mar 30 05:30:52 2000
***************
*** 315,320 ****
--- 315,321 ----
result.object_compview(true);
push_stack(result);
}
+
/*****************************************************************************/
UtmZoneFunc::UtmZoneFunc(ComTerp* comterp) : ComFunc(comterp) {
***************
*** 325,330 ****
--- 326,409 ----
reset_stack();
ComValue retval(MapProjection::utmzone(longv.float_val()));
push_stack(retval);
+ }
+
+ /*****************************************************************************/
+
+ UtmToGeoFunc::UtmToGeoFunc(ComTerp* comterp) : ComFunc(comterp) {
+ }
+
+ void UtmToGeoFunc::execute() {
+ ComValue utmsv(stack_arg(0));
+ ComValue zonev(stack_arg(1));
+ reset_stack();
+ char zs[40];
+ sprintf(zs, "zone=%f", zonev.float_val());
+ char* parms[4];
+ parms[0] = "proj=utm";
+ parms[1] = "ellps=WGS84";
+ parms[2] = zs;
+ parms[3] = "no_defs";
+ PJ* proj= pj_init(4, parms);
+ AttributeValueList *avl = utmsv.is_type(ComValue::ArrayType)
+ ? utmsv.array_val() : nil;
+ if (avl && proj) {
+ Iterator i;
+ avl->First(i);
+ UV data;
+ data.u = avl->GetAttrVal(i)->double_val();
+ avl->Next(i);
+ data.v = avl->GetAttrVal(i)->double_val();
+ data = pj_inv(data, proj);
+ double lon = data.u * RAD_TO_DEG;
+ double lat = data.v * RAD_TO_DEG;
+ AttributeValueList* navl = new AttributeValueList();
+ navl->Append(new ComValue(lon));
+ navl->Append(new ComValue(lat));
+ ComValue retval(navl);
+ push_stack(retval);
+ }
+ delete proj;
+ }
+
+ /*****************************************************************************/
+
+ GeoToUtmFunc::GeoToUtmFunc(ComTerp* comterp) : ComFunc(comterp) {
+ }
+
+ void GeoToUtmFunc::execute() {
+ ComValue lonlatv(stack_arg(0));
+ reset_stack();
+ AttributeValueList *avl = lonlatv.is_type(ComValue::ArrayType)
+ ? lonlatv.array_val() : nil;
+ if (avl && avl->Number()==2) {
+ Iterator i;
+ avl->First(i);
+ double lon = avl->GetAttrVal(i)->double_val();
+ avl->Next(i);
+ double lat = avl->GetAttrVal(i)->double_val();
+ char ls[40];
+ sprintf(ls, "lon_0=%f", lon);
+ char* parms[4];
+ parms[0] = "proj=utm";
+ parms[1] = "ellps=WGS84";
+ parms[2] = ls;
+ parms[3] = "no_defs";
+ PJ* proj= pj_init(4, parms);
+ if (proj) {
+ UV data;
+ data.u = lon * DEG_TO_RAD;
+ data.v = lat * DEG_TO_RAD;
+ data = pj_fwd(data, proj);
+ double lat = data.v * RAD_TO_DEG;
+ AttributeValueList* navl = new AttributeValueList();
+ navl->Append(new ComValue(data.u));
+ navl->Append(new ComValue(data.v));
+ ComValue retval(navl);
+ push_stack(retval);
+ }
+ delete proj;
+ }
}
Index: ProjServ/projfunc.h
diff -c ProjServ/projfunc.h:1.2 ProjServ/projfunc.h:1.3
*** ProjServ/projfunc.h:1.2 Wed Mar 29 23:08:46 2000
--- src/ProjServ/projfunc.h Thu Mar 30 05:30:52 2000
***************
*** 74,77 ****
--- 74,98 ----
return "int=%s(longitude) -- return utm zone for given longitude"; }
};
+ class UtmToGeoFunc : public ComFunc {
+ public:
+ UtmToGeoFunc(ComTerp*);
+ virtual void execute();
+ virtual const char* docstring() {
+ return "long,lat=%s(utme,utmn zone) -- convert utm to geo (longitude/latitude)"; }
+ };
+
+ class GeoToUtmFunc : public ComFunc {
+ public:
+ GeoToUtmFunc(ComTerp*);
+ virtual void execute();
+ virtual const char* docstring() {
+ return "utme,utmn=%s(long,lat) -- convert geo (longitude/latitude) to utm"; }
+ };
+
#endif
+
+
+
+
+
Index: ProjServ/projhandler.c
diff -c ProjServ/projhandler.c:1.3 ProjServ/projhandler.c:1.4
*** ProjServ/projhandler.c:1.3 Wed Mar 29 23:08:46 2000
--- src/ProjServ/projhandler.c Thu Mar 30 05:30:52 2000
***************
*** 76,89 ****
comterp->add_command("exportgrtr", new ExportFCGrTrFunc(expgraphic_func));
comterp->add_command("printgr", new PrintFCGrFunc(comterp));
comterp->add_command("loadvpffc", new LoadVpfFCFunc(comterp));
comterp->add_command("load100kdlgfc", new Load100KDLGFCFunc(comterp));
comterp->add_command("vpftileidsbygeo", new VpfTileIdsByGeoFunc(comterp));
comterp->add_command("graticulefc", new GraticuleFCFunc(comterp));
- comterp->add_command("utmzone", new UtmZoneFunc(comterp));
! comterp->add_command("points", new MapPointsFunc(comterp));
!
}
--- 76,91 ----
comterp->add_command("exportgrtr", new ExportFCGrTrFunc(expgraphic_func));
comterp->add_command("printgr", new PrintFCGrFunc(comterp));
+ comterp->add_command("points", new MapPointsFunc(comterp));
+
comterp->add_command("loadvpffc", new LoadVpfFCFunc(comterp));
comterp->add_command("load100kdlgfc", new Load100KDLGFCFunc(comterp));
comterp->add_command("vpftileidsbygeo", new VpfTileIdsByGeoFunc(comterp));
comterp->add_command("graticulefc", new GraticuleFCFunc(comterp));
! comterp->add_command("utmzone", new UtmZoneFunc(comterp));
! comterp->add_command("utmtogeo", new UtmToGeoFunc(comterp));
! comterp->add_command("geotoutm", new GeoToUtmFunc(comterp));
}
Index: projserv/README
diff -c projserv/README:1.2 projserv/README:1.3
*** projserv/README:1.2 Wed Mar 29 23:08:47 2000
--- src/projserv/README Thu Mar 30 05:30:54 2000
***************
*** 33,41 ****
fclass=load100kdlgfc(dbpathstr libnamestr covnamestr fcnamestr) -- import a 100K DLG format feature class
fclass=graticulefc(:startlon -180.0 :endlon 180.0 :startlat -90.0 :endlat :90.0 :spacing 15.0 :resolution 5.0) -- create a graticule feature class
intlist=vpftileidsbygeo(dbpathstr libname sw_lon sw_lat ne_lon ne_lat) -- return ids of VPF tiles containing a geo rectangle
- int=utmzone(longitude) -- return utm zone for a given longitude
SEE ALSO
mapserv
--- 33,44 ----
fclass=load100kdlgfc(dbpathstr libnamestr covnamestr fcnamestr) -- import a 100K DLG format feature class
fclass=graticulefc(:startlon -180.0 :endlon 180.0 :startlat -90.0 :endlat :90.0 :spacing 15.0 :resolution 5.0) -- create a graticule feature class
intlist=vpftileidsbygeo(dbpathstr libname sw_lon sw_lat ne_lon ne_lat) -- return ids of VPF tiles containing a geo rectangle
+ PROJECTION COMMANDS
+ int=utmzone(longitude) -- return utm zone for a given longitude
+ utme,utmn=geotoutm(long,lat) -- convert geo(longitude/latitude) to utm
+ long,lat=geotoutm(utme,utmn zone) -- convert utm to geo (longitude/latitude)
SEE ALSO
mapserv
*** /dev/null Thu Mar 30 05:31:01 PST 2000
--- patches/vhclmaps-000330-johnston-018
*************** patches/vhclmaps-000330-johnston-018
*** 0 ****
--- 1 ----
+ vhclmaps-000330-johnston-018
|
|
From: <joh...@ie...> - 2000-04-06 23:58:17
|
Patch: vhclmaps-000330-johnston-017 For: vhclmaps-0.7.4 Author: joh...@us... Subject: missing include file Requires: This is an intermediate patch to vhclmaps-0.7.4. To apply, cd to the top-level directory of the vhclmaps source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - missing #include of <Map/maproject.h> in LosServ/losfunc.c Index: LosServ/losfunc.c diff -c LosServ/losfunc.c:1.7 LosServ/losfunc.c:1.8 *** LosServ/losfunc.c:1.7 Wed Mar 29 23:08:44 2000 --- src/LosServ/losfunc.c Thu Mar 30 03:29:54 2000 *************** *** 44,49 **** --- 44,50 ---- #include <Map/mapfclass.h> #include <Map/mapfeature.h> #include <Map/mapprim.h> + #include <Map/mapproject.h> #include <MapServ/mapfunc.h> #include <MapUnidraw/mapcomps.h> #include <Attribute/attribute.h> *** /dev/null Thu Mar 30 03:30:03 PST 2000 --- patches/vhclmaps-000330-johnston-017 *************** patches/vhclmaps-000330-johnston-017 *** 0 **** --- 1 ---- + vhclmaps-000330-johnston-017 |
|
From: <joh...@ie...> - 2000-04-06 23:17:58
|
Patch: vhclmaps-000329-johnston-016
For: vhclmaps-0.7.4
Author: joh...@us...
Subject: composite vehicle rotation and utmzone func
Requires:
This is an intermediate patch to vhclmaps-0.7.4. To apply, cd to the
top-level directory of the vhclmaps source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- ability to rotate composite vehicles in a vhclserv or derivative program
- utmzone func added to projserv, uses MapProjection::utmzone.
Index: MapUnidraw/mapscripts.c
diff -c MapUnidraw/mapscripts.c:1.3 MapUnidraw/mapscripts.c:1.4
*** MapUnidraw/mapscripts.c:1.3 Tue Mar 21 12:03:12 2000
--- src/MapUnidraw/mapscripts.c Wed Mar 29 23:08:38 2000
***************
*** 720,725 ****
--- 720,726 ----
return MAPFCLASS_RAW == id || MapFClassScript::IsA(id);
}
+ #if 0
static int utmzone(float lon) {
if (lon > -180.0 && lon < -174.0)
return 1;
***************
*** 844,849 ****
--- 845,851 ----
else
return 0;
}
+ #endif
boolean MapFClassRawScript::Definition (ostream& out) {
Iterator i;
***************
*** 885,891 ****
// char ln0[80];
// sprintf(ln0, "%f", x1);
! utm_zone = utmzone(x1+0.1);
}
// out << " :lon0 " << ln0;
out << "\n :proj " << "utm";
--- 887,893 ----
// char ln0[80];
// sprintf(ln0, "%f", x1);
! utm_zone = MapProjection::utmzone(x1+0.1);
}
// out << " :lon0 " << ln0;
out << "\n :proj " << "utm";
Index: mapserv/README
diff -c mapserv/README:1.1 mapserv/README:1.2
*** mapserv/README:1.1 Mon Aug 2 13:53:23 1999
--- src/mapserv/README Wed Mar 29 23:08:40 2000
***************
*** 75,80 ****
--- 75,84 ----
exportgrtr(tr_str) -- default transformer string for feature classes
printgr(fclass) -- print drawtool format to stdout
+ UTILITY COMMANDS
+
+ int=utmzone(longitude) -- return utm zone for a given longitude
+
OTHER COMMANDS
Index: LosServ/losfunc.c
diff -c LosServ/losfunc.c:1.6 LosServ/losfunc.c:1.7
*** LosServ/losfunc.c:1.6 Fri Mar 24 23:21:01 2000
--- src/LosServ/losfunc.c Wed Mar 29 23:08:44 2000
***************
*** 435,440 ****
--- 435,441 ----
/*****************************************************************************/
+ #if 0
static int utmzone(float lon) {
if (lon > -180.0 && lon < -174.0)
return 1;
***************
*** 559,564 ****
--- 560,566 ----
else
return 0;
}
+ #endif
inline double dmin(double a, double b) { return a < b ? a : b; } \
inline double dmax(double a, double b) { return a > b ? a : b; }
***************
*** 655,661 ****
AttributeList* alist = mfccomp->GetAttributeList();
alist->add_attr("proj", new AttributeValue("utm"));
alist->add_attr("ellps", new AttributeValue("WGS84"));
! int zone = utmzone(xmin);
mapfc->set_extent(xmin, ymin, xmax, ymax, zone);
if (zone) {
AttributeValue* zoneval = new AttributeValue(zone, AttributeValue::IntType);
--- 657,663 ----
AttributeList* alist = mfccomp->GetAttributeList();
alist->add_attr("proj", new AttributeValue("utm"));
alist->add_attr("ellps", new AttributeValue("WGS84"));
! int zone = MapProjection::utmzone(xmin);
mapfc->set_extent(xmin, ymin, xmax, ymax, zone);
if (zone) {
AttributeValue* zoneval = new AttributeValue(zone, AttributeValue::IntType);
Index: ProjServ/projfunc.c
diff -c ProjServ/projfunc.c:1.4 ProjServ/projfunc.c:1.5
*** ProjServ/projfunc.c:1.4 Fri Mar 24 23:21:03 2000
--- src/ProjServ/projfunc.c Wed Mar 29 23:08:45 2000
***************
*** 1,4 ****
--- 1,5 ----
/*
+ * Copyright (c) 2000 IET Inc.
* Copyright (c) 1998-1999 Vectaport Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
***************
*** 48,53 ****
--- 49,55 ----
#include <Map/mapfeature.h>
#include <Map/mapprim.h>
+ #include <Map/mapproject.h>
#include <TopoFace/fgeomobjs.h>
#include <TopoFace/topoface.h>
***************
*** 65,70 ****
--- 67,74 ----
#include <ComUtil/comutil.h>
+ /*****************************************************************************/
+
LoadVpfFCFunc::LoadVpfFCFunc(ComTerp* comterp) : ComFunc(comterp) {
_tileid_symid = symbol_add("tileid");
}
***************
*** 135,140 ****
--- 139,146 ----
}
}
+ /*****************************************************************************/
+
VpfTileIdsByGeoFunc::VpfTileIdsByGeoFunc(ComTerp* comterp) : ComFunc(comterp) {
}
***************
*** 179,184 ****
--- 185,192 ----
push_stack(result);
}
+ /*****************************************************************************/
+
Load100KDLGFCFunc::Load100KDLGFCFunc(ComTerp* comterp) : ComFunc(comterp) {
}
***************
*** 215,220 ****
--- 223,230 ----
push_stack(result);
}
+ /*****************************************************************************/
+
GraticuleFCFunc::GraticuleFCFunc(ComTerp* comterp) : ComFunc(comterp) {
_startlon_symid = symbol_add("startlon");
_endlon_symid = symbol_add("endlon");
***************
*** 305,307 ****
--- 315,331 ----
result.object_compview(true);
push_stack(result);
}
+ /*****************************************************************************/
+
+ UtmZoneFunc::UtmZoneFunc(ComTerp* comterp) : ComFunc(comterp) {
+ }
+
+ void UtmZoneFunc::execute() {
+ ComValue longv(stack_arg(0));
+ reset_stack();
+ ComValue retval(MapProjection::utmzone(longv.float_val()));
+ push_stack(retval);
+ }
+
+
+
Index: ProjServ/projfunc.h
diff -c ProjServ/projfunc.h:1.1 ProjServ/projfunc.h:1.2
*** ProjServ/projfunc.h:1.1 Mon Aug 2 13:53:39 1999
--- src/ProjServ/projfunc.h Wed Mar 29 23:08:46 2000
***************
*** 1,4 ****
--- 1,5 ----
/*
+ * Copyright (c) 2000 IET Inc.
* Copyright (c) 1998 Vectaport Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
***************
*** 63,68 ****
--- 64,77 ----
protected:
int _startlon_symid, _endlon_symid, _startlat_symid, _endlat_symid,
_spacing_symid, _resolution_symid;
+ };
+
+ class UtmZoneFunc : public ComFunc {
+ public:
+ UtmZoneFunc(ComTerp*);
+ virtual void execute();
+ virtual const char* docstring() {
+ return "int=%s(longitude) -- return utm zone for given longitude"; }
};
#endif
Index: ProjServ/projhandler.c
diff -c ProjServ/projhandler.c:1.2 ProjServ/projhandler.c:1.3
*** ProjServ/projhandler.c:1.2 Sat Mar 18 02:24:14 2000
--- src/ProjServ/projhandler.c Wed Mar 29 23:08:46 2000
***************
*** 80,87 ****
--- 80,89 ----
comterp->add_command("load100kdlgfc", new Load100KDLGFCFunc(comterp));
comterp->add_command("vpftileidsbygeo", new VpfTileIdsByGeoFunc(comterp));
comterp->add_command("graticulefc", new GraticuleFCFunc(comterp));
+ comterp->add_command("utmzone", new UtmZoneFunc(comterp));
comterp->add_command("points", new MapPointsFunc(comterp));
+
}
Index: projserv/README
diff -c projserv/README:1.1 projserv/README:1.2
*** projserv/README:1.1 Mon Aug 2 13:53:41 1999
--- src/projserv/README Wed Mar 29 23:08:47 2000
***************
*** 33,38 ****
--- 33,40 ----
fclass=load100kdlgfc(dbpathstr libnamestr covnamestr fcnamestr) -- import a 100K DLG format feature class
fclass=graticulefc(:startlon -180.0 :endlon 180.0 :startlat -90.0 :endlat :90.0 :spacing 15.0 :resolution 5.0) -- create a graticule feature class
intlist=vpftileidsbygeo(dbpathstr libname sw_lon sw_lat ne_lon ne_lat) -- return ids of VPF tiles containing a geo rectangle
+ int=utmzone(longitude) -- return utm zone for a given longitude
+
SEE ALSO
Index: Vehicle/compositevhcl.c
diff -c Vehicle/compositevhcl.c:1.2 Vehicle/compositevhcl.c:1.3
*** Vehicle/compositevhcl.c:1.2 Fri Mar 24 23:21:06 2000
--- src/Vehicle/compositevhcl.c Wed Mar 29 23:08:49 2000
***************
*** 34,39 ****
--- 34,40 ----
for (int i=0; i<nvhcls; i++) {
if (vhcls[i]) {
_vhcls[cnt] = vhcls[i];
+ _vhcls[cnt]->attach(this);
cx += _vhcls[cnt]->xloc();
cy += _vhcls[cnt]->yloc();
cz += _vhcls[cnt]->zloc();
***************
*** 44,49 ****
--- 45,51 ----
_loc[0] = cx/_nvhcls;
_loc[1] = cy/_nvhcls;
_loc[2] = cz/_nvhcls;
+ _defer_composite_update = false;
}
CompositeVehicle::~CompositeVehicle() {
***************
*** 74,270 ****
}
void CompositeVehicle::update(Observable* obs) {
! recompute();
! notify();
}
void CompositeVehicle::move(float dx, float dy) {
if (dx || dy) {
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->move(dx, dy);
}
recompute();
}
}
void CompositeVehicle::move(float dx, float dy, float dz) {
if (dx || dy || dz) {
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->move(dx, dy, dz);
}
! recompute();
}
}
void CompositeVehicle::move(float* deltas, int ndeltas) {
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->move(deltas, ndeltas);
}
! recompute();
}
void CompositeVehicle::jump(float x, float y) {
if (x || y) {
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->jump(x, y);
}
! recompute();
}
}
void CompositeVehicle::jump(float x, float y, float z) {
if (x || y || z) {
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->jump(x, y, z);
}
! recompute();
}
}
void CompositeVehicle::jump(float* loc, int n) {
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->jump(loc, n);
}
! recompute();
}
void CompositeVehicle::turn(float dx, float dy) {
if (dx || dy) {
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->turn(dx, dy);
}
! recompute();
}
}
void CompositeVehicle::turn(float dx, float dy, float dz) {
if (dx || dy || dz) {
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->turn(dx, dy, dz);
}
! recompute();
}
}
void CompositeVehicle::turn(float* deltas, int ndeltas) {
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->turn(deltas, ndeltas);
}
! recompute();
}
void CompositeVehicle::turnto(float x, float y) {
if (x || y) {
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->turnto(x, y);
}
! recompute();
}
}
void CompositeVehicle::turnto(float x, float y, float z) {
if (x || y || z) {
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->turnto(x, y, z);
}
! recompute();
}
}
void CompositeVehicle::turnto(float* dir, int n) {
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->turnto(dir, n);
}
! recompute();
}
void CompositeVehicle::jumpturn(float x, float y, float z,
float dx, float dy) {
if (dx || dy) {
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->jumpturn(x, y, z, dx, dy);
}
! recompute();
}
}
void CompositeVehicle::jumpturn(float x, float y, float z,
float dx, float dy, float dz) {
if (dx || dy || dz) {
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->jumpturn(x, y, z, dx, dy);
}
! recompute();
}
}
void CompositeVehicle::jumpturn(float* loc, float* dir, int n) {
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->jumpturn(loc, dir, n);
}
! recompute();
}
void CompositeVehicle::forward2d(float dist) {
if (dist) {
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->forward2d(dist);
}
! recompute();
}
}
void CompositeVehicle::backward2d(float dist) {
if (dist) {
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->backward2d(dist);
}
! recompute();
}
}
void CompositeVehicle::rotate2d(float ang) {
if (ang) {
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
! Vehicle* subv = subvhcl(i);
! if (subv) subv->rotate2d(ang);
}
! recompute();
}
}
--- 76,321 ----
}
void CompositeVehicle::update(Observable* obs) {
! if (!_defer_composite_update) {
! recompute();
! notify();
! }
}
void CompositeVehicle::move(float dx, float dy) {
if (dx || dy) {
+ defer_composite_update()=true;
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->move(dx, dy);
}
+ defer_composite_update()=false;
recompute();
+ notify();
}
}
void CompositeVehicle::move(float dx, float dy, float dz) {
if (dx || dy || dz) {
+ defer_composite_update()=true;
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->move(dx, dy, dz);
}
! defer_composite_update()=false;
! recompute();notify();
}
}
void CompositeVehicle::move(float* deltas, int ndeltas) {
+ defer_composite_update()=true;
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->move(deltas, ndeltas);
}
! defer_composite_update()=false;
! recompute();notify();
}
void CompositeVehicle::jump(float x, float y) {
if (x || y) {
+ defer_composite_update()=true;
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->jump(x, y);
}
! defer_composite_update()=false;
! recompute();notify();
}
}
void CompositeVehicle::jump(float x, float y, float z) {
if (x || y || z) {
+ defer_composite_update()=true;
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->jump(x, y, z);
}
! defer_composite_update()=false;
! recompute();notify();
}
}
void CompositeVehicle::jump(float* loc, int n) {
+ defer_composite_update()=true;
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->jump(loc, n);
}
! defer_composite_update()=false;
! recompute();notify();
}
void CompositeVehicle::turn(float dx, float dy) {
if (dx || dy) {
+ defer_composite_update()=true;
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->turn(dx, dy);
}
! defer_composite_update();
! recompute();notify();
}
}
void CompositeVehicle::turn(float dx, float dy, float dz) {
if (dx || dy || dz) {
+ defer_composite_update()=true;
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->turn(dx, dy, dz);
}
! defer_composite_update()=false;
! recompute();notify();
}
}
void CompositeVehicle::turn(float* deltas, int ndeltas) {
+ defer_composite_update()=true;
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->turn(deltas, ndeltas);
}
! defer_composite_update()=false;
! recompute();notify();
}
void CompositeVehicle::turnto(float x, float y) {
if (x || y) {
+ defer_composite_update()=true;
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->turnto(x, y);
}
! defer_composite_update()=false;
! recompute();notify();
}
}
void CompositeVehicle::turnto(float x, float y, float z) {
if (x || y || z) {
+ defer_composite_update()=true;
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->turnto(x, y, z);
}
! defer_composite_update()=false;
! recompute();notify();
}
}
void CompositeVehicle::turnto(float* dir, int n) {
+ defer_composite_update()=true;
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->turnto(dir, n);
}
! defer_composite_update()=false;
! recompute();notify();
}
void CompositeVehicle::jumpturn(float x, float y, float z,
float dx, float dy) {
if (dx || dy) {
+ defer_composite_update()=true;
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->jumpturn(x, y, z, dx, dy);
}
! defer_composite_update()=false;
! recompute();notify();
}
}
void CompositeVehicle::jumpturn(float x, float y, float z,
float dx, float dy, float dz) {
if (dx || dy || dz) {
+ defer_composite_update()=true;
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->jumpturn(x, y, z, dx, dy);
}
! defer_composite_update()=false;
! recompute();notify();
}
}
void CompositeVehicle::jumpturn(float* loc, float* dir, int n) {
+ defer_composite_update()=true;
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->jumpturn(loc, dir, n);
}
! defer_composite_update()=false;
! recompute();notify();
}
void CompositeVehicle::forward2d(float dist) {
if (dist) {
+ defer_composite_update()=true;
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->forward2d(dist);
}
! defer_composite_update()=false;
! recompute();notify();
}
}
void CompositeVehicle::backward2d(float dist) {
if (dist) {
+ defer_composite_update()=true;
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
Vehicle* subv = subvhcl(i);
if (subv) subv->backward2d(dist);
}
! defer_composite_update()=false;
! recompute();notify();
}
}
void CompositeVehicle::rotate2d(float ang) {
if (ang) {
+ defer_composite_update()=true;
int nvhcls = nsubvhcls();
for(int i=0; i<nvhcls; i++) {
! Vehicle* vhcl = subvhcl(i);
! float cx = xloc();
! float cy = yloc();
! vec2 vec(vhcl->xloc()-cx, vhcl->yloc()-cy);
! float veclen=vec.length();
! if (veclen) vec.normalize();
! mat3 mat = rotation2D(vec, ang);
! vec2 newvec = vec * mat;
! if(newvec.length()!=1.0) newvec.normalize();
! newvec *= veclen;
! vhcl->xloc() = newvec[0]+cx;
! vhcl->yloc() = newvec[1]+cy;
}
! defer_composite_update()=false;
! recompute();notify();
}
}
Index: Vehicle/compositevhcl.h
diff -c Vehicle/compositevhcl.h:1.2 Vehicle/compositevhcl.h:1.3
*** Vehicle/compositevhcl.h:1.2 Fri Mar 24 23:21:06 2000
--- src/Vehicle/compositevhcl.h Wed Mar 29 23:08:49 2000
***************
*** 59,67 ****
--- 59,70 ----
virtual void backward2d(float dist =1.0);
virtual void rotate2d(float ang);
+ boolean& defer_composite_update() { return _defer_composite_update; }
+
protected:
Vehicle** _vhcls;
int _nvhcls;
+ boolean _defer_composite_update;
};
#endif
Index: VhclServ/vhclfunc.h
diff -c VhclServ/vhclfunc.h:1.3 VhclServ/vhclfunc.h:1.4
*** VhclServ/vhclfunc.h:1.3 Fri Mar 24 23:21:09 2000
--- src/VhclServ/vhclfunc.h Wed Mar 29 23:08:51 2000
***************
*** 1,4 ****
--- 1,5 ----
/*
+ * Copyright (c) 2000 IET Inc.
* Copyright (c) 1997-1999 Vectaport Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
Index: VhclUnidraw/vhcleditor.c
diff -c VhclUnidraw/vhcleditor.c:1.1 VhclUnidraw/vhcleditor.c:1.2
*** VhclUnidraw/vhcleditor.c:1.1 Mon Aug 2 13:53:53 1999
--- src/VhclUnidraw/vhcleditor.c Wed Mar 29 23:08:52 2000
***************
*** 1,4 ****
--- 1,5 ----
/*
+ * Copyright 2000 IET Inc.
* Copyright 1998 Vectaport Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and its
***************
*** 31,36 ****
--- 32,39 ----
#include <Unidraw/iterator.h>
#include <Unidraw/unidraw.h>
#include <ComTerp/comterpserv.h>
+ #include <Attribute/attribute.h>
+ #include <Attribute/attrlist.h>
/*****************************************************************************/
***************
*** 68,73 ****
--- 71,87 ----
void VhclEditor::Init (OverlayComp* comp, const char* name) {
MapEditor::Init(comp, name);
}
+
+ void VhclEditor::InitCommands() {
+ UtmEditor::InitCommands();
+ Attribute* mag = ((OverlayComp*)GetGraphicComp())->GetAttributeList()->GetAttr("initmag");
+ if (mag) {
+ unidraw->Update(); // need this to make SetMag/MapCenter work properly
+ GetViewer()->SetMagnification(mag->Value()->float_val());
+ }
+ }
+
+
void VhclEditor::AddCommands(ComTerp* comterp) {
UtmEditor::AddCommands(comterp);
Index: VhclUnidraw/vhcleditor.h
diff -c VhclUnidraw/vhcleditor.h:1.2 VhclUnidraw/vhcleditor.h:1.3
*** VhclUnidraw/vhcleditor.h:1.2 Mon Feb 28 17:28:05 2000
--- src/VhclUnidraw/vhcleditor.h Wed Mar 29 23:08:52 2000
***************
*** 1,4 ****
--- 1,5 ----
/*
+ * Copyright 2000 IET Inc.
* Copyright 1998 Vectaport Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and its
***************
*** 35,40 ****
--- 36,42 ----
VhclEditor(const char* file, OverlayKit* = VhclKit::Instance());
void Init(OverlayComp* = nil, const char* = "VhclEditor");
virtual void AddCommands(ComTerp*);
+ virtual void InitCommands();
FrameTimeState*& simtimestate() { return _simtimestate; }
*** /dev/null Wed Mar 29 23:08:56 PST 2000
--- patches/vhclmaps-000329-johnston-016
*************** patches/vhclmaps-000329-johnston-016
*** 0 ****
--- 1 ----
+ vhclmaps-000329-johnston-016
|
|
From: <joh...@ie...> - 2000-03-24 20:37:36
|
Patch: vhclmaps-000324-johnston-015
For: vhclmaps-0.7.4
Author: joh...@us...
Subject: evolve CompositeVehicle class and use of symbol-table based class ids for interpreter components
Requires: ivtools-000324-johnston-034
This is an intermediate patch to vhclmaps-0.7.4. To apply, cd to the
top-level directory of the vhclmaps source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- change the use of symbol-table based class ids to be consistent with
ivtools, i.e. when a feature class is returned on the stack in mapserv
you see "MapFClassComp" printed out, or in vhclserv when you construct
a vehicle you see "VehicleComp". The "Comp" lets you know the object
is derived from OverlayComp/GraphicComp/Component, and it is wrapped
up in a ComponentView (which means it can be integrated into a viewer).
- evolve the Vehicle and CompositeVehicle classes so that any
move/jump/turn done to the composite vehicle is implemented by
moving/jumping/turning the individual vehicles.
Index: MapUnidraw/mapcomps.c
diff -c MapUnidraw/mapcomps.c:1.1 MapUnidraw/mapcomps.c:1.2
*** MapUnidraw/mapcomps.c:1.1 Mon Aug 2 13:53:06 1999
--- src/MapUnidraw/mapcomps.c Fri Mar 24 23:20:51 2000
***************
*** 68,73 ****
--- 68,74 ----
/****************************************************************************/
ParamList* MapFeatureComp::_map_feat_params = nil;
+ int MapFeatureComp::_symid = -1;
MapFeatureComp::MapFeatureComp(MapFeature* mf, OverlayComp* parent) :
OverlayComp(nil, parent) {
***************
*** 145,150 ****
--- 146,152 ----
/*****************************************************************************/
ParamList* MapFClassComp::_map_fcl_params = nil;
+ int MapFClassComp::_symid = -1;
MapFClassComp::MapFClassComp(MapFeatureClass* mfc) : OverlaysComp() {
_mapfc = mfc;
***************
*** 439,444 ****
--- 441,447 ----
/*****************************************************************************/
ParamList* MapCovComp::_map_cov_params = nil;
+ int MapCovComp::_symid = -1;
MapCovComp::MapCovComp(MapCoverage* mc) : OverlaysComp() {
_mapcov = mc;
***************
*** 523,528 ****
--- 526,532 ----
/*****************************************************************************/
ParamList* MapLibComp::_map_lib_params = nil;
+ int MapLibComp::_symid = -1;
MapLibComp::MapLibComp(MapLibrary* ml) : OverlaysComp() {
_maplib = ml;
***************
*** 602,607 ****
--- 606,612 ----
/*****************************************************************************/
ParamList* MapDbComp::_map_db_params = nil;
+ int MapDbComp::_symid = -1;
MapDbComp::MapDbComp(MapDatabase* mdb) : OverlaysComp()
{
***************
*** 686,691 ****
--- 691,697 ----
int MapIdrawComp::_projection_symid = -1;
ParamList* MapIdrawComp::_map_idraw_params = nil;
+ int MapIdrawComp::_symid = -1;
MapIdrawComp::MapIdrawComp (const char* pathname, OverlayComp* parent) : FrameIdrawComp(true, pathname, parent)
{
Index: MapUnidraw/mapcomps.h
diff -c MapUnidraw/mapcomps.h:1.1 MapUnidraw/mapcomps.h:1.2
*** MapUnidraw/mapcomps.h:1.1 Mon Aug 2 13:53:06 1999
--- src/MapUnidraw/mapcomps.h Fri Mar 24 23:20:51 2000
***************
*** 67,72 ****
--- 67,74 ----
ParamList* GetParamList();
void GrowParamList(ParamList*);
static ParamList* _map_feat_params;
+
+ CLASS_SYMID("MapFeatureComp");
};
***************
*** 106,111 ****
--- 108,115 ----
ParamList* GetParamList();
void GrowParamList(ParamList*);
static ParamList* _map_fcl_params;
+
+ CLASS_SYMID("MapFClassComp");
};
class MapCovComp : public OverlaysComp {
***************
*** 132,137 ****
--- 136,143 ----
ParamList* GetParamList();
void GrowParamList(ParamList*);
static ParamList* _map_cov_params;
+
+ CLASS_SYMID("MapCovComp");
};
class MapLibComp : public OverlaysComp {
***************
*** 158,163 ****
--- 164,171 ----
ParamList* GetParamList();
void GrowParamList(ParamList*);
static ParamList* _map_lib_params;
+
+ CLASS_SYMID("MapLibComp");
};
class MapDbComp : public OverlaysComp {
***************
*** 184,189 ****
--- 192,199 ----
ParamList* GetParamList();
void GrowParamList(ParamList*);
static ParamList* _map_db_params;
+
+ CLASS_SYMID("MapDbComp");
};
class MapIdrawComp : public FrameIdrawComp {
***************
*** 205,210 ****
--- 215,222 ----
void GrowParamList(ParamList*);
static ParamList* _map_idraw_params;
static int _projection_symid;
+
+ CLASS_SYMID("MapIdrawComp");
};
#endif
Index: MapUnidraw/maproute.c
diff -c MapUnidraw/maproute.c:1.3 MapUnidraw/maproute.c:1.4
*** MapUnidraw/maproute.c:1.3 Tue Mar 21 12:03:11 2000
--- src/MapUnidraw/maproute.c Fri Mar 24 23:20:51 2000
***************
*** 48,53 ****
--- 48,54 ----
/****************************************************************************/
ParamList* MapRouteComp::_maproute_params = nil;
+ int MapRouteComp::_symid = -1;
MapRouteComp::MapRouteComp(MapElement* me)
: MapFeatureComp(me) {
Index: MapUnidraw/maproute.h
diff -c MapUnidraw/maproute.h:1.1 MapUnidraw/maproute.h:1.2
*** MapUnidraw/maproute.h:1.1 Mon Aug 2 13:53:07 1999
--- src/MapUnidraw/maproute.h Fri Mar 24 23:20:51 2000
***************
*** 46,51 ****
--- 46,52 ----
void GrowParamList(ParamList*);
static ParamList* _maproute_params;
+ CLASS_SYMID("MapRouteComp");
};
class MapRouteView : public MapFeatureView {
Index: MapServ/mapfunc.c
diff -c MapServ/mapfunc.c:1.3 MapServ/mapfunc.c:1.4
*** MapServ/mapfunc.c:1.3 Sat Mar 18 02:24:06 2000
--- src/MapServ/mapfunc.c Fri Mar 24 23:20:54 2000
***************
*** 95,105 ****
#include <stdio.h>
#include <ComUtil/comutil.h>
- static int PointFeature_symid = symbol_add("PointFeature");
- static int NodeFeature_symid = symbol_add("NodeFeature");
- static int LineFeature_symid = symbol_add("LineFeature");
- static int AreaFeature_symid = symbol_add("AreaFeature");
- static int FeatureClass_symid = symbol_add("FeatureClass");
/*****************************************************************************/
--- 95,100 ----
***************
*** 248,254 ****
ComponentView* view = new ComponentView(fccomp);
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = FeatureClass_symid;
result.object_compview() = true;
push_stack(result);
}
--- 243,249 ----
ComponentView* view = new ComponentView(fccomp);
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = MapFClassComp::class_symid();
result.object_compview() = true;
push_stack(result);
}
***************
*** 290,296 ****
ComponentView* view = new ComponentView(fccomp);
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = FeatureClass_symid;
result.object_compview() = true;
push_stack(result);
}
--- 285,291 ----
ComponentView* view = new ComponentView(fccomp);
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = MapFClassComp::class_symid();
result.object_compview() = true;
push_stack(result);
}
***************
*** 326,335 ****
mappoint->feature(point);
MapFeatureComp* fcomp = new MapFeatureComp(point);
ComponentView* view = new ComponentView(fcomp);
! ComValue result;
! result.type(AttributeValue::ObjectType);
! result.obj_ref() = view;
! result.obj_type_ref() = PointFeature_symid;
result.object_compview(true);
push_stack(result);
}
--- 321,327 ----
mappoint->feature(point);
MapFeatureComp* fcomp = new MapFeatureComp(point);
ComponentView* view = new ComponentView(fcomp);
! ComValue result(MapFeatureComp::class_symid(), (void*)view);
result.object_compview(true);
push_stack(result);
}
***************
*** 364,373 ****
MapFeatureComp* fcomp = new MapFeatureComp(line);
ComponentView* view = new ComponentView(fcomp);
! ComValue result;
! result.type(AttributeValue::ObjectType);
! result.obj_ref() = view;
! result.obj_type_ref() = LineFeature_symid;
result.object_compview(true);
push_stack(result);
}
--- 356,362 ----
MapFeatureComp* fcomp = new MapFeatureComp(line);
ComponentView* view = new ComponentView(fcomp);
! ComValue result(MapFeatureComp::class_symid(), (void*)view);
result.object_compview(true);
push_stack(result);
}
***************
*** 402,411 ****
MapFeatureComp* fcomp = new MapFeatureComp(area);
ComponentView* view = new ComponentView(fcomp);
! ComValue result;
! result.type(AttributeValue::ObjectType);
! result.obj_ref() = view;
! result.obj_type_ref() = AreaFeature_symid;
result.object_compview(true);
push_stack(result);
}
--- 391,397 ----
MapFeatureComp* fcomp = new MapFeatureComp(area);
ComponentView* view = new ComponentView(fcomp);
! ComValue result(MapFeatureComp::class_symid(), (void*)view);
result.object_compview(true);
push_stack(result);
}
***************
*** 434,443 ****
MapFeatureComp* fcomp = new MapFeatureComp(node);
ComponentView* view = new ComponentView(fcomp);
! ComValue result;
! result.type(AttributeValue::ObjectType);
! result.obj_ref() = view;
! result.obj_type_ref() = NodeFeature_symid;
result.object_compview(true);
push_stack(result);
}
--- 420,426 ----
MapFeatureComp* fcomp = new MapFeatureComp(node);
ComponentView* view = new ComponentView(fcomp);
! ComValue result(MapFeatureComp::class_symid(), (void*)view);
result.object_compview(true);
push_stack(result);
}
***************
*** 451,457 ****
ComValue mf(stack_arg(0));
reset_stack();
MapFeatureComp* fcomp = nil;
! if (fcomp == (MapFeatureComp*)MapFunc::geta(&mf, AreaFeature_symid)) {
MapFeature* feat = fcomp ? fcomp->feature() : nil;
MapFace* face = feat ? feat->face_primitive() : nil;
float area = face ? face->topo()->area() : -1;
--- 434,440 ----
ComValue mf(stack_arg(0));
reset_stack();
MapFeatureComp* fcomp = nil;
! if (fcomp == (MapFeatureComp*)MapFunc::geta(&mf, MapFeatureComp::class_symid())) {
MapFeature* feat = fcomp ? fcomp->feature() : nil;
MapFace* face = feat ? feat->face_primitive() : nil;
float area = face ? face->topo()->area() : -1;
***************
*** 476,485 ****
MapFeatureClass* fc = new MapFeatureClass(0);
MapFClassComp* fcomp = new MapFClassComp(fc);
ComponentView* view = new ComponentView(fcomp);
! ComValue result;
! result.type(AttributeValue::ObjectType);
! result.obj_ref() = view;
! result.obj_type_ref() = FeatureClass_symid;
result.object_compview(true);
push_stack(result);
}
--- 459,465 ----
MapFeatureClass* fc = new MapFeatureClass(0);
MapFClassComp* fcomp = new MapFClassComp(fc);
ComponentView* view = new ComponentView(fcomp);
! ComValue result(MapFClassComp::class_symid(), (void*) view);
result.object_compview(true);
push_stack(result);
}
***************
*** 504,513 ****
f->feature_class(fc);
fccomp->Append(fcomp);
! ComValue result;
! result.type(AttributeValue::ObjectType);
! result.obj_ref() = fcview;
! result.obj_type_ref() = FeatureClass_symid;
push_stack(result);
}
--- 484,491 ----
f->feature_class(fc);
fccomp->Append(fcomp);
! ComValue result(MapFClassComp::class_symid(), (void*)fcview);
! result.object_compview(true);
push_stack(result);
}
***************
*** 521,549 ****
ComValue pt2(stack_arg(1));
reset_stack();
if (pt1.type() == ComValue::ObjectType &&
! pt1.obj_type_val() == PointFeature_symid &&
pt2.type() == ComValue::ObjectType &&
! pt2.obj_type_val() == PointFeature_symid) {
ComponentView* view1 = (ComponentView*)pt1.obj_val();
MapFeatureComp* fcomp1 = (MapFeatureComp*)view1->GetSubject();
MapFeature* feat1 = fcomp1->feature();
MapPoint* point1 = feat1->point_primitive();
- float x1 = point1->topo()->xpoints()[0];
- float y1 = point1->topo()->ypoints()[0];
ComponentView* view2 = (ComponentView*)pt2.obj_val();
MapFeatureComp* fcomp2 = (MapFeatureComp*)view2->GetSubject();
MapFeature* feat2 = fcomp2->feature();
MapPoint* point2 = feat2->point_primitive();
! float x2 = point2->topo()->xpoints()[0];
! float y2 = point2->topo()->ypoints()[0];
!
! float dist = sqrt((y2-y1)*(y2-y1)+(x2-x1)*(x2-x1));
! ComValue result(dist);
! push_stack(result);
! }
! else {
! push_stack(ComValue::nullval());
}
}
/*****************************************************************************/
--- 499,527 ----
ComValue pt2(stack_arg(1));
reset_stack();
if (pt1.type() == ComValue::ObjectType &&
! pt1.obj_type_val() == MapFeatureComp::class_symid() &&
pt2.type() == ComValue::ObjectType &&
! pt2.obj_type_val() == MapFeatureComp::class_symid()) {
ComponentView* view1 = (ComponentView*)pt1.obj_val();
MapFeatureComp* fcomp1 = (MapFeatureComp*)view1->GetSubject();
MapFeature* feat1 = fcomp1->feature();
MapPoint* point1 = feat1->point_primitive();
ComponentView* view2 = (ComponentView*)pt2.obj_val();
MapFeatureComp* fcomp2 = (MapFeatureComp*)view2->GetSubject();
MapFeature* feat2 = fcomp2->feature();
MapPoint* point2 = feat2->point_primitive();
! if (point1 && point2) {
! float x1 = point1->topo()->xpoints()[0];
! float y1 = point1->topo()->ypoints()[0];
! float x2 = point2->topo()->xpoints()[0];
! float y2 = point2->topo()->ypoints()[0];
!
! float dist = sqrt((y2-y1)*(y2-y1)+(x2-x1)*(x2-x1));
! ComValue result(dist);
! push_stack(result);
! }
}
+ push_stack(ComValue::nullval());
}
/*****************************************************************************/
***************
*** 556,623 ****
ComValue ln(stack_arg(1));
reset_stack();
! if (pt.obj_type_val() == PointFeature_symid && ln.obj_type_val() == LineFeature_symid){
ComponentView* ptview = (ComponentView*)pt.obj_val();
ComponentView* lnview = (ComponentView*)ln.obj_val();
MapFeatureComp* ptcomp = (MapFeatureComp*)ptview->GetSubject();
MapFeatureComp* lncomp = (MapFeatureComp*)lnview->GetSubject();
MapFeature* ptf = ptcomp->feature();
MapFeature* lnf = lncomp->feature();
! MapPoint* ptp = ptf->point_primitive();
! MapEdge* lnp = lnf->edge_primitive();
! Point3 point;
! Line3 line;
!
! int nlpts = lnp->npts();
! double mindist = DBL_MAX;
! double mint = -1.0;
! int mini = 0;
! double it;
! const float* lx = lnp->xpoints();
! const float* ly = lnp->ypoints();
! for (int i = 1; i < nlpts; i++) {
! point.x = ptp->xpoints()[0] - lx[i-1];
! point.y = ptp->ypoints()[0] - ly[i-1];
! point.z = 0.0;
! line.b.x = 0.0;
! line.b.y = 0.0;
! line.b.z = 0.0;
! line.m.x = lx[i]-lx[i-1];
! line.m.y = ly[i]-ly[i-1];
! line.m.z = 0.0;
! double dist = MinPointLine(point, line, it);
! if (dist < mindist) {
! mindist = dist;
! mint = it;
! mini = i;
}
}
- if (mini > 0) {
- double dx = lx[mini]-lx[mini-1];
- double dy = ly[mini]-ly[mini-1];
- float rpx = dx * mint + lx[mini-1];
- float rpy = dy * mint + ly[mini-1];
- MapPoint* rpoint = new MapPoint();
- rpoint->insert_points(1, &rpx, &rpy);
- MapFeature* rfeat = new MapFeature(-1, MapFeature::PointType);
- rfeat->point_primitive(rpoint);
- rpoint->feature(rfeat);
- MapFeatureComp* rcomp = new MapFeatureComp(rfeat);
- ComponentView* rview = new ComponentView(rcomp);
- ComValue result;
- result.type(AttributeValue::ObjectType);
- result.obj_ref() = rview;
- result.obj_type_ref() = PointFeature_symid;
- result.object_compview(true);
- push_stack(result);
- }
- else
- push_stack(ComValue::nullval());
}
! else
! push_stack(ComValue::nullval());
! }
/*****************************************************************************/
--- 534,597 ----
ComValue ln(stack_arg(1));
reset_stack();
! if (pt.obj_type_val() == MapFeatureComp::class_symid() && ln.obj_type_val() == MapFeatureComp::class_symid()){
ComponentView* ptview = (ComponentView*)pt.obj_val();
ComponentView* lnview = (ComponentView*)ln.obj_val();
MapFeatureComp* ptcomp = (MapFeatureComp*)ptview->GetSubject();
MapFeatureComp* lncomp = (MapFeatureComp*)lnview->GetSubject();
MapFeature* ptf = ptcomp->feature();
MapFeature* lnf = lncomp->feature();
! MapPoint* ptp = ptf ? ptf->point_primitive() : nil;
! MapEdge* lnp = lnf ? lnf->edge_primitive() : nil;
! if (ptp && lnp) {
! Point3 point;
! Line3 line;
!
! int nlpts = lnp->npts();
! double mindist = DBL_MAX;
! double mint = -1.0;
! int mini = 0;
! double it;
! const float* lx = lnp->xpoints();
! const float* ly = lnp->ypoints();
! for (int i = 1; i < nlpts; i++) {
! point.x = ptp->xpoints()[0] - lx[i-1];
! point.y = ptp->ypoints()[0] - ly[i-1];
! point.z = 0.0;
! line.b.x = 0.0;
! line.b.y = 0.0;
! line.b.z = 0.0;
! line.m.x = lx[i]-lx[i-1];
! line.m.y = ly[i]-ly[i-1];
! line.m.z = 0.0;
! double dist = MinPointLine(point, line, it);
! if (dist < mindist) {
! mindist = dist;
! mint = it;
! mini = i;
! }
}
+ if (mini > 0) {
+ double dx = lx[mini]-lx[mini-1];
+ double dy = ly[mini]-ly[mini-1];
+ float rpx = dx * mint + lx[mini-1];
+ float rpy = dy * mint + ly[mini-1];
+ MapPoint* rpoint = new MapPoint();
+ rpoint->insert_points(1, &rpx, &rpy);
+ MapFeature* rfeat = new MapFeature(-1, MapFeature::PointType);
+ rfeat->point_primitive(rpoint);
+ rpoint->feature(rfeat);
+ MapFeatureComp* rcomp = new MapFeatureComp(rfeat);
+ ComponentView* rview = new ComponentView(rcomp);
+ ComValue result(MapFeatureComp::class_symid(), (void*)rview);
+ result.object_compview(true);
+ push_stack(result);
+ }
}
}
! push_stack(ComValue::nullval());
! }
/*****************************************************************************/
***************
*** 628,653 ****
int nf = nargs();
if (nf > 0) {
int ptcount = 0;
for (int i = 0; i < nf; i++) {
ComValue val(stack_arg(i));
if (val.type() == ComValue::ObjectType) {
! if (val.is_object(PointFeature_symid)) {
! ptcount++;
! } else if (val.is_object(LineFeature_symid)) {
! ComponentView* lview = (ComponentView*)val.obj_val();
! MapFeatureComp* lcomp = (MapFeatureComp*)lview->GetSubject();
! MapFeature* lf = lcomp->feature();
! MapEdge* le = lf->edge_primitive();
! ptcount += le->topo()->npts();
! } else if (val.is_object(AreaFeature_symid)) {
! ComponentView* aview = (ComponentView*)val.obj_val();
! MapFeatureComp* acomp = (MapFeatureComp*)aview->GetSubject();
! MapFeature* af = acomp->feature();
! MapFace* face = af->face_primitive();
! ptcount += face->topo()->npts();
! } else if (val.is_object(NodeFeature_symid)) {
! ptcount++;
! } else if (val.is_object(FeatureClass_symid)) {
ComponentView* fcview = (ComponentView*)val.obj_val();
MapFClassComp* fccomp = (MapFClassComp*)fcview->GetSubject();
MapFeatureClass* fc = fccomp->GetFeatureClass();
--- 602,633 ----
int nf = nargs();
if (nf > 0) {
int ptcount = 0;
+
+ /* loop through features or feature classes */
for (int i = 0; i < nf; i++) {
ComValue val(stack_arg(i));
+
if (val.type() == ComValue::ObjectType) {
!
! if (val.is_object(MapFeatureComp::class_symid())) {
! if (((MapFeatureComp*)val.obj_val())->feature()->point_primitive()) {
! ptcount++;
! } else if (((MapFeatureComp*)val.obj_val())->feature()->edge_primitive()) {
! ComponentView* lview = (ComponentView*)val.obj_val();
! MapFeatureComp* lcomp = (MapFeatureComp*)lview->GetSubject();
! MapFeature* lf = lcomp->feature();
! MapEdge* le = lf->edge_primitive();
! ptcount += le->topo()->npts();
! } else if (((MapFeatureComp*)val.obj_val())->feature()->face_primitive()) {
! ComponentView* aview = (ComponentView*)val.obj_val();
! MapFeatureComp* acomp = (MapFeatureComp*)aview->GetSubject();
! MapFeature* af = acomp->feature();
! MapFace* face = af->face_primitive();
! ptcount += face->topo()->npts();
! } else if (((MapFeatureComp*)val.obj_val())->feature()->node_primitive()) {
! ptcount++;
! }
! } else if (val.is_object(MapFClassComp::class_symid())) {
ComponentView* fcview = (ComponentView*)val.obj_val();
MapFClassComp* fccomp = (MapFClassComp*)fcview->GetSubject();
MapFeatureClass* fc = fccomp->GetFeatureClass();
***************
*** 671,719 ****
}
}
}
float* fx = new float[ptcount];
float* fy = new float[ptcount];
int pti = 0;
for (int i = 0; i < nf; i++) {
ComValue val(stack_arg(i));
if (val.type() == ComValue::ObjectType) {
! if(val.is_object(PointFeature_symid)) {
! ComponentView* pview = (ComponentView*)val.obj_val();
! MapFeatureComp* pcomp = (MapFeatureComp*)pview->GetSubject();
! MapFeature* pf = pcomp->feature();
! MapPoint* pp = pf->point_primitive();
! fx[pti] = pp->topo()->xpoints()[0];
! fy[pti] = pp->topo()->ypoints()[0];
! pti++;
! } else if (val.is_object(LineFeature_symid)) {
! ComponentView* lview = (ComponentView*)val.obj_val();
! MapFeatureComp* lcomp = (MapFeatureComp*)lview->GetSubject();
! MapFeature* lf = lcomp->feature();
! MapEdge* le = lf->edge_primitive();
! for (int k = 0; k < le->topo()->npts(); k++) {
! fx[pti] = le->topo()->xpoints()[k];
! fy[pti] = le->topo()->ypoints()[k];
pti++;
! }
! } else if (val.is_object(AreaFeature_symid)) {
! ComponentView* aview = (ComponentView*)val.obj_val();
! MapFeatureComp* acomp = (MapFeatureComp*)aview->GetSubject();
! MapFeature* af = acomp->feature();
! MapFace* face = af->face_primitive();
! for (int k = 0; k < face->topo()->npts(); k++) {
! fx[pti] = face->topo()->xpoints()[k];
! fy[pti] = face->topo()->ypoints()[k];
pti++;
! }
! } else if (val.is_object(NodeFeature_symid)) {
! ComponentView* nview = (ComponentView*)val.obj_val();
! MapFeatureComp* ncomp = (MapFeatureComp*)nview->GetSubject();
! MapFeature* nf = ncomp->feature();
! MapNode* np = nf->node_primitive();
! fx[pti] = np->topo()->xpoints()[0];
! fy[pti] = np->topo()->ypoints()[0];
! pti++;
! } else if (val.is_object(FeatureClass_symid)) {
ComponentView* fcview = (ComponentView*)val.obj_val();
MapFClassComp* fccomp = (MapFClassComp*)fcview->GetSubject();
MapFeatureClass* fc = fccomp->GetFeatureClass();
--- 651,702 ----
}
}
}
+
float* fx = new float[ptcount];
float* fy = new float[ptcount];
int pti = 0;
for (int i = 0; i < nf; i++) {
ComValue val(stack_arg(i));
if (val.type() == ComValue::ObjectType) {
! if (val.is_object(MapFeatureComp::class_symid())) {
! if(((MapFeatureComp*)val.obj_val())->feature()->point_primitive()) {
! ComponentView* pview = (ComponentView*)val.obj_val();
! MapFeatureComp* pcomp = (MapFeatureComp*)pview->GetSubject();
! MapFeature* pf = pcomp->feature();
! MapPoint* pp = pf->point_primitive();
! fx[pti] = pp->topo()->xpoints()[0];
! fy[pti] = pp->topo()->ypoints()[0];
pti++;
! } else if(((MapFeatureComp*)val.obj_val())->feature()->edge_primitive()) {
! ComponentView* lview = (ComponentView*)val.obj_val();
! MapFeatureComp* lcomp = (MapFeatureComp*)lview->GetSubject();
! MapFeature* lf = lcomp->feature();
! MapEdge* le = lf->edge_primitive();
! for (int k = 0; k < le->topo()->npts(); k++) {
! fx[pti] = le->topo()->xpoints()[k];
! fy[pti] = le->topo()->ypoints()[k];
! pti++;
! }
! } else if(((MapFeatureComp*)val.obj_val())->feature()->face_primitive()) {
! ComponentView* aview = (ComponentView*)val.obj_val();
! MapFeatureComp* acomp = (MapFeatureComp*)aview->GetSubject();
! MapFeature* af = acomp->feature();
! MapFace* face = af->face_primitive();
! for (int k = 0; k < face->topo()->npts(); k++) {
! fx[pti] = face->topo()->xpoints()[k];
! fy[pti] = face->topo()->ypoints()[k];
! pti++;
! }
! } else if(((MapFeatureComp*)val.obj_val())->feature()->node_primitive()) {
! ComponentView* nview = (ComponentView*)val.obj_val();
! MapFeatureComp* ncomp = (MapFeatureComp*)nview->GetSubject();
! MapFeature* nf = ncomp->feature();
! MapNode* np = nf->node_primitive();
! fx[pti] = np->topo()->xpoints()[0];
! fy[pti] = np->topo()->ypoints()[0];
pti++;
! }
! } else if (val.is_object(MapFClassComp::class_symid())) {
ComponentView* fcview = (ComponentView*)val.obj_val();
MapFClassComp* fccomp = (MapFClassComp*)fcview->GetSubject();
MapFeatureClass* fc = fccomp->GetFeatureClass();
***************
*** 764,784 ****
MapFeatureComp* hcomp = new MapFeatureComp(hfeat);
hfeat->graphic((void*)hcomp);
ComponentView* hview = new ComponentView(hcomp);
! ComValue result;
! result.type(ComValue::ObjectType);
! result.obj_type_ref() = AreaFeature_symid;
! result.obj_ref() = hview;
result.object_compview(true);
push_stack(result);
}
- else
- push_stack(ComValue::nullval());
- }
- else {
- push_stack(ComValue::nullval());
}
}
/*****************************************************************************/
ShapeSelFunc::ShapeSelFunc(ComTerp* comterp) : MapFunc(comterp) {
--- 747,761 ----
MapFeatureComp* hcomp = new MapFeatureComp(hfeat);
hfeat->graphic((void*)hcomp);
ComponentView* hview = new ComponentView(hcomp);
! ComValue result(MapFeatureComp::class_symid(), (void*)hview);
result.object_compview(true);
push_stack(result);
}
}
+ push_stack(ComValue::nullval());
}
+
/*****************************************************************************/
ShapeSelFunc::ShapeSelFunc(ComTerp* comterp) : MapFunc(comterp) {
***************
*** 900,908 ****
ComValue mf(stack_arg(1));
reset_stack();
if (mfc.type() == ComValue::ObjectType &&
! mfc.obj_type_val() == FeatureClass_symid &&
mf.type() == ComValue::ObjectType &&
! mf.obj_type_val() == AreaFeature_symid) {
ComponentView* fcview = (ComponentView*)mfc.obj_val();
MapFClassComp* fccomp = (MapFClassComp*)fcview->GetSubject();
MapFeatureClass* fc = fccomp->GetFeatureClass();
--- 877,886 ----
ComValue mf(stack_arg(1));
reset_stack();
if (mfc.type() == ComValue::ObjectType &&
! mfc.obj_type_val() == MapFClassComp::class_symid() &&
mf.type() == ComValue::ObjectType &&
! mf.obj_type_val() == MapFeatureComp::class_symid() &&
! ((MapFeatureComp*)mf.obj_val())->feature()->point_primitive()) {
ComponentView* fcview = (ComponentView*)mfc.obj_val();
MapFClassComp* fccomp = (MapFClassComp*)fcview->GetSubject();
MapFeatureClass* fc = fccomp->GetFeatureClass();
***************
*** 1093,1102 ****
ComponentView* nview = new ComponentView(nfccomp);
! ComValue result;
! result.type(AttributeValue::ObjectType);
! result.obj_ref() = nview;
! result.obj_type_ref() = FeatureClass_symid;
result.object_compview(true);
push_stack(result);
--- 1071,1077 ----
ComponentView* nview = new ComponentView(nfccomp);
! ComValue result(MapFClassComp::class_symid(), (void*)nview);
result.object_compview(true);
push_stack(result);
***************
*** 1318,1324 ****
result.type(AttributeValue::ObjectType);
result.obj_ref() = nview;
! result.obj_type_ref() = FeatureClass_symid;
result.object_compview(true);
push_stack(result);
}
--- 1293,1299 ----
result.type(AttributeValue::ObjectType);
result.obj_ref() = nview;
! result.obj_type_ref() = MapFClassComp::class_symid();
result.object_compview(true);
push_stack(result);
}
***************
*** 1497,1503 ****
result.type(AttributeValue::ObjectType);
result.obj_ref() = nfcview;
! result.obj_type_ref() = FeatureClass_symid;
result.object_compview(true);
push_stack(result);
}
--- 1472,1478 ----
result.type(AttributeValue::ObjectType);
result.obj_ref() = nfcview;
! result.obj_type_ref() = MapFClassComp::class_symid();
result.object_compview(true);
push_stack(result);
}
***************
*** 1521,1527 ****
ComValue nen(stack_key(_nen_symid));
reset_stack();
! MapFClassComp* comp = (MapFClassComp*)MapFunc::geta(&fcc, FeatureClass_symid);
MapFeatureClass* fc = comp ? comp->GetFeatureClass() : nil;
if (fc) {
double x1, y1, x2, y2;
--- 1496,1502 ----
ComValue nen(stack_key(_nen_symid));
reset_stack();
! MapFClassComp* comp = (MapFClassComp*)MapFunc::geta(&fcc, MapFClassComp::class_symid());
MapFeatureClass* fc = comp ? comp->GetFeatureClass() : nil;
if (fc) {
double x1, y1, x2, y2;
***************
*** 1619,1625 ****
result.type(AttributeValue::ObjectType);
result.obj_ref() = nview;
! result.obj_type_ref() = FeatureClass_symid;
result.object_compview(true);
push_stack(result);
--- 1594,1600 ----
result.type(AttributeValue::ObjectType);
result.obj_ref() = nview;
! result.obj_type_ref() = MapFClassComp::class_symid();
result.object_compview(true);
push_stack(result);
***************
*** 1719,1725 ****
result.type(AttributeValue::ObjectType);
result.obj_ref() = nview;
! result.obj_type_ref() = FeatureClass_symid;
result.object_compview(true);
push_stack(result);
--- 1694,1700 ----
result.type(AttributeValue::ObjectType);
result.obj_ref() = nview;
! result.obj_type_ref() = MapFClassComp::class_symid();
result.object_compview(true);
push_stack(result);
***************
*** 2322,2329 ****
if (comp && comp->IsA(MAPFCLASS_COMP)) {
ComponentView* view = new ComponentView(comp);
! ComValue result(ComValue::ObjectType, (void*)view);
! result.obj_type_ref() = FeatureClass_symid;
result.object_compview(true);
push_stack(result);
} else {
--- 2297,2303 ----
if (comp && comp->IsA(MAPFCLASS_COMP)) {
ComponentView* view = new ComponentView(comp);
! ComValue result(MapFClassComp::class_symid(), (void*)view);
result.object_compview(true);
push_stack(result);
} else {
***************
*** 2341,2347 ****
ComValue fclass(stack_arg(0));
reset_stack();
if (fclass.type() == ComValue::ObjectType &&
! fclass.obj_type_val() == FeatureClass_symid) {
ComponentView* view = (ComponentView*)fclass.obj_val();
MapFClassComp* comp = (MapFClassComp*)view->GetSubject();
MapFeatureClass* fc = comp->GetFeatureClass();
--- 2315,2321 ----
ComValue fclass(stack_arg(0));
reset_stack();
if (fclass.type() == ComValue::ObjectType &&
! fclass.obj_type_val() == MapFClassComp::class_symid()) {
ComponentView* view = (ComponentView*)fclass.obj_val();
MapFClassComp* comp = (MapFClassComp*)view->GetSubject();
MapFeatureClass* fc = comp->GetFeatureClass();
***************
*** 2362,2368 ****
ComValue fn(stack_arg(1));
reset_stack();
if (fclass.type() == ComValue::ObjectType &&
! fclass.obj_type_val() == FeatureClass_symid &&
fn.type() == ComValue::IntType) {
ComponentView* view = (ComponentView*)fclass.obj_val();
MapFClassComp* comp = (MapFClassComp*)view->GetSubject();
--- 2336,2342 ----
ComValue fn(stack_arg(1));
reset_stack();
if (fclass.type() == ComValue::ObjectType &&
! fclass.obj_type_val() == MapFClassComp::class_symid() &&
fn.type() == ComValue::IntType) {
ComponentView* view = (ComponentView*)fclass.obj_val();
MapFClassComp* comp = (MapFClassComp*)view->GetSubject();
***************
*** 2372,2400 ****
if (feature) {
MapFeatureComp* fcomp = (MapFeatureComp*)feature->graphic();
MapFeature* newf = nil;
- ComValue result;
- result.type(ComValue::ObjectType);
switch(feature->type()) {
case MapFeature::PointType:
- result.obj_type_ref() = PointFeature_symid;
newf = copy_point(feature, (MapFeatureComp*)feature->graphic());
break;
case MapFeature::LineType:
- result.obj_type_ref() = LineFeature_symid;
newf = copy_line(feature, (MapFeatureComp*)feature->graphic());
break;
case MapFeature::AreaType:
- result.obj_type_ref() = AreaFeature_symid;
newf = copy_area(feature, (MapFeatureComp*)feature->graphic());
break;
case MapFeature::JunctionType:
- result.obj_type_ref() = NodeFeature_symid;
newf = copy_junction(feature, (MapFeatureComp*)feature->graphic());
break;
}
MapFeatureComp* nfcomp = (MapFeatureComp*)newf->graphic();
ComponentView* fview = new ComponentView(nfcomp);
! result.obj_ref() = fview;
result.object_compview(true);
push_stack(result);
}
--- 2346,2368 ----
if (feature) {
MapFeatureComp* fcomp = (MapFeatureComp*)feature->graphic();
MapFeature* newf = nil;
switch(feature->type()) {
case MapFeature::PointType:
newf = copy_point(feature, (MapFeatureComp*)feature->graphic());
break;
case MapFeature::LineType:
newf = copy_line(feature, (MapFeatureComp*)feature->graphic());
break;
case MapFeature::AreaType:
newf = copy_area(feature, (MapFeatureComp*)feature->graphic());
break;
case MapFeature::JunctionType:
newf = copy_junction(feature, (MapFeatureComp*)feature->graphic());
break;
}
MapFeatureComp* nfcomp = (MapFeatureComp*)newf->graphic();
ComponentView* fview = new ComponentView(nfcomp);
! ComValue result(MapFClassComp::class_symid(), (void*)fview);
result.object_compview(true);
push_stack(result);
}
Index: UtmUnidraw/utmfunc.c
diff -c UtmUnidraw/utmfunc.c:1.3 UtmUnidraw/utmfunc.c:1.4
*** UtmUnidraw/utmfunc.c:1.3 Sat Mar 18 02:24:08 2000
--- src/UtmUnidraw/utmfunc.c Fri Mar 24 23:20:58 2000
***************
*** 90,96 ****
VhclViewFunc::VhclViewFunc(ComTerp* comterp, Editor* ed) : UtmFunc(comterp, ed) {
_name_symid = symbol_add("name");
_gr_symid = symbol_add("gr");
- _vhclpict_symid = symbol_add("VhclPict");
}
void VhclViewFunc::execute() {
--- 90,95 ----
***************
*** 123,130 ****
PasteCmd* cmd = new PasteCmd(_ed, new Clipboard(vhclpict));
execute_log(cmd);
! ComValue result(ComValue::ObjectType, (void*)new ComponentView(vhclpict));
! result.obj_type_ref() = _vhclpict_symid;
result.object_compview(true);
push_stack(result);
--- 122,128 ----
PasteCmd* cmd = new PasteCmd(_ed, new Clipboard(vhclpict));
execute_log(cmd);
! ComValue result(vhclpict->classid(), (void*)new ComponentView(vhclpict));
result.object_compview(true);
push_stack(result);
***************
*** 157,163 ****
}
ComponentView* compview =
! (ComponentView*)compval.geta(symbol_add("VhclPict"));
OverlaysComp* vhclpict =
compview ? (OverlaysComp*)compview->GetSubject() : nil;
if (vhclpict) {
--- 155,161 ----
}
ComponentView* compview =
! (ComponentView*)compval.geta(OverlaysComp::class_symid());
OverlaysComp* vhclpict =
compview ? (OverlaysComp*)compview->GetSubject() : nil;
if (vhclpict) {
Index: UtmUnidraw/utmfunc.h
diff -c UtmUnidraw/utmfunc.h:1.3 UtmUnidraw/utmfunc.h:1.4
*** UtmUnidraw/utmfunc.h:1.3 Sat Mar 18 02:24:10 2000
--- src/UtmUnidraw/utmfunc.h Fri Mar 24 23:20:58 2000
***************
*** 48,54 ****
protected:
int _gr_symid;
int _name_symid;
- int _vhclpict_symid;
};
class VhclMoveToFunc : public UtmFunc {
--- 48,53 ----
Index: LosServ/losfunc.c
diff -c LosServ/losfunc.c:1.5 LosServ/losfunc.c:1.6
*** LosServ/losfunc.c:1.5 Sat Mar 18 02:24:12 2000
--- src/LosServ/losfunc.c Fri Mar 24 23:21:01 2000
***************
*** 75,81 ****
UsgsDem* dem;
#include <ComUtil/comutil.h>
- static int FeatureClass_symid = symbol_add("FeatureClass");
/*****************************************************************************/
--- 75,80 ----
***************
*** 428,434 ****
ComValue result;
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = FeatureClass_symid;
result.object_compview(true);
push_stack(result);
}
--- 427,433 ----
ComValue result;
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = MapFClassComp::class_symid();
result.object_compview(true);
push_stack(result);
}
***************
*** 675,681 ****
ComValue result;
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = FeatureClass_symid;
result.object_compview(true);
push_stack(result);
}
--- 674,680 ----
ComValue result;
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = MapFClassComp::class_symid();
result.object_compview(true);
push_stack(result);
}
Index: ProjServ/projfunc.c
diff -c ProjServ/projfunc.c:1.3 ProjServ/projfunc.c:1.4
*** ProjServ/projfunc.c:1.3 Sat Mar 18 02:24:14 2000
--- src/ProjServ/projfunc.c Fri Mar 24 23:21:03 2000
***************
*** 64,70 ****
#include <stdio.h>
#include <ComUtil/comutil.h>
- static int FeatureClass_symid = symbol_add("FeatureClass");
LoadVpfFCFunc::LoadVpfFCFunc(ComTerp* comterp) : ComFunc(comterp) {
_tileid_symid = symbol_add("tileid");
--- 64,69 ----
***************
*** 120,126 ****
if (view) {
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = FeatureClass_symid;
result.object_compview(true);
push_stack(result);
} else {
--- 119,125 ----
if (view) {
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = MapFClassComp::class_symid();
result.object_compview(true);
push_stack(result);
} else {
***************
*** 211,217 ****
ComponentView* view = new ComponentView(fccomp);
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = FeatureClass_symid;
result.object_compview(true);
push_stack(result);
}
--- 210,216 ----
ComponentView* view = new ComponentView(fccomp);
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = MapFClassComp::class_symid();
result.object_compview(true);
push_stack(result);
}
***************
*** 302,308 ****
ComponentView* view = new ComponentView(fccomp);
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = FeatureClass_symid;
result.object_compview(true);
push_stack(result);
}
--- 301,307 ----
ComponentView* view = new ComponentView(fccomp);
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = MapFClassComp::class_symid();
result.object_compview(true);
push_stack(result);
}
Index: Vehicle/compositevhcl.c
diff -c Vehicle/compositevhcl.c:1.1 Vehicle/compositevhcl.c:1.2
*** Vehicle/compositevhcl.c:1.1 Mon Aug 2 13:53:46 1999
--- src/Vehicle/compositevhcl.c Fri Mar 24 23:21:06 2000
***************
*** 1,4 ****
--- 1,5 ----
/*
+ * Copyright (c) 2000 IET Inc.
* Copyright (c) 1998 Vectaport Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
***************
*** 25,41 ****
CompositeVehicle::CompositeVehicle
(const char* name, Vehicle** vhcls, int nvhcls) : Vehicle(name) {
! _nvhcls = nvhcls;
! _vhcls = new Vehicle*[_nvhcls];
double cx = 0.0;
double cy = 0.0;
double cz = 0.0;
! for (int i=0; i<_nvhcls; i++) {
! _vhcls[i] = vhcls[i];
! cx += _vhcls[i]->xloc();
! cy += _vhcls[i]->yloc();
! cz += _vhcls[i]->zloc();
}
_loc[0] = cx/_nvhcls;
_loc[1] = cy/_nvhcls;
_loc[2] = cz/_nvhcls;
--- 26,46 ----
CompositeVehicle::CompositeVehicle
(const char* name, Vehicle** vhcls, int nvhcls) : Vehicle(name) {
! _vhcls = new Vehicle*[nvhcls];
double cx = 0.0;
double cy = 0.0;
double cz = 0.0;
! int cnt=0;
! for (int i=0; i<nvhcls; i++) {
! if (vhcls[i]) {
! _vhcls[cnt] = vhcls[i];
! cx += _vhcls[cnt]->xloc();
! cy += _vhcls[cnt]->yloc();
! cz += _vhcls[cnt]->zloc();
! cnt++;
! }
}
+ _nvhcls = cnt;
_loc[0] = cx/_nvhcls;
_loc[1] = cy/_nvhcls;
_loc[2] = cz/_nvhcls;
***************
*** 45,51 ****
delete [] _vhcls;
}
! void CompositeVehicle::update(Observable* obs) {
/* compute new center and heading of composite vehicle */
double cx = 0.0;
--- 50,56 ----
delete [] _vhcls;
}
! void CompositeVehicle::recompute() {
/* compute new center and heading of composite vehicle */
double cx = 0.0;
***************
*** 66,71 ****
--- 71,271 ----
_loc[1] = cy;
_loc[2] = cz;
+ }
+
+ void CompositeVehicle::update(Observable* obs) {
+ recompute();
notify();
}
+
+ void CompositeVehicle::move(float dx, float dy) {
+ if (dx || dy) {
+ int nvhcls = nsubvhcls();
+ for(int i=0; i<nvhcls; i++) {
+ Vehicle* subv = subvhcl(i);
+ if (subv) subv->move(dx, dy);
+ }
+ recompute();
+ }
+ }
+
+ void CompositeVehicle::move(float dx, float dy, float dz) {
+ if (dx || dy || dz) {
+ int nvhcls = nsubvhcls();
+ for(int i=0; i<nvhcls; i++) {
+ Vehicle* subv = subvhcl(i);
+ if (subv) subv->move(dx, dy, dz);
+ }
+ recompute();
+ }
+ }
+
+ void CompositeVehicle::move(float* deltas, int ndeltas) {
+ int nvhcls = nsubvhcls();
+ for(int i=0; i<nvhcls; i++) {
+ Vehicle* subv = subvhcl(i);
+ if (subv) subv->move(deltas, ndeltas);
+ }
+ recompute();
+ }
+
+ void CompositeVehicle::jump(float x, float y) {
+ if (x || y) {
+ int nvhcls = nsubvhcls();
+ for(int i=0; i<nvhcls; i++) {
+ Vehicle* subv = subvhcl(i);
+ if (subv) subv->jump(x, y);
+ }
+ recompute();
+ }
+ }
+
+ void CompositeVehicle::jump(float x, float y, float z) {
+ if (x || y || z) {
+ int nvhcls = nsubvhcls();
+ for(int i=0; i<nvhcls; i++) {
+ Vehicle* subv = subvhcl(i);
+ if (subv) subv->jump(x, y, z);
+ }
+ recompute();
+ }
+ }
+
+ void CompositeVehicle::jump(float* loc, int n) {
+ int nvhcls = nsubvhcls();
+ for(int i=0; i<nvhcls; i++) {
+ Vehicle* subv = subvhcl(i);
+ if (subv) subv->jump(loc, n);
+ }
+ recompute();
+ }
+
+ void CompositeVehicle::turn(float dx, float dy) {
+ if (dx || dy) {
+ int nvhcls = nsubvhcls();
+ for(int i=0; i<nvhcls; i++) {
+ Vehicle* subv = subvhcl(i);
+ if (subv) subv->turn(dx, dy);
+ }
+ recompute();
+ }
+ }
+
+ void CompositeVehicle::turn(float dx, float dy, float dz) {
+ if (dx || dy || dz) {
+ int nvhcls = nsubvhcls();
+ for(int i=0; i<nvhcls; i++) {
+ Vehicle* subv = subvhcl(i);
+ if (subv) subv->turn(dx, dy, dz);
+ }
+ recompute();
+ }
+ }
+
+ void CompositeVehicle::turn(float* deltas, int ndeltas) {
+ int nvhcls = nsubvhcls();
+ for(int i=0; i<nvhcls; i++) {
+ Vehicle* subv = subvhcl(i);
+ if (subv) subv->turn(deltas, ndeltas);
+ }
+ recompute();
+ }
+
+ void CompositeVehicle::turnto(float x, float y) {
+ if (x || y) {
+ int nvhcls = nsubvhcls();
+ for(int i=0; i<nvhcls; i++) {
+ Vehicle* subv = subvhcl(i);
+ if (subv) subv->turnto(x, y);
+ }
+ recompute();
+ }
+ }
+
+ void CompositeVehicle::turnto(float x, float y, float z) {
+ if (x || y || z) {
+ int nvhcls = nsubvhcls();
+ for(int i=0; i<nvhcls; i++) {
+ Vehicle* subv = subvhcl(i);
+ if (subv) subv->turnto(x, y, z);
+ }
+ recompute();
+ }
+ }
+
+ void CompositeVehicle::turnto(float* dir, int n) {
+ int nvhcls = nsubvhcls();
+ for(int i=0; i<nvhcls; i++) {
+ Vehicle* subv = subvhcl(i);
+ if (subv) subv->turnto(dir, n);
+ }
+ recompute();
+ }
+
+ void CompositeVehicle::jumpturn(float x, float y, float z,
+ float dx, float dy) {
+ if (dx || dy) {
+ int nvhcls = nsubvhcls();
+ for(int i=0; i<nvhcls; i++) {
+ Vehicle* subv = subvhcl(i);
+ if (subv) subv->jumpturn(x, y, z, dx, dy);
+ }
+ recompute();
+ }
+ }
+
+ void CompositeVehicle::jumpturn(float x, float y, float z,
+ float dx, float dy, float dz) {
+ if (dx || dy || dz) {
+ int nvhcls = nsubvhcls();
+ for(int i=0; i<nvhcls; i++) {
+ Vehicle* subv = subvhcl(i);
+ if (subv) subv->jumpturn(x, y, z, dx, dy);
+ }
+ recompute();
+ }
+ }
+
+ void CompositeVehicle::jumpturn(float* loc, float* dir, int n) {
+ int nvhcls = nsubvhcls();
+ for(int i=0; i<nvhcls; i++) {
+ Vehicle* subv = subvhcl(i);
+ if (subv) subv->jumpturn(loc, dir, n);
+ }
+ recompute();
+ }
+
+ void CompositeVehicle::forward2d(float dist) {
+ if (dist) {
+ int nvhcls = nsubvhcls();
+ for(int i=0; i<nvhcls; i++) {
+ Vehicle* subv = subvhcl(i);
+ if (subv) subv->forward2d(dist);
+ }
+ recompute();
+ }
+ }
+
+ void CompositeVehicle::backward2d(float dist) {
+ if (dist) {
+ int nvhcls = nsubvhcls();
+ for(int i=0; i<nvhcls; i++) {
+ Vehicle* subv = subvhcl(i);
+ if (subv) subv->backward2d(dist);
+ }
+ recompute();
+ }
+ }
+
+ void CompositeVehicle::rotate2d(float ang) {
+ if (ang) {
+ int nvhcls = nsubvhcls();
+ for(int i=0; i<nvhcls; i++) {
+ Vehicle* subv = subvhcl(i);
+ if (subv) subv->rotate2d(ang);
+ }
+ recompute();
+ }
+ }
+
Index: Vehicle/compositevhcl.h
diff -c Vehicle/compositevhcl.h:1.1 Vehicle/compositevhcl.h:1.2
*** Vehicle/compositevhcl.h:1.1 Mon Aug 2 13:53:47 1999
--- src/Vehicle/compositevhcl.h Fri Mar 24 23:21:06 2000
***************
*** 1,4 ****
--- 1,5 ----
/*
+ * Copyright (c) 2000 IET Inc.
* Copyright (c) 1998 Vectaport Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
***************
*** 32,41 ****
--- 33,63 ----
virtual ~CompositeVehicle();
virtual void update(Observable*);
+ void recompute();
virtual Vehicle* subvhcl(int vhclindex)
{ return vhclindex>=0 && vhclindex<_nvhcls ? _vhcls[vhclindex] : nil; }
virtual int nsubvhcls() { return _nvhcls; }
+
+ virtual void move(float dx, float dy);
+ virtual void move(float dx, float dy, float dy);
+ virtual void move(float* deltas, int ndeltas);
+ virtual void jump(float x, float y);
+ virtual void jump(float x, float y, float y);
+ virtual void jump(float* loc, int n);
+ virtual void turn(float dx, float dy);
+ virtual void turn(float dx, float dy, float dy);
+ virtual void turn(float* deltas, int ndeltas);
+ virtual void turnto(float x, float y);
+ virtual void turnto(float x, float y, float y);
+ virtual void turnto(float* dir, int n);
+ virtual void jumpturn(float x, float y, float y, float dx, float dy);
+ virtual void jumpturn(float x, float y, float y, float dx, float dy, float dz);
+ virtual void jumpturn(float* loc, float* dir, int n);
+
+ virtual void forward2d(float dist =1.0);
+ virtual void backward2d(float dist =1.0);
+ virtual void rotate2d(float ang);
protected:
Vehicle** _vhcls;
Index: Vehicle/vehicle.c
diff -c Vehicle/vehicle.c:1.1 Vehicle/vehicle.c:1.2
*** Vehicle/vehicle.c:1.1 Mon Aug 2 13:53:47 1999
--- src/Vehicle/vehicle.c Fri Mar 24 23:21:06 2000
***************
*** 205,211 ****
void Vehicle::jumpturn(float x, float y, float z,
float dx, float dy, float dz) {
! if (dx || dy) {
xdelta() = x - xloc();
ydelta() = y - yloc();
zdelta() = z - zloc();
--- 205,211 ----
void Vehicle::jumpturn(float x, float y, float z,
float dx, float dy, float dz) {
! if (dx || dy || dz) {
xdelta() = x - xloc();
ydelta() = y - yloc();
zdelta() = z - zloc();
Index: Vehicle/vehicle.h
diff -c Vehicle/vehicle.h:1.1 Vehicle/vehicle.h:1.2
*** Vehicle/vehicle.h:1.1 Mon Aug 2 13:53:47 1999
--- src/Vehicle/vehicle.h Fri Mar 24 23:21:06 2000
***************
*** 1,4 ****
--- 1,5 ----
/*
+ * Copyright (c) 2000 IET Inc.
* Copyright (c) 1997-1998 Vectaport Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
***************
*** 46,70 ****
float& ydelta() { return _delta[1]; }
float& zdelta() { return _delta[2]; }
! void move(float dx, float dy);
! void move(float dx, float dy, float dy);
! void move(float* deltas, int ndeltas);
! void jump(float x, float y);
! void jump(float x, float y, float y);
! void jump(float* loc, int n);
! void turn(float dx, float dy);
! void turn(float dx, float dy, float dy);
! void turn(float* deltas, int ndeltas);
! void turnto(float x, float y);
! void turnto(float x, float y, float y);
! void turnto(float* dir, int n);
! void jumpturn(float x, float y, float y, float dx, float dy);
! void jumpturn(float x, float y, float y, float dx, float dy, float dz);
! void jumpturn(float* loc, float* dir, int n);
!
! void forward2d(float dist =1.0);
! void backward2d(float dist =1.0);
! void rotate2d(float ang);
float heading2d();
--- 47,71 ----
float& ydelta() { return _delta[1]; }
float& zdelta() { return _delta[2]; }
! virtual void move(float dx, float dy);
! virtual void move(float dx, float dy, float dy);
! virtual void move(float* deltas, int ndeltas);
! virtual void jump(float x, float y);
! virtual void jump(float x, float y, float y);
! virtual void jump(float* loc, int n);
! virtual void turn(float dx, float dy);
! virtual void turn(float dx, float dy, float dy);
! virtual void turn(float* deltas, int ndeltas);
! virtual void turnto(float x, float y);
! virtual void turnto(float x, float y, float y);
! virtual void turnto(float* dir, int n);
! virtual void jumpturn(float x, float y, float y, float dx, float dy);
! virtual void jumpturn(float x, float y, float y, float dx, float dy, float dz);
! virtual void jumpturn(float* loc, float* dir, int n);
!
! virtual void forward2d(float dist =1.0);
! virtual void backward2d(float dist =1.0);
! virtual void rotate2d(float ang);
float heading2d();
Index: VhclServ/vhclcomps.h
diff -c VhclServ/vhclcomps.h:1.3 VhclServ/vhclcomps.h:1.4
*** VhclServ/vhclcomps.h:1.3 Thu Feb 17 21:56:56 2000
--- src/VhclServ/vhclcomps.h Fri Mar 24 23:21:09 2000
***************
*** 26,32 ****
#include <OverlayUnidraw/ovcomps.h>
#include <OverlayUnidraw/scriptview.h>
- #include <ComTerp/_comutil.h>
#ifdef HAVE_ACE
#include <ace/Acceptor.h>
--- 26,31 ----
Index: VhclServ/vhclfunc.c
diff -c VhclServ/vhclfunc.c:1.4 VhclServ/vhclfunc.c:1.5
*** VhclServ/vhclfunc.c:1.4 Sat Mar 18 02:24:17 2000
--- src/VhclServ/vhclfunc.c Fri Mar 24 23:21:09 2000
***************
*** 1,4 ****
--- 1,5 ----
/*
+ * Copyright (c) 2000 IET Inc.
* Copyright (c) 1997-1999 Vectaport Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
***************
*** 92,106 ****
ComValue defaultportnum(5678);
ComValue portnum(stack_key(_gpsdport_symid, false, defaultportnum, true));
reset_stack();
VehicleComp* vhclcomp = VhclFunc::findvhcl(namestr.symbol_val());
if (vhclcomp) return;
const char* name = namestr.string_ptr();
int port = portnum.int_val();
vhclcomp = new VehicleComp(name, port);
VhclSimTimeFunc::simtime()->attach(vhclcomp->vehicle());
ComValue* result =
! new ComValue(ComValue::ObjectType, new ComponentView(vhclcomp));
! result->obj_type_ref() = VehicleComp::class_symid();
result->object_compview(true);
VhclFunc::vhcltable()->insert(namestr.symbol_val(), result);
push_stack(*result);
--- 93,110 ----
ComValue defaultportnum(5678);
ComValue portnum(stack_key(_gpsdport_symid, false, defaultportnum, true));
reset_stack();
+ #if 0
VehicleComp* vhclcomp = VhclFunc::findvhcl(namestr.symbol_val());
if (vhclcomp) return;
+ #else
+ VehicleComp* vhclcomp = nil;
+ #endif
const char* name = namestr.string_ptr();
int port = portnum.int_val();
vhclcomp = new VehicleComp(name, port);
VhclSimTimeFunc::simtime()->attach(vhclcomp->vehicle());
ComValue* result =
! new ComValue(VehicleComp::class_symid(), new ComponentView(vhclcomp));
result->object_compview(true);
VhclFunc::vhcltable()->insert(namestr.symbol_val(), result);
push_stack(*result);
***************
*** 116,151 ****
}
void CreateCompVhclFunc::execute() {
! ComValue namestr(stack_arg(0, true));
! ComValue& vhclvect = stack_arg(1, true);
! if (!vhclvect.is_type(ComValue::ArrayType) || vhclvect.array_len()==0) {
reset_stack();
! push_stack(ComValue::nullval());
return;
}
! const int nvhcls = vhclvect.array_len();
! Vehicle* vhcls[nvhcls];
! ALIterator i;
! AttributeValueList* avl = vhclvect.array_val();
! avl->First(i);
! for (int j=0; j<nvhcls && !avl->Done(i); j++) {
! vhcls[j] = VhclFunc::findvhcl(avl->GetAttrVal(i)->symbol_val())->vehicle();
! avl->Next(i);
}
reset_stack();
VehicleComp* vhclcomp = VhclFunc::findvhcl(namestr.symbol_val());
if (vhclcomp) return;
const char* name = namestr.string_ptr();
CompositeVehicle* compvhcl = new CompositeVehicle(name, vhcls, nvhcls);
vhclcomp = new VehicleComp(compvhcl);
VhclSimTimeFunc::simtime()->attach(vhclcomp->vehicle());
ComValue* result =
! new ComValue(ComValue::ObjectType, new ComponentView(vhclcomp));
! result->obj_type_ref() = VehicleComp::class_symid();
result->object_compview(true);
VhclFunc::vhcltable()->insert(namestr.symbol_val(), result);
push_stack(*result);
--- 120,173 ----
}
void CreateCompVhclFunc::execute() {
! if (nargs()<=1) {
reset_stack();
! push_stack(ComValue::nullval());
return;
}
+
+ Vehicle** vhcls = nil;
+ int nvhcls = -1;
! ComValue namestr(stack_arg(0, true));
! ComValue& vhclvect = stack_arg(1, true);
! if (vhclvect.is_type(ComValue::ArrayType)) {
! nvhcls = vhclvect.array_len();
! vhcls = new Vehicle*[nvhcls];
! ALIterator i;
! AttributeValueList* avl = vhclvect.array_val();
! avl->First(i);
! for (int j=0; j<nvhcls && !avl->Done(i); j++) {
! VehicleComp* vcomp = VhclFunc::findvhcl(avl->GetAttrVal(i)->symbol_val());
! vhcls[j] = vcomp ? vcomp->vehicle() : nil;
! avl->Next(i);
! }
! } else {
! nvhcls = nargs()-1;
! vhcls = new Vehicle*[nvhcls];
! for (int j=0; j<nvhcls; j++) {
! ComValue vhclsymv(stack_arg(j+1, true));
! VehicleComp* vcomp = VhclFunc::findvhcl(vhclsymv.symbol_val());
! vhcls[j] = vcomp ? vcomp->vehicle() : nil;
! }
}
reset_stack();
+ #if 0
VehicleComp* vhclcomp = VhclFunc::findvhcl(namestr.symbol_val());
if (vhclcomp) return;
+ #else
+ VehicleComp* vhclcomp = nil;
+ #endif
const char* name = namestr.string_ptr();
CompositeVehicle* compvhcl = new CompositeVehicle(name, vhcls, nvhcls);
+ delete vhcls;
vhclcomp = new VehicleComp(compvhcl);
VhclSimTimeFunc::simtime()->attach(vhclcomp->vehicle());
ComValue* result =
! new ComValue(VehicleComp::class_symid(), new ComponentView(vhclcomp));
result->object_compview(true);
VhclFunc::vhcltable()->insert(namestr.symbol_val(), result);
push_stack(*result);
***************
*** 194,201 ****
Route* rte = new Route(name, npts, x, y);
RouteComp* rtecomp = new RouteComp(rte);
ComValue* result =
! new ComValue(ComValue::ObjectType, new ComponentView(rtecomp));
! result->obj_type_ref() = RouteComp::class_symid();
result->object_compview(true);
VhclFunc::rtetable()->insert(namestr.symbol_val(), result);
push_stack(*result);
--- 216,222 ----
Route* rte = new Route(name, npts, x, y);
RouteComp* rtecomp = new RouteComp(rte);
ComValue* result =
! new ComValue(RouteComp::class_symid(), new ComponentView(rtecomp));
result->object_compview(true);
VhclFunc::rtetable()->insert(namestr.symbol_val(), result);
push_stack(*result);
***************
*** 271,282 ****
portnum = atoi(portp->string_ptr());
if (vhclremote && vhclremote->connect(host, portnum)) {
! ComValue retval(ComValue::ObjectType, vhclremote);
! retval.obj_type_ref() = VehicleUpdater::class_symid();
push_stack(retval);
} else if (rteremote && rteremote->connect(host, portnum)) {
! ComValue retval(ComValue::ObjectType, rteremote);
! retval.obj_type_ref() = RouteUpdater::class_symid();
push_stack(retval);
} else {
delete vhclremote;
--- 292,301 ----
portnum = atoi(portp->string_ptr());
if (vhclremote && vhclremote->connect(host, portnum)) {
! ComValue retval(VehicleUpdater::class_symid(), vhclremote);
push_stack(retval);
} else if (rteremote && rteremote->connect(host, portnum)) {
! ComValue retval(RouteUpdater::class_symid(), rteremote);
push_stack(retval);
} else {
delete vhclremote;
Index: VhclServ/vhclfunc.h
diff -c VhclServ/vhclfunc.h:1.2 VhclServ/vhclfunc.h:1.3
*** VhclServ/vhclfunc.h:1.2 Tue Jan 25 03:35:33 2000
--- src/VhclServ/vhclfunc.h Fri Mar 24 23:21:09 2000
***************
*** 66,72 ****
CreateCompVhclFunc(ComTerp*);
virtual void execute();
virtual const char* docstring() {
! return "%s(compvhclsym vhclsym1[,vhclsym2[,...vhclsymn]]) -- create a composite vehicle"; }
};
class ConnectVhclFunc : public VhclFunc {
--- 66,72 ----
CreateCompVhclFunc(ComTerp*);
virtual void execute();
virtual const char* docstring() {
! return "%s(compvhclsym vhclsym1 [vhclsym2 [... vhclsymn]]) -- create a composite vehicle"; }
};
class ConnectVhclFunc : public VhclFunc {
Index: VhclServ/vhclmapcomps.c
diff -c VhclServ/vhclmapcomps.c:1.1 VhclServ/vhclmapcomps.c:1.2
*** VhclServ/vhclmapcomps.c:1.1 Mon Aug 2 13:53:49 1999
--- src/VhclServ/vhclmapcomps.c Fri Mar 24 23:21:09 2000
***************
*** 33,38 ****
--- 33,40 ----
/****************************************************************************/
+ int VhclMapFeatureComp::_symid = -1;
+
VhclMapFeatureComp::VhclMapFeatureComp(MapFeature* mf, OverlayComp* parent) :
MapFeatureComp(mf, parent) {
}
Index: VhclServ/vhclmapcomps.h
diff -c VhclServ/vhclmapcomps.h:1.1 VhclServ/vhclmapcomps.h:1.2
*** VhclServ/vhclmapcomps.h:1.1 Mon Aug 2 13:53:49 1999
--- src/VhclServ/vhclmapcomps.h Fri Mar 24 23:21:09 2000
***************
*** 31,36 ****
--- 31,38 ----
VhclMapFeatureComp(MapFeature* =nil, OverlayComp* parent=nil);
virtual void update(Observable*);
+ CLASS_SYMID("VhclMapFeatureComp");
+
};
#endif
Index: VhclServ/vhclmapfunc.c
diff -c VhclServ/vhclmapfunc.c:1.2 VhclServ/vhclmapfunc.c:1.3
*** VhclServ/vhclmapfunc.c:1.2 Sat Mar 18 02:24:17 2000
--- src/VhclServ/vhclmapfunc.c Fri Mar 24 23:21:09 2000
***************
*** 58,67 ****
mappoint->feature(point);
VhclMapFeatureComp* fcom...
[truncated message content] |
|
From: <joh...@ie...> - 2000-03-21 08:15:05
|
Patch: vhclmaps-000321-johnston-014
For: vhclmaps-0.7.4
Author: joh...@us...
Subject: organize precedence of utmviewer commands, suppress output of multi-frame objects in a mapserv document
Requires: ivtools-000321-johnston-033
This is an intermediate patch to vhclmaps-0.7.4. To apply, cd to the
top-level directory of the vhclmaps source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- suppress output of multi-frame objects in a mapserv document.
- reorganize inclusion of commands into a utmviewer command
interpreter to ensure MapPointsFunc is what the point command resolves
to, and GrDotFunc is what "." resolves to.
Index: MapUnidraw/maproute.c
diff -c MapUnidraw/maproute.c:1.2 MapUnidraw/maproute.c:1.3
*** MapUnidraw/maproute.c:1.2 Mon Feb 28 17:27:53 2000
--- src/MapUnidraw/maproute.c Tue Mar 21 12:03:11 2000
***************
*** 1,4 ****
--- 1,5 ----
/*
+ * Copyright 2000 IET Inc.
* Copyright 1997 Vectaport Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
Index: MapUnidraw/mapscripts.c
diff -c MapUnidraw/mapscripts.c:1.2 MapUnidraw/mapscripts.c:1.3
*** MapUnidraw/mapscripts.c:1.2 Sat Mar 18 02:24:03 2000
--- src/MapUnidraw/mapscripts.c Tue Mar 21 12:03:12 2000
***************
*** 1,4 ****
--- 1,5 ----
/*
+ * Copyright 2000 IET Inc.
* Copyright 1995-1997 Vectaport Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
***************
*** 38,43 ****
--- 39,46 ----
#include <Map/mapprim.h>
#include <Map/mapproject.h>
+ #include <FrameUnidraw/frameclasses.h>
+
#include <OverlayUnidraw/paramlist.h>
#include <OverlayUnidraw/ovclasses.h>
#include <OverlayUnidraw/ovfile.h>
***************
*** 543,548 ****
--- 546,553 ----
ExternView* ev = GetView(i);
if (exporttype != OvIdrawType)
Indent(out);
+ if (ev->IsA(FRAME_SCRIPT))
+ ((FrameScript*)ev)->suppress_frame();
status = ev->Definition(out);
Next(i);
if (!Done(i)) out << ",\n";
Index: UtmUnidraw/utmeditor.c
diff -c UtmUnidraw/utmeditor.c:1.3 UtmUnidraw/utmeditor.c:1.4
*** UtmUnidraw/utmeditor.c:1.3 Sat Mar 18 02:24:08 2000
--- src/UtmUnidraw/utmeditor.c Tue Mar 21 12:03:21 2000
***************
*** 30,35 ****
--- 30,36 ----
#include <MapUnidraw/mapcreator.h>
#include <MapUnidraw/mapviewer.h>
#include <MapUnidraw/mapviewstate.h>
+ #include <ComUnidraw/grdotfunc.h>
#include <Unidraw/catalog.h>
#include <Unidraw/iterator.h>
#include <Unidraw/unidraw.h>
***************
*** 130,142 ****
comterp->add_command("mapviewstate", new MapViewStateFunc(comterp, this));
comterp->add_command("utmtoscreen", new UtmToScreenFunc(comterp, this));
- MapservHandler::AddCommands(comterp);
ComEditor::AddCommands(comterp);
! #if 0
! // override more generic "points" func. -- now in mapserv
! comterp->add_command("points", new MapPointsFunc(comterp, this));
! #endif
}
--- 131,141 ----
comterp->add_command("mapviewstate", new MapViewStateFunc(comterp, this));
comterp->add_command("utmtoscreen", new UtmToScreenFunc(comterp, this));
ComEditor::AddCommands(comterp);
+ MapservHandler::AddCommands(comterp);
! // override more generic dot func
! comterp->add_command("dot", new GrDotFunc(comterp));
}
*** /dev/null Tue Mar 21 12:03:47 PST 2000
--- patches/vhclmaps-000321-johnston-014
*************** patches/vhclmaps-000321-johnston-014
*** 0 ****
--- 1 ----
+ vhclmaps-000321-johnston-014
|
|
From: <joh...@ie...> - 2000-03-21 08:14:31
|
Patch: vhclmaps-000318-johnston-013
For: vhclmaps-0.7.4
Author: joh...@us...
Subject: UTM points from map feature class in map/proj/vhclserv, ComValue::object_compview() used everywhere
Requires: ivtools-000318-johnston-032
This is an intermediate patch to vhclmaps-0.7.4. To apply, cd to the
top-level directory of the vhclmaps source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- migrate a generic one-shot latlon-to-utm method from MapFeatureScript to MapProjection (void MapProjection::to_utm(double &fx, double &fy)).
- fix up problem with determining the number of features in a tiled
vpf feature class.
- find all the other places where a simple "id" is now used for the
first column name.
- migrate the utmviewer points command to mapserv, remove any viewer
dependencies, make it work for MapFeatureComp's (as well as
MapRouteComp's), and add a :utm flag to allow for conversion from
latlon to utm on the fly when generating point lists for use in the
interpreter.
- migrate to consistent use of ComValue::object_compview() mechanism.
Index: Map/mapproject.c
diff -c Map/mapproject.c:1.1 Map/mapproject.c:1.2
*** Map/mapproject.c:1.1 Mon Aug 2 13:52:40 1999
--- src/Map/mapproject.c Sat Mar 18 02:23:58 2000
***************
*** 23,28 ****
--- 23,32 ----
#include <Map/mapproject.h>
+ #include <stdio.h>
+ extern "C" {
+ #include <projects.h>
+ }
/*****************************************************************************/
***************
*** 39,41 ****
--- 43,65 ----
while (utmzone>60) utmzone-=60;
return utmzone;
}
+
+ void MapProjection::to_utm(double& fx, double& fy) {
+ char* parms[4];
+ char lon0[80];
+ parms[0] = "proj=utm";
+ parms[1] = "ellps=WGS84";
+ parms[3] = "no_defs";
+ sprintf(lon0, "lon_0=%f", fx); // let proj pick the utm zone
+ parms[2] = lon0;
+
+ PJ* proj = pj_init(4, parms);
+ UV data;
+ data.u = fx * DEG_TO_RAD;
+ data.v = fy * DEG_TO_RAD;
+ data = pj_fwd(data, proj);
+ fx = data.u;
+ fy = data.v;
+ return;
+ }
+
Index: Map/mapproject.h
diff -c Map/mapproject.h:1.1 Map/mapproject.h:1.2
*** Map/mapproject.h:1.1 Mon Aug 2 13:52:40 1999
--- src/Map/mapproject.h Sat Mar 18 02:23:59 2000
***************
*** 51,56 ****
--- 51,57 ----
virtual void project(double* x, double* y, double* z, int npts) const = 0;
static int utmzone(float lon);
+ static void to_utm(double& fx,double& fy);
};
Index: Vpf/vpftiledfc.c
diff -c Vpf/vpftiledfc.c:1.2 Vpf/vpftiledfc.c:1.3
*** Vpf/vpftiledfc.c:1.2 Tue Mar 14 22:51:57 2000
--- src/Vpf/vpftiledfc.c Sat Mar 18 02:24:01 2000
***************
*** 29,34 ****
--- 29,35 ----
#include <OS/math.h>
#include <iostream.h>
+ #include <math.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
***************
*** 140,151 ****
--- 141,156 ----
vpf_table_type table;
char tablepath[255];
+ #if 0
fixpath(tilename);
rjust(tilename);
strcpy(tablepath, _coverage->path());
strcat(tablepath, "/");
strcat(tablepath, tilename);
strcat(tablepath, &_ptable[strlen(_ptable)-5]);
+ #else
+ strcpy(tablepath, _tabl);
+ #endif
struct stat statbuf;
if (stat(tablepath, &statbuf) != 0 &&
***************
*** 174,180 ****
row = get_row(table.nrows, table);
get_table_element(colpos,row,table,&tileend[tileid],&n);
free_row(row,table);
! #endif
int fn;
int fnmin = MAXINT;
int fnmax = -1;
--- 179,185 ----
row = get_row(table.nrows, table);
get_table_element(colpos,row,table,&tileend[tileid],&n);
free_row(row,table);
! #else
int fn;
int fnmin = MAXINT;
int fnmax = -1;
***************
*** 189,196 ****
fnmax = fn;
}
}
tilestart[tileid] = fnmin;
! tileend[tileid] = fnmax;
vpf_close_table(&table);
}
--- 194,204 ----
fnmax = fn;
}
}
+ //cerr << "VpfTiledFeatureClass::init_tile, fnmin, fnmax, table.nrows: "
+ // << fnmin << "," << fnmax << "," << table.nrows << "\n";
tilestart[tileid] = fnmin;
! tileend[tileid] = Math::max(table.nrows,(long int)fnmax);
! #endif
vpf_close_table(&table);
}
***************
*** 411,417 ****
strupr(colname);
strcat(colname, "_ID");
long int edge_feat_pos = table_pos(colname, edgetable);
!
_tfeatures[tileid] = new VpfFeature*[edgetable.nrows];
int fi = 0;
for (i=1;i<=edgetable.nrows;i++) {
--- 419,425 ----
strupr(colname);
strcat(colname, "_ID");
long int edge_feat_pos = table_pos(colname, edgetable);
! if (edge_feat_pos==-1) edge_feat_pos = table_pos("id", edgetable);
_tfeatures[tileid] = new VpfFeature*[edgetable.nrows];
int fi = 0;
for (i=1;i<=edgetable.nrows;i++) {
***************
*** 511,516 ****
--- 519,525 ----
strupr(colname);
strcat(colname, "_ID");
long int node_feat_pos = table_pos(colname, nodetable);
+ if (node_feat_pos==-1) node_feat_pos = table_pos("id", nodetable);
_tfeatures[tileid] = new VpfFeature*[nodetable.nrows];
int fi = 0;
***************
*** 573,578 ****
--- 582,588 ----
strupr(colname);
strcat(colname, "_ID");
long int text_feat_pos = table_pos(colname, texttable);
+ if (text_feat_pos==-1) text_feat_pos =table_pos("id", texttable);
_tfeatures[tileid] = new VpfFeature*[texttable.nrows];
int fi = 0;
Index: MapUnidraw/mapscripts.c
diff -c MapUnidraw/mapscripts.c:1.1 MapUnidraw/mapscripts.c:1.2
*** MapUnidraw/mapscripts.c:1.1 Mon Aug 2 13:53:07 1999
--- src/MapUnidraw/mapscripts.c Sat Mar 18 02:24:03 2000
***************
*** 36,41 ****
--- 36,42 ----
#include <Map/mapfclass.h>
#include <Map/mapfeature.h>
#include <Map/mapprim.h>
+ #include <Map/mapproject.h>
#include <OverlayUnidraw/paramlist.h>
#include <OverlayUnidraw/ovclasses.h>
***************
*** 208,213 ****
--- 209,218 ----
return 0;
}
+ void MapFeatureScript::to_utm(double& fx, double& fy) {
+ MapProjection::to_utm(fx, fy);
+ }
+
/*****************************************************************************/
MapFClassScript::MapFClassScript (MapFClassComp* subj) : OverlaysScript(subj) {}
***************
*** 564,569 ****
--- 569,578 ----
boolean MapFeatureRawScript::Definition (ostream& out) {
MapFeatureComp* comp = (MapFeatureComp*)GetSubject();
+ int static proj_symid = symbol_add("proj");
+ int static utm_symid = symbol_add("utm");
+ AttributeValue* projv = comp->FindValue(proj_symid, false, false, false, true);
+ boolean utmflag = 1; // projv && projv->symbol_val() == utm_symid;
MapFeature* feature = comp->feature();
int i;
switch(feature->type()) {
***************
*** 571,581 ****
{
MapPoint* point = feature->point_primitive();
if (!point) break;
! if (MapFeatureRawScript::native())
! out.form("point(%.6f,%.6f", point->xorigin(), point->yorigin());
! else
! out << "ellipse(" << Math::round(point->xorigin()) << ","
! << Math::round(point->yorigin()) << "10,10";
}
break;
case MapFeature::LineType:
--- 580,598 ----
{
MapPoint* point = feature->point_primitive();
if (!point) break;
! if (MapFeatureRawScript::native()) {
! double tx = point->xorigin();
! double ty = point->yorigin();
! const char* fstr=nil;
! if (utmflag) {
! MapFeatureScript::to_utm(tx, ty);
! fstr="point(%.2f,%.2f";
! } else
! fstr="point(%.6f,%.6f";
! out.form(fstr, tx, ty);
! } else
! out << "ellipse(" << Math::round(point->xorigin()) << ","
! << Math::round(point->yorigin()) << "10,10";
}
break;
case MapFeature::LineType:
***************
*** 590,600 ****
else
out << "multiline(";
for (i=0; i<npts; i++) {
! if (MapFeatureRawScript::native())
! out.form("(%.6f,%.6f)", fx[i], fy[i]);
! else
! out << "(" << Math::round(fx[i]) << "," << Math::round(fy[i]) << ")";
! if (i+1 < npts ) out << ",";
}
}
break;
--- 607,626 ----
else
out << "multiline(";
for (i=0; i<npts; i++) {
! if (MapFeatureRawScript::native()) {
! double tx = fx[i];
! double ty = fy[i];
! const char* fstr = nil;
! if (utmflag) {
! MapFeatureScript::to_utm(tx, ty);
! fstr="(%.2f,%.2f)";
! } else
! fstr="(%.6f,%.6f)";
! out.form(fstr, tx, ty);
! }
! else
! out << "(" << Math::round(fx[i]) << "," << Math::round(fy[i]) << ")";
! if (i+1 < npts ) out << ",";
}
}
break;
***************
*** 610,620 ****
else
out << "polygon(";
for (i=0; i<npts; i++) {
! if (MapFeatureRawScript::native())
! out.form("(%.6f,%.6f)", fx[i], fy[i]);
! else
! out << "(" << Math::round(fx[i]) << "," << Math::round(fy[i]) << ")";
! if (i+1 < npts ) out << ",";
}
}
break;
--- 636,655 ----
else
out << "polygon(";
for (i=0; i<npts; i++) {
! if (MapFeatureRawScript::native()) {
! double tx = fx[i];
! double ty = fy[i];
! const char* fstr = nil;
! if (utmflag) {
! MapFeatureScript::to_utm(tx, ty);
! fstr="(%.2f,%.2f)";
! } else
! fstr="(%.6f,%.6f)";
! out.form(fstr, tx, ty);
! }
! else
! out << "(" << Math::round(fx[i]) << "," << Math::round(fy[i]) << ")";
! if (i+1 < npts ) out << ",";
}
}
break;
***************
*** 622,628 ****
{
MapText* text = feature->text_primitive();
if (!text) break;
! out.form("text(%.6f,%.6f", text->xorigin(), text->yorigin());
out << ", \"" << text->text() << "\"";
}
break;
--- 657,671 ----
{
MapText* text = feature->text_primitive();
if (!text) break;
! double tx = text->xorigin();
! double ty = text->yorigin();
! const char* fstr = nil;
! if (utmflag) {
! MapFeatureScript::to_utm(tx, ty);
! fstr="text(%.2f,%.2f";
! } else
! fstr="text(%.6f,%.6f";
! out.form(fstr, tx, ty);
out << ", \"" << text->text() << "\"";
}
break;
***************
*** 630,640 ****
{
MapNode* node = feature->node_primitive();
if (!node) break;
! if (MapFeatureRawScript::native())
! out.form("junction(%.6f,%.6f", node->xorigin(), node->yorigin());
else
! out << "ellipse(" << Math::round(node->xorigin()) << ","
! << Math::round(node->yorigin()) << "10,10";
}
break;
case MapFeature::RasterType:
--- 673,692 ----
{
MapNode* node = feature->node_primitive();
if (!node) break;
! if (MapFeatureRawScript::native()) {
! double tx = node->xorigin();
! double ty = node->yorigin();
! const char* fstr = nil;
! if (utmflag) {
! MapFeatureScript::to_utm(tx, ty);
! fstr="junction(%.2f,%.2f";
! } else
! fstr="junction(%.6f,%.6f";
! out.form(fstr, tx, ty);
! }
else
! out << "ellipse(" << Math::round(node->xorigin()) << ","
! << Math::round(node->yorigin()) << "10,10";
}
break;
case MapFeature::RasterType:
Index: MapUnidraw/mapscripts.h
diff -c MapUnidraw/mapscripts.h:1.1 MapUnidraw/mapscripts.h:1.2
*** MapUnidraw/mapscripts.h:1.1 Mon Aug 2 13:53:07 1999
--- src/MapUnidraw/mapscripts.h Sat Mar 18 02:24:04 2000
***************
*** 42,47 ****
--- 42,48 ----
virtual boolean Definition(ostream&);
static int ReadFeature(istream&, void*, void*, void*, void*);
+ static void to_utm(double& fx,double& fy);
};
class MapFClassScript : public OverlaysScript {
***************
*** 106,111 ****
--- 107,113 ----
boolean static native() { return _native; }
void static native(boolean v) { _native = v;}
+
protected:
static boolean _native;
Index: MapServ/mapfunc.c
diff -c MapServ/mapfunc.c:1.2 MapServ/mapfunc.c:1.3
*** MapServ/mapfunc.c:1.2 Tue Mar 14 22:52:05 2000
--- src/MapServ/mapfunc.c Sat Mar 18 02:24:06 2000
***************
*** 47,54 ****
--- 47,57 ----
#include <TopoFace/topoedge.h>
#include <TopoFace/topoface.h>
#include <TopoFace/toponode.h>
+ #include <Map/mapelt.h>
#include <Map/mapfeature.h>
#include <Map/mapprim.h>
+ #include <Map/mapproject.h>
+ #include <MapUnidraw/maproute.h>
#if !defined(DLG_FREE)
#include <DlgUnidraw/dlgclasses.h>
#include <DlgUnidraw/dlgcomps.h>
***************
*** 97,103 ****
static int LineFeature_symid = symbol_add("LineFeature");
static int AreaFeature_symid = symbol_add("AreaFeature");
static int FeatureClass_symid = symbol_add("FeatureClass");
- static int ComponentView_symid = symbol_add("ComponentView");
/*****************************************************************************/
--- 100,105 ----
***************
*** 184,189 ****
--- 186,202 ----
return newf;
}
+ void* MapFunc::geta(ComValue* val, int class_symid) {
+ if (val->class_symid() != class_symid) return nil;
+ if (val->object_compview()) {
+ ComponentView* view = (ComponentView*)val->obj_val();
+ OverlayComp* comp = view ? (OverlayComp*) view->GetSubject() : nil;
+ return comp;
+ } else
+ return val->geta(class_symid);
+ }
+
+
/*****************************************************************************/
#if !defined(VPF_FREE)
***************
*** 236,241 ****
--- 249,255 ----
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
result.obj_type_ref() = FeatureClass_symid;
+ result.object_compview() = true;
push_stack(result);
}
***************
*** 277,282 ****
--- 291,297 ----
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
result.obj_type_ref() = FeatureClass_symid;
+ result.object_compview() = true;
push_stack(result);
}
***************
*** 315,320 ****
--- 330,336 ----
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
result.obj_type_ref() = PointFeature_symid;
+ result.object_compview(true);
push_stack(result);
}
***************
*** 352,357 ****
--- 368,374 ----
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
result.obj_type_ref() = LineFeature_symid;
+ result.object_compview(true);
push_stack(result);
}
***************
*** 389,394 ****
--- 406,412 ----
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
result.obj_type_ref() = AreaFeature_symid;
+ result.object_compview(true);
push_stack(result);
}
***************
*** 420,425 ****
--- 438,444 ----
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
result.obj_type_ref() = NodeFeature_symid;
+ result.object_compview(true);
push_stack(result);
}
***************
*** 431,444 ****
void PolygonAreaFunc::execute() {
ComValue mf(stack_arg(0));
reset_stack();
! if (mf.type() == ComValue::ObjectType && mf.obj_type_val() == AreaFeature_symid) {
! ComponentView* view = (ComponentView*)mf.obj_val();
! MapFeatureComp* fcomp = (MapFeatureComp*)view->GetSubject();
! MapFeature* feat = fcomp->feature();
! MapFace* face = feat->face_primitive();
! float area = face->topo()->area();
! ComValue result(area);
! push_stack(result);
}
else {
push_stack(ComValue::nullval());
--- 450,465 ----
void PolygonAreaFunc::execute() {
ComValue mf(stack_arg(0));
reset_stack();
! MapFeatureComp* fcomp = nil;
! if (fcomp == (MapFeatureComp*)MapFunc::geta(&mf, AreaFeature_symid)) {
! MapFeature* feat = fcomp ? fcomp->feature() : nil;
! MapFace* face = feat ? feat->face_primitive() : nil;
! float area = face ? face->topo()->area() : -1;
! if (face) {
! ComValue result(area);
! push_stack(result);
! } else
! push_stack(ComValue::nullval());
}
else {
push_stack(ComValue::nullval());
***************
*** 459,464 ****
--- 480,486 ----
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
result.obj_type_ref() = FeatureClass_symid;
+ result.object_compview(true);
push_stack(result);
}
***************
*** 587,592 ****
--- 609,615 ----
result.type(AttributeValue::ObjectType);
result.obj_ref() = rview;
result.obj_type_ref() = PointFeature_symid;
+ result.object_compview(true);
push_stack(result);
}
else
***************
*** 745,750 ****
--- 768,774 ----
result.type(ComValue::ObjectType);
result.obj_type_ref() = AreaFeature_symid;
result.obj_ref() = hview;
+ result.object_compview(true);
push_stack(result);
}
else
***************
*** 1073,1078 ****
--- 1097,1103 ----
result.type(AttributeValue::ObjectType);
result.obj_ref() = nview;
result.obj_type_ref() = FeatureClass_symid;
+ result.object_compview(true);
push_stack(result);
}
***************
*** 1294,1299 ****
--- 1319,1325 ----
result.type(AttributeValue::ObjectType);
result.obj_ref() = nview;
result.obj_type_ref() = FeatureClass_symid;
+ result.object_compview(true);
push_stack(result);
}
***************
*** 1472,1477 ****
--- 1498,1504 ----
result.type(AttributeValue::ObjectType);
result.obj_ref() = nfcview;
result.obj_type_ref() = FeatureClass_symid;
+ result.object_compview(true);
push_stack(result);
}
***************
*** 1494,1501 ****
ComValue nen(stack_key(_nen_symid));
reset_stack();
! ComponentView* view = (ComponentView*)fcc.geta(ComponentView_symid);
! MapFClassComp* comp = view ? (MapFClassComp*)view->GetSubject() : nil;
MapFeatureClass* fc = comp ? comp->GetFeatureClass() : nil;
if (fc) {
double x1, y1, x2, y2;
--- 1521,1527 ----
ComValue nen(stack_key(_nen_symid));
reset_stack();
! MapFClassComp* comp = (MapFClassComp*)MapFunc::geta(&fcc, FeatureClass_symid);
MapFeatureClass* fc = comp ? comp->GetFeatureClass() : nil;
if (fc) {
double x1, y1, x2, y2;
***************
*** 1594,1599 ****
--- 1620,1626 ----
result.type(AttributeValue::ObjectType);
result.obj_ref() = nview;
result.obj_type_ref() = FeatureClass_symid;
+ result.object_compview(true);
push_stack(result);
delete attrterp;
***************
*** 1693,1698 ****
--- 1720,1726 ----
result.type(AttributeValue::ObjectType);
result.obj_ref() = nview;
result.obj_type_ref() = FeatureClass_symid;
+ result.object_compview(true);
push_stack(result);
delete attrterp;
***************
*** 1785,1791 ****
if (conn.connect (*socket, addr) == -1)
ACE_ERROR ((LM_ERROR, "%p\n", "open"));
fbuf.attach(socket->get_handle());
! } else if (comterp()->handler()) {
fbuf.attach(comterp()->handler()->get_handle());
} else
#endif
--- 1813,1819 ----
if (conn.connect (*socket, addr) == -1)
ACE_ERROR ((LM_ERROR, "%p\n", "open"));
fbuf.attach(socket->get_handle());
! } else if (comterp()->handler() && comterp()->handler()->get_handle()>-1) {
fbuf.attach(comterp()->handler()->get_handle());
} else
#endif
***************
*** 2296,2301 ****
--- 2324,2330 ----
ComponentView* view = new ComponentView(comp);
ComValue result(ComValue::ObjectType, (void*)view);
result.obj_type_ref() = FeatureClass_symid;
+ result.object_compview(true);
push_stack(result);
} else {
if (comp) delete comp;
***************
*** 2366,2371 ****
--- 2395,2401 ----
MapFeatureComp* nfcomp = (MapFeatureComp*)newf->graphic();
ComponentView* fview = new ComponentView(nfcomp);
result.obj_ref() = fview;
+ result.object_compview(true);
push_stack(result);
}
else
***************
*** 2439,2442 ****
--- 2469,2533 ----
}
push_stack(viewv);
+ }
+
+ /*****************************************************************************/
+
+ MapPointsFunc::MapPointsFunc(ComTerp* comterp) : MapFunc(comterp) {
+ }
+
+ void MapPointsFunc::execute() {
+ ComValue& obj = stack_arg(0);
+ static int utm_symid = symbol_add("utm");
+ ComValue utmv(stack_key(utm_symid));
+ boolean utmflag=utmv.is_true();
+
+ if (!obj.object_compview()) {
+ reset_stack();
+ return;
+ } else {
+ ComponentView* compview = (ComponentView*)obj.obj_val();
+ if (compview && compview->GetSubject()) {
+ GraphicComp* comp = (GraphicComp*)compview->GetSubject();
+ Graphic* gr = comp ? comp->GetGraphic() : nil;
+ AttributeValueList* avl = new AttributeValueList();
+ if (gr && comp->IsA(MAP_ROUTE_COMP)) {
+ MapRouteComp* rtecomp = (MapRouteComp*)comp;
+ double *x, *y;
+ int n;
+ ((MapElement*)rtecomp->feature())->points(x, y, n);
+ for(int i=0; i<n; i++) {
+ ComValue* val = new ComValue(x[i]);
+ avl->Append(val);
+ val = new ComValue(y[i]);
+ avl->Append(val);
+ }
+ reset_stack();
+ ComValue retval(avl);
+ push_stack(retval);
+
+
+ } else if (!gr && comp->IsA(MAPFEATURE_COMP)) {
+
+ MapFeature* feature = ((MapFeatureComp*)comp)->feature();
+ MapPrimitive* primitive = feature ? feature->primitive() : nil;
+ if (primitive) {
+ for(int i=0; i<primitive->npts(); i++) {
+ double fx= primitive->xpoints()[i];
+ double fy= primitive->ypoints()[i];
+ if(utmflag) MapProjection::to_utm(fx, fy);
+ ComValue* val = new ComValue(fx);
+ avl->Append(val);
+ val = new ComValue(fy);
+ avl->Append(val);
+ }
+ ComValue retval(avl);
+ push_stack(retval);
+ } else {
+ reset_stack();
+ push_stack(ComValue::nullval());
+ }
+ }
+ }
+ }
}
Index: MapServ/mapfunc.h
diff -c MapServ/mapfunc.h:1.1 MapServ/mapfunc.h:1.2
*** MapServ/mapfunc.h:1.1 Mon Aug 2 13:53:21 1999
--- src/MapServ/mapfunc.h Sat Mar 18 02:24:06 2000
***************
*** 40,45 ****
--- 40,47 ----
public:
MapFunc(ComTerp*);
virtual void execute() = 0;
+
+ static void* geta(ComValue* val, int class_symid);
protected:
void insert_array(MapFeature**& array, int& nf, int& curnf, MapFeature* f);
MapFeature* copy_point(MapFeature*, MapFeatureComp*);
***************
*** 417,422 ****
--- 419,433 ----
protected:
void SensitizeAll(OverlayComp*,boolean);
int _sens_symid;
+ };
+
+ class MapPointsFunc : public MapFunc {
+ public:
+ MapPointsFunc(ComTerp*);
+ virtual void execute();
+ virtual const char* docstring() {
+ return "ptlist=%s(compview :utm) -- return point list from map feature component"; }
+
};
#endif
Index: MapServ/maphandler.c
diff -c MapServ/maphandler.c:1.1 MapServ/maphandler.c:1.2
*** MapServ/maphandler.c:1.1 Mon Aug 2 13:53:21 1999
--- src/MapServ/maphandler.c Sat Mar 18 02:24:06 2000
***************
*** 73,78 ****
--- 73,79 ----
comterp->add_command("exportgrgs", new ExportFCGrGsFunc(expgraphic_func));
comterp->add_command("exportgrtr", new ExportFCGrTrFunc(expgraphic_func));
comterp->add_command("printgr", new PrintFCGrFunc(comterp));
+ comterp->add_command("points", new MapPointsFunc(comterp));
#if !defined(VPF_FREE)
comterp->add_command("loadvpffc", new LoadVpfFCFunc(comterp));
Index: UtmUnidraw/utmeditor.c
diff -c UtmUnidraw/utmeditor.c:1.2 UtmUnidraw/utmeditor.c:1.3
*** UtmUnidraw/utmeditor.c:1.2 Mon Feb 28 17:27:58 2000
--- src/UtmUnidraw/utmeditor.c Sat Mar 18 02:24:08 2000
***************
*** 133,140 ****
MapservHandler::AddCommands(comterp);
ComEditor::AddCommands(comterp);
! // override more generic "points" func.
comterp->add_command("points", new MapPointsFunc(comterp, this));
}
--- 133,142 ----
MapservHandler::AddCommands(comterp);
ComEditor::AddCommands(comterp);
! #if 0
! // override more generic "points" func. -- now in mapserv
comterp->add_command("points", new MapPointsFunc(comterp, this));
+ #endif
}
Index: UtmUnidraw/utmfunc.c
diff -c UtmUnidraw/utmfunc.c:1.2 UtmUnidraw/utmfunc.c:1.3
*** UtmUnidraw/utmfunc.c:1.2 Mon Feb 28 17:27:58 2000
--- src/UtmUnidraw/utmfunc.c Sat Mar 18 02:24:08 2000
***************
*** 125,130 ****
--- 125,131 ----
ComValue result(ComValue::ObjectType, (void*)new ComponentView(vhclpict));
result.obj_type_ref() = _vhclpict_symid;
+ result.object_compview(true);
push_stack(result);
} else
***************
*** 273,278 ****
--- 274,280 ----
ComValue result(ComValue::ObjectType, (void*)new ComponentView(rtepict));
result.obj_type_ref() = _rtepict_symid;
+ result.object_compview(true);
push_stack(result);
} else {
***************
*** 346,391 ****
push_stack(screencoordv);
}
-
- /*****************************************************************************/
-
- MapPointsFunc::MapPointsFunc(ComTerp* comterp, Editor* ed) : UtmFunc(comterp, ed) {
- }
-
- void MapPointsFunc::execute() {
- Viewer* viewer = _ed->GetViewer();
- ComValue& obj = stack_arg(0);
-
- if (obj.obj_type_val() != _compview_id) {
- reset_stack();
- return;
- } else {
- ComponentView* compview = (ComponentView*)obj.obj_val();
- if (compview && compview->GetSubject()) {
- GraphicComp* comp = (GraphicComp*)compview->GetSubject();
- Graphic* gr = comp ? comp->GetGraphic() : nil;
- AttributeValueList* avl = new AttributeValueList();
- if (gr && comp->IsA(MAP_ROUTE_COMP)) {
- MapRouteComp* rtecomp = (MapRouteComp*)comp;
- double *x, *y;
- int n;
- ((MapElement*)rtecomp->feature())->points(x, y, n);
- for(int i=0; i<n; i++) {
- ComValue* val = new ComValue(x[i]);
- avl->Append(val);
- val = new ComValue(y[i]);
- avl->Append(val);
- }
- reset_stack();
- ComValue retval(avl);
- push_stack(retval);
-
- } else {
- PointsFunc func(comterp(), editor());
- func.execute();
- }
-
- }
- }
- }
-
--- 348,350 ----
Index: UtmUnidraw/utmfunc.h
diff -c UtmUnidraw/utmfunc.h:1.2 UtmUnidraw/utmfunc.h:1.3
*** UtmUnidraw/utmfunc.h:1.2 Mon Feb 28 17:27:58 2000
--- src/UtmUnidraw/utmfunc.h Sat Mar 18 02:24:10 2000
***************
*** 93,105 ****
};
- class MapPointsFunc : public UtmFunc {
- public:
- MapPointsFunc(ComTerp*, Editor* ed);
- virtual void execute();
- virtual const char* docstring() {
- return "ptlist=%s(compview) -- return point list from map feature component"; }
-
- };
-
#endif
--- 93,96 ----
Index: LosServ/losfunc.c
diff -c LosServ/losfunc.c:1.4 LosServ/losfunc.c:1.5
*** LosServ/losfunc.c:1.4 Tue Mar 14 22:52:11 2000
--- src/LosServ/losfunc.c Sat Mar 18 02:24:12 2000
***************
*** 230,235 ****
--- 230,236 ----
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
result.obj_type_ref() = FeatureClass_symid;
+ result.object_compview(true);
push_stack(result);
}
else {
***************
*** 428,433 ****
--- 429,435 ----
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
result.obj_type_ref() = FeatureClass_symid;
+ result.object_compview(true);
push_stack(result);
}
}
***************
*** 674,679 ****
--- 676,682 ----
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
result.obj_type_ref() = FeatureClass_symid;
+ result.object_compview(true);
push_stack(result);
}
}
Index: ProjServ/projfunc.c
diff -c ProjServ/projfunc.c:1.2 ProjServ/projfunc.c:1.3
*** ProjServ/projfunc.c:1.2 Tue Mar 14 22:52:13 2000
--- src/ProjServ/projfunc.c Sat Mar 18 02:24:14 2000
***************
*** 64,70 ****
#include <stdio.h>
#include <ComUtil/comutil.h>
! static int ComponentView_symid = symbol_add("ComponentView");
LoadVpfFCFunc::LoadVpfFCFunc(ComTerp* comterp) : ComFunc(comterp) {
_tileid_symid = symbol_add("tileid");
--- 64,70 ----
#include <stdio.h>
#include <ComUtil/comutil.h>
! static int FeatureClass_symid = symbol_add("FeatureClass");
LoadVpfFCFunc::LoadVpfFCFunc(ComTerp* comterp) : ComFunc(comterp) {
_tileid_symid = symbol_add("tileid");
***************
*** 120,136 ****
if (view) {
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = ComponentView_symid;
push_stack(result);
} else {
cerr << "database open failed\n";
! delete db;
! delete lib;
! delete libcomp;
! delete cov;
! delete covcomp;
! delete fclass;
! delete fccomp;
push_stack(ComValue::nullval());
}
}
--- 120,131 ----
if (view) {
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = FeatureClass_symid;
! result.object_compview(true);
push_stack(result);
} else {
cerr << "database open failed\n";
! // delete db;
push_stack(ComValue::nullval());
}
}
***************
*** 216,222 ****
ComponentView* view = new ComponentView(fccomp);
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = ComponentView_symid;
push_stack(result);
}
--- 211,218 ----
ComponentView* view = new ComponentView(fccomp);
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = FeatureClass_symid;
! result.object_compview(true);
push_stack(result);
}
***************
*** 306,311 ****
ComponentView* view = new ComponentView(fccomp);
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = ComponentView_symid;
push_stack(result);
}
--- 302,308 ----
ComponentView* view = new ComponentView(fccomp);
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = FeatureClass_symid;
! result.object_compview(true);
push_stack(result);
}
Index: ProjServ/projhandler.c
diff -c ProjServ/projhandler.c:1.1 ProjServ/projhandler.c:1.2
*** ProjServ/projhandler.c:1.1 Mon Aug 2 13:53:39 1999
--- src/ProjServ/projhandler.c Sat Mar 18 02:24:14 2000
***************
*** 22,27 ****
--- 22,28 ----
*/
#include <MapServ/mapfunc.h>
+ #include <UtmUnidraw/utmfunc.h>
#include <ComTerp/comterpserv.h>
#include <ProjServ/projfunc.h>
#include <ProjServ/projhandler.h>
***************
*** 79,84 ****
--- 80,87 ----
comterp->add_command("load100kdlgfc", new Load100KDLGFCFunc(comterp));
comterp->add_command("vpftileidsbygeo", new VpfTileIdsByGeoFunc(comterp));
comterp->add_command("graticulefc", new GraticuleFCFunc(comterp));
+
+ comterp->add_command("points", new MapPointsFunc(comterp));
}
Index: VhclServ/vhclfunc.c
diff -c VhclServ/vhclfunc.c:1.3 VhclServ/vhclfunc.c:1.4
*** VhclServ/vhclfunc.c:1.3 Mon Feb 28 17:28:03 2000
--- src/VhclServ/vhclfunc.c Sat Mar 18 02:24:17 2000
***************
*** 101,106 ****
--- 101,107 ----
ComValue* result =
new ComValue(ComValue::ObjectType, new ComponentView(vhclcomp));
result->obj_type_ref() = VehicleComp::class_symid();
+ result->object_compview(true);
VhclFunc::vhcltable()->insert(namestr.symbol_val(), result);
push_stack(*result);
VhclViewerFunc func(comterp());
***************
*** 145,150 ****
--- 146,152 ----
ComValue* result =
new ComValue(ComValue::ObjectType, new ComponentView(vhclcomp));
result->obj_type_ref() = VehicleComp::class_symid();
+ result->object_compview(true);
VhclFunc::vhcltable()->insert(namestr.symbol_val(), result);
push_stack(*result);
VhclViewerFunc func(comterp());
***************
*** 194,199 ****
--- 196,202 ----
ComValue* result =
new ComValue(ComValue::ObjectType, new ComponentView(rtecomp));
result->obj_type_ref() = RouteComp::class_symid();
+ result->object_compview(true);
VhclFunc::rtetable()->insert(namestr.symbol_val(), result);
push_stack(*result);
VhclViewerFunc func(comterp());
Index: VhclServ/vhclhandler.c
diff -c VhclServ/vhclhandler.c:1.1 VhclServ/vhclhandler.c:1.2
*** VhclServ/vhclhandler.c:1.1 Mon Aug 2 13:53:49 1999
--- src/VhclServ/vhclhandler.c Sat Mar 18 02:24:17 2000
***************
*** 59,64 ****
--- 59,65 ----
MapservHandler::AddCommands(comterp);
comterp->add_command("load100kdlgfc", new Load100KDLGFCFunc(comterp));
+ comterp->add_command("loadvpffc", new LoadVpfFCFunc(comterp));
comterp->add_command("vhclpoint", new VhclPointFeatureFunc(comterp));
comterp->add_command("vhclconvexhull", new VhclConvexHullFunc(comterp));
comterp->add_command("roamroads", new VhclRoamRoadsFunc(comterp));
Index: VhclServ/vhclmapfunc.c
diff -c VhclServ/vhclmapfunc.c:1.1 VhclServ/vhclmapfunc.c:1.2
*** VhclServ/vhclmapfunc.c:1.1 Mon Aug 2 13:53:49 1999
--- src/VhclServ/vhclmapfunc.c Sat Mar 18 02:24:17 2000
***************
*** 62,67 ****
--- 62,68 ----
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
result.obj_type_ref() = POINT_FEATURE;
+ result.object_compview(true);
vhcl->attach(fcomp);
push_stack(result);
return;
***************
*** 115,120 ****
--- 116,122 ----
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
result.obj_type_ref() = AREA_FEATURE;
+ result.object_compview(true);
vhcl->attach(fcomp);
push_stack(result);
}
*** /dev/null Sat Mar 18 02:24:19 PST 2000
--- patches/vhclmaps-000318-johnston-031
*************** patches/vhclmaps-000318-johnston-031
*** 0 ****
--- 1 ----
+ vhclmaps-000318-johnston-031
|
|
From: <joh...@ie...> - 2000-03-14 19:48:13
|
Patch: vhclmaps-000314-johnston-012
For: vhclmaps-0.7.4
Author: joh...@us...
Subject: MapFiles::valid(), handle more Vpf database anomalies
Requires: ivtools-000314-johnston-031
This is an intermediate patch to vhclmaps-0.7.4. To apply, cd to the
top-level directory of the vhclmaps source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- add a MapFiles::valid() (the base class of the
MapDatabase/MapLibrary/MapCoverage/MapFClass/MapFeature hierarchy)
which is by default true, but any subclass can clear if they have
problem constructing themselves.
- fix segfault that occurs when the pathnames and names for a Vpf
database (library/coverage/feature-class) are not incorrect.
- fix problem with Vpf database that has a negative (or
outrageously large) edge_id in the first row of a face table.
- fix problems with Vpf databases that use "id" for a feature
table, instead of a col name that embeds the feature table name in it.
Index: top_vhclmaps/configure
diff -c top_vhclmaps/configure:1.3 top_vhclmaps/configure:1.4
*** top_vhclmaps/configure:1.3 Thu Feb 17 22:39:14 2000
--- ./configure Tue Mar 14 22:51:49 2000
***************
*** 2022,2028 ****
echo writing \"CPU = `make CPU`\"
echo CPU = `make CPU` >>config/config.mk
echo
! echo "now do a \"make World\""
echo
--- 2022,2028 ----
echo writing \"CPU = `make CPU`\"
echo CPU = `make CPU` >>config/config.mk
echo
! echo "now do a \"make\""
echo
Index: top_vhclmaps/configure.in
diff -c top_vhclmaps/configure.in:1.5 top_vhclmaps/configure.in:1.6
*** top_vhclmaps/configure.in:1.5 Thu Feb 17 22:39:14 2000
--- ./configure.in Tue Mar 14 22:51:50 2000
***************
*** 411,417 ****
echo writing \"CPU = `make CPU`\"
echo CPU = `make CPU` >>config/config.mk
echo
! echo "now do a \"make World\""
echo
--- 411,417 ----
echo writing \"CPU = `make CPU`\"
echo CPU = `make CPU` >>config/config.mk
echo
! echo "now do a \"make\""
echo
Index: Map/mapfiles.c
diff -c Map/mapfiles.c:1.1 Map/mapfiles.c:1.2
*** Map/mapfiles.c:1.1 Mon Aug 2 13:52:40 1999
--- src/Map/mapfiles.c Tue Mar 14 22:51:52 2000
***************
*** 45,50 ****
--- 45,52 ----
} else
_path = nil;
+ /* start with the assumption everythings ok */
+ _valid = true;
}
MapFiles::~MapFiles () {
Index: Map/mapfiles.h
diff -c Map/mapfiles.h:1.1 Map/mapfiles.h:1.2
*** Map/mapfiles.h:1.1 Mon Aug 2 13:52:40 1999
--- src/Map/mapfiles.h Tue Mar 14 22:51:52 2000
***************
*** 43,48 ****
--- 43,50 ----
virtual const char* description() const;
+ boolean valid() { return _valid; }
+
protected:
boolean initialized() const {return false;}
***************
*** 51,56 ****
--- 53,59 ----
protected:
char* _name;
char* _path;
+ boolean _valid;
};
#endif /* defined(mapfiles_h) */
Index: VpfUtil/vpftable.c
diff -c VpfUtil/vpftable.c:1.1 VpfUtil/vpftable.c:1.2
*** VpfUtil/vpftable.c:1.1 Mon Aug 2 13:52:45 1999
--- src/VpfUtil/vpftable.c Tue Mar 14 22:51:54 2000
***************
*** 810,817 ****
#endif
*/
free(table.path);
! fclose(table.fp);
! table.fp = NULL;
return table;
}
--- 810,819 ----
#endif
*/
free(table.path);
! if (table.fp) {
! fclose(table.fp);
! table.fp = NULL;
! }
return table;
}
Index: Vpf/vpfdb.c
diff -c Vpf/vpfdb.c:1.1 Vpf/vpfdb.c:1.2
*** Vpf/vpfdb.c:1.1 Mon Aug 2 13:52:48 1999
--- src/Vpf/vpfdb.c Tue Mar 14 22:51:57 2000
***************
*** 45,52 ****
}
void VpfDatabase::init() {
! producer();
! init_libraries();
}
VpfLibrary* VpfDatabase::library(unsigned libnum) const {
--- 45,54 ----
}
void VpfDatabase::init() {
! if(!producer())
! _valid = false;
! else
! init_libraries();
}
VpfLibrary* VpfDatabase::library(unsigned libnum) const {
***************
*** 66,71 ****
--- 68,74 ----
strcat(dhtpath, "/dht.");
table = vpf_open_table(dhtpath, disk, "rb", NULL);
if (!table.fp) {
+ ((VpfDatabase*)this)->_valid = false;
return nil;
}
else {
Index: Vpf/vpffclass.c
diff -c Vpf/vpffclass.c:1.1 Vpf/vpffclass.c:1.2
*** Vpf/vpffclass.c:1.1 Mon Aug 2 13:52:48 1999
--- src/Vpf/vpffclass.c Tue Mar 14 22:51:57 2000
***************
*** 989,999 ****
face_rec = read_face( face_id, facetable );
ring_rec = read_ring( face_rec.ring, ringtable );
! MapFace* mf = outline_polygon_loop( row, face_id, ring_rec.edge, edgetable, ftype);
! VpfFeature* vf = new VpfFeature((VpfFeatureClass*)this,feat_id,MapFeature::AreaType,
ftype,row);
! vf->face_primitive(mf);
! return vf;
}
/* Inspired by DosVpfviews\'s table_pos */
--- 989,1002 ----
face_rec = read_face( face_id, facetable );
ring_rec = read_ring( face_rec.ring, ringtable );
! if (ring_rec.edge>0) {
! MapFace* mf = outline_polygon_loop( row, face_id, ring_rec.edge, edgetable, ftype);
! VpfFeature* vf = new VpfFeature((VpfFeatureClass*)this,feat_id,MapFeature::AreaType,
ftype,row);
! vf->face_primitive(mf);
! return vf;
! } else
! return nil;
}
/* Inspired by DosVpfviews\'s table_pos */
Index: Vpf/vpftiledfc.c
diff -c Vpf/vpftiledfc.c:1.1 Vpf/vpftiledfc.c:1.2
*** Vpf/vpftiledfc.c:1.1 Mon Aug 2 13:52:48 1999
--- src/Vpf/vpftiledfc.c Tue Mar 14 22:51:57 2000
***************
*** 162,167 ****
--- 162,171 ----
strupr(colname);
strcat(colname, "_ID");
long int colpos = table_pos(colname, table);
+ if (colpos<0) {
+ strcpy(colname, "id");
+ colpos = table_pos(colname, table);
+ }
long int n;
#if 0
row = get_row(1, table);
***************
*** 291,296 ****
--- 295,304 ----
strupr(colname);
strcat(colname, "_ID");
long int face_feat_pos = table_pos(colname, facetable);
+ if (face_feat_pos<0) {
+ strcpy(colname, "id");
+ face_feat_pos = table_pos(colname, facetable);
+ }
ringtable = vpf_open_table(ringpath,disk,"rb",NULL);
if (!ringtable.fp) return;
long ring_id_pos = table_pos("ID", ringtable);
Index: VpfUnidraw/vpfcomps.c
diff -c VpfUnidraw/vpfcomps.c:1.1 VpfUnidraw/vpfcomps.c:1.2
*** VpfUnidraw/vpfcomps.c:1.1 Mon Aug 2 13:53:11 1999
--- src/VpfUnidraw/vpfcomps.c Tue Mar 14 22:52:02 2000
***************
*** 330,356 ****
}
else for (i = 0; i < tfc->nfeats(tileid); i++) {
MapFeature* vf = tfc->feature(tileid,i);
! PJ* pj = ((MapShowCmd*)cmd)->GetProjection();
! if (pj)
! project_feature(pj, vf);
! MapFeatureComp* mfc = new MapFeatureComp(vf);
! ((VpfFeature*)vf)->graphic(mfc);
!
! // create companion point comp for text comp
! if (vf->type() == MapFeature::TextType) {
! MapFeature* pf = new MapFeature
! (vf->feature_class(), -1, MapFeature::PointType);
! MapPoint* pp = new MapPoint(pf);
! float px = vf->text_primitive()->xorigin();
! float py = vf->text_primitive()->yorigin();
! pp->insert_points(1, &px, &py);
! pf->point_primitive(pp);
! MapFeatureComp* pfc = new MapFeatureComp(pf);
! _tcomps[tileid]->Append(pfc);
! mfc->pointcomp(pfc);
}
-
- _tcomps[tileid]->Append(mfc);
}
Append(_tcomps[tileid]);
}
--- 330,359 ----
}
else for (i = 0; i < tfc->nfeats(tileid); i++) {
MapFeature* vf = tfc->feature(tileid,i);
! if (vf) {
!
! PJ* pj = ((MapShowCmd*)cmd)->GetProjection();
! if (pj)
! project_feature(pj, vf);
! MapFeatureComp* mfc = new MapFeatureComp(vf);
! ((VpfFeature*)vf)->graphic(mfc);
!
! // create companion point comp for text comp
! if (vf->type() == MapFeature::TextType) {
! MapFeature* pf = new MapFeature
! (vf->feature_class(), -1, MapFeature::PointType);
! MapPoint* pp = new MapPoint(pf);
! float px = vf->text_primitive()->xorigin();
! float py = vf->text_primitive()->yorigin();
! pp->insert_points(1, &px, &py);
! pf->point_primitive(pp);
! MapFeatureComp* pfc = new MapFeatureComp(pf);
! _tcomps[tileid]->Append(pfc);
! mfc->pointcomp(pfc);
! }
!
! _tcomps[tileid]->Append(mfc);
}
}
Append(_tcomps[tileid]);
}
Index: MapServ/mapfunc.c
diff -c MapServ/mapfunc.c:1.1 MapServ/mapfunc.c:1.2
*** MapServ/mapfunc.c:1.1 Mon Aug 2 13:53:21 1999
--- src/MapServ/mapfunc.c Tue Mar 14 22:52:05 2000
***************
*** 1,4 ****
--- 1,5 ----
/*
+ * Copyright (c) 2000 IET Inc.
* Copyright (c) 1997-1999 Vectaport Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
***************
*** 90,95 ****
--- 91,104 ----
#include <strstream.h>
#include <stdio.h>
+ #include <ComUtil/comutil.h>
+ static int PointFeature_symid = symbol_add("PointFeature");
+ static int NodeFeature_symid = symbol_add("NodeFeature");
+ static int LineFeature_symid = symbol_add("LineFeature");
+ static int AreaFeature_symid = symbol_add("AreaFeature");
+ static int FeatureClass_symid = symbol_add("FeatureClass");
+ static int ComponentView_symid = symbol_add("ComponentView");
+
/*****************************************************************************/
MapFunc::MapFunc(ComTerp* comterp) : ComFunc(comterp) {
***************
*** 226,232 ****
ComponentView* view = new ComponentView(fccomp);
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = FEATURE_CLASS;
push_stack(result);
}
--- 235,241 ----
ComponentView* view = new ComponentView(fccomp);
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = FeatureClass_symid;
push_stack(result);
}
***************
*** 267,273 ****
ComponentView* view = new ComponentView(fccomp);
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = FEATURE_CLASS;
push_stack(result);
}
--- 276,282 ----
ComponentView* view = new ComponentView(fccomp);
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = FeatureClass_symid;
push_stack(result);
}
***************
*** 305,311 ****
ComValue result;
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = POINT_FEATURE;
push_stack(result);
}
--- 314,320 ----
ComValue result;
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = PointFeature_symid;
push_stack(result);
}
***************
*** 342,348 ****
ComValue result;
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = LINE_FEATURE;
push_stack(result);
}
--- 351,357 ----
ComValue result;
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = LineFeature_symid;
push_stack(result);
}
***************
*** 379,385 ****
ComValue result;
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = AREA_FEATURE;
push_stack(result);
}
--- 388,394 ----
ComValue result;
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = AreaFeature_symid;
push_stack(result);
}
***************
*** 410,416 ****
ComValue result;
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = NODE_FEATURE;
push_stack(result);
}
--- 419,425 ----
ComValue result;
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = NodeFeature_symid;
push_stack(result);
}
***************
*** 422,428 ****
void PolygonAreaFunc::execute() {
ComValue mf(stack_arg(0));
reset_stack();
! if (mf.type() == ComValue::ObjectType && mf.obj_type_val() == AREA_FEATURE) {
ComponentView* view = (ComponentView*)mf.obj_val();
MapFeatureComp* fcomp = (MapFeatureComp*)view->GetSubject();
MapFeature* feat = fcomp->feature();
--- 431,437 ----
void PolygonAreaFunc::execute() {
ComValue mf(stack_arg(0));
reset_stack();
! if (mf.type() == ComValue::ObjectType && mf.obj_type_val() == AreaFeature_symid) {
ComponentView* view = (ComponentView*)mf.obj_val();
MapFeatureComp* fcomp = (MapFeatureComp*)view->GetSubject();
MapFeature* feat = fcomp->feature();
***************
*** 449,455 ****
ComValue result;
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = FEATURE_CLASS;
push_stack(result);
}
--- 458,464 ----
ComValue result;
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = FeatureClass_symid;
push_stack(result);
}
***************
*** 476,482 ****
ComValue result;
result.type(AttributeValue::ObjectType);
result.obj_ref() = fcview;
! result.obj_type_ref() = FEATURE_CLASS;
push_stack(result);
}
--- 485,491 ----
ComValue result;
result.type(AttributeValue::ObjectType);
result.obj_ref() = fcview;
! result.obj_type_ref() = FeatureClass_symid;
push_stack(result);
}
***************
*** 490,498 ****
ComValue pt2(stack_arg(1));
reset_stack();
if (pt1.type() == ComValue::ObjectType &&
! pt1.obj_type_val() == POINT_FEATURE &&
pt2.type() == ComValue::ObjectType &&
! pt2.obj_type_val() == POINT_FEATURE) {
ComponentView* view1 = (ComponentView*)pt1.obj_val();
MapFeatureComp* fcomp1 = (MapFeatureComp*)view1->GetSubject();
MapFeature* feat1 = fcomp1->feature();
--- 499,507 ----
ComValue pt2(stack_arg(1));
reset_stack();
if (pt1.type() == ComValue::ObjectType &&
! pt1.obj_type_val() == PointFeature_symid &&
pt2.type() == ComValue::ObjectType &&
! pt2.obj_type_val() == PointFeature_symid) {
ComponentView* view1 = (ComponentView*)pt1.obj_val();
MapFeatureComp* fcomp1 = (MapFeatureComp*)view1->GetSubject();
MapFeature* feat1 = fcomp1->feature();
***************
*** 525,531 ****
ComValue ln(stack_arg(1));
reset_stack();
! if (pt.obj_type_val() == POINT_FEATURE && ln.obj_type_val() == LINE_FEATURE){
ComponentView* ptview = (ComponentView*)pt.obj_val();
ComponentView* lnview = (ComponentView*)ln.obj_val();
MapFeatureComp* ptcomp = (MapFeatureComp*)ptview->GetSubject();
--- 534,540 ----
ComValue ln(stack_arg(1));
reset_stack();
! if (pt.obj_type_val() == PointFeature_symid && ln.obj_type_val() == LineFeature_symid){
ComponentView* ptview = (ComponentView*)pt.obj_val();
ComponentView* lnview = (ComponentView*)ln.obj_val();
MapFeatureComp* ptcomp = (MapFeatureComp*)ptview->GetSubject();
***************
*** 577,583 ****
ComValue result;
result.type(AttributeValue::ObjectType);
result.obj_ref() = rview;
! result.obj_type_ref() = POINT_FEATURE;
push_stack(result);
}
else
--- 586,592 ----
ComValue result;
result.type(AttributeValue::ObjectType);
result.obj_ref() = rview;
! result.obj_type_ref() = PointFeature_symid;
push_stack(result);
}
else
***************
*** 599,628 ****
for (int i = 0; i < nf; i++) {
ComValue val(stack_arg(i));
if (val.type() == ComValue::ObjectType) {
! switch(val.obj_type_val()) {
! case POINT_FEATURE:
ptcount++;
! break;
! case LINE_FEATURE: {
ComponentView* lview = (ComponentView*)val.obj_val();
MapFeatureComp* lcomp = (MapFeatureComp*)lview->GetSubject();
MapFeature* lf = lcomp->feature();
MapEdge* le = lf->edge_primitive();
ptcount += le->topo()->npts();
! }
! break;
! case AREA_FEATURE: {
ComponentView* aview = (ComponentView*)val.obj_val();
MapFeatureComp* acomp = (MapFeatureComp*)aview->GetSubject();
MapFeature* af = acomp->feature();
MapFace* face = af->face_primitive();
ptcount += face->topo()->npts();
! }
! break;
! case NODE_FEATURE:
ptcount++;
! break;
! case FEATURE_CLASS: {
ComponentView* fcview = (ComponentView*)val.obj_val();
MapFClassComp* fccomp = (MapFClassComp*)fcview->GetSubject();
MapFeatureClass* fc = fccomp->GetFeatureClass();
--- 608,630 ----
for (int i = 0; i < nf; i++) {
ComValue val(stack_arg(i));
if (val.type() == ComValue::ObjectType) {
! if (val.is_object(PointFeature_symid)) {
ptcount++;
! } else if (val.is_object(LineFeature_symid)) {
ComponentView* lview = (ComponentView*)val.obj_val();
MapFeatureComp* lcomp = (MapFeatureComp*)lview->GetSubject();
MapFeature* lf = lcomp->feature();
MapEdge* le = lf->edge_primitive();
ptcount += le->topo()->npts();
! } else if (val.is_object(AreaFeature_symid)) {
ComponentView* aview = (ComponentView*)val.obj_val();
MapFeatureComp* acomp = (MapFeatureComp*)aview->GetSubject();
MapFeature* af = acomp->feature();
MapFace* face = af->face_primitive();
ptcount += face->topo()->npts();
! } else if (val.is_object(NodeFeature_symid)) {
ptcount++;
! } else if (val.is_object(FeatureClass_symid)) {
ComponentView* fcview = (ComponentView*)val.obj_val();
MapFClassComp* fccomp = (MapFClassComp*)fcview->GetSubject();
MapFeatureClass* fc = fccomp->GetFeatureClass();
***************
*** 644,651 ****
}
}
}
- break;
- }
}
}
float* fx = new float[ptcount];
--- 646,651 ----
***************
*** 654,661 ****
for (int i = 0; i < nf; i++) {
ComValue val(stack_arg(i));
if (val.type() == ComValue::ObjectType) {
! switch(val.obj_type_val()) {
! case POINT_FEATURE: {
ComponentView* pview = (ComponentView*)val.obj_val();
MapFeatureComp* pcomp = (MapFeatureComp*)pview->GetSubject();
MapFeature* pf = pcomp->feature();
--- 654,660 ----
for (int i = 0; i < nf; i++) {
ComValue val(stack_arg(i));
if (val.type() == ComValue::ObjectType) {
! if(val.is_object(PointFeature_symid)) {
ComponentView* pview = (ComponentView*)val.obj_val();
MapFeatureComp* pcomp = (MapFeatureComp*)pview->GetSubject();
MapFeature* pf = pcomp->feature();
***************
*** 663,671 ****
fx[pti] = pp->topo()->xpoints()[0];
fy[pti] = pp->topo()->ypoints()[0];
pti++;
! }
! break;
! case LINE_FEATURE: {
ComponentView* lview = (ComponentView*)val.obj_val();
MapFeatureComp* lcomp = (MapFeatureComp*)lview->GetSubject();
MapFeature* lf = lcomp->feature();
--- 662,668 ----
fx[pti] = pp->topo()->xpoints()[0];
fy[pti] = pp->topo()->ypoints()[0];
pti++;
! } else if (val.is_object(LineFeature_symid)) {
ComponentView* lview = (ComponentView*)val.obj_val();
MapFeatureComp* lcomp = (MapFeatureComp*)lview->GetSubject();
MapFeature* lf = lcomp->feature();
***************
*** 675,683 ****
fy[pti] = le->topo()->ypoints()[k];
pti++;
}
! }
! break;
! case AREA_FEATURE: {
ComponentView* aview = (ComponentView*)val.obj_val();
MapFeatureComp* acomp = (MapFeatureComp*)aview->GetSubject();
MapFeature* af = acomp->feature();
--- 672,678 ----
fy[pti] = le->topo()->ypoints()[k];
pti++;
}
! } else if (val.is_object(AreaFeature_symid)) {
ComponentView* aview = (ComponentView*)val.obj_val();
MapFeatureComp* acomp = (MapFeatureComp*)aview->GetSubject();
MapFeature* af = acomp->feature();
***************
*** 687,695 ****
fy[pti] = face->topo()->ypoints()[k];
pti++;
}
! }
! break;
! case NODE_FEATURE: {
ComponentView* nview = (ComponentView*)val.obj_val();
MapFeatureComp* ncomp = (MapFeatureComp*)nview->GetSubject();
MapFeature* nf = ncomp->feature();
--- 682,688 ----
fy[pti] = face->topo()->ypoints()[k];
pti++;
}
! } else if (val.is_object(NodeFeature_symid)) {
ComponentView* nview = (ComponentView*)val.obj_val();
MapFeatureComp* ncomp = (MapFeatureComp*)nview->GetSubject();
MapFeature* nf = ncomp->feature();
***************
*** 697,705 ****
fx[pti] = np->topo()->xpoints()[0];
fy[pti] = np->topo()->ypoints()[0];
pti++;
! }
! break;
! case FEATURE_CLASS: {
ComponentView* fcview = (ComponentView*)val.obj_val();
MapFClassComp* fccomp = (MapFClassComp*)fcview->GetSubject();
MapFeatureClass* fc = fccomp->GetFeatureClass();
--- 690,696 ----
fx[pti] = np->topo()->xpoints()[0];
fy[pti] = np->topo()->ypoints()[0];
pti++;
! } else if (val.is_object(FeatureClass_symid)) {
ComponentView* fcview = (ComponentView*)val.obj_val();
MapFClassComp* fccomp = (MapFClassComp*)fcview->GetSubject();
MapFeatureClass* fc = fccomp->GetFeatureClass();
***************
*** 733,740 ****
}
}
}
- break;
- }
}
}
reset_stack();
--- 724,729 ----
***************
*** 754,760 ****
ComponentView* hview = new ComponentView(hcomp);
ComValue result;
result.type(ComValue::ObjectType);
! result.obj_type_ref() = AREA_FEATURE;
result.obj_ref() = hview;
push_stack(result);
}
--- 743,749 ----
ComponentView* hview = new ComponentView(hcomp);
ComValue result;
result.type(ComValue::ObjectType);
! result.obj_type_ref() = AreaFeature_symid;
result.obj_ref() = hview;
push_stack(result);
}
***************
*** 887,895 ****
ComValue mf(stack_arg(1));
reset_stack();
if (mfc.type() == ComValue::ObjectType &&
! mfc.obj_type_val() == FEATURE_CLASS &&
mf.type() == ComValue::ObjectType &&
! mf.obj_type_val() == AREA_FEATURE) {
ComponentView* fcview = (ComponentView*)mfc.obj_val();
MapFClassComp* fccomp = (MapFClassComp*)fcview->GetSubject();
MapFeatureClass* fc = fccomp->GetFeatureClass();
--- 876,884 ----
ComValue mf(stack_arg(1));
reset_stack();
if (mfc.type() == ComValue::ObjectType &&
! mfc.obj_type_val() == FeatureClass_symid &&
mf.type() == ComValue::ObjectType &&
! mf.obj_type_val() == AreaFeature_symid) {
ComponentView* fcview = (ComponentView*)mfc.obj_val();
MapFClassComp* fccomp = (MapFClassComp*)fcview->GetSubject();
MapFeatureClass* fc = fccomp->GetFeatureClass();
***************
*** 1083,1089 ****
ComValue result;
result.type(AttributeValue::ObjectType);
result.obj_ref() = nview;
! result.obj_type_ref() = FEATURE_CLASS;
push_stack(result);
}
--- 1072,1078 ----
ComValue result;
result.type(AttributeValue::ObjectType);
result.obj_ref() = nview;
! result.obj_type_ref() = FeatureClass_symid;
push_stack(result);
}
***************
*** 1304,1310 ****
result.type(AttributeValue::ObjectType);
result.obj_ref() = nview;
! result.obj_type_ref() = FEATURE_CLASS;
push_stack(result);
}
--- 1293,1299 ----
result.type(AttributeValue::ObjectType);
result.obj_ref() = nview;
! result.obj_type_ref() = FeatureClass_symid;
push_stack(result);
}
***************
*** 1482,1488 ****
result.type(AttributeValue::ObjectType);
result.obj_ref() = nfcview;
! result.obj_type_ref() = FEATURE_CLASS;
push_stack(result);
}
--- 1471,1477 ----
result.type(AttributeValue::ObjectType);
result.obj_ref() = nfcview;
! result.obj_type_ref() = FeatureClass_symid;
push_stack(result);
}
***************
*** 1505,1522 ****
ComValue nen(stack_key(_nen_symid));
reset_stack();
! ComponentView* view = (ComponentView*)fcc.obj_val();
! MapFClassComp* comp = (MapFClassComp*)view->GetSubject();
! MapFeatureClass* fc = comp->GetFeatureClass();
! double x1, y1, x2, y2;
! int zone;
! fc->extent(x1, y1, x2, y2, zone);
! if (zone==0) {
! char lon0[80];
! sprintf(lon0, "lon_0=%f", x1); // let proj pick the utm zone
! char* parms[4];
! parms[0] = "proj=utm";
! parms[1] = "ellps=WGS84";
parms[2] = lon0;
parms[3] = "no_defs";
PJ* proj = pj_init(4, parms);
--- 1494,1512 ----
ComValue nen(stack_key(_nen_symid));
reset_stack();
! ComponentView* view = (ComponentView*)fcc.geta(ComponentView_symid);
! MapFClassComp* comp = view ? (MapFClassComp*)view->GetSubject() : nil;
! MapFeatureClass* fc = comp ? comp->GetFeatureClass() : nil;
! if (fc) {
! double x1, y1, x2, y2;
! int zone;
! fc->extent(x1, y1, x2, y2, zone);
! if (zone==0) {
! char lon0[80];
! sprintf(lon0, "lon_0=%f", x1); // let proj pick the utm zone
! char* parms[4];
! parms[0] = "proj=utm";
! parms[1] = "ellps=WGS84";
parms[2] = lon0;
parms[3] = "no_defs";
PJ* proj = pj_init(4, parms);
***************
*** 1531,1558 ****
data = pj_fwd(data, proj);
x2 = data.u;
y2 = data.v;
! }
#if 0
! cout << "(" << Math::round(x1) << ", " << Math::round(y1)
! << ", " << Math::round(x2) << ", " << Math::round(y2) << ")\n";
#endif
! int nflags = swn.is_true() + swe.is_true() + nen.is_true() + nee.is_true();
! if (nflags==0 || nflags>1) {
! AttributeValueList* al = new AttributeValueList();
! if (swe.is_true() || !nflags) al->Append(new AttributeValue(x1));
! if (swn.is_true() || !nflags) al->Append(new AttributeValue(y1));
! if (nee.is_true() || !nflags) al->Append(new AttributeValue(x2));
! if (nen.is_true() || !nflags) al->Append(new AttributeValue(y2));
! ComValue retval(al);
! push_stack(retval);
! } else {
! double result;
! if (swe.is_true()) result = x1;
! if (swn.is_true()) result = y1;
! if (nee.is_true()) result = x2;
! if (nen.is_true()) result = y2;
! ComValue retval(result);
! push_stack(retval);
}
}
--- 1521,1549 ----
data = pj_fwd(data, proj);
x2 = data.u;
y2 = data.v;
! }
#if 0
! cout << "(" << Math::round(x1) << ", " << Math::round(y1)
! << ", " << Math::round(x2) << ", " << Math::round(y2) << ")\n";
#endif
! int nflags = swn.is_true() + swe.is_true() + nen.is_true() + nee.is_true();
! if (nflags==0 || nflags>1) {
! AttributeValueList* al = new AttributeValueList();
! if (swe.is_true() || !nflags) al->Append(new AttributeValue(x1));
! if (swn.is_true() || !nflags) al->Append(new AttributeValue(y1));
! if (nee.is_true() || !nflags) al->Append(new AttributeValue(x2));
! if (nen.is_true() || !nflags) al->Append(new AttributeValue(y2));
! ComValue retval(al);
! push_stack(retval);
! } else {
! double result;
! if (swe.is_true()) result = x1;
! if (swn.is_true()) result = y1;
! if (nee.is_true()) result = x2;
! if (nen.is_true()) result = y2;
! ComValue retval(result);
! push_stack(retval);
! }
}
}
***************
*** 1602,1608 ****
result.type(AttributeValue::ObjectType);
result.obj_ref() = nview;
! result.obj_type_ref() = FEATURE_CLASS;
push_stack(result);
delete attrterp;
--- 1593,1599 ----
result.type(AttributeValue::ObjectType);
result.obj_ref() = nview;
! result.obj_type_ref() = FeatureClass_symid;
push_stack(result);
delete attrterp;
***************
*** 1701,1707 ****
result.type(AttributeValue::ObjectType);
result.obj_ref() = nview;
! result.obj_type_ref() = FEATURE_CLASS;
push_stack(result);
delete attrterp;
--- 1692,1698 ----
result.type(AttributeValue::ObjectType);
result.obj_ref() = nview;
! result.obj_type_ref() = FeatureClass_symid;
push_stack(result);
delete attrterp;
***************
*** 2304,2310 ****
if (comp && comp->IsA(MAPFCLASS_COMP)) {
ComponentView* view = new ComponentView(comp);
ComValue result(ComValue::ObjectType, (void*)view);
! result.obj_type_ref() = FEATURE_CLASS;
push_stack(result);
} else {
if (comp) delete comp;
--- 2295,2301 ----
if (comp && comp->IsA(MAPFCLASS_COMP)) {
ComponentView* view = new ComponentView(comp);
ComValue result(ComValue::ObjectType, (void*)view);
! result.obj_type_ref() = FeatureClass_symid;
push_stack(result);
} else {
if (comp) delete comp;
***************
*** 2321,2327 ****
ComValue fclass(stack_arg(0));
reset_stack();
if (fclass.type() == ComValue::ObjectType &&
! fclass.obj_type_val() == FEATURE_CLASS) {
ComponentView* view = (ComponentView*)fclass.obj_val();
MapFClassComp* comp = (MapFClassComp*)view->GetSubject();
MapFeatureClass* fc = comp->GetFeatureClass();
--- 2312,2318 ----
ComValue fclass(stack_arg(0));
reset_stack();
if (fclass.type() == ComValue::ObjectType &&
! fclass.obj_type_val() == FeatureClass_symid) {
ComponentView* view = (ComponentView*)fclass.obj_val();
MapFClassComp* comp = (MapFClassComp*)view->GetSubject();
MapFeatureClass* fc = comp->GetFeatureClass();
***************
*** 2342,2348 ****
ComValue fn(stack_arg(1));
reset_stack();
if (fclass.type() == ComValue::ObjectType &&
! fclass.obj_type_val() == FEATURE_CLASS &&
fn.type() == ComValue::IntType) {
ComponentView* view = (ComponentView*)fclass.obj_val();
MapFClassComp* comp = (MapFClassComp*)view->GetSubject();
--- 2333,2339 ----
ComValue fn(stack_arg(1));
reset_stack();
if (fclass.type() == ComValue::ObjectType &&
! fclass.obj_type_val() == FeatureClass_symid &&
fn.type() == ComValue::IntType) {
ComponentView* view = (ComponentView*)fclass.obj_val();
MapFClassComp* comp = (MapFClassComp*)view->GetSubject();
***************
*** 2356,2374 ****
result.type(ComValue::ObjectType);
switch(feature->type()) {
case MapFeature::PointType:
! result.obj_type_ref() = POINT_FEATURE;
newf = copy_point(feature, (MapFeatureComp*)feature->graphic());
break;
case MapFeature::LineType:
! result.obj_type_ref() = LINE_FEATURE;
newf = copy_line(feature, (MapFeatureComp*)feature->graphic());
break;
case MapFeature::AreaType:
! result.obj_type_ref() = AREA_FEATURE;
newf = copy_area(feature, (MapFeatureComp*)feature->graphic());
break;
case MapFeature::JunctionType:
! result.obj_type_ref() = NODE_FEATURE;
newf = copy_junction(feature, (MapFeatureComp*)feature->graphic());
break;
}
--- 2347,2365 ----
result.type(ComValue::ObjectType);
switch(feature->type()) {
case MapFeature::PointType:
! result.obj_type_ref() = PointFeature_symid;
newf = copy_point(feature, (MapFeatureComp*)feature->graphic());
break;
case MapFeature::LineType:
! result.obj_type_ref() = LineFeature_symid;
newf = copy_line(feature, (MapFeatureComp*)feature->graphic());
break;
case MapFeature::AreaType:
! result.obj_type_ref() = AreaFeature_symid;
newf = copy_area(feature, (MapFeatureComp*)feature->graphic());
break;
case MapFeature::JunctionType:
! result.obj_type_ref() = NodeFeature_symid;
newf = copy_junction(feature, (MapFeatureComp*)feature->graphic());
break;
}
Index: LosServ/losfunc.c
diff -c LosServ/losfunc.c:1.3 LosServ/losfunc.c:1.4
*** LosServ/losfunc.c:1.3 Tue Jan 25 03:22:07 2000
--- src/LosServ/losfunc.c Tue Mar 14 22:52:11 2000
***************
*** 74,79 ****
--- 74,82 ----
//int round(double x) { return x > 0 ? int(x+0.5) : -int(-x+0.5); }
UsgsDem* dem;
+ #include <ComUtil/comutil.h>
+ static int FeatureClass_symid = symbol_add("FeatureClass");
+
/*****************************************************************************/
DemLosFunc::DemLosFunc(ComTerp* comterp) : ComFunc(comterp) {
***************
*** 226,232 ****
ComValue result;
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = FEATURE_CLASS;
push_stack(result);
}
else {
--- 229,235 ----
ComValue result;
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = FeatureClass_symid;
push_stack(result);
}
else {
***************
*** 424,430 ****
ComValue result;
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = FEATURE_CLASS;
push_stack(result);
}
}
--- 427,433 ----
ComValue result;
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = FeatureClass_symid;
push_stack(result);
}
}
***************
*** 670,676 ****
ComValue result;
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = FEATURE_CLASS;
push_stack(result);
}
}
--- 673,679 ----
ComValue result;
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = FeatureClass_symid;
push_stack(result);
}
}
Index: ProjServ/projfunc.c
diff -c ProjServ/projfunc.c:1.1 ProjServ/projfunc.c:1.2
*** ProjServ/projfunc.c:1.1 Mon Aug 2 13:53:39 1999
--- src/ProjServ/projfunc.c Tue Mar 14 22:52:13 2000
***************
*** 63,68 ****
--- 63,71 ----
#include <strstream.h>
#include <stdio.h>
+ #include <ComUtil/comutil.h>
+ static int ComponentView_symid = symbol_add("ComponentView");
+
LoadVpfFCFunc::LoadVpfFCFunc(ComTerp* comterp) : ComFunc(comterp) {
_tileid_symid = symbol_add("tileid");
}
***************
*** 82,122 ****
Creator::instance(new VpfCreator());
const char* dbdir = dbpath.string_ptr();
VpfDatabase* db = new VpfDatabase(dbdir);
! VpfLibrary* lib = db->library(libname.string_ptr());
! VpfDbComp* dbcomp = new VpfDbComp(db);
! MapShowCmd* showcmd = new MapShowCmd();
! showcmd->SetUseEditor(false);
! showcmd->SetLibName(libname.string_ptr());
! showcmd->SetCovName(covname.string_ptr());
! showcmd->SetFClassName(fcname.string_ptr());
! VpfExtent* ext = lib->extent();
! if (utmflag.is_true()) {
! char lon0[80];
! sprintf(lon0, "lon_0=%f", ext->x1); // let proj pick the utm zone
! char* parms[4];
! parms[0] = "proj=utm";
! parms[1] = "ellps=WGS84";
! parms[2] = lon0;
! parms[3] = "no_defs";
! PJ* proj = pj_init(4, parms);
! showcmd->SetProjection(proj);
}
! if (tileid.type() != ComValue::UnknownType) {
! int tid = tileid.int_val();
! showcmd->SetTileId(tid);
}
- dbcomp->Interpret(showcmd);
-
- VpfLibComp* libcomp = (VpfLibComp*)dbcomp->FindLibComp(lib);
- VpfCoverage* cov = lib->coverage(covname.string_ptr());
- VpfCovComp* covcomp = (VpfCovComp*)libcomp->FindCovComp(cov);
- VpfFeatureClass* fclass = cov->feature_class(fcname.string_ptr());
- VpfFClassComp* fccomp = (VpfFClassComp*)covcomp->FindFClassComp(fclass);
- ComponentView* view = new ComponentView(fccomp);
- result.type(AttributeValue::ObjectType);
- result.obj_ref() = view;
- result.obj_type_ref() = FEATURE_CLASS;
- push_stack(result);
}
VpfTileIdsByGeoFunc::VpfTileIdsByGeoFunc(ComTerp* comterp) : ComFunc(comterp) {
--- 85,144 ----
Creator::instance(new VpfCreator());
const char* dbdir = dbpath.string_ptr();
VpfDatabase* db = new VpfDatabase(dbdir);
! VpfLibrary* lib = db->valid() ? db->library(libname.string_ptr()) : nil;
! VpfDbComp* dbcomp = db->valid() ? new VpfDbComp(db) : nil;
! if (dbcomp) {
! MapShowCmd* showcmd = new MapShowCmd();
! showcmd->SetUseEditor(false);
! showcmd->SetLibName(libname.string_ptr());
! showcmd->SetCovName(covname.string_ptr());
! showcmd->SetFClassName(fcname.string_ptr());
! VpfExtent* ext = lib->extent();
! if (utmflag.is_true()) {
! char lon0[80];
! sprintf(lon0, "lon_0=%f", ext->x1); // let proj pick the utm zone
! char* parms[4];
! parms[0] = "proj=utm";
! parms[1] = "ellps=WGS84";
! parms[2] = lon0;
! parms[3] = "no_defs";
! PJ* proj = pj_init(4, parms);
! showcmd->SetProjection(proj);
! }
! if (tileid.type() != ComValue::UnknownType) {
! int tid = tileid.int_val();
! showcmd->SetTileId(tid);
! }
! dbcomp->Interpret(showcmd);
!
! VpfLibComp* libcomp = (VpfLibComp*)dbcomp->FindLibComp(lib);
! VpfCoverage* cov = lib->coverage(covname.string_ptr());
! VpfCovComp* covcomp = (VpfCovComp*)libcomp->FindCovComp(cov);
! VpfFeatureClass* fclass = cov->feature_class(fcname.string_ptr());
! VpfFClassComp* fccomp = (VpfFClassComp*)covcomp->FindFClassComp(fclass);
! ComponentView* view = fccomp ? new ComponentView(fccomp) : nil;
! if (view) {
! result.type(AttributeValue::ObjectType);
! result.obj_ref() = view;
! result.obj_type_ref() = ComponentView_symid;
! push_stack(result);
! } else {
! cerr << "database open failed\n";
! delete db;
! delete lib;
! delete libcomp;
! delete cov;
! delete covcomp;
! delete fclass;
! delete fccomp;
! push_stack(ComValue::nullval());
! }
}
! else {
! cerr << "database open failed\n";
! delete db;
! push_stack(ComValue::nullval());
}
}
VpfTileIdsByGeoFunc::VpfTileIdsByGeoFunc(ComTerp* comterp) : ComFunc(comterp) {
***************
*** 194,200 ****
ComponentView* view = new ComponentView(fccomp);
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = FEATURE_CLASS;
push_stack(result);
}
--- 216,222 ----
ComponentView* view = new ComponentView(fccomp);
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = ComponentView_symid;
push_stack(result);
}
***************
*** 284,289 ****
ComponentView* view = new ComponentView(fccomp);
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = FEATURE_CLASS;
push_stack(result);
}
--- 306,311 ----
ComponentView* view = new ComponentView(fccomp);
result.type(AttributeValue::ObjectType);
result.obj_ref() = view;
! result.obj_type_ref() = ComponentView_symid;
push_stack(result);
}
*** /dev/null Tue Mar 14 22:52:21 PST 2000
--- patches/vhclmaps-000314-johnston-012
*************** patches/vhclmaps-000314-johnston-012
*** 0 ****
--- 1 ----
+ vhclmaps-000314-johnston-012
|
|
From: <joh...@ie...> - 2000-02-29 01:50:33
|
Patch: vhclmaps-000228-johnston-011
For: vhclmaps-0.7.4
Author: joh...@us...
This is an intermediate patch to vhclmaps-0.7.4. To apply, cd to the
top-level directory of the vhclmaps source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- more specific "points" command to return points from map feature
components in the viewer as well.
- simulation time view added to frame state bar in the vhclviewer user
interface.
Index: top_vhclmaps/MANIFEST
diff -c top_vhclmaps/MANIFEST:1.2 top_vhclmaps/MANIFEST:1.3
*** top_vhclmaps/MANIFEST:1.2 Tue Jan 25 03:21:40 2000
--- ./MANIFEST Mon Feb 28 17:27:48 2000
***************
*** 47,52 ****
--- 47,53 ----
vhclmaps-0.7/config/alpha4-gcc.mk
vhclmaps-0.7/config/arch.def
vhclmaps-0.7/config/config.defs.in
+ vhclmaps-0.7/config/config.mk
vhclmaps-0.7/config/config.null.mk
vhclmaps-0.7/config/default-gcc.mk
vhclmaps-0.7/config/freebsd2.1-gcc.mk
***************
*** 383,388 ****
--- 384,391 ----
vhclmaps-0.7/src/VhclUnidraw/vhclkit.h
vhclmaps-0.7/src/VhclUnidraw/vhclmapcreator.c
vhclmaps-0.7/src/VhclUnidraw/vhclmapcreator.h
+ vhclmaps-0.7/src/VhclUnidraw/vhclstates.c
+ vhclmaps-0.7/src/VhclUnidraw/vhclstates.h
vhclmaps-0.7/src/Vpf/Imakefile
vhclmaps-0.7/src/Vpf/Makefile
vhclmaps-0.7/src/Vpf/vpf.c
Index: MapUnidraw/maproute.c
diff -c MapUnidraw/maproute.c:1.1 MapUnidraw/maproute.c:1.2
*** MapUnidraw/maproute.c:1.1 Mon Aug 2 13:53:07 1999
--- src/MapUnidraw/maproute.c Mon Feb 28 17:27:53 2000
***************
*** 332,338 ****
delete [] utmy;
MapElement* route = new MapElement(0, MapFeature::LineType,
n, ex, ey);
! cmd = new PasteCmd(ed, new Clipboard(new MapRouteComp(route)));
}
delete x;
delete y;
--- 332,339 ----
delete [] utmy;
MapElement* route = new MapElement(0, MapFeature::LineType,
n, ex, ey);
! MapRouteComp* mapcomp = new MapRouteComp(route);
! cmd = new PasteCmd(ed, new Clipboard(mapcomp));
}
delete x;
delete y;
***************
*** 362,369 ****
MapElement* route =
new MapElement(0, MapFeature::LineType,
edge->npts(), xpts, ypts);
! PasteCmd* cmd = new PasteCmd(v->GetEditor(),
! new Clipboard(new MapRouteComp(route)));
cmd->Execute();
}
}
--- 363,370 ----
MapElement* route =
new MapElement(0, MapFeature::LineType,
edge->npts(), xpts, ypts);
! MapRouteComp* mapcomp = new MapRouteComp(route);
! PasteCmd* cmd = new PasteCmd(v->GetEditor(), new Clipboard(mapcomp));
cmd->Execute();
}
}
Index: UtmUnidraw/utmeditor.c
diff -c UtmUnidraw/utmeditor.c:1.1 UtmUnidraw/utmeditor.c:1.2
*** UtmUnidraw/utmeditor.c:1.1 Mon Aug 2 13:53:25 1999
--- src/UtmUnidraw/utmeditor.c Mon Feb 28 17:27:58 2000
***************
*** 132,137 ****
--- 132,140 ----
MapservHandler::AddCommands(comterp);
ComEditor::AddCommands(comterp);
+
+ // override more generic "points" func.
+ comterp->add_command("points", new MapPointsFunc(comterp, this));
}
Index: UtmUnidraw/utmfunc.c
diff -c UtmUnidraw/utmfunc.c:1.1 UtmUnidraw/utmfunc.c:1.2
*** UtmUnidraw/utmfunc.c:1.1 Mon Aug 2 13:53:25 1999
--- src/UtmUnidraw/utmfunc.c Mon Feb 28 17:27:58 2000
***************
*** 1,4 ****
--- 1,5 ----
/*
+ * Copyright (c) 2000 IET Inc.
* Copyright (c) 1997 Vectaport Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
***************
*** 21,33 ****
*
*/
- #include <MapUnidraw/mapcomps.h>
#include <UtmUnidraw/utmfunc.h>
#include <MapUnidraw/mapeditor.h>
#include <MapUnidraw/maproute.h>
#include <MapUnidraw/mapviewer.h>
#include <MapUnidraw/mapviewstate.h>
#include <Map/mapelt.h>
#include <OverlayUnidraw/ovcomps.h>
#include <OverlayUnidraw/ovselection.h>
#include <OverlayUnidraw/ovviewer.h>
--- 22,36 ----
*
*/
#include <UtmUnidraw/utmfunc.h>
+ #include <MapUnidraw/mapclasses.h>
+ #include <MapUnidraw/mapcomps.h>
#include <MapUnidraw/mapeditor.h>
#include <MapUnidraw/maproute.h>
#include <MapUnidraw/mapviewer.h>
#include <MapUnidraw/mapviewstate.h>
#include <Map/mapelt.h>
+ #include <ComUnidraw/grstatfunc.h>
#include <OverlayUnidraw/ovcomps.h>
#include <OverlayUnidraw/ovselection.h>
#include <OverlayUnidraw/ovviewer.h>
***************
*** 342,346 ****
--- 345,391 ----
ComValue screencoordv(screencoord);
push_stack(screencoordv);
+ }
+
+ /*****************************************************************************/
+
+ MapPointsFunc::MapPointsFunc(ComTerp* comterp, Editor* ed) : UtmFunc(comterp, ed) {
+ }
+
+ void MapPointsFunc::execute() {
+ Viewer* viewer = _ed->GetViewer();
+ ComValue& obj = stack_arg(0);
+
+ if (obj.obj_type_val() != _compview_id) {
+ reset_stack();
+ return;
+ } else {
+ ComponentView* compview = (ComponentView*)obj.obj_val();
+ if (compview && compview->GetSubject()) {
+ GraphicComp* comp = (GraphicComp*)compview->GetSubject();
+ Graphic* gr = comp ? comp->GetGraphic() : nil;
+ AttributeValueList* avl = new AttributeValueList();
+ if (gr && comp->IsA(MAP_ROUTE_COMP)) {
+ MapRouteComp* rtecomp = (MapRouteComp*)comp;
+ double *x, *y;
+ int n;
+ ((MapElement*)rtecomp->feature())->points(x, y, n);
+ for(int i=0; i<n; i++) {
+ ComValue* val = new ComValue(x[i]);
+ avl->Append(val);
+ val = new ComValue(y[i]);
+ avl->Append(val);
+ }
+ reset_stack();
+ ComValue retval(avl);
+ push_stack(retval);
+
+ } else {
+ PointsFunc func(comterp(), editor());
+ func.execute();
+ }
+
+ }
+ }
}
Index: UtmUnidraw/utmfunc.h
diff -c UtmUnidraw/utmfunc.h:1.1 UtmUnidraw/utmfunc.h:1.2
*** UtmUnidraw/utmfunc.h:1.1 Mon Aug 2 13:53:25 1999
--- src/UtmUnidraw/utmfunc.h Mon Feb 28 17:27:58 2000
***************
*** 93,96 ****
--- 93,105 ----
};
+ class MapPointsFunc : public UtmFunc {
+ public:
+ MapPointsFunc(ComTerp*, Editor* ed);
+ virtual void execute();
+ virtual const char* docstring() {
+ return "ptlist=%s(compview) -- return point list from map feature component"; }
+
+ };
+
#endif
Index: VhclServ/vhclfunc.c
diff -c VhclServ/vhclfunc.c:1.2 VhclServ/vhclfunc.c:1.3
*** VhclServ/vhclfunc.c:1.2 Tue Jan 25 03:35:33 2000
--- src/VhclServ/vhclfunc.c Mon Feb 28 17:28:03 2000
***************
*** 646,653 ****
newtime += simtime.ulong_val();
_simtime->time(newtime);
}
! }
if (!quiet) {
filebuf fbuf;
int fd = comterp()->handler() ? comterp()->handler()->get_handle() : 1;
--- 646,654 ----
newtime += simtime.ulong_val();
_simtime->time(newtime);
}
! }
+ #if 0
if (!quiet) {
filebuf fbuf;
int fd = comterp()->handler() ? comterp()->handler()->get_handle() : 1;
***************
*** 656,661 ****
--- 657,667 ----
out << "simtime: " << _simtime->time()->seconds() << "\n";
out.flush();
}
+ #endif
+
+ ComValue retval(_simtime->time()->seconds());
+ push_stack(retval);
+
return;
}
Index: VhclUnidraw/Imakefile
diff -c VhclUnidraw/Imakefile:1.2 VhclUnidraw/Imakefile:1.3
*** VhclUnidraw/Imakefile:1.2 Tue Jan 25 03:22:17 2000
--- src/VhclUnidraw/Imakefile Mon Feb 28 17:28:05 2000
***************
*** 24,29 ****
--- 24,30 ----
Obj31(vhclabout)
Obj31(vhclkit)
+ Obj31(vhclstates)
#define Obj_ACE(file) MakeObjectFromSrcFlags(file, -D__ACE_INLINE__ -Uiv2_6_compatible -I$(IVTOOLSSRC)/include $(TOP_CCINCLUDES))
Index: VhclUnidraw/vhcleditor.h
diff -c VhclUnidraw/vhcleditor.h:1.1 VhclUnidraw/vhcleditor.h:1.2
*** VhclUnidraw/vhcleditor.h:1.1 Mon Aug 2 13:53:53 1999
--- src/VhclUnidraw/vhcleditor.h Mon Feb 28 17:28:05 2000
***************
*** 26,32 ****
#include <UtmUnidraw/utmeditor.h>
#include <VhclUnidraw/vhclkit.h>
! class FrameNumberState;
class VhclEditor : public UtmEditor {
public:
--- 26,32 ----
#include <UtmUnidraw/utmeditor.h>
#include <VhclUnidraw/vhclkit.h>
! class FrameTimeState;
class VhclEditor : public UtmEditor {
public:
***************
*** 36,45 ****
void Init(OverlayComp* = nil, const char* = "VhclEditor");
virtual void AddCommands(ComTerp*);
! FrameNumberState*& simtimestate() { return _simtimestate; }
protected:
! FrameNumberState* _simtimestate;
friend class VhclKit;
};
--- 36,45 ----
void Init(OverlayComp* = nil, const char* = "VhclEditor");
virtual void AddCommands(ComTerp*);
! FrameTimeState*& simtimestate() { return _simtimestate; }
protected:
! FrameTimeState* _simtimestate;
friend class VhclKit;
};
Index: VhclUnidraw/vhclkit.c
diff -c VhclUnidraw/vhclkit.c:1.2 VhclUnidraw/vhclkit.c:1.3
*** VhclUnidraw/vhclkit.c:1.2 Sat Feb 26 03:30:53 2000
--- src/VhclUnidraw/vhclkit.c Mon Feb 28 17:28:05 2000
***************
*** 1,4 ****
--- 1,5 ----
/*
+ * Copyright 2000 IET Inc.
* Copyright 1998 Vectaport Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and its
***************
*** 23,28 ****
--- 24,31 ----
#include <VhclUnidraw/vhclabout.h>
#include <VhclUnidraw/vhcleditor.h>
#include <VhclUnidraw/vhclkit.h>
+ #include <VhclUnidraw/vhclstates.h>
+ #include <VhclServ/vhclfunc.h>
#include <UtmUnidraw/utmcmds.h>
#include <MapUnidraw/mapcomps.h>
#include <MapUnidraw/mapexport.h>
***************
*** 30,48 ****
#include <FrameUnidraw/framecmds.h>
#include <FrameUnidraw/frameeditor.h>
#include <FrameUnidraw/framekit.h>
- #include <FrameUnidraw/framestates.h>
#include <OverlayUnidraw/ovcmds.h>
#include <OverlayUnidraw/ovcmds.h>
#include <OverlayUnidraw/ovprint.h>
#include <UniIdraw/idkybd.h>
#include <Unidraw/kybd.h>
#include <Unidraw/ctrlinfo.h>
#include <IVGlyph/exportchooser.h>
#include <IVGlyph/importchooser.h>
#include <IV-look/kit.h>
#include <InterViews/layout.h>
#include <InterViews/session.h>
#include <InterViews/style.h>
VhclKit* VhclKit::_vhclkit = nil;
--- 33,52 ----
#include <FrameUnidraw/framecmds.h>
#include <FrameUnidraw/frameeditor.h>
#include <FrameUnidraw/framekit.h>
#include <OverlayUnidraw/ovcmds.h>
#include <OverlayUnidraw/ovcmds.h>
#include <OverlayUnidraw/ovprint.h>
#include <UniIdraw/idkybd.h>
#include <Unidraw/kybd.h>
#include <Unidraw/ctrlinfo.h>
+ #include <Time/obstime.h>
#include <IVGlyph/exportchooser.h>
#include <IVGlyph/importchooser.h>
#include <IV-look/kit.h>
#include <InterViews/layout.h>
#include <InterViews/session.h>
#include <InterViews/style.h>
+ #include <InterViews/observe.h>
VhclKit* VhclKit::_vhclkit = nil;
***************
*** 169,175 ****
Glyph* VhclKit::MakeStates() {
((FrameEditor*)_ed)->framenumstate() = new FrameNumberState();
((FrameEditor*)_ed)->frameliststate() = new FrameListState();
! ((VhclEditor*)_ed)->simtimestate() = new FrameNumberState(0, "Simulation Time");
NameView* fnumview = new NameView(((FrameEditor*)_ed)->framenumstate());
NameView* flistview = new NameView(((FrameEditor*)_ed)->frameliststate());
NameView* simtimeview = new NameView(((VhclEditor*)_ed)->simtimestate());
--- 173,182 ----
Glyph* VhclKit::MakeStates() {
((FrameEditor*)_ed)->framenumstate() = new FrameNumberState();
((FrameEditor*)_ed)->frameliststate() = new FrameListState();
! ((VhclEditor*)_ed)->simtimestate() = new FrameTimeState(0, "Simulation Time");
! ((VhclEditor*)_ed)->simtimestate()->set_bgstr("0");
! VhclSimTimeFunc::simtime()->attach(((VhclEditor*)_ed)->simtimestate());
!
NameView* fnumview = new NameView(((FrameEditor*)_ed)->framenumstate());
NameView* flistview = new NameView(((FrameEditor*)_ed)->frameliststate());
NameView* simtimeview = new NameView(((VhclEditor*)_ed)->simtimestate());
***************
*** 178,184 ****
--- 185,195 ----
WidgetKit& kit = *WidgetKit::instance();
return kit.inset_frame(
lk.margin(
+ #if 0
lk.hbox(fnumview, lk.hspace(40), flistview, lk.hglue()),
+ #else
+ lk.hbox(simtimeview, lk.hspace(40), fnumview, lk.hspace(40), flistview, lk.hglue()),
+ #endif
4, 2
)
);
Index: VhclUnidraw/vhclstates.c
diff -c /dev/null VhclUnidraw/vhclstates.c:1.1
*** /dev/null Mon Feb 28 17:28:06 2000
--- src/VhclUnidraw/vhclstates.c Mon Feb 28 17:28:05 2000
***************
*** 0 ****
--- 1,43 ----
+ /*
+ * Copyright (c) 2000 IET Inc.
+ * Copyright (c) 1994, 1995 Vectaport Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the names of the copyright holders not be used in
+ * advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. The copyright holders make
+ * no representations about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL,
+ * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+ #include <VhclUnidraw/vhclstates.h>
+ #include <Time/obstime.h>
+ #include <stdio.h>
+ #include <string.h>
+
+ /*****************************************************************************/
+
+ FrameTimeState::FrameTimeState(int fn, const char* desc, int usebg)
+ :FrameNumberState(fn, desc, usebg)
+ {
+ }
+
+ void FrameTimeState::update(Observable* observable) {
+ ObservableTime* otime = (ObservableTime*)observable;
+ framenumber(otime->time()->seconds());
+ }
+
+
+
Index: VhclUnidraw/vhclstates.h
diff -c /dev/null VhclUnidraw/vhclstates.h:1.1
*** /dev/null Mon Feb 28 17:28:06 2000
--- src/VhclUnidraw/vhclstates.h Mon Feb 28 17:28:05 2000
***************
*** 0 ****
--- 1,39 ----
+ /*
+ * Copyright (c) 2000 IET Inc.
+ * Copyright (c) 1994, 1995, 1999 Vectaport Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the names of the copyright holders not be used in
+ * advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. The copyright holders make
+ * no representations about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL,
+ * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+ #ifndef vhclstates_h
+ #define vhclstates_h
+
+ #include <FrameUnidraw/framestates.h>
+ #include <InterViews/observe.h>
+
+ //: state variable for current-frame-number.
+ class FrameTimeState : public FrameNumberState, public Observer {
+ public:
+ FrameTimeState(int =0, const char* desc=nil, int usebg =1);
+
+ virtual void update(Observable*);
+ // assumes update is coming from an ObservableTime.
+ };
+ #endif
*** /dev/null Mon Feb 28 17:28:10 PST 2000
--- patches/vhclmaps-000228-johnston-011
*************** patches/vhclmaps-000228-johnston-011
*** 0 ****
--- 1 ----
+ vhclmaps-000228-johnston-011
|
|
From: <joh...@ie...> - 2000-02-25 23:32:32
|
Patch: vhclmaps-000226-johnston-010
For: vhclmaps-0.7.4
Author: joh...@us...
This is an intermediate patch to vhclmaps-0.7.4. To apply, cd to the
top-level directory of the vhclmaps source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- change parent of MapKit from OverlayKit to FrameKit.
- enable the AreaFeature tool in utmviewer, but beware, it has a bug.
- setup a command interpreter in the texteditor at the bottom of the
vhclviewer screen.
Index: MapUnidraw/mapeditor.c
diff -c MapUnidraw/mapeditor.c:1.1 MapUnidraw/mapeditor.c:1.2
*** MapUnidraw/mapeditor.c:1.1 Mon Aug 2 13:53:06 1999
--- src/MapUnidraw/mapeditor.c Sat Feb 26 03:30:44 2000
***************
*** 115,120 ****
--- 115,122 ----
_texteditor = nil;
if (!comp) comp = new MapIdrawComp((const char*) nil, nil);
_terp = new ComTerpServ();
+ _terp->add_defaults();
+ AddCommands(_terp);
add_comterp("MapEditor", _terp);
_overlay_kit->Init(comp, name);
InitFrame();
Index: MapUnidraw/mapkit.c
diff -c MapUnidraw/mapkit.c:1.2 MapUnidraw/mapkit.c:1.3
*** MapUnidraw/mapkit.c:1.2 Thu Feb 10 04:32:30 2000
--- src/MapUnidraw/mapkit.c Sat Feb 26 03:30:44 2000
***************
*** 189,195 ****
MapKit* MapKit::_mapkit = nil;
MapKit::MapKit ()
! :OverlayKit()
{
_projnameview = nil;
}
--- 189,195 ----
MapKit* MapKit::_mapkit = nil;
MapKit::MapKit ()
! :FrameKit()
{
_projnameview = nil;
}
Index: MapUnidraw/mapkit.h
diff -c MapUnidraw/mapkit.h:1.1 MapUnidraw/mapkit.h:1.2
*** MapUnidraw/mapkit.h:1.1 Mon Aug 2 13:53:07 1999
--- src/MapUnidraw/mapkit.h Sat Feb 26 03:30:44 2000
***************
*** 28,34 ****
#ifndef map_kit_h
#define map_kit_h
! #include <OverlayUnidraw/ovkit.h>
#include <InterViews/_enter.h>
--- 28,34 ----
#ifndef map_kit_h
#define map_kit_h
! #include <FrameUnidraw/framekit.h>
#include <InterViews/_enter.h>
***************
*** 36,42 ****
class NameView;
class ThemeChooser;
! class MapKit : public OverlayKit {
public:
MapKit();
--- 36,42 ----
class NameView;
class ThemeChooser;
! class MapKit : public FrameKit {
public:
MapKit();
Index: UtmUnidraw/utmkit.c
diff -c UtmUnidraw/utmkit.c:1.1 UtmUnidraw/utmkit.c:1.2
*** UtmUnidraw/utmkit.c:1.1 Mon Aug 2 13:53:25 1999
--- src/UtmUnidraw/utmkit.c Sat Feb 26 03:30:46 2000
***************
*** 1,4 ****
--- 1,5 ----
/*
+ * Copyright 2000 IET Inc.
* Copyright 1997-1999 Vectaport Inc.
* Copyright 1994, 1995 Vectaport Inc., Cartoactive Systems
* Copyright 1993 David B. Hollenbeck
***************
*** 131,136 ****
--- 132,140 ----
return _utmkit;
}
+ #define LINEFEATURE_TOOL
+ #define AREAFEATURE_TOOL
+
Glyph* UtmKit::MakeToolbar() {
WidgetKit& kit = *WidgetKit::instance();
const LayoutKit& layout = *LayoutKit::instance();
***************
*** 160,167 ****
#if 0
ToolButton* prtbutton;
#endif
ToolButton* lftbutton;
! #if 0
ToolButton* aftbutton;
#endif
ToolButton* geolog;
--- 164,173 ----
#if 0
ToolButton* prtbutton;
#endif
+ #if defined(LINEFEATURE_TOOL)
ToolButton* lftbutton;
! #endif
! #if defined(AREAFEATURE_TOOL)
ToolButton* aftbutton;
#endif
ToolButton* geolog;
***************
*** 184,191 ****
#if 0
Glyph* prt = kit.label("PickRoute");
#endif
Glyph* lft = kit.label("LineFeature");
! #if 0
Glyph* aft = kit.label("AreaFeature");
#endif
Glyph* geologl = geolog_cmd ? kit.label("GeoLog") : nil;
--- 190,199 ----
#if 0
Glyph* prt = kit.label("PickRoute");
#endif
+ #if defined(LINEFEATURE_TOOL)
Glyph* lft = kit.label("LineFeature");
! #endif
! #if defined(AREAFEATURE_TOOL)
Glyph* aft = kit.label("AreaFeature");
#endif
Glyph* geologl = geolog_cmd ? kit.label("GeoLog") : nil;
***************
*** 216,224 ****
maxwidth = Math::max((prt->request(req), req.x_requirement().natural()),
maxwidth);
#endif
maxwidth = Math::max((lft->request(req), req.x_requirement().natural()),
maxwidth);
! #if 0
maxwidth = Math::max((aft->request(req), req.x_requirement().natural()),
maxwidth);
#endif
--- 224,234 ----
maxwidth = Math::max((prt->request(req), req.x_requirement().natural()),
maxwidth);
#endif
+ #if defined(LINEFEATURE_TOOL)
maxwidth = Math::max((lft->request(req), req.x_requirement().natural()),
maxwidth);
! #endif
! #if defined(AREAFEATURE_TOOL)
maxwidth = Math::max((aft->request(req), req.x_requirement().natural()),
maxwidth);
#endif
***************
*** 281,290 ****
layout.overlay(layout.hcenter(layout.hspace(maxwidth)),
layout.hcenter(prt)), tg));
#endif
vb->append(lftbutton = MakeTool(new LineFeatureTool(new ControlInfo("LineFeature")),
layout.overlay(layout.hcenter(layout.hspace(maxwidth)),
layout.hcenter(lft)), tg));
! #if 0
vb->append(aftbutton = MakeTool(new AreaFeatureTool(new ControlInfo("AreaFeature")),
layout.overlay(layout.hcenter(layout.hspace(maxwidth)),
layout.hcenter(aft)), tg));
--- 291,302 ----
layout.overlay(layout.hcenter(layout.hspace(maxwidth)),
layout.hcenter(prt)), tg));
#endif
+ #if defined(LINEFEATURE_TOOL)
vb->append(lftbutton = MakeTool(new LineFeatureTool(new ControlInfo("LineFeature")),
layout.overlay(layout.hcenter(layout.hspace(maxwidth)),
layout.hcenter(lft)), tg));
! #endif
! #if defined(AREAFEATURE_TOOL)
vb->append(aftbutton = MakeTool(new AreaFeatureTool(new ControlInfo("AreaFeature")),
layout.overlay(layout.hcenter(layout.hspace(maxwidth)),
layout.hcenter(aft)), tg));
***************
*** 292,302 ****
_toolbars->append(vb);
! #ifdef HAVE_ACE
! vb = layout.vbox(7 + 3*(losserv_enable!=0) + geolog_cmd!=0);
! #else
! vb = layout.vbox(5 + geolog_cmd!=0);
! #endif
vb->append(magnify);
vb->append(mapselect);
vb->append(inspect);
--- 304,310 ----
_toolbars->append(vb);
! vb = layout.vbox();
vb->append(magnify);
vb->append(mapselect);
vb->append(inspect);
***************
*** 318,325 ****
#if 0
vb->append(prtbutton);
#endif
vb->append(lftbutton);
! #if 0
vb->append(aftbutton);
#endif
_toolbars->append(vb);
--- 326,335 ----
#if 0
vb->append(prtbutton);
#endif
+ #if defined(LINEFEATURE_TOOL)
vb->append(lftbutton);
! #endif
! #if defined(AREAFEATURE_TOOL)
vb->append(aftbutton);
#endif
_toolbars->append(vb);
Index: VhclUnidraw/vhclkit.c
diff -c VhclUnidraw/vhclkit.c:1.1 VhclUnidraw/vhclkit.c:1.2
*** VhclUnidraw/vhclkit.c:1.1 Mon Aug 2 13:53:53 1999
--- src/VhclUnidraw/vhclkit.c Sat Feb 26 03:30:53 2000
***************
*** 157,163 ****
--- 157,169 ----
}
void VhclKit::InitLayout(const char* name) {
+ boolean save_set_button_flag = _set_button_flag;
+ boolean save_clr_button_flag = _clr_button_flag;
+ _set_button_flag = false;
+ _clr_button_flag = false;
FrameKit::InitLayout(this, name);
+ _set_button_flag = save_set_button_flag;
+ _clr_button_flag = save_clr_button_flag;
}
Glyph* VhclKit::MakeStates() {
*** /dev/null Sat Feb 26 03:30:55 PST 2000
--- patches/vhclmaps-000226-johnston-010
*************** patches/vhclmaps-000226-johnston-010
*** 0 ****
--- 1 ----
+ vhclmaps-000226-johnston-010
|
|
From: <joh...@ve...> - 2000-02-17 18:06:33
|
Patch: vhclmaps-000217-johnston-008
For: vhclmaps-0.7.4
Author: joh...@us...
This is an intermediate patch to vhclmaps-0.7.4. To apply, cd to the
top-level directory of the vhclmaps source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- Now when you run "make" with no arguments, the first time through it
does the same thing as "make World", so everything gets built
automatically.
Index: top_vhclmaps/Imakefile
diff -c top_vhclmaps/Imakefile:1.1 top_vhclmaps/Imakefile:1.2
*** top_vhclmaps/Imakefile:1.1 Mon Aug 2 13:52:35 1999
--- ./Imakefile Thu Feb 17 21:56:46 2000
***************
*** 1,14 ****
XCOMM
! XCOMM "make CPU" prints the name you should assign to CPU.
! XCOMM "make World" builds everything.
XCOMM "make install" installs everything.
XCOMM
PACKAGE = top_vhclmaps
! WORLDOPTS = -k
SUBDIRS = src config
MakeCPU()
MakeWorld($(WORLDOPTS))
! MakeInSubdirs($(SUBDIRS))
--- 1,18 ----
XCOMM
! XCOMM "make CPU" prints the name used for machine-specific subdirectories
! XCOMM "make" builds everything.
XCOMM "make install" installs everything.
XCOMM
PACKAGE = top_vhclmaps
! WORLDOPTS =
SUBDIRS = src config
MakeCPU()
MakeWorld($(WORLDOPTS))
! MakeWorld2($(WORLDOPTS))
! MakeInSubdirsTop($(SUBDIRS))
!
! clean::
! @$(RM_CMD) make.makefile make.makefiles make.depend make.make
Index: Dlg/dlgfclass.c
diff -c Dlg/dlgfclass.c:1.1 Dlg/dlgfclass.c:1.2
*** Dlg/dlgfclass.c:1.1 Mon Aug 2 13:52:51 1999
--- src/Dlg/dlgfclass.c Thu Feb 17 21:56:49 2000
***************
*** 39,46 ****
#include <Unidraw/Graphic/graphic.h>
#include <Unidraw/Graphic/pspaint.h>
- #include <OS/math.h>
-
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
--- 39,44 ----
Index: MapUnidraw/geoloctool.c
diff -c MapUnidraw/geoloctool.c:1.1 MapUnidraw/geoloctool.c:1.2
*** MapUnidraw/geoloctool.c:1.1 Mon Aug 2 13:53:05 1999
--- src/MapUnidraw/geoloctool.c Thu Feb 17 21:56:52 2000
***************
*** 35,40 ****
--- 35,41 ----
#include <iostream.h>
#include <stdio.h>
+ #include <string.h>
/*****************************************************************************/
Index: VhclServ/vhclcomps.h
diff -c VhclServ/vhclcomps.h:1.2 VhclServ/vhclcomps.h:1.3
*** VhclServ/vhclcomps.h:1.2 Tue Jan 25 03:35:33 2000
--- src/VhclServ/vhclcomps.h Thu Feb 17 21:56:56 2000
***************
*** 54,60 ****
// void GrowParamList(ParamList*);
// static ParamList* _vehicle_params;
! classid("VhclServComp");
friend class VhclServUpdater;
};
--- 54,60 ----
// void GrowParamList(ParamList*);
// static ParamList* _vehicle_params;
! CLASS_SYMID("VhclServComp");
friend class VhclServUpdater;
};
***************
*** 77,83 ****
virtual void send_disconnect_commands(ostream&) = 0;
virtual void send_update_commands(ostream&) = 0;
! classid("VhclServUpdater");
protected:
char* _host;
--- 77,83 ----
virtual void send_disconnect_commands(ostream&) = 0;
virtual void send_update_commands(ostream&) = 0;
! CLASS_SYMID("VhclServUpdater");
protected:
char* _host;
***************
*** 142,148 ****
GpsdAcceptor* _gpsd_acceptor;
#endif
! classid("VehicleComp");
friend class VehicleUpdater;
};
--- 142,148 ----
GpsdAcceptor* _gpsd_acceptor;
#endif
! CLASS_SYMID("VehicleComp");
friend class VehicleUpdater;
};
***************
*** 161,167 ****
virtual void send_disconnect_commands(ostream&);
virtual void send_update_commands(ostream&);
! classid("VehicleUpdater");
};
--- 161,167 ----
virtual void send_disconnect_commands(ostream&);
virtual void send_update_commands(ostream&);
! CLASS_SYMID("VehicleUpdater");
};
***************
*** 185,191 ****
Route* _route;
! classid("RouteComp");
friend class RouteUpdater;
};
--- 185,191 ----
Route* _route;
! CLASS_SYMID("RouteComp");
friend class RouteUpdater;
};
***************
*** 203,209 ****
virtual void send_disconnect_commands(ostream&);
virtual void send_update_commands(ostream&);
! classid("RouteUpdater");
};
--- 203,209 ----
virtual void send_disconnect_commands(ostream&);
virtual void send_update_commands(ostream&);
! CLASS_SYMID("RouteUpdater");
};
Index: config_vhclmaps/rules.def
diff -c config_vhclmaps/rules.def:1.1 config_vhclmaps/rules.def:1.2
*** config_vhclmaps/rules.def:1.1 Mon Aug 2 13:53:59 1999
--- config/rules.def Thu Feb 17 21:56:58 2000
***************
*** 34,44 ****
@echo "" @@\
$(MAKE) Makefile CONFIGSRC=$(CONFIGSRC) XCONFIGDIR=$(XCONFIGDIR)@@\
@echo "" @@\
$(MAKE) Makefiles @@\
@echo "" @@\
$(MAKE) depend @@\
@echo "" @@\
! $(MAKE) flags all @@\
@echo "" @@\
@echo "$(RELEASE) build completed on `date`" @@\
@echo ""
--- 34,47 ----
@echo "" @@\
$(MAKE) Makefile CONFIGSRC=$(CONFIGSRC) XCONFIGDIR=$(XCONFIGDIR)@@\
@echo "" @@\
+ @echo "twice to propogate new toplevel pathname" @@\
+ $(MAKE) Makefile @@\
+ @echo "" @@\
$(MAKE) Makefiles @@\
@echo "" @@\
$(MAKE) depend @@\
@echo "" @@\
! $(MAKE) flags subdirs @@\
@echo "" @@\
@echo "$(RELEASE) build completed on `date`" @@\
@echo ""
***************
*** 79,84 ****
--- 82,119 ----
#endif
/*
+ * Make everything by default
+ */
+ #ifndef MakeWorld2
+ #define MakeWorld2(flags) @@\
+ all:: @@\
+ -@if [ ! -f make.makefile ]; then \ @@\
+ echo ""; \ @@\
+ echo "Building $(RELEASE) on `date`"; \ @@\
+ echo ""; \ @@\
+ $(MAKE) Makefile CONFIGSRC=$(CONFIGSRC) XCONFIGDIR=$(XCONFIGDIR);\@@\
+ echo "twice to propogate new toplevel pathname"; \ @@\
+ $(MAKE) Makefile; \ @@\
+ touch make.makefile; fi @@\
+ -@if [ ! -f make.makefiles ]; then \ @@\
+ echo ""; \ @@\
+ $(MAKE) Makefiles; \ @@\
+ touch make.makefiles; fi @@\
+ -@if [ ! -f make.depend ]; then \ @@\
+ echo ""; \ @@\
+ $(MAKE) depend; \ @@\
+ touch make.depend; fi @@\
+ -@if [ ! -f make.make ]; then \ @@\
+ echo ""; fi @@\
+ $(MAKE) flags subdirs @@\
+ -@if [ ! -f make.make ]; then \ @@\
+ echo ""; \ @@\
+ echo "$(RELEASE) build completed on `date`"; \ @@\
+ echo ""; \ @@\
+ touch make.make; fi
+ #endif
+
+ /*
* Make the Makefile in the current directory.
*/
#ifdef LinuxArchitecture
***************
*** 182,187 ****
--- 217,239 ----
done
#endif
+ /*
+ * Make the given target in the list of subdirectories.
+ */
+ #ifndef IntoSubdirs2
+ #define IntoSubdirs2(name,dirs,verb,target) @@\
+ target:: @@\
+ -@for i in dirs; \ @@\
+ do \ @@\
+ if [ -d $$i ]; then ( \ @@\
+ echo verb \ @@\
+ "for $(ARCH) in $(CURRENT_DIR)/$$i"; \ @@\
+ cd $$i; \ @@\
+ $(MAKE) $(PASSARCH) name; \ @@\
+ ) else continue; fi; \ @@\
+ done
+ #endif
+
#ifndef DependSubdirs
#define DependSubdirs(dirs) @@\
IntoSubdirs(depend,dirs,"depending")
***************
*** 192,197 ****
--- 244,254 ----
IntoSubdirs(all,dirs,"making all")
#endif
+ #ifndef MakeSubdirsTop
+ #define MakeSubdirsTop(dirs) @@\
+ IntoSubdirs2(all,dirs,"making all",subdirs)
+ #endif
+
#ifndef InstallSubdirs
#define InstallSubdirs(dirs) @@\
IntoSubdirs(install,dirs,"installing") @@\
***************
*** 279,285 ****
InstallSubdirs(dirs) @@\
CleanSubdirs(dirs) @@\
SpecialTargets(debug,-DUseDebug) @@\
- SpecialTargets(noshared,-DUseNonShared) @@\
IvmkcmTargets($(PACKAGE)) @@\
IvmkcmSubdirs(dirs)
#else
--- 336,341 ----
***************
*** 290,295 ****
--- 346,380 ----
InstallSubdirs(dirs) @@\
CleanSubdirs(dirs) @@\
SpecialTargets(debug,-DUseDebug) @@\
+ IvmkcmTargets($(PACKAGE)) @@\
+ IvmkcmSubdirs(dirs)
+ #endif
+ #endif
+
+ /*
+ * Version of MakeInSubdirs for the top-level without the MakeSubdirs
+ */
+ #ifndef MakeInSubdirsTop
+ #if HasDynamicSharedLibraries
+ #define MakeInSubdirsTop(dirs) @@\
+ MakefilesSubdirs(dirs) @@\
+ DependSubdirs(dirs) @@\
+ MakeSubdirsTop(dirs) @@\
+ InstallSubdirs(dirs) @@\
+ CleanSubdirs(dirs) @@\
+ SpecialTargets(debug,-DUseDebug) @@\
+ SpecialTargets(noshared,-DUseNonShared) @@\
+ IvmkcmTargets($(PACKAGE)) @@\
+ IvmkcmSubdirs(dirs)
+ #else
+ #define MakeInSubdirsTop(dirs) @@\
+ MakefilesSubdirs(dirs) @@\
+ DependSubdirs(dirs) @@\
+ MakeSubdirsTop(dirs) @@\
+ InstallSubdirs(dirs) @@\
+ CleanSubdirs(dirs) @@\
+ SpecialTargets(debug,-DUseDebug) @@\
+ SpecialTargets(noshared,-DUseNonShared) @@\
IvmkcmTargets($(PACKAGE)) @@\
IvmkcmSubdirs(dirs)
#endif
Index: vhclmaps_patches/vhclmaps-000210-johnston-007
*** /dev/null Thu Feb 17 21:57:02 PST 2000
--- patches/vhclmaps-000217-johnston-008
*************** patches/vhclmaps-000217-johnston-008
*** 0 ****
--- 1 ----
+ vhclmaps-000217-johnston-008
|