|
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
|