Skip to content

Commit 433a6c6

Browse files
committed
Merge branch 'master' of github.com:ComputationalRadiationPhysics/isaac
2 parents e570ba5 + 69d013d commit 433a6c6

File tree

11 files changed

+188
-68
lines changed

11 files changed

+188
-68
lines changed

client/interface.htm

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,8 +697,11 @@ <h3 id="isaac_name"></h3>
697697
var row = metadata_table.insertRow(-1);
698698
var cell = row.insertCell(-1);
699699
cell.innerHTML += "<b>" + element + "</b>";
700-
cell = row.insertCell(-1);
701-
cell.innerHTML += metadata[element];
700+
cell = row.insertCell(-1);
701+
var cell_string = String(metadata[element]);
702+
if (cell_string.length > 50)
703+
cell_string = cell_string.substring(0,50) + "...";
704+
cell.innerHTML += cell_string;
702705
}
703706
}
704707

example/example.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ int main(int argc, char **argv)
160160
srand(time(NULL));
161161
id = rand() % 1000000;
162162
}
163-
MPI_Bcast(&id,sizeof(id), MPI_INT, 0, MPI_COMM_WORLD);
163+
MPI_Bcast(&id,1, MPI_INT, 0, MPI_COMM_WORLD);
164164
char name[32];
165165
sprintf(name,"Example_%i",id);
166166
printf("Using name %s\n",name);
@@ -309,6 +309,7 @@ int main(int argc, char **argv)
309309

310310
#if (ISAAC_STEREO == 0)
311311
isaac::DefaultController,
312+
//isaac::OrthoController,
312313
isaac::DefaultCompositor
313314
#else
314315
isaac::StereoController,

lib/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,15 @@ configure_file (
66
"${PROJECT_BINARY_DIR}/ISAACConfigVersion.cmake"
77
@ONLY
88
)
9+
configure_file (
10+
"${PROJECT_SOURCE_DIR}/ISAACBaseDir.cmake.in"
11+
"${PROJECT_BINARY_DIR}/ISAACBaseDir.cmake"
12+
@ONLY
13+
)
914

1015
install( FILES "${CMAKE_CURRENT_SOURCE_DIR}/isaac.hpp" DESTINATION "include" )
1116
install( DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/isaac" DESTINATION "include" PATTERN "mainpage.dox" EXCLUDE )
1217
install( FILES "${CMAKE_CURRENT_SOURCE_DIR}/ISAACConfig.cmake" DESTINATION "lib/cmake/ISAAC" )
1318
install( FILES "${PROJECT_BINARY_DIR}/ISAACConfigVersion.cmake" DESTINATION "lib/cmake/ISAAC" )
19+
install( FILES "${PROJECT_BINARY_DIR}/ISAACBaseDir.cmake" DESTINATION "lib/cmake/ISAAC" )
20+
install( DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../Modules" DESTINATION "lib/cmake/ISAAC")

lib/ISAACBaseDir.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
###############################################################################
2+
# INCLUDES
3+
###############################################################################
4+
set(ISAAC_INCLUDE_DIRS ${ISAAC_INCLUDE_DIRS} "${ISAAC_DIR}")
5+
set(ISAAC_INCLUDE_DIRS ${ISAAC_INCLUDE_DIRS} "${ISAAC_DIR}/isaac")
6+
7+
###############################################################################
8+
# MODULES
9+
###############################################################################
10+
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${ISAAC_DIR}/../Modules")

lib/ISAACBaseDir.cmake.in

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
###############################################################################
2+
# INCLUDES
3+
###############################################################################
4+
set(ISAAC_INCLUDE_DIRS ${ISAAC_INCLUDE_DIRS} "@CMAKE_INSTALL_PREFIX@/include")
5+
set(ISAAC_INCLUDE_DIRS ${ISAAC_INCLUDE_DIRS} "@CMAKE_INSTALL_PREFIX@/include/isaac")
6+
7+
###############################################################################
8+
# MODULES
9+
###############################################################################
10+
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/Modules")

lib/ISAACConfig.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,7 @@
1919
cmake_minimum_required (VERSION 3.3.0)
2020
cmake_policy(SET CMP0048 OLD)
2121

22-
set(ISAAC_INCLUDE_DIRS ${ISAAC_INCLUDE_DIRS} "${ISAAC_DIR}")
23-
set(ISAAC_INCLUDE_DIRS ${ISAAC_INCLUDE_DIRS} "${ISAAC_DIR}/isaac")
24-
25-
###############################################################################
26-
# MODULES
27-
###############################################################################
28-
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${ISAAC_DIR}/Modules")
22+
include("${CMAKE_CURRENT_LIST_DIR}/ISAACBaseDir.cmake")
2923

3024
###############################################################################
3125
# OPTIONS

lib/isaac/isaac_compositors.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ namespace isaac
2121
struct DefaultCompositor
2222
{
2323
DefaultCompositor( isaac_size2 framebuffer_size ) {}
24-
~DefaultCompositor() {}
2524
static inline isaac_size2 getCompositedbufferSize( isaac_size2 framebuffer_size )
2625
{
2726
return framebuffer_size;

lib/isaac/isaac_controllers.hpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ namespace isaac
2121
struct DefaultController
2222
{
2323
static const int pass_count = 1;
24-
DefaultController() {}
25-
~DefaultController() {}
2624
inline bool updateProjection( IceTDouble * const projection, const isaac_size2 & framebuffer_size, json_t * const message, const bool first = false)
2725
{
2826
if (first)
@@ -32,14 +30,25 @@ struct DefaultController
3230
inline void sendFeedback( json_t * const json_root, bool force = false ) {}
3331
};
3432

33+
struct OrthoController
34+
{
35+
static const int pass_count = 1;
36+
inline bool updateProjection( IceTDouble * const projection, const isaac_size2 & framebuffer_size, json_t * const message, const bool first = false)
37+
{
38+
if (first)
39+
setOrthographic( projection, (isaac_float)framebuffer_size.x/(isaac_float)framebuffer_size.y*isaac_float(2), isaac_float(2), ISAAC_Z_NEAR, ISAAC_Z_FAR);
40+
return false;
41+
}
42+
inline void sendFeedback( json_t * const json_root, bool force = false ) {}
43+
};
44+
3545
struct StereoController
3646
{
3747
static const int pass_count = 2;
3848
StereoController() :
3949
eye_distance(0.06f),
4050
send_stereo(true)
4151
{}
42-
~StereoController() {}
4352
inline bool updateProjection( IceTDouble * const projection, const isaac_size2 & framebuffer_size, json_t * const message, const bool first = false)
4453
{
4554
if ( json_t* js = json_object_get(message, "eye distance") )

lib/isaac/isaac_defines.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#endif
3939

4040
#ifndef ISAAC_GUARD_SIZE
41-
#define ISAAC_GUARD_SIZE 2
41+
#define ISAAC_GUARD_SIZE 1
4242
#endif
4343

4444
#ifndef ISAAC_DEFAULT_STEP

lib/isaac/isaac_helper.hpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ void setFrustum(IceTDouble * const projection, const isaac_float left,const isaa
276276
projection[14] = ( -znear2 * zfar ) / -zRange;
277277
projection[15] = isaac_float( 0);
278278
}
279+
279280
void setPerspective(IceTDouble * const projection, const isaac_float fovyInDegrees,const isaac_float aspectRatio,const isaac_float znear,const isaac_float zfar )
280281
{
281282
isaac_float ymax = znear * tan( fovyInDegrees * M_PI / isaac_float(360) );
@@ -294,6 +295,29 @@ void spSetPerspectiveStereoscopic( IceTDouble * const projection, const isaac_fl
294295
projection[12] += distance;
295296
}
296297

298+
299+
void setOrthographic(IceTDouble * const projection, const isaac_float right,const isaac_float top,const isaac_float znear,const isaac_float zfar )
300+
{
301+
projection[ 0] = 1.0 / right;
302+
projection[ 1] = isaac_float( 0);
303+
projection[ 2] = isaac_float( 0);
304+
projection[ 3] = isaac_float( 0);
305+
projection[ 4] = isaac_float( 0);
306+
projection[ 5] = 1.0 / top;
307+
projection[ 6] = isaac_float( 0);
308+
projection[ 7] = isaac_float( 0);
309+
projection[ 8] = isaac_float( 0);
310+
projection[ 9] = isaac_float( 0);
311+
projection[10] = -2.0 / (zfar-znear);
312+
projection[11] = isaac_float( 0);
313+
projection[12] = isaac_float( 0);
314+
projection[13] = isaac_float( 0);
315+
projection[14] = - (zfar+znear) / (zfar-znear);
316+
projection[15] = isaac_float( 1);
317+
}
318+
319+
320+
297321
#if ISAAC_VALGRIND_TWEAKS == 1
298322
static void *extra_malloc(size_t size)
299323
{

0 commit comments

Comments
 (0)