Commit f382ef13 authored by hrchilds's avatar hrchilds

Update from July 3, 2003

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@27 18c085ea-50e0-402c-830e-de6fd14e8384
parent 1e89eb07
......@@ -223,6 +223,10 @@ $0 = shift @ARGV;
# Akira Haddox, Tue Jul 1 12:56:14 PDT 2003
# Added the makemili tool.
#
# Jeremy Meredith, Thu Jul 3 15:10:36 PDT 2003
# Added doc for "-nopty". Made it stricter about when it will
# allow non-private plugin installs.
#
###############################################################################
......@@ -286,6 +290,7 @@ USAGE: visit [arguments]
-noint Disable interruption capability
-numrestarts <#> Number of attempts to restart a failed engine
(default is 2)
-nopty Run without PTYs.
Window arguments:
-small Use a smaller desktop area/window size
......@@ -649,8 +654,9 @@ if ($exe_name eq "engine")
}
}
# If a directory was specified or the executable exists in a first-level bin
# directory, then don't bother looking for versions to use.
# If the executable exists in a first-level "bin" directory,
# then don't bother looking for versions to use; this is a
# development executable.
if (-e "$visitdir/bin/$exe_name" ||
-e "$visitdir/bin/mdserver")
{
......@@ -675,6 +681,7 @@ if (-e "$visitdir/bin/$exe_name" ||
}
else
{
# We're running a public version.
@exe = <$visitdir/*/$archdir/bin/$exe_name>;
@exeversions = map {m|^$visitdir/(.*?)/|; $_ = $1;} @exe;
$current_version = readlink("$visitdir/current");
......@@ -803,17 +810,16 @@ elsif (!grep /$visitprivateplugins/, $ENV{VISITPLUGINDIR})
}
# If we are using a public version and any public plugin directory is
# If we are using a public version, or if any main plugin directory is
# not writeable, then we should default to a private plugin installation.
$ENV{VISITPLUGININSTPUB}="$visitplugins";
$ENV{VISITPLUGININSTPRI}="$visitprivateplugins";
$shouldinstallprivate = 0;
$shouldinstallprivate = $publicversion;
foreach (@plugincategories)
{
$shouldinstallprivate=1 if (! -w "$visitplugins/$_");
}
$shouldinstallprivate &= $publicversion;
if ($shouldinstallprivate)
{
......
......@@ -72,6 +72,7 @@ struct ThreadCallbackDataStruct
// Static data
//
void (*RemoteProcess::getAuthentication)(const char *, const char *, int) = NULL;
bool RemoteProcess::disablePTY = false;
using std::map;
static map<int, bool> childDied;
......@@ -228,6 +229,23 @@ RemoteProcess::~RemoteProcess()
CloseListenSocket();
}
// ****************************************************************************
// Method: RemoteProcess::DisablePTY
//
// Purpose:
// Disables usage of PTYs.
//
// Programmer: Jeremy Meredith
// Creation: July 3, 2003
//
// ****************************************************************************
void
RemoteProcess::DisablePTY()
{
disablePTY = true;
}
// ****************************************************************************
// Method: RemoteProcess::AddArgument
//
......@@ -1524,6 +1542,9 @@ RemoteProcess::CreateCommandLine(stringVector &args, const std::string &rHost,
// Brad Whitlock, Mon May 5 13:10:52 PST 2003
// I moved large portions of the command line creation code elsewhere.
//
// Jeremy Meredith, Thu Jul 3 15:01:25 PDT 2003
// Allowed disabling of PTYs even when they are available.
//
// ****************************************************************************
void
......@@ -1545,13 +1566,22 @@ RemoteProcess::LaunchRemote(const stringVector &args)
// Start the program in UNIX
#ifdef USE_PTY
int ptyFileDescriptor;
// we will tell pty_fork to set up the signal handler for us, because
// this call must come after the grantpt call inside pty_fork()
switch (remoteProgramPid = pty_fork(ptyFileDescriptor, catch_dead_child))
if (!disablePTY)
{
// we will tell pty_fork to set up the signal handler for us, because
// this call must come after the grantpt call inside pty_fork()
remoteProgramPid = pty_fork(ptyFileDescriptor, catch_dead_child);
}
else
{
signal(SIGCHLD, catch_dead_child);
remoteProgramPid = fork();
}
#else
signal(SIGCHLD, catch_dead_child);
switch (remoteProgramPid = fork())
remoteProgramPid = fork();
#endif
switch (remoteProgramPid)
{
case -1:
// Could not fork.
......@@ -1574,7 +1604,7 @@ RemoteProcess::LaunchRemote(const stringVector &args)
}
#ifdef USE_PTY
if (getAuthentication)
if (!disablePTY && getAuthentication)
{
TRY
{
......
......@@ -63,6 +63,9 @@ class Connection;
// Brad Whitlock, Mon May 5 13:24:47 PST 2003
// I refactored the code a little to simplify handling of command lines.
//
// Jeremy Meredith, Thu Jul 3 14:49:23 PDT 2003
// Added ability to disable ptys.
//
// ****************************************************************************
class COMM_API RemoteProcess
......@@ -83,6 +86,7 @@ public:
void SetProgressCallback(bool (*)(void *, int), void *);
static void SetAuthenticationCallback(void (*)(const char *, const char *, int));
static void DisablePTY();
protected:
bool StartMakingConnection(const std::string &rHost, int numRead,
int numWrite);
......@@ -121,6 +125,7 @@ private:
void *progressCallbackData;
static void (*getAuthentication)(const char *, const char *, int);
static bool disablePTY;
};
#endif
This diff is collapsed.
......@@ -3,6 +3,7 @@
#include <state_exports.h>
#include <stdio.h>
#include <DataNode.h>
#include <string>
// ****************************************************************************
// Class: ConfigManager
......@@ -22,6 +23,9 @@
// Brad Whitlock, Tue Feb 19 12:29:17 PDT 2002
// Added a method to get the name of the system config file.
//
// Brad Whitlock, Thu Jul 3 16:14:04 PST 2003
// Rewrote the methods that read in the file.
//
// ****************************************************************************
class STATE_API ConfigManager
......@@ -43,18 +47,18 @@ protected:
void WriteBack(DataNode *root);
// Functions to read in the tree.
void ReadObject(DataNode *);
bool ReadObject(DataNode *);
bool ReadObjectHelper(DataNode *, bool &);
char ReadChar();
void PutBackChar(char c);
void ReadField(DataNode *);
DataNode *ReadFieldData(const char *, NodeTypeEnum, int);
void FinishTag();
int ReadLength();
NodeTypeEnum ReadType();
void ReadName(char *);
int ReadTag();
char **ReadStringList(int *length);
void FreeStringList(char **strlist, int len);
bool ReadField(DataNode *parentNode, const std::string &tagName,
NodeTypeEnum tagType, int tagLength);
DataNode *ReadFieldData(const std::string &tagName, NodeTypeEnum tagType,
int tagLength);
bool ReadTag(std::string &tagName, NodeTypeEnum &tagType,
int &tagLength, bool &tagIsReturnTag);
stringVector ReadStringVector(char termChar);
// File attributes used in reading.
bool putback;
......
This diff is collapsed.
......@@ -5,7 +5,7 @@
#include <avtView2D.h>
#include <avtViewInfo.h>
#include <ViewAttributes.h>
// ****************************************************************************
// Method: avtView2D constructor
......@@ -354,4 +354,52 @@ avtView2D::GetValidWindow(double *valid_window) const
}
}
// ****************************************************************************
// Method: avtView2D::SetFromViewAttributes
//
// Purpose:
// Sets the view from the ViewAttributes.
//
// Arguments:
// viewAtts : The ViewAttributes to use.
//
// Programmer: Brad Whitlock
// Creation: Tue Jul 1 14:05:11 PST 2003
//
// Modifications:
//
// ****************************************************************************
void
avtView2D::SetFromViewAttributes(const ViewAttributes *viewAtts)
{
for(int i = 0; i < 4; ++i)
{
viewport[i] = viewAtts->GetViewportCoords()[i];
window[i] = viewAtts->GetWindowCoords()[i];
}
}
// ****************************************************************************
// Method: avtView2D::SetToViewAttributes
//
// Purpose:
// Sets a ViewAttributes from the avtView2D.
//
// Arguments:
// viewAtts : The ViewAttributes object to set.
//
// Programmer: Brad Whitlock
// Creation: Tue Jul 1 14:05:48 PST 2003
//
// Modifications:
//
// ****************************************************************************
void
avtView2D::SetToViewAttributes(ViewAttributes *viewAtts) const
{
viewAtts->SetWindowCoords(window);
viewAtts->SetViewportCoords(viewport);
}
......@@ -7,6 +7,7 @@
#include <pipeline_exports.h>
struct avtViewInfo;
class ViewAttributes;
// ****************************************************************************
// Class: avtView2D
......@@ -39,6 +40,9 @@ struct PIPELINE_API avtView2D
void SetViewInfoFromView(avtViewInfo &) const;
void SetViewportFromView(double *, const int, const int) const;
void SetFromViewAttributes(const ViewAttributes *);
void SetToViewAttributes(ViewAttributes *) const;
protected:
void GetValidWindow(double *) const;
};
......
......@@ -7,6 +7,7 @@
#include <math.h>
#include <avtViewInfo.h>
#include <ViewAttributes.h>
//
// Local macros.
......@@ -256,3 +257,71 @@ avtView3D::SetViewInfoFromView(avtViewInfo &viewInfo) const
viewInfo.imagePan[1] = imagePan[1];
viewInfo.imageZoom = imageZoom;
}
// ****************************************************************************
// Method: avtView3D::SetFromViewAttributes
//
// Purpose:
// Sets the avtView3D from a ViewAttributes object.
//
// Arguments:
// viewAtts : The ViewAttributes to use.
//
// Programmer: Brad Whitlock
// Creation: Tue Jul 1 14:00:50 PST 2003
//
// Modifications:
//
// ****************************************************************************
void
avtView3D::SetFromViewAttributes(const ViewAttributes *viewAtts)
{
for(int i = 0; i < 3; ++i)
{
normal[i] = viewAtts->GetViewNormal()[i];
focus[i] = viewAtts->GetFocus()[i];
viewUp[i] = viewAtts->GetViewUp()[i];
}
viewAngle = viewAtts->GetViewAngle();
parallelScale = viewAtts->GetParallelScale();
nearPlane = viewAtts->GetNearPlane();
farPlane = viewAtts->GetFarPlane();
imagePan[0] = viewAtts->GetImagePan()[0];
imagePan[1] = viewAtts->GetImagePan()[1];
imageZoom = viewAtts->GetImageZoom();
perspective = viewAtts->GetPerspective();
}
// ****************************************************************************
// Method: avtView3D::SetToViewAttributes
//
// Purpose:
// Sets a ViewAttributes from the avtView3D.
//
// Arguments:
// viewAtts : The ViewAttributes object to set.
//
// Programmer: Brad Whitlock
// Creation: Tue Jul 1 14:01:23 PST 2003
//
// Modifications:
//
// ****************************************************************************
void
avtView3D::SetToViewAttributes(ViewAttributes *viewAtts) const
{
viewAtts->SetViewNormal(normal);
viewAtts->SetFocus(focus);
viewAtts->SetViewUp(viewUp);
viewAtts->SetViewAngle(viewAngle);
viewAtts->SetParallelScale(parallelScale);
viewAtts->SetSetScale(true);
viewAtts->SetNearPlane(nearPlane);
viewAtts->SetFarPlane(farPlane);
viewAtts->SetImagePan(imagePan);
viewAtts->SetImageZoom(imageZoom);
viewAtts->SetPerspective(perspective);
}
......@@ -7,6 +7,7 @@
#include <pipeline_exports.h>
struct avtViewInfo;
class ViewAttributes;
// ****************************************************************************
// Class: avtView3D
......@@ -45,6 +46,9 @@ struct PIPELINE_API avtView3D
bool operator==(const avtView3D &);
void SetToDefault(void);
void SetViewInfoFromView(avtViewInfo &) const;
void SetFromViewAttributes(const ViewAttributes *);
void SetToViewAttributes(ViewAttributes *) const;
};
......
......@@ -6,6 +6,7 @@
#include <avtViewInfo.h>
#include <DebugStream.h>
#include <ViewAttributes.h>
// ****************************************************************************
// Method: avtViewCurve constructor
......@@ -243,3 +244,51 @@ avtViewCurve::SetViewportFromView(double *winViewport, const int, const int) con
winViewport[3] = viewport[3];
}
// ****************************************************************************
// Method: avtViewCurve::SetFromViewAttributes
//
// Purpose:
// Sets the avtCurveView from the ViewAttributes object.
//
// Arguments:
// viewAtts : A pointer to the ViewAttributes object to use.
//
// Programmer: Brad Whitlock
// Creation: Tue Jul 1 13:00:39 PST 2003
//
// Modifications:
//
// ****************************************************************************
void
avtViewCurve::SetFromViewAttributes(const ViewAttributes *viewAtts)
{
for(int i = 0; i < 4; ++i)
{
window[i] = viewAtts->GetWindowCoords()[i];
viewport[i] = viewAtts->GetViewportCoords()[i];
}
}
// ****************************************************************************
// Method: avtViewCurve::SetToViewAttributes
//
// Purpose:
// Sets the ViewAttributes from the avtView2D object.
//
// Arguments:
// viewAtts : A pointer to the ViewAttributes object to use.
//
// Programmer: Brad Whitlock
// Creation: Tue Jul 1 13:00:39 PST 2003
//
// Modifications:
//
// ****************************************************************************
void
avtViewCurve::SetToViewAttributes(ViewAttributes *viewAtts) const
{
viewAtts->SetWindowCoords(window);
viewAtts->SetViewportCoords(viewport);
}
......@@ -7,6 +7,7 @@
#include <pipeline_exports.h>
struct avtViewInfo;
class ViewAttributes;
// ****************************************************************************
// Class: avtViewCurve
......@@ -33,6 +34,9 @@ struct PIPELINE_API avtViewCurve
void SetViewFromViewInfo(const avtViewInfo &);
void SetViewInfoFromView(avtViewInfo &) const;
void SetViewportFromView(double *, const int, const int) const;
void SetFromViewAttributes(const ViewAttributes *);
void SetToViewAttributes(ViewAttributes *) const;
};
......
This diff is collapsed.
......@@ -9,7 +9,9 @@
#include <ZoomInteractor.h>
class vtkActor2D;
class vtkPolyData;
class vtkDashedXorGridMapper2D;
class VisWindowInteractorProxy;
......@@ -37,12 +39,16 @@ class VisWindowInteractorProxy;
// Removed arguments from all ButtonAction methods, in order to match
// vtk's new interactor api.
//
// Akira Haddox, Thu Jul 3 13:58:11 PDT 2003
// Added drawing of guidelines.
//
// ****************************************************************************
class VISWINDOW_API Zoom2D : public ZoomInteractor
{
public:
Zoom2D(VisWindowInteractorProxy &);
virtual ~Zoom2D();
virtual void StartLeftButtonAction();
virtual void EndLeftButtonAction();
......@@ -51,6 +57,23 @@ class VISWINDOW_API Zoom2D : public ZoomInteractor
virtual void EndMiddleButtonAction();
protected:
int lastGuideX;
int lastGuideY;
vtkPolyData *guideLines;
vtkDashedXorGridMapper2D *guideLinesMapper;
vtkActor2D *guideLinesActor;
virtual void StartRubberBand(int, int);
virtual void EndRubberBand();
virtual void UpdateRubberBand(int, int, int, int, int, int);
void UpdateGuideLines(int, int, int, int, int, int);
void DrawAllGuideLines(int, int, int, int);
void DrawGuideLines(int, int, int, int, const bool which[8]);
void DrawGuideLine(int, int, int, int);
void ZoomCamera(void);
void ZoomCamera(const int x, const int y);
};
......
......@@ -191,6 +191,9 @@ Zoom3D::EndMiddleButtonAction()
// I changed the zoom behavior so that it pans and zooms the image and
// doesn't change the camera and focal point.
//
// Akira Haddox, Thu Jul 3 13:54:59 PDT 2003
// Changed check for not zooming to include line rubberbands.
//
// ****************************************************************************
void
......@@ -198,10 +201,10 @@ Zoom3D::ZoomCamera(void)
{
vtkRenderWindowInteractor *rwi = Interactor;
if (anchorX == lastX && anchorY == lastY)
if (anchorX == lastX || anchorY == lastY)
{
//
// This is a point, not a rectangle.
// This is a line, not a rectangle.
//
return;
}
......
......@@ -30,6 +30,9 @@
//
// Kathleen Bonnell, Thu Nov 15 12:24:45 PST 2001
// Change ids from int to vtkIdType to match VTK 4.0 API.
//
// Akira Haddox, Thu Jul 3 14:15:48 PDT 2003
// Added initialization of shift and controlKeyDown.
//
// ****************************************************************************
......@@ -37,6 +40,7 @@ ZoomInteractor::ZoomInteractor(VisWindowInteractorProxy &vw)
: VisitInteractor(vw)
{
rubberBandMode = false;
shiftKeyDown = controlKeyDown = false;
//
// Create the poly data that will map the rubber band onto the screen.
......@@ -139,6 +143,9 @@ ZoomInteractor::SetCanvasViewport(void)
// Hank Childs, Tue Aug 1 15:37:11 PDT 2000
// Moved SetCanvasViewport to be before ForceCoordsToViewport.
//
// Akira Haddox, Thu Jul 3 14:17:48 PDT 2003
// Set shift and controlKeyDown based on interactor information.
//
// ****************************************************************************
void
......@@ -146,6 +153,9 @@ ZoomInteractor::StartRubberBand(int x, int y)
{
rubberBandMode = true;
shiftKeyDown = Interactor->GetShiftKey();
controlKeyDown = Interactor->GetControlKey();
//
// Add the rubber band actors to the background. We do this since the
// background is in the same display coordinates that the rubber band will
......@@ -200,6 +210,10 @@ ZoomInteractor::StartRubberBand(int x, int y)
// Kathleen Bonnell, Fri Dec 13 16:41:12 PST 2002
// Removed arguments to comply with vtks' new interactor interface.
// Values are now accessed via the RenderWindowInteractor.
//
// Akira Haddox, Thu Jul 3 14:17:48 PDT 2003
// Force a square rubber band when shift key is down.
//
// ****************************************************************************
void
......@@ -210,6 +224,68 @@ ZoomInteractor::OnMouseMove()
{
Interactor->GetEventPosition(x, y);
ForceCoordsToViewport(x, y);
//
// If the shift key is down, lock the coordinates so that we form
// a square.
//
if (shiftKeyDown)
{
int deltaX = x - anchorX;
int deltaY = y - anchorY;
int absDeltaX = abs(deltaX);
int absDeltaY = abs(deltaY);
if (absDeltaX > absDeltaY)
{
// x stays the same, adjust y
if (deltaY < 0)
y = anchorY - absDeltaX;
else
y = anchorY + absDeltaX;
}
else
{
// y stays the same, adjust x
if (deltaX < 0)
x = anchorX - absDeltaY;
else
x = anchorX + absDeltaY;
}
// We now have a square, but it might be outside our bounds.
// We force the coordinates again, since we take the larger
// dimension to expand the square on, and we might have
// expanded outside the box.
// If these coordinates change, then we need to make it a box
// again.
//
int oldX = x;
int oldY = y;
ForceCoordsToViewport(x, y);
oldX = abs(x-oldX);
oldY = abs(y-oldY);
// if x was forced, adjust y
if (oldX)
{
if (deltaY < 0)
y += oldX;
else
y -= oldX;
}
// if y was forced, adjust x
if (oldY)
{
if (deltaX < 0)
x += oldY;
else
x -= oldY;
}
}
UpdateRubberBand(anchorX, anchorY, lastX, lastY, x, y);
lastX = x;
lastY = y;
......
......@@ -43,6 +43,10 @@ class VisWindowInteractorProxy;
// Removed arguments from all OnMouseMove, in order to match
// vtk's new interactor api.
//
// Akira Haddox, Thu Jul 3 14:15:48 PDT 2003
// Added two flags for when control and shift are set.
// Made Start/End/UpdateRubberBand virtual (overloaded in Zoom2D).
//
// ****************************************************************************
class VISWINDOW_API ZoomInteractor : public VisitInteractor
......@@ -66,11 +70,14 @@ class VISWINDOW_API ZoomInteractor : public VisitInteractor
bool rubberBandMode;
bool rubberBandDrawn;
void StartRubberBand(int, int);
void EndRubberBand();
void UpdateRubberBand(int, int, int, int, int, int);
void DrawRubberBandLine(int, int, int, int);
bool shiftKeyDown;
bool controlKeyDown;
virtual void StartRubberBand(int, int);
virtual void EndRubberBand();
virtual void UpdateRubberBand(int, int, int, int, int, int);
virtual void DrawRubberBandLine(int, int, int, int);
void SetCanvasViewport(void);
void ForceCoordsToViewport(int &, int &);
......
......@@ -24,6 +24,10 @@
// Programmer: Akira Haddox
// Creation: Mon Jun 9 09:21:40 PDT 2003
//
// Modifications:
// Akira Haddox, Wed Jul 2 14:56:33 PDT 2003
// Added axis translate.
//
// ****************************************************************************
VisitPointTool::VisitPointTool(VisWindowToolProxy &p) : VisitInteractiveTool(p),
......@@ -32,7 +36,7 @@ VisitPointTool::VisitPointTool(VisWindowToolProxy &p) : VisitInteractiveTool(p),
window3D = false;
addedBbox = false;
addedGuide = false;
depthTranslate = false;
axisTranslate = none;
HotPoint h;
h.radius = 1./60.; // See what a good value is.
......@@ -786,6 +790,93 @@ VisitPointTool::FinalActorSetup()
addedBbox = false;
}
// ****************************************************************************
// Method: VisitPointTool::ComputeTranslationDistance
//
// Purpose:
// Compute a vector for point motion based on a particular
// direction.
//
// Arguments:
// direction the direction to move in
//
// Programmer: Akira Haddox
// Creation: July 2, 2003
//
// ****************************************************************************