Text archives Help
- From:
- To:
- Subject: [Manta] r2373 - in trunk: Model/Materials SwigInterface scenes/csafe/python scenes/csafe/src
- Date: Wed, 4 Feb 2009 17:25:30 -0700 (MST)
Author: brownlee
Date: Wed Feb 4 17:25:23 2009
New Revision: 2373
Modified:
trunk/Model/Materials/Volume.h
trunk/SwigInterface/BackgroundFrame.py
trunk/SwigInterface/CameraFrame.py
trunk/SwigInterface/FloatSpin.py
trunk/SwigInterface/MantaCameraPath.py
trunk/SwigInterface/MantaCapture.py
trunk/scenes/csafe/python/Configuration.py
trunk/scenes/csafe/python/Histogram.py
trunk/scenes/csafe/python/SceneInfo.py
trunk/scenes/csafe/python/csafe_demo.cfg
trunk/scenes/csafe/src/CDGridSpheres.cc
trunk/scenes/csafe/src/CDTest.h
Log:
M scenes/csafe/python/SceneInfo.py
adjusting default step_size to be much smaller
M scenes/csafe/python/csafe_demo.cfg
fixing initial voluem size
M scenes/csafe/python/Histogram.py
fixing layout issues
M scenes/csafe/python/Configuration.py
fixing saving/loading nrrd files
M scenes/csafe/src/CDGridSpheres.cc
min/max computation
M scenes/csafe/src/CDTest.h
speedup for computing min/max
M SwigInterface/BackgroundFrame.py
fixing layout issue
M SwigInterface/FloatSpin.py
fixing overflow errors
M SwigInterface/CameraFrame.py
added close button
M SwigInterface/MntaCapture.py
added close button
M SwigInterface/MantaCameraPath.py
added close button
M Model/Materials/Volume.h
fixed a bug with edge fragments introduced in accidental commit a while back
Modified: trunk/Model/Materials/Volume.h
==============================================================================
--- trunk/Model/Materials/Volume.h (original)
+++ trunk/Model/Materials/Volume.h Wed Feb 4 17:25:23 2009
@@ -1072,7 +1072,7 @@
//let's trace these rays
lRays1.resize(start, i);
context.sample_generator->setupChildPacket(context, rays,
lRays1);
- //context.renderer->traceRays(context, lRays1);
+ context.renderer->traceRays(context, lRays1);
for(int k = start; k < i; k++) {
Color bgColor(RGB(0,0,0));
if (depth)
@@ -1087,7 +1087,7 @@
}
if (start >= 0) {
//let's trace just these active rays
- // lRays1.resize(start, rays.end());
+ lRays1.resize(start, rays.end());
context.sample_generator->setupChildPacket(context, rays, lRays1);
context.renderer->traceRays(context, lRays1);
Modified: trunk/SwigInterface/BackgroundFrame.py
==============================================================================
--- trunk/SwigInterface/BackgroundFrame.py (original)
+++ trunk/SwigInterface/BackgroundFrame.py Wed Feb 4 17:25:23 2009
@@ -31,12 +31,11 @@
self.engine = engine
panel = scrolled.ScrolledPanel(self, -1, style=wx.TAB_TRAVERSAL)
self.vs = vs = wx.BoxSizer(wx.VERTICAL)
- box1_title = wx.StaticBox( panel, -1, "Constant Background" )
+ box1_title = wx.StaticBox( panel, label="Constant Background" )
self.box1 = box1 = wx.StaticBoxSizer( box1_title, wx.VERTICAL )
self.constantPanel = ConstantBackgroundPanel(panel, engine)
box1.Add(self.constantPanel, 0, wx.ALIGN_CENTRE|wx.ALL, 0)
- box1.Layout()
vs.Add(box1, 0, wx.ALIGN_CENTRE|wx.ALL, 0)
hs = wx.BoxSizer(wx.HORIZONTAL)
okButton = wx.Button(panel, wx.ID_OK)
@@ -89,8 +88,12 @@
wx.Panel.__init__(self, parent, -1, (0,0))
self.engine = engine
#TODO: memory leak, need callbacks to delete old background
- self.manta_object =
manta_new(ConstantBackground(Color(RGBColor(0,0.1,0.8))))
+ self.manta_object =
manta_new(ConstantBackground(Color(RGBColor(0,0,0))))
+ sizer = wx.BoxSizer(wx.VERTICAL)
self.color1Button = csel.ColourSelect(self, -1, "Background Color")
+ sizer.Add(self.color1Button)
+ self.SetSizer(sizer)
+ self.SetAutoLayout(True)
self.color1Button.Bind(csel.EVT_COLOURSELECT, self.OnSetColor1)
def OnSetColor1(self, event):
color = event.GetValue()
Modified: trunk/SwigInterface/CameraFrame.py
==============================================================================
--- trunk/SwigInterface/CameraFrame.py (original)
+++ trunk/SwigInterface/CameraFrame.py Wed Feb 4 17:25:23 2009
@@ -87,7 +87,12 @@
self.applyButton = wx.Button(self, wx.ID_APPLY)
hsizer.Add(self.okButton, 0, wx.ALIGN_CENTER)
hsizer.Add(self.applyButton, 0, wx.ALIGN_CENTER)
+
+ closeButton = wx.Button(self, wx.ID_CLOSE)
+ hsizer.Add(closeButton, 0, wx.ALIGN_CENTER|wx.ALL, 0)
+ self.Bind(wx.EVT_BUTTON, self.OnCloseWindow, closeButton)
vsizer.Add(hsizer, 0, wx.ALIGN_CENTER);
+
self.SetSizerAndFit(vsizer);
Modified: trunk/SwigInterface/FloatSpin.py
==============================================================================
--- trunk/SwigInterface/FloatSpin.py (original)
+++ trunk/SwigInterface/FloatSpin.py Wed Feb 4 17:25:23 2009
@@ -128,6 +128,7 @@
#----------------------------------------------------------------------
import wx
+import math
# Set The Styles For The Underline wx.TextCtrl
FS_READONLY = 1
@@ -367,7 +368,13 @@
event = wx.CommandEvent(wx.wxEVT_COMMAND_SPINCTRL_UPDATED,
self.GetId())
event.SetEventObject(self)
- event.SetInt(int(self._value + 0.5))
+ value = self._value
+ # clamp to one less than int range to avoid overflows
+ if value > 2147483646:
+ value = 2147483646
+ if value < -2147483647:
+ value = -2147483647
+ event.SetInt(int(value + 0.5))
if self._textctrl:
event.SetString(self._textctrl.GetValue())
@@ -375,7 +382,7 @@
self.GetEventHandler().ProcessEvent(event)
eventOut = FloatSpinEvent(wxEVT_FLOATSPIN, self.GetId())
- eventOut.SetPosition(int(self._value + 0.5))
+ eventOut.SetPosition(int(value + 0.5))
eventOut.SetEventObject(self)
self.GetEventHandler().ProcessEvent(eventOut)
@@ -623,9 +630,12 @@
def SetIncrement(self, increment):
""" Sets The Increment For Every EVT_FLOATSPIN Event. """
-
- if increment < 1./10.0**self._digits:
- raise "\nERROR: Increment Should Be Greater Or Equal To
1/(10**digits)."
+ sci_not = abs(self._value)/pow(10.0,int(math.log(abs(self._value))))
+ print "val: " + str(self._value)
+ print "sci_not: " + str(sci_not)
+ print "check: " + str(abs(self._value)/10.0**self._digits/sci_not)
+ if increment < abs(self._value)/(10.0**self._digits)/sci_not:
+ raise "\nERROR: Increment Should Be Greater Or Equal To
value/(10**digits)."
self._increment = FixedPoint(str(increment), 20)
self.SetValue(self._value)
Modified: trunk/SwigInterface/MantaCameraPath.py
==============================================================================
--- trunk/SwigInterface/MantaCameraPath.py (original)
+++ trunk/SwigInterface/MantaCameraPath.py Wed Feb 4 17:25:23 2009
@@ -537,12 +537,21 @@
class MantaCameraPathFrame(wx.Frame):
def __init__(self, parent, engine, channel=0 ):
wx.Frame.__init__(self, parent=parent, title="Camera Paths")
-
+ panel = wx.lib.scrolledpanel.ScrolledPanel(self, -1,
style=wx.TAB_TRAVERSAL)
# Create a Capture Panel.
- self.panel = MantaCameraPathPanel( self, engine, channel )
+ sizer = wx.BoxSizer(wx.VERTICAL)
+ self.panel = MantaCameraPathPanel( panel, engine, channel )
self.statusbar = self.CreateStatusBar()
-
- self.SetClientSize(self.panel.GetSize())
+
+ sizer.Add(self.panel, 0, wx.ALIGN_CENTER|wx.ALL, 0)
+ closeButton = wx.Button(panel, wx.ID_CLOSE)
+ sizer.Add(closeButton, 0, wx.ALIGN_CENTER|wx.ALL, 0)
+ self.Bind(wx.EVT_BUTTON, self.OnCloseWindow, closeButton)
+
+ panel.SetSizer(sizer)
+ panel.Layout()
+ self.Layout()
+ self.SetClientSize(self.panel.GetSize()+(0,50))
self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
Modified: trunk/SwigInterface/MantaCapture.py
==============================================================================
--- trunk/SwigInterface/MantaCapture.py (original)
+++ trunk/SwigInterface/MantaCapture.py Wed Feb 4 17:25:23 2009
@@ -51,7 +51,7 @@
hsizer.Add( wx.StaticText(self,-1,"frames."), wx.ALIGN_CENTER )
vsizer.Add( hsizer, wx.ALIGN_CENTER );
- vsizer.Add( self.timestamp_check, wx.ALIGN_CENTER )
+ vsizer.Add( self.timestamp_check, wx.ALIGN_CENTER )
self.SetSizerAndFit(vsizer)
@@ -166,7 +166,12 @@
hsizer.Add( self.start_button, wx.ALIGN_CENTER )
hsizer.Add( self.stop_button, wx.ALIGN_CENTER )
# hsizer.Add( self.capture_button, wx.ALIGN_CENTER )
+
vsizer.Add( hsizer, 0, wx.EXPAND )
+
+ closeButton = wx.Button(panel, wx.ID_CLOSE)
+ vsizer.Add(closeButton, 0, wx.ALIGN_CENTER|wx.ALL, 0)
+ self.Bind(wx.EVT_BUTTON, self.OnCloseWindow, closeButton)
panel.SetSizerAndFit( vsizer )
Modified: trunk/scenes/csafe/python/Configuration.py
==============================================================================
--- trunk/scenes/csafe/python/Configuration.py (original)
+++ trunk/scenes/csafe/python/Configuration.py Wed Feb 4 17:25:23 2009
@@ -54,8 +54,8 @@
f.write(str(h.varIndex)+'\n')
f.write(str(h.group)+'\n')
f.write(str(h.histogram.zoomDMin)+' '+str(h.histogram.zoomDMax)+'\n')
- f.write(str(h.dataMin)+' '+str(h.dataMax)+'\n')
f.write(str(h.histogram.cropDMin)+' '+str(h.histogram.cropDMax)+'\n')
+ f.write(str(h.histogram.colorDMin)+'
'+str(h.histogram.colorDMax)+'\n')
f.write(str(h.transferFID)+'\n')
f.write('\n\n')
@@ -187,6 +187,10 @@
# else:
# scene.test.setVolCMinMax(cropColorMin, cropColorMax)
+ print "sending values: " + str(zoomIntoMin) + " " +
str(zoomIntoMax) + " " + str(cropDisplayMin) + " " + str(cropDisplayMax) + "
" + str(cropColorMin) + " " + str(cropColorMax)
+
+ histoGroup.SendValues(zoomIntoMin, zoomIntoMax, cropDisplayMin,
cropDisplayMax, cropColorMin, cropColorMax)
+
##### Eye (Camera) ####
elif lines[i].find("[Eye]") != -1:
i += 1
@@ -301,14 +305,24 @@
lines = f.readlines()
i = 0
while i in range(len(lines)-1):
- vol = lines[i].strip(); i += 1
+ sphere = ""
+ vol = ""
+ vol = lines[i].strip()
+ i += 1
while (vol == "" and i < len(lines)-1):
- vol = lines[i].strip(); i += 1
+ vol = lines[i].strip()
+ i += 1
sphere = lines[i].strip()
+ i += 1
while(sphere == "" and i < len(lines) -1):
- sphere = lines[i].strip(); i += 1
+ sphere = lines[i].strip()
+ i += 1
if (sphere == "" or vol == ""):
return
+ if (sphere[len(sphere)-1] == "w") : #raw file look for nhdr
+ sphere = sphere.strip(".raw")
+ sphere = sphere + ".nhdr"
+
print "volume file: " + str(vol) + " sphere file: " + str(sphere)
scene.nrrdFiles.append(sphere)
scene.nrrdFiles2.append(vol)
Modified: trunk/scenes/csafe/python/Histogram.py
==============================================================================
--- trunk/scenes/csafe/python/Histogram.py (original)
+++ trunk/scenes/csafe/python/Histogram.py Wed Feb 4 17:25:23 2009
@@ -926,6 +926,12 @@
floatspin.SetDigits(5)
return floatspin
+ def UpdateIncrement(self, fs):
+ val = fs.GetValue()
+ print "val: " + str(val)
+ print "updating increment to: " + str(abs(val*0.01))
+ fs.SetIncrement(abs(val*0.01))
+
def OnZoomMinFS(self, evt):
val = self.zoomMinFS.GetValue()
val2 = self.zoomMaxFS.GetValue()
@@ -933,6 +939,7 @@
val = val2
self.zoomMinFS.SetValue(val2);
self.ApplyValues()
+ self.UpdateIncrement(self.zoomMinFS)
def OnZoomMaxFS(self, evt):
val = self.zoomMaxFS.GetValue()
@@ -941,6 +948,7 @@
val = val2
self.zoomMaxFS.SetValue(val2);
self.ApplyValues()
+ self.UpdateIncrement(self.zoomMaxFS)
def OnCropMinFS(self, evt):
val = self.cropMinFS.GetValue()
@@ -949,6 +957,7 @@
val = val2
self.cropMinFS.SetValue(val2);
self.ApplyValues()
+ self.UpdateIncrement(self.cropMinFS)
def OnCropMaxFS(self, evt):
val = self.cropMaxFS.GetValue()
@@ -957,6 +966,7 @@
val = val2
self.cropMaxFS.SetValue(val2);
self.ApplyValues()
+ self.UpdateIncrement(self.cropMaxFS)
def OnColorMinFS(self, evt):
val = self.colorMinFS.GetValue()
@@ -965,6 +975,7 @@
val = val2
self.colorMinFS.SetValue(val2);
self.ApplyValues()
+ self.UpdateIncrement(self.colorMinFS)
def OnColorMaxFS(self, evt):
val = self.colorMaxFS.GetValue()
@@ -973,6 +984,7 @@
val = val2
self.colorMaxFS.SetValue(val2);
self.ApplyValues()
+ self.UpdateIncrement(self.colorMaxFS)
def OnCancel(self, evt):
self.Show( False )
Modified: trunk/scenes/csafe/python/SceneInfo.py
==============================================================================
--- trunk/scenes/csafe/python/SceneInfo.py (original)
+++ trunk/scenes/csafe/python/SceneInfo.py Wed Feb 4 17:25:23 2009
@@ -39,6 +39,6 @@
self.volumeMaxBound = [0.101, 0.201, 0.101]
self.forceDataMin = float(0) #manually set volume data range
self.forceDataMax = float(0)
- self.stepSize = float(0.0125)
+ self.stepSize = float(0.0016)
self.currentHistogram = None
Modified: trunk/scenes/csafe/python/csafe_demo.cfg
==============================================================================
--- trunk/scenes/csafe/python/csafe_demo.cfg (original)
+++ trunk/scenes/csafe/python/csafe_demo.cfg Wed Feb 4 17:25:23 2009
@@ -397,8 +397,8 @@
0.001
4
4
--0.496 -0.496 -0.496
-0.496 0.496 0.496
+-0.001 -0.101 -.001
+0.101 0.201 0.101
1
/home/sci/brownlee/Data-Explosion/vol/temp_CC_M02_0002.nrrd
1
Modified: trunk/scenes/csafe/src/CDGridSpheres.cc
==============================================================================
--- trunk/scenes/csafe/src/CDGridSpheres.cc (original)
+++ trunk/scenes/csafe/src/CDGridSpheres.cc Wed Feb 4 17:25:23 2009
@@ -96,6 +96,7 @@
#ifdef USE_FUNCTION_POINER
intersectSphere=0;
#endif
+ cout << "GridSpheres done\n";
}
CDGridSpheres::~CDGridSpheres()
Modified: trunk/scenes/csafe/src/CDTest.h
==============================================================================
--- trunk/scenes/csafe/src/CDTest.h (original)
+++ trunk/scenes/csafe/src/CDTest.h Wed Feb 4 17:25:23 2009
@@ -103,7 +103,7 @@
_sphereDMaxs = new float[16];
_minBound = volumeMinBound;
_maxBound = volumeMaxBound;
- _stepSize = 0.0125;
+ _stepSize = 0.0015;
}
~CDTest()
@@ -417,18 +417,10 @@
}
for(int j = 0; j < int(_sphereMins.size()); j++)
{
- float min = _sphereMins[j];
- float max = _sphereMaxs[j];
- float* pdata = pnrrd->getParticleData();
- for(size_t i = 0; i < pnrrd->getNParticles(); i++) {
- if (pdata[j] < min)
- min = pdata[j];
- if (pdata[j] > max)
- max = pdata[j];
- pdata += pnrrd->getNVars();
- }
- _sphereMins[j] = min;
- _sphereMaxs[j] = max;
+ float min,max;
+ grid->getMinMax(j, min, max);
+ _sphereMins[j] = Min(_sphereMins[j], min);
+ _sphereMaxs[j] = Max(_sphereMaxs[j], max);
}
//_sphereAnimation->useAccelerationStructure(grid);
numFrames1++;
- [Manta] r2373 - in trunk: Model/Materials SwigInterface scenes/csafe/python scenes/csafe/src, brownlee, 02/04/2009
Archive powered by MHonArc 2.6.16.