Skip to content

Commit

Permalink
Merge branch 'release-0.7' into devel
Browse files Browse the repository at this point in the history
  • Loading branch information
ingowald committed Jan 5, 2015
2 parents 7935b7e + b46a837 commit 42d8f35
Show file tree
Hide file tree
Showing 13 changed files with 611 additions and 617 deletions.
10 changes: 5 additions & 5 deletions apps/common/widgets/glut3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,9 @@ namespace ospray {
if (!dumpFileRoot)
dumpFileRoot = getenv("OSPRAY_SCREEN_DUMP_ROOT");
if (!dumpFileRoot) {
mkstemp(tmpFileName);
mkstemp(tmpFileName);
dumpFileRoot = tmpFileName;
}
}

char fileName[100000];
sprintf(fileName,"%s_%08ld.ppm",dumpFileRoot,times(NULL));
Expand Down Expand Up @@ -713,14 +713,14 @@ namespace ospray {
if (animating) {
dumpScreensDuringAnimation = !dumpScreensDuringAnimation;
} else {
char tmpFileName[] = "/tmp/ospray_screen_dump_file.XXXXXXXX";
char tmpFileName[] = "/tmp/ospray_screen_dump_file.XXXXXXXX";
static const char *dumpFileRoot;
if (!dumpFileRoot)
dumpFileRoot = getenv("OSPRAY_SCREEN_DUMP_ROOT");
if (!dumpFileRoot) {
mkstemp(tmpFileName);
mkstemp(tmpFileName);
dumpFileRoot = tmpFileName;
}
}
char fileName[100000];
static int frameDumpSequenceID = 0;
sprintf(fileName,"%s_%05d.ppm",dumpFileRoot,frameDumpSequenceID++);
Expand Down
56 changes: 28 additions & 28 deletions apps/modelViewer/modelViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,23 +213,23 @@ namespace ospray {
virtual void specialkey(int32 key, const vec2f where)
{
switch(key) {
case GLUT_KEY_PAGE_UP:
g_near_clip += 10.f * motionSpeed;
ospSet1f(renderer, "near_clip", g_near_clip);
ospCommit(renderer);
ospFrameBufferClear(fb,OSP_FB_ACCUM);
forceRedraw();
break;
case GLUT_KEY_PAGE_DOWN:
g_near_clip -= 10.f * motionSpeed;
g_near_clip = std::max(g_near_clip, 1e-6f);
ospSet1f(renderer, "near_clip", g_near_clip);
ospCommit(renderer);
ospFrameBufferClear(fb,OSP_FB_ACCUM);
forceRedraw();
break;
default:
Glut3DWidget::keypress(key,where);
case GLUT_KEY_PAGE_UP:
g_near_clip += 10.f * motionSpeed;
ospSet1f(renderer, "near_clip", g_near_clip);
ospCommit(renderer);
ospFrameBufferClear(fb,OSP_FB_ACCUM);
forceRedraw();
break;
case GLUT_KEY_PAGE_DOWN:
g_near_clip -= 10.f * motionSpeed;
g_near_clip = std::max(g_near_clip, 1e-6f);
ospSet1f(renderer, "near_clip", g_near_clip);
ospCommit(renderer);
ospFrameBufferClear(fb,OSP_FB_ACCUM);
forceRedraw();
break;
default:
Glut3DWidget::keypress(key,where);
}
}

Expand All @@ -247,7 +247,7 @@ namespace ospray {
viewPort.at = p;
//viewPort.from += offset;
viewPort.modified = true;
computeFrame();
computeFrame();
accumID = 0;
ospFrameBufferClear(fb,OSP_FB_ACCUM);
//((glut3D::InspectCenter*)inspectCenterManipulator)->pivot = p;
Expand Down Expand Up @@ -311,15 +311,15 @@ namespace ospray {
++accumID;

if (showDepthBuffer) {
depthFB = (float *) ospMapFrameBuffer(fb, OSP_FB_DEPTH);
frameBufferMode = Glut3DWidget::FRAMEBUFFER_DEPTH;
Glut3DWidget::display();
ospUnmapFrameBuffer(depthFB,fb);
depthFB = (float *) ospMapFrameBuffer(fb, OSP_FB_DEPTH);
frameBufferMode = Glut3DWidget::FRAMEBUFFER_DEPTH;
Glut3DWidget::display();
ospUnmapFrameBuffer(depthFB,fb);
} else {
ucharFB = (uint32 *) ospMapFrameBuffer(fb, OSP_FB_COLOR);
frameBufferMode = Glut3DWidget::FRAMEBUFFER_UCHAR;
Glut3DWidget::display();
ospUnmapFrameBuffer(ucharFB,fb);
ucharFB = (uint32 *) ospMapFrameBuffer(fb, OSP_FB_COLOR);
frameBufferMode = Glut3DWidget::FRAMEBUFFER_UCHAR;
Glut3DWidget::display();
ospUnmapFrameBuffer(ucharFB,fb);
}
// frameBufferMode = g_frameBufferMode;
// switch(frameBufferMode) {
Expand Down Expand Up @@ -694,7 +694,7 @@ namespace ospray {
// add color array to mesh
if (!msgMesh->color.empty()) {
OSPData color = ospNewData(msgMesh->color.size(),OSP_FLOAT3A,
&msgMesh->color[0],OSP_DATA_SHARED_BUFFER);
&msgMesh->color[0],OSP_DATA_SHARED_BUFFER);
assert(msgMesh->color.size() > 0);
ospSetData(ospMesh,"vertex.color",color);
} else {
Expand Down Expand Up @@ -726,7 +726,7 @@ namespace ospray {
materialList.push_back(createMaterial(ospRenderer, msgMesh->materialList[i].ptr));

for (miniSG::Material::ParamMap::const_iterator it = msgMesh->materialList[i]->params.begin();
it != msgMesh->materialList[i]->params.end(); it++) {
it != msgMesh->materialList[i]->params.end(); it++) {
const char *name = it->first.c_str();
const miniSG::Material::Param *p = it->second.ptr;
if(p->type == miniSG::Material::Param::TEXTURE) {
Expand Down
108 changes: 54 additions & 54 deletions apps/streamLineViewer/StreamLineViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,66 +281,66 @@ namespace ospray {
}
}

void exportOSX(const char *fn,StreamLines *streamLines, Triangles *triangles)
void exportOSX(const char *fn,StreamLines *streamLines, Triangles *triangles)
{
FILE *file = fopen(fn,"w");
fprintf(file,"<?xml version=\"1.0\"?>\n\n");
fprintf(file,"<OSPRay>\n");
{
FILE *file = fopen(fn,"w");
fprintf(file,"<?xml version=\"1.0\"?>\n\n");
fprintf(file,"<OSPRay>\n");
fprintf(file,"<Model>\n");
{
fprintf(file,"<Model>\n");
fprintf(file,"<StreamLines>\n");
{
fprintf(file,"<StreamLines>\n");
{
fprintf(file,"<vertex>\n");
for (int i=0;i<streamLines->vertex.size();i++)
fprintf(file,"%f %f %f\n",
streamLines->vertex[i].x,
streamLines->vertex[i].y,
streamLines->vertex[i].z);
fprintf(file,"</vertex>\n");

fprintf(file,"<index>\n");
for (int i=0;i<streamLines->index.size();i++)
fprintf(file,"%i ",streamLines->index[i]);
fprintf(file,"\n</index>\n");
}
fprintf(file,"</StreamLines>\n");


fprintf(file,"<TriangleMesh>\n");
{
fprintf(file,"<vertex>\n");
for (int i=0;i<triangles->vertex.size();i++)
fprintf(file,"%f %f %f\n",
triangles->vertex[i].x,
triangles->vertex[i].y,
triangles->vertex[i].z);
fprintf(file,"</vertex>\n");

fprintf(file,"<color>\n");
for (int i=0;i<triangles->color.size();i++)
fprintf(file,"%f %f %f\n",
triangles->color[i].x,
triangles->color[i].y,
triangles->color[i].z);
fprintf(file,"</color>\n");

fprintf(file,"<index>\n");
for (int i=0;i<triangles->index.size();i++)
fprintf(file,"%i %i %i\n",
triangles->index[i].x,
triangles->index[i].y,
triangles->index[i].z);
fprintf(file,"</index>\n");
fprintf(file,"<vertex>\n");
for (int i=0;i<streamLines->vertex.size();i++)
fprintf(file,"%f %f %f\n",
streamLines->vertex[i].x,
streamLines->vertex[i].y,
streamLines->vertex[i].z);
fprintf(file,"</vertex>\n");

fprintf(file,"<index>\n");
for (int i=0;i<streamLines->index.size();i++)
fprintf(file,"%i ",streamLines->index[i]);
fprintf(file,"\n</index>\n");
}
fprintf(file,"</StreamLines>\n");


fprintf(file,"<TriangleMesh>\n");
{
fprintf(file,"<vertex>\n");
for (int i=0;i<triangles->vertex.size();i++)
fprintf(file,"%f %f %f\n",
triangles->vertex[i].x,
triangles->vertex[i].y,
triangles->vertex[i].z);
fprintf(file,"</vertex>\n");

fprintf(file,"<color>\n");
for (int i=0;i<triangles->color.size();i++)
fprintf(file,"%f %f %f\n",
triangles->color[i].x,
triangles->color[i].y,
triangles->color[i].z);
fprintf(file,"</color>\n");

fprintf(file,"<index>\n");
for (int i=0;i<triangles->index.size();i++)
fprintf(file,"%i %i %i\n",
triangles->index[i].x,
triangles->index[i].y,
triangles->index[i].z);
fprintf(file,"</index>\n");

}
fprintf(file,"</TriangleMesh>\n");
}
fprintf(file,"</Model>\n");
fprintf(file,"</TriangleMesh>\n");
}
fprintf(file,"</OSPRay>\n");
fclose(file);
fprintf(file,"</Model>\n");
}
fprintf(file,"</OSPRay>\n");
fclose(file);
}

struct StreamLineViewer : public Glut3DWidget {
/*! construct volume from file name and dimensions \see volview_notes_on_volume_interface */
Expand Down Expand Up @@ -501,7 +501,7 @@ namespace ospray {
else
throw std::runtime_error("unknown file format "+fn.str());
} else if (arg == "--module") {
ospLoadModule(av[++i]);
ospLoadModule(av[++i]);
} else if (arg == "--renderer") {
rendererType = av[++i];
} else if (arg == "--radius") {
Expand Down
10 changes: 5 additions & 5 deletions ospray/api/API.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ namespace ospray {
#if OSPRAY_MPI
std::cout << "#osp: launching ospray mpi ring - make sure that mpd is running" << std::endl;
ospray::api::Device::current
= mpi::createMPI_LaunchWorkerGroup(_ac,_av,OSP_MPI_LAUNCH_FROM_ENV);
= mpi::createMPI_LaunchWorkerGroup(_ac,_av,OSP_MPI_LAUNCH_FROM_ENV);
#else
throw std::runtime_error("OSPRay MPI support not compiled in");
#endif
Expand Down Expand Up @@ -336,10 +336,10 @@ namespace ospray {
}

extern "C" OSPTexture2D ospNewTexture2D(int width,
int height,
OSPDataType type,
void *data = NULL,
int flags = 0)
int height,
OSPDataType type,
void *data = NULL,
int flags = 0)
{
ASSERT_DEVICE();
Assert2(width > 0, "Width must be greater than 0 in ospNewTexture2D");
Expand Down
7 changes: 4 additions & 3 deletions ospray/api/LocalDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ namespace ospray {
embreeConfig << " threads=1,verbose=2";
rtcInit(embreeConfig.str().c_str());

if (rtcGetError() != RTC_NO_ERROR) {
RTCError erc = rtcGetError();
if (erc != RTC_NO_ERROR) {
// why did the error function not get called !?
std::cerr << "#osp:init: embree internal error number " << (int)rtcGetError() << std::endl;
assert(rtcGetError() == RTC_NO_ERROR);
std::cerr << "#osp:init: embree internal error number " << (int)erc << std::endl;
assert(erc == RTC_NO_ERROR);
}
TiledLoadBalancer::instance = new LocalTiledLoadBalancer;
}
Expand Down
Loading

0 comments on commit 42d8f35

Please sign in to comment.