Commit 6d5daa6d authored by hrchilds's avatar hrchilds
Browse files

Update from April 13, 2005

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@450 18c085ea-50e0-402c-830e-de6fd14e8384
parent 92f4077f
......@@ -1221,8 +1221,11 @@ avtPixieFileFormat::ReadVariableFromFile(int timestate, const std::string &varna
// Converts an array to a float array.
//
// Arguments:
// data : The data array to be converted.
// nels : The number of elements in the data array.
// allocated : Whether a new data array had to be allocated.
//
// Returns:
// Returns: Pointer to the converted data.
//
// Note:
//
......@@ -1234,12 +1237,13 @@ avtPixieFileFormat::ReadVariableFromFile(int timestate, const std::string &varna
// ****************************************************************************
template <class T>
float *ConvertToFloat(const T *data, int nels)
float *ConvertToFloat(const T *data, int nels, bool &allocated)
{
float *f;
if(sizeof(float) == sizeof(T))
{
allocated = false;
// Change to float in the same memory.
f = (float *)data;
for(int i = 0; i < nels; ++i)
......@@ -1247,6 +1251,7 @@ float *ConvertToFloat(const T *data, int nels)
}
else
{
allocated = true;
f = new float[nels];
for(int i = 0; i < nels; ++i)
f[i] = (float)data[i];
......@@ -1277,6 +1282,9 @@ float *ConvertToFloat(const T *data, int nels)
// Eric Brugger, Tue Oct 26 08:36:53 PDT 2004
// I modified the routine to read a hyperslab of the array.
//
// Brad Whitlock, Wed Apr 13 11:27:03 PDT 2005
// I changed the calls to ConvertToFloat.
//
// ****************************************************************************
bool
......@@ -1305,7 +1313,8 @@ avtPixieFileFormat::ReadCoordinateFields(int timestate, const VarInfo &info,
//
for(i = 0; i < nDims; ++i)
{
int nels = dims[0] * dims[1] * dims[2];
bool allocated;
int nels = dims[0] * dims[1] * dims[2];
if(H5Tequal(vars[i]->second.nativeVarType, H5T_NATIVE_INT) > 0 ||
H5Tequal(vars[i]->second.nativeVarType, H5T_NATIVE_UINT) > 0)
{
......@@ -1314,8 +1323,9 @@ avtPixieFileFormat::ReadCoordinateFields(int timestate, const VarInfo &info,
{
ReadVariableFromFile(timestate, vars[i]->first,
vars[i]->second, dims, (void *)data);
coords[i] = ConvertToFloat(data, nels);
delete [] data;
coords[i] = ConvertToFloat(data, nels, allocated);
if(allocated)
delete [] data;
}
CATCH(VisItException)
{
......@@ -1337,8 +1347,9 @@ avtPixieFileFormat::ReadCoordinateFields(int timestate, const VarInfo &info,
{
ReadVariableFromFile(timestate, vars[i]->first,
vars[i]->second, dims, (void *)data);
coords[i] = ConvertToFloat(data, nels);
delete [] data;
coords[i] = ConvertToFloat(data, nels, allocated);
if(allocated)
delete [] data;
}
CATCH(VisItException)
{
......
# Copyright 2000 - 2004
# Copyright 2000 - 2005
# The Regents of the University of California.
# All rights reserved.
#
......@@ -79,6 +79,10 @@
# Brad Whitlock, Tue Sep 28 09:04:01 PDT 2004
# Added InteractorAttributes so the library builds again.
#
# Brad Whitlock, Fri Apr 8 13:12:25 PST 2005
# Added NIFGUI.java as an example of creating a GUI program that uses
# the Java client.
#
##############################################################################
##
......@@ -164,7 +168,7 @@ Version.java \
ViewerProxy.java \
Xfer.java
MAIN_SRC = RunViewer.java TryLighting.java TryQuery.java
MAIN_SRC = NIFGUI.java RunViewer.java TryLighting.java TryQuery.java
MAIN_CLASS = $(MAIN_SRC:.java=.class)
VERSIONWRITER = versionwriter
......
This diff is collapsed.
......@@ -125,6 +125,9 @@ import java.util.Vector;
// I hooked up the InteractorAttributes to xfer and added a silAtts
// member to get the sil attributes for simulations.
//
// Brad Whitlock, Fri Apr 8 11:57:46 PDT 2005
// Overloaded AddOperator.
//
// ****************************************************************************
public class ViewerProxy implements SimpleObserver
......@@ -727,6 +730,15 @@ public class ViewerProxy implements SimpleObserver
return synchronous ? Synchronize() : true;
}
public boolean AddOperator(String type)
{
int oper = operatorPlugins.IndexFromName(type);
rpc.SetRPCType(ViewerRPC.VIEWERRPCTYPE_ADDOPERATORRPC);
rpc.SetOperatorType(oper);
rpc.Notify();
return synchronous ? Synchronize() : true;
}
public boolean PromoteOperator(int operatorId)
{
rpc.SetRPCType(ViewerRPC.VIEWERRPCTYPE_PROMOTEOPERATORRPC);
......
......@@ -423,7 +423,10 @@ avtLabelRenderer::GetCellCenterArray()
// Creation: Mon Oct 25 09:01:34 PDT 2004
//
// Modifications:
//
// Brad Whitlock, Wed Apr 13 13:08:36 PST 2005
// I removed a check that prevented the single cell label from showing up
// when a mesh is sliced.
//
// ****************************************************************************
void
......@@ -433,8 +436,7 @@ avtLabelRenderer::SetupSingleCellLabel()
// Figure out where the single cell, if specified, should be plotted.
//
vtkIdType nCells = input->GetNumberOfCells();
if(singleCellIndex >= 0 && singleCellIndex < nCells)
if(singleCellIndex >= 0)
{
//
// Look for the cell center array that the label filter calculated.
......@@ -503,7 +505,10 @@ avtLabelRenderer::SetupSingleCellLabel()
// Creation: Mon Oct 25 09:02:31 PDT 2004
//
// Modifications:
//
// Brad Whitlock, Wed Apr 13 13:07:31 PST 2005
// Removed a check that prevented the single node label from showing up
// when a mesh is sliced.
//
// ****************************************************************************
void
......@@ -514,7 +519,7 @@ avtLabelRenderer::SetupSingleNodeLabel()
//
vtkPoints *p = input->GetPoints();
vtkIdType npts = p ? p->GetNumberOfPoints() : 0;
if(singleNodeIndex >= 0 && singleNodeIndex < npts)
if(singleNodeIndex >= 0)
{
//
// Look for the original cell number array.
......
......@@ -686,7 +686,10 @@ avtOpenGLLabelRenderer::DrawAllLabels2D(bool drawNodeLabels, bool drawCellLabels
// Modifications:
// Jeremy Meredith, Mon Nov 8 17:16:21 PST 2004
// Caching is now done on a per-vtk-dataset basis.
//
//
// Brad Whitlock, Wed Apr 13 12:01:21 PDT 2005
// I fixed a problem with how the bins array was allocated.
//
// ****************************************************************************
void
......@@ -718,7 +721,8 @@ avtOpenGLLabelRenderer::DrawDynamicallySelectedLabels2D(bool drawNodeLabels,
// The cell aspect ratio is computed from the longest label.
//
const double char_aspect = 0.8;
double bin_aspect = maxLabelLength * char_aspect;
int LL = (maxLabelLength < 1) ? 1 : maxLabelLength;
double bin_aspect = LL * char_aspect;
double nx_target = sqrt (atts.GetNumberOfLabels() * win_aspect / bin_aspect);
double ny_target = sqrt (atts.GetNumberOfLabels() * bin_aspect / win_aspect);
......@@ -763,8 +767,8 @@ avtOpenGLLabelRenderer::DrawDynamicallySelectedLabels2D(bool drawNodeLabels,
// Create an array to record whether or not we've drawn a label
// for a bin.
//
char *bins = new char[bin_x_n * bin_x_y];
memset (bins, -1, bin_x_n * bin_y_n * sizeof (char)); /* -1 */
char *bins = new char[bin_x_y];
memset (bins, -1, bin_x_y * sizeof (char)); /* -1 */
//
// Iterate through the node labels and draw them if they fit into bins.
......
......@@ -210,6 +210,9 @@ class avtDatabaseMetaData;
// Jeremy Meredith, Mon Mar 21 10:28:46 PST 2005
// Added SendSimulationCommand.
//
// Brad Whitlock, Wed Apr 13 14:50:50 PST 2005
// Made EngineExists be public.
//
// ****************************************************************************
class VIEWER_API ViewerEngineManager : public ViewerServerManager,
......@@ -264,6 +267,7 @@ class VIEWER_API ViewerEngineManager : public ViewerServerManager,
void ClearCacheForAllEngines();
static EngineList *GetEngineList();
bool EngineExists(const EngineKey &ek) const;
// Global engine computation attributes
static MaterialAttributes *GetMaterialClientAtts();
......@@ -315,7 +319,7 @@ class VIEWER_API ViewerEngineManager : public ViewerServerManager,
ViewerEngineManager();
void RemoveEngine(const EngineKey &ek, bool close);
void RemoveFailedEngine(const EngineKey &ek);
bool EngineExists(const EngineKey &ek) const;
void UpdateEngineList();
EngineProxy *GetEngine(const EngineKey &ek);
void LaunchMessage(const EngineKey &ek) const;
......
......@@ -4232,6 +4232,10 @@ ViewerSubject::DeleteDatabaseCorrelation()
// Made it re-use command line arguments if we had some, as long as
// we were in nowin mode and no explicit arguments were given.
//
// Brad Whitlock, Wed Apr 13 14:58:21 PST 2005
// I made it issue a warning message if a compute engine is already
// running on the desired host.
//
// ****************************************************************************
void
......@@ -4249,18 +4253,32 @@ ViewerSubject::OpenComputeEngine()
bool givenOptions = (options.size() > 0);
bool givenCLArgs = (engineParallelArguments.size() > 0);
if (givenOptions)
ViewerEngineManager::Instance()->CreateEngine(EngineKey(hostName,""),
EngineKey key(hostName, "");
if(ViewerEngineManager::Instance()->EngineExists(key))
{
string msg("VisIt did not open a new compute engine host ");
msg += hostName;
msg += " because a compute engine is already running there.";
Warning(msg.c_str());
}
else if (givenOptions)
{
ViewerEngineManager::Instance()->CreateEngine(key,
options, true,
numEngineRestarts);
}
else if (nowin && givenCLArgs)
ViewerEngineManager::Instance()->CreateEngine(EngineKey(hostName,""),
{
ViewerEngineManager::Instance()->CreateEngine(key,
engineParallelArguments,
true, numEngineRestarts);
}
else
ViewerEngineManager::Instance()->CreateEngine(EngineKey(hostName,""),
{
ViewerEngineManager::Instance()->CreateEngine(key,
options, false,
numEngineRestarts);
}
}
// ****************************************************************************
......
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