Commit a57a6110 authored by hrchilds's avatar hrchilds
Browse files

Update from May 17, 2004

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@243 18c085ea-50e0-402c-830e-de6fd14e8384
parent 9441f574
......@@ -28,6 +28,17 @@ Explorer::Explorer(const QString &file, QWidget *p, const QString &n)
filemenu->insertItem( "E&xit", this, SLOT(close()), CTRL+Key_X );
}
// ****************************************************************************
// Destructor: Explorer::~Explorer
//
// Programmer: Jeremy Meredith
// Creation: May 17, 2004
//
// ****************************************************************************
Explorer::~Explorer()
{
}
// ****************************************************************************
// Method: Explorer::open
//
......@@ -37,6 +48,10 @@ Explorer::Explorer(const QString &file, QWidget *p, const QString &n)
// Programmer: Jeremy Meredith
// Creation: November 12, 2001
//
// Modifications:
// Jeremy Meredith, Mon May 17 11:50:08 PDT 2004
// Change the window caption when opening a new file.
//
// ****************************************************************************
void
Explorer::open()
......@@ -48,5 +63,7 @@ Explorer::open()
NULL, "SiloOpen", "Open file...");
if (file.isNull())
return;
setCaption("Explorer: "+file);
view->Set(file);
}
......@@ -20,6 +20,7 @@ class Explorer : public QMainWindow
Q_OBJECT
public:
Explorer(const QString &file, QWidget *p, const QString &n);
virtual ~Explorer();
public slots:
void open();
private:
......
......@@ -15,9 +15,14 @@
// Creation: November 12, 2001
//
// Modifications:
// Mark Miller, Tue 23 Mar 11:19:13 PDT 2004
// Fixed problem with character arrays longer than 1024 chars
// Added missing call to free memory allocated by GetVar call
//
// Jeremy Meredith, Mon May 17 11:56:24 PDT 2004
// Rewrote character array code to fix garbage/missing character output
// and prevent it splitting at 1024 bytes.
//
// ****************************************************************************
SiloArrayViewWindow::SiloArrayViewWindow(SiloFile *s, const QString &n, QWidget *p)
: QMainWindow(p, n), silo(s), name(n)
......@@ -74,32 +79,33 @@ SiloArrayViewWindow::SiloArrayViewWindow(SiloFile *s, const QString &n, QWidget
}
else
{
char str[1024];
// Copy the character array into a temporary buffer,
// splitting at semicolons, and putting the result in a list box
char *str = new char[len+1];
char *p = str;
for (int i=0; i<len; i++)
{
char c = ((char*)var)[i];
if (c == ';')
*p = ((char*)var)[i];
if (*p == ';')
{
*p = '\0';
if (strlen(str) > 0)
if (p != str)
{
*p = '\0';
lb->insertItem(str);
}
p = str;
}
else if (i % (sizeof(str)-2) == 0)
else
{
str[sizeof(str)-2] = c;
str[sizeof(str)-1] = '\0';
if (strlen(str) > 0)
lb->insertItem(str);
p = str;
p++;
}
else
*(p++)=c;
}
*p = '\0';
if (strlen(str) > 0)
if (p != str)
{
*p = '\0';
lb->insertItem(str);
}
delete[] str;
}
free(var);
......
......@@ -52,6 +52,10 @@ SiloObjectViewWindow::ShowItem(QListViewItem *i)
// Programmer: Jeremy Meredith
// Creation: November 12, 2001
//
// Modifications:
// Jeremy Meredith, Mon May 17 12:37:32 PDT 2004
// Added a couple calls to free memory and prevent really big leaks.
//
// ****************************************************************************
SiloObjectView::SiloObjectView(SiloFile *s, const QString &n, QWidget *p)
: QListView(p, n), silo(s), name(n)
......@@ -122,7 +126,11 @@ SiloObjectView::SiloObjectView(SiloFile *s, const QString &n, QWidget *p)
sprintf(value, "%s", pdbname.latin1());
break;
}
// No such call as "DBFreeComponent". Maybe there should be one!
free(comp);
comp = NULL;
if (type==DB_INT || type==DB_SHORT || type==DB_LONG)
{
if (compname == "coordtype")
......@@ -185,6 +193,7 @@ SiloObjectView::SiloObjectView(SiloFile *s, const QString &n, QWidget *p)
}
total_items = object->ncomponents;
DBFreeObject(object);
}
// ****************************************************************************
......
......@@ -13,6 +13,10 @@
// Programmer: Jeremy Meredith
// Creation: November 12, 2001
//
// Modifications:
// Mark Miller, Tue 23 Mar 11:19:13 PDT 2004
// Added call to free memory from the Silo DBGetVar call.
//
// ****************************************************************************
SiloValueViewWindow::SiloValueViewWindow(SiloFile *s, const QString &n, QWidget *p)
: QMainWindow(p, n), silo(s), name(n)
......
......@@ -42,6 +42,18 @@ SiloView::SiloView(const QString &file, QWidget *p, const QString &n)
dirView->header()->setResizeEnabled(false);
}
// ****************************************************************************
// Destructor: SiloView::~SiloView
//
// Programmer: Jeremy Meredith
// Creation: May 17, 2004
//
// ****************************************************************************
SiloView::~SiloView()
{
delete silo;
}
// ****************************************************************************
// Method: SiloView::Set
//
......
......@@ -25,6 +25,7 @@ class SiloView : public QSplitter
Q_OBJECT
public:
SiloView(const QString &file, QWidget *p, const QString &n);
virtual ~SiloView();
void Set(const QString &file);
public slots:
......
......@@ -6235,7 +6235,6 @@ ViewerWindow::CreateNode(DataNode *parentNode, bool detailed)
//
windowNode->AddNode(new DataNode("scalableAutoThreshold", GetScalableAutoThreshold()));
windowNode->AddNode(new DataNode("scalableActivationMode", GetScalableActivationMode()));
windowNode->AddNode(new DataNode("scalableRendering", GetScalableRendering()));
windowNode->AddNode(new DataNode("notifyForEachRender", GetNotifyForEachRender()));
windowNode->AddNode(new DataNode("surfaceRepresentation", GetSurfaceRepresentation()));
windowNode->AddNode(new DataNode("displayListMode", GetDisplayListMode()));
......@@ -6571,8 +6570,6 @@ ViewerWindow::SetFromNode(DataNode *parentNode)
SetScalableAutoThreshold(node->AsInt());
if((node = windowNode->GetNode("scalableActivationMode")) != 0)
SetScalableActivationMode(node->AsInt());
if((node = windowNode->GetNode("scalableRendering")) != 0)
SendScalableRenderingModeChangeMessage(node->AsBool());
if((node = windowNode->GetNode("notifyForEachRender")) != 0)
SetNotifyForEachRender(node->AsBool());
if((node = windowNode->GetNode("surfaceRepresentation")) != 0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment