lavavu 1.8.60__tar.gz → 1.8.62__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {lavavu-1.8.60/lavavu.egg-info → lavavu-1.8.62}/PKG-INFO +1 -1
- {lavavu-1.8.60 → lavavu-1.8.62}/README.md +1 -1
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/LavaVuPython.py +1 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/dict.json +1 -1
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/html/webview.html +1 -1
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/lavavu.py +22 -0
- {lavavu-1.8.60 → lavavu-1.8.62/lavavu.egg-info}/PKG-INFO +1 -1
- {lavavu-1.8.60 → lavavu-1.8.62}/setup.py +1 -1
- {lavavu-1.8.60 → lavavu-1.8.62}/src/DrawingObject.cpp +3 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Geometry.cpp +25 -5
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Geometry.h +3 -1
- {lavavu-1.8.60 → lavavu-1.8.62}/src/GraphicsUtil.cpp +2 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/LavaVu.cpp +28 -6
- {lavavu-1.8.60 → lavavu-1.8.62}/src/LavaVu.h +1 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/LavaVuPython_wrap.cxx +79 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Model.cpp +22 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Model.h +1 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Session.cpp +3 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Session.h +5 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/View.cpp +12 -1
- lavavu-1.8.62/src/version.cpp +2 -0
- lavavu-1.8.60/src/version.cpp +0 -2
- {lavavu-1.8.60 → lavavu-1.8.62}/LICENSE.md +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/MANIFEST.in +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/Makefile +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/__init__.py +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/__main__.py +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/amalgamate.py +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/aserver.py +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/control.py +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/convert.py +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/font.bin +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/html/LavaVu-amalgamated.css +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/html/OK-min.js +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/html/baseviewer.js +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/html/control.css +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/html/control.js +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/html/dat-gui-light-theme.css +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/html/dat.gui.min.js +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/html/draw.js +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/html/drawbox.js +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/html/emscripten-template.js +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/html/emscripten.css +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/html/favicon.ico +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/html/gl-matrix-min.js +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/html/gui.css +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/html/menu.js +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/html/server.js +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/html/stats.min.js +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/html/styles.css +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/html/webview-template.html +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/points.py +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/server.py +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/shaders/default.frag +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/shaders/default.vert +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/shaders/fontShader.frag +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/shaders/fontShader.vert +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/shaders/lineShader.frag +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/shaders/lineShader.vert +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/shaders/pointShader.frag +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/shaders/pointShader.vert +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/shaders/triShader.frag +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/shaders/triShader.vert +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/shaders/volumeShader.frag +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/shaders/volumeShader.vert +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/tracers.py +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu/vutils.py +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu.egg-info/SOURCES.txt +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu.egg-info/dependency_links.txt +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu.egg-info/entry_points.txt +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu.egg-info/requires.txt +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/lavavu.egg-info/top_level.txt +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/pyproject.toml +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/requirements.txt +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/setup.cfg +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/ApplicationInterface.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/ColourMap.cpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/ColourMap.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Colours.cpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Colours.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Contour.cpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Contour.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/DrawingObject.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Extensions.cpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Extensions.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/FontLine.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/FontSans.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/GLUtils.cpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/GLUtils.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/GraphicsUtil.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Include.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/InputInterface.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/InteractiveViewer.cpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/IsoSurface.cpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/IsoSurface.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Lines.cpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/LinesSorted.cpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Links.cpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Main/CGLViewer.cpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Main/CGLViewer.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Main/CocoaViewer.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Main/CocoaViewer.mm +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Main/EGLViewer.cpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Main/EGLViewer.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Main/GLFWViewer.cpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Main/GLFWViewer.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Main/OSMesaViewer.cpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Main/OSMesaViewer.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Main/X11Viewer.cpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Main/X11Viewer.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Main/main.cpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/OpenGLViewer.cpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/OpenGLViewer.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/OutputInterface.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Points.cpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/QuadSurfaces.cpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/RenderContext.cpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/RenderContext.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Shaders.cpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Shaders.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Shapes.cpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/TimeStep.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Tracers.cpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/TriSurfaces.cpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Triangles.cpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Util.cpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Util.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Vectors.cpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/VideoEncoder.cpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/VideoEncoder.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/View.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/ViewerApp.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/ViewerTypes.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/Volumes.cpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/base64.cpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/base64.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/fifo_map.hpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/jpeg/jpgd.cpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/jpeg/jpgd.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/jpeg/jpge.cpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/jpeg/jpge.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/json.hpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/linalg.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/miniz/miniz.c +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/miniz/miniz.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/png/lodepng.cpp +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/png/lodepng.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/sqlite3/sqlite3.c +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/sqlite3/sqlite3.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/stb_image_resize.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/tiny_obj_loader.h +0 -0
- {lavavu-1.8.60 → lavavu-1.8.62}/src/version.h +0 -0
@@ -3,7 +3,7 @@
|
|
3
3
|
[](https://github.com/lavavu/LavaVu/actions?query=workflow:Test)
|
4
4
|
[](https://github.com/lavavu/LavaVu/actions?query=workflow:Deploy)
|
5
5
|
[](https://zenodo.org/badge/latestdoi/45163055)
|
6
|
-
[](https://mybinder.org/v2/gh/lavavu/LavaVu/1.8.
|
6
|
+
[](https://mybinder.org/v2/gh/lavavu/LavaVu/1.8.62)
|
7
7
|
|
8
8
|
A scientific visualisation tool with a python interface for fast and flexible visual analysis.
|
9
9
|
|
@@ -492,6 +492,7 @@ class LavaVu(object):
|
|
492
492
|
getTimeSteps = _swig_new_instance_method(_LavaVuPython.LavaVu_getTimeSteps)
|
493
493
|
addTimeStep = _swig_new_instance_method(_LavaVuPython.LavaVu_addTimeStep)
|
494
494
|
resetViews = _swig_new_instance_method(_LavaVuPython.LavaVu_resetViews)
|
495
|
+
addViewport = _swig_new_instance_method(_LavaVuPython.LavaVu_addViewport)
|
495
496
|
setObject = _swig_new_instance_method(_LavaVuPython.LavaVu_setObject)
|
496
497
|
createObject = _swig_new_instance_method(_LavaVuPython.LavaVu_createObject)
|
497
498
|
getObject = _swig_new_instance_method(_LavaVuPython.LavaVu_getObject)
|
@@ -27,7 +27,7 @@
|
|
27
27
|
|
28
28
|
<input id="fileinput" type="file" style="visibility:hidden" onchange="useFileInput(this)" />
|
29
29
|
|
30
|
-
<script async src="https://cdn.jsdelivr.net/gh/lavavu/lavavu.github.io@1.8.
|
30
|
+
<script async src="https://cdn.jsdelivr.net/gh/lavavu/lavavu.github.io@1.8.62/LavaVu-amalgamated.min.js"></script>
|
31
31
|
<!--script src="dat.gui.min.js"></script>
|
32
32
|
<script src="OK-min.js"></script>
|
33
33
|
|
@@ -3287,6 +3287,28 @@ class Viewer(dict):
|
|
3287
3287
|
#Return wrapper obj
|
3288
3288
|
return obj
|
3289
3289
|
|
3290
|
+
def viewport(self, x=0.0, y=0.0, width=1.0, height=1.0, replace=False, **kwargs):
|
3291
|
+
"""
|
3292
|
+
Add a viewport object
|
3293
|
+
|
3294
|
+
Parameters
|
3295
|
+
----------
|
3296
|
+
x : float
|
3297
|
+
x offset as fraction of window size [0,1]
|
3298
|
+
y : float
|
3299
|
+
y offset as fraction of window size [0,1]
|
3300
|
+
width : float
|
3301
|
+
width as fraction of window size [0,1]
|
3302
|
+
height : float
|
3303
|
+
height as fraction of window size [0,1]
|
3304
|
+
replace : bool
|
3305
|
+
Set to True to replace the active viewport instead of adding a new viewport
|
3306
|
+
|
3307
|
+
Subsequent kwargs are passed as properties dict
|
3308
|
+
"""
|
3309
|
+
#Adds a new viewport, kwargs passed to properties dict
|
3310
|
+
self.app.addViewport(x, y, width, height, replace, _convert_args(kwargs))
|
3311
|
+
|
3290
3312
|
def add(self, name=None, **kwargs):
|
3291
3313
|
"""
|
3292
3314
|
Add a visualisation object
|
@@ -233,6 +233,9 @@ TextureData* DrawingObject::useTexture(Texture_Ptr tex)
|
|
233
233
|
//printf("Load texture from cached copy on drawing object\n");
|
234
234
|
tex = texture;
|
235
235
|
}
|
236
|
+
//else if (properties.has("cubemap"))
|
237
|
+
//{
|
238
|
+
//}
|
236
239
|
else if (properties.has("texture"))
|
237
240
|
{
|
238
241
|
//printf("Load texture from property\n");
|
@@ -1400,16 +1400,34 @@ void Geometry::setState(Geom_Ptr g)
|
|
1400
1400
|
prop = it.value();
|
1401
1401
|
//std::cout << label << " ==> " << prop << std::endl;
|
1402
1402
|
|
1403
|
-
//Special case: string data -> treat as
|
1403
|
+
//Special case: string data -> treat as texture
|
1404
1404
|
if (prop.is_string())
|
1405
1405
|
{
|
1406
|
-
|
1406
|
+
std::string texfn = prop;
|
1407
|
+
//Support multiple textures, load subsequent from custom props
|
1408
|
+
if (textures.find(texfn) == textures.end())
|
1407
1409
|
{
|
1408
|
-
|
1409
|
-
|
1410
|
+
//Add a new empty texture container
|
1411
|
+
textures[texfn] = std::make_shared<ImageLoader>();
|
1412
|
+
textures[texfn]->fn = texfn;
|
1413
|
+
//std::cout << "LOADED ADDITIONAL TEX " << label << " : " << texfn << std::endl;
|
1414
|
+
|
1415
|
+
//NOTE: hasTexture() on geom objects will return False, unless the
|
1416
|
+
//drawing object has a texture set too, so need to set ["texture"] = True at least
|
1417
|
+
}
|
1418
|
+
//else
|
1419
|
+
//std::cout << "FOUND ADDITIONAL TEX " << label << " : " << textures[texfn]->empty() << std::endl;
|
1420
|
+
auto the_texture = textures[texfn];
|
1421
|
+
TextureData* texture_data = draw->useTexture(the_texture);
|
1422
|
+
if (texture_data)
|
1423
|
+
{
|
1424
|
+
if (!texture_data->unit)
|
1425
|
+
texture_data->unit = textures.size()+2; //Set the texture unit, starting from 2 (1 reserved for 3d)
|
1426
|
+
prog->setUniformi(label, texture_data->unit);
|
1427
|
+
//printf("Texture unit set %d \n", texture_data->unit);
|
1410
1428
|
}
|
1411
1429
|
else
|
1412
|
-
|
1430
|
+
printf("Texture load failed, data is NULL!\n");
|
1413
1431
|
}
|
1414
1432
|
else if (!prop.is_null())
|
1415
1433
|
{
|
@@ -1441,6 +1459,8 @@ void Geometry::setState(Geom_Ptr g)
|
|
1441
1459
|
prog->setUniformf("uOpaque", allopaque || g->opaque);
|
1442
1460
|
prog->setUniformf("uFlat", flat);
|
1443
1461
|
//std::cout << i << " OPAQUE: " << allopaque << " || " << g->opaque << std::endl;
|
1462
|
+
prog->setUniformi("uFrame", session.frame);
|
1463
|
+
prog->setUniformf("uTime", session.time);
|
1444
1464
|
|
1445
1465
|
if (texture)
|
1446
1466
|
prog->setUniform("uTexture", (int)texture->unit);
|
@@ -318,7 +318,7 @@ public:
|
|
318
318
|
unsigned int height;
|
319
319
|
unsigned int depth;
|
320
320
|
bool opaque; //Flag for opaque geometry, render first, don't depth sort
|
321
|
-
Texture_Ptr texture;
|
321
|
+
Texture_Ptr texture; //Default texture
|
322
322
|
lucGeometryType type; //Holds the object type
|
323
323
|
int step = -1; //Holds the timestep
|
324
324
|
unsigned int voffset = 0; //Vertex offset in VBO
|
@@ -556,6 +556,8 @@ protected:
|
|
556
556
|
std::vector<Geom_Ptr> records;
|
557
557
|
std::vector<Geom_Ptr> geom;
|
558
558
|
std::vector<bool> hidden;
|
559
|
+
//Additional textures (stored by filename)
|
560
|
+
std::map<std::string, Texture_Ptr> textures;
|
559
561
|
unsigned int elements;
|
560
562
|
unsigned int drawcount;
|
561
563
|
DrawingObject* cached;
|
@@ -747,11 +747,13 @@ void ImageLoader::loadPNG()
|
|
747
747
|
if (!file)
|
748
748
|
{
|
749
749
|
debug_print("Cannot open '%s'\n", fn.full.c_str());
|
750
|
+
printf("Cannot open '%s'\n", fn.full.c_str());
|
750
751
|
return;
|
751
752
|
}
|
752
753
|
newSource();
|
753
754
|
source->pixels = (GLubyte*)read_png(file, source->channels, source->width, source->height);
|
754
755
|
source->allocated = true; //Allocated by read_png()
|
756
|
+
//printf("Loaded, width %d, fn '%s'\n", source->width, fn.full.c_str());
|
755
757
|
|
756
758
|
file.close();
|
757
759
|
}
|
@@ -2455,6 +2455,8 @@ void LavaVu::display(bool redraw)
|
|
2455
2455
|
#endif
|
2456
2456
|
{
|
2457
2457
|
//Loop through all viewports and display each
|
2458
|
+
//TODO: Using > 1 viewport KILLS the framerate < 10%
|
2459
|
+
//Biggest drop is (a) reload, second is (b) viewSelect
|
2458
2460
|
int selview = view;
|
2459
2461
|
for (unsigned int v=0; v<amodel->views.size(); v++)
|
2460
2462
|
{
|
@@ -2462,23 +2464,32 @@ void LavaVu::display(bool redraw)
|
|
2462
2464
|
GL_Error_Check;
|
2463
2465
|
|
2464
2466
|
//Require reload of object data for multiple viewports
|
2465
|
-
|
2466
|
-
|
2467
|
+
//Only seems to be required for old databases, see: uw1-viewports test
|
2468
|
+
//if (!viewer->visible && amodel->views.size() > 1)
|
2469
|
+
if (amodel->views.size() > 1 && !aview->is3d)
|
2470
|
+
{
|
2471
|
+
//amodel->reload(); //(a)
|
2472
|
+
//Flag redraw on all objects in passed viewport
|
2473
|
+
for (unsigned int i=0; i < aview->objects.size(); i++)
|
2474
|
+
amodel->reloadRedraw(aview->objects[i], true);
|
2475
|
+
}
|
2467
2476
|
|
2468
2477
|
// Default non-stereo render
|
2469
2478
|
aview->projection(EYE_CENTRE);
|
2470
|
-
drawSceneBlended(
|
2479
|
+
drawSceneBlended();
|
2471
2480
|
}
|
2472
2481
|
|
2473
2482
|
if (view != selview)
|
2474
|
-
|
2483
|
+
viewSelect(selview); //(b)
|
2475
2484
|
}
|
2476
2485
|
|
2486
|
+
auto now = std::chrono::system_clock::now();
|
2487
|
+
std::chrono::duration<float> diff = now-frametime;
|
2488
|
+
session.frame++;
|
2489
|
+
|
2477
2490
|
//Calculate FPS
|
2478
2491
|
if (session.global("fps"))
|
2479
2492
|
{
|
2480
|
-
auto now = std::chrono::system_clock::now();
|
2481
|
-
std::chrono::duration<float> diff = now-frametime;
|
2482
2493
|
framecount++;
|
2483
2494
|
if (diff.count() > 1.0f)
|
2484
2495
|
{
|
@@ -2491,6 +2502,10 @@ void LavaVu::display(bool redraw)
|
|
2491
2502
|
displayText(ss.str(), 1);
|
2492
2503
|
}
|
2493
2504
|
|
2505
|
+
//Get current time since started
|
2506
|
+
diff = now-session.start;
|
2507
|
+
session.time = (float)diff.count();
|
2508
|
+
|
2494
2509
|
if ((viewer->visible && !viewer->imagemode) || message[0] == ':')
|
2495
2510
|
{
|
2496
2511
|
//Print current info message (displayed for one frame only)
|
@@ -3626,6 +3641,13 @@ void LavaVu::addTimeStep(int step, std::string properties)
|
|
3626
3641
|
amodel->setTimeStep(step);
|
3627
3642
|
}
|
3628
3643
|
|
3644
|
+
void LavaVu::addViewport(float x, float y, float w, float h, bool replace, std::string properties)
|
3645
|
+
{
|
3646
|
+
if (!amodel) return;
|
3647
|
+
amodel->addViewport(x, y, w, h, replace, properties);
|
3648
|
+
viewSelect(amodel->views.size()-1);
|
3649
|
+
}
|
3650
|
+
|
3629
3651
|
void LavaVu::setObject(DrawingObject* target, std::string properties)
|
3630
3652
|
{
|
3631
3653
|
if (!amodel || !target) return;
|
@@ -236,6 +236,7 @@ public:
|
|
236
236
|
std::string getState();
|
237
237
|
std::string getTimeSteps();
|
238
238
|
void addTimeStep(int step, std::string properties="");
|
239
|
+
void addViewport(float x, float y, float w, float h, bool replace, std::string properties);
|
239
240
|
|
240
241
|
void setObject(DrawingObject* target, std::string properties);
|
241
242
|
DrawingObject* createObject(std::string properties);
|
@@ -24304,6 +24304,83 @@ fail:
|
|
24304
24304
|
}
|
24305
24305
|
|
24306
24306
|
|
24307
|
+
SWIGINTERN PyObject *_wrap_LavaVu_addViewport(PyObject *self, PyObject *args) {
|
24308
|
+
PyObject *resultobj = 0;
|
24309
|
+
LavaVu *arg1 = (LavaVu *) 0 ;
|
24310
|
+
float arg2 ;
|
24311
|
+
float arg3 ;
|
24312
|
+
float arg4 ;
|
24313
|
+
float arg5 ;
|
24314
|
+
bool arg6 ;
|
24315
|
+
std::string arg7 ;
|
24316
|
+
void *argp1 = 0 ;
|
24317
|
+
int res1 = 0 ;
|
24318
|
+
float val2 ;
|
24319
|
+
int ecode2 = 0 ;
|
24320
|
+
float val3 ;
|
24321
|
+
int ecode3 = 0 ;
|
24322
|
+
float val4 ;
|
24323
|
+
int ecode4 = 0 ;
|
24324
|
+
float val5 ;
|
24325
|
+
int ecode5 = 0 ;
|
24326
|
+
bool val6 ;
|
24327
|
+
int ecode6 = 0 ;
|
24328
|
+
PyObject *swig_obj[7] ;
|
24329
|
+
|
24330
|
+
if (!SWIG_Python_UnpackTuple(args, "LavaVu_addViewport", 7, 7, swig_obj)) SWIG_fail;
|
24331
|
+
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_LavaVu, 0 | 0 );
|
24332
|
+
if (!SWIG_IsOK(res1)) {
|
24333
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LavaVu_addViewport" "', argument " "1"" of type '" "LavaVu *""'");
|
24334
|
+
}
|
24335
|
+
arg1 = reinterpret_cast< LavaVu * >(argp1);
|
24336
|
+
ecode2 = SWIG_AsVal_float(swig_obj[1], &val2);
|
24337
|
+
if (!SWIG_IsOK(ecode2)) {
|
24338
|
+
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LavaVu_addViewport" "', argument " "2"" of type '" "float""'");
|
24339
|
+
}
|
24340
|
+
arg2 = static_cast< float >(val2);
|
24341
|
+
ecode3 = SWIG_AsVal_float(swig_obj[2], &val3);
|
24342
|
+
if (!SWIG_IsOK(ecode3)) {
|
24343
|
+
SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "LavaVu_addViewport" "', argument " "3"" of type '" "float""'");
|
24344
|
+
}
|
24345
|
+
arg3 = static_cast< float >(val3);
|
24346
|
+
ecode4 = SWIG_AsVal_float(swig_obj[3], &val4);
|
24347
|
+
if (!SWIG_IsOK(ecode4)) {
|
24348
|
+
SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "LavaVu_addViewport" "', argument " "4"" of type '" "float""'");
|
24349
|
+
}
|
24350
|
+
arg4 = static_cast< float >(val4);
|
24351
|
+
ecode5 = SWIG_AsVal_float(swig_obj[4], &val5);
|
24352
|
+
if (!SWIG_IsOK(ecode5)) {
|
24353
|
+
SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "LavaVu_addViewport" "', argument " "5"" of type '" "float""'");
|
24354
|
+
}
|
24355
|
+
arg5 = static_cast< float >(val5);
|
24356
|
+
ecode6 = SWIG_AsVal_bool(swig_obj[5], &val6);
|
24357
|
+
if (!SWIG_IsOK(ecode6)) {
|
24358
|
+
SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "LavaVu_addViewport" "', argument " "6"" of type '" "bool""'");
|
24359
|
+
}
|
24360
|
+
arg6 = static_cast< bool >(val6);
|
24361
|
+
{
|
24362
|
+
std::string *ptr = (std::string *)0;
|
24363
|
+
int res = SWIG_AsPtr_std_string(swig_obj[6], &ptr);
|
24364
|
+
if (!SWIG_IsOK(res) || !ptr) {
|
24365
|
+
SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "LavaVu_addViewport" "', argument " "7"" of type '" "std::string""'");
|
24366
|
+
}
|
24367
|
+
arg7 = *ptr;
|
24368
|
+
if (SWIG_IsNewObj(res)) delete ptr;
|
24369
|
+
}
|
24370
|
+
{
|
24371
|
+
try {
|
24372
|
+
(arg1)->addViewport(arg2,arg3,arg4,arg5,arg6,arg7);
|
24373
|
+
} catch (const std::runtime_error& e) {
|
24374
|
+
SWIG_exception(SWIG_RuntimeError, e.what());
|
24375
|
+
}
|
24376
|
+
}
|
24377
|
+
resultobj = SWIG_Py_Void();
|
24378
|
+
return resultobj;
|
24379
|
+
fail:
|
24380
|
+
return NULL;
|
24381
|
+
}
|
24382
|
+
|
24383
|
+
|
24307
24384
|
SWIGINTERN PyObject *_wrap_LavaVu_setObject(PyObject *self, PyObject *args) {
|
24308
24385
|
PyObject *resultobj = 0;
|
24309
24386
|
LavaVu *arg1 = (LavaVu *) 0 ;
|
@@ -31476,6 +31553,7 @@ static PyMethodDef SwigMethods[] = {
|
|
31476
31553
|
{ "LavaVu_getTimeSteps", _wrap_LavaVu_getTimeSteps, METH_O, NULL},
|
31477
31554
|
{ "LavaVu_addTimeStep", _wrap_LavaVu_addTimeStep, METH_VARARGS, NULL},
|
31478
31555
|
{ "LavaVu_resetViews", _wrap_LavaVu_resetViews, METH_VARARGS, NULL},
|
31556
|
+
{ "LavaVu_addViewport", _wrap_LavaVu_addViewport, METH_VARARGS, NULL},
|
31479
31557
|
{ "LavaVu_setObject", _wrap_LavaVu_setObject, METH_VARARGS, NULL},
|
31480
31558
|
{ "LavaVu_createObject", _wrap_LavaVu_createObject, METH_VARARGS, NULL},
|
31481
31559
|
{ "LavaVu_getObject", _wrap_LavaVu_getObject, METH_VARARGS, NULL},
|
@@ -31879,6 +31957,7 @@ static PyMethodDef SwigMethods_proxydocs[] = {
|
|
31879
31957
|
{ "LavaVu_getTimeSteps", _wrap_LavaVu_getTimeSteps, METH_O, NULL},
|
31880
31958
|
{ "LavaVu_addTimeStep", _wrap_LavaVu_addTimeStep, METH_VARARGS, NULL},
|
31881
31959
|
{ "LavaVu_resetViews", _wrap_LavaVu_resetViews, METH_VARARGS, NULL},
|
31960
|
+
{ "LavaVu_addViewport", _wrap_LavaVu_addViewport, METH_VARARGS, NULL},
|
31882
31961
|
{ "LavaVu_setObject", _wrap_LavaVu_setObject, METH_VARARGS, NULL},
|
31883
31962
|
{ "LavaVu_createObject", _wrap_LavaVu_createObject, METH_VARARGS, NULL},
|
31884
31963
|
{ "LavaVu_getObject", _wrap_LavaVu_getObject, METH_VARARGS, NULL},
|
@@ -498,6 +498,21 @@ int Model::addFigure(std::string name, const std::string& state)
|
|
498
498
|
return figures.size()-1;
|
499
499
|
}
|
500
500
|
|
501
|
+
void Model::addViewport(float x, float y, float w, float h, bool replace, std::string properties)
|
502
|
+
{
|
503
|
+
//Create the view object and add to list
|
504
|
+
View* v = views.back();
|
505
|
+
if (!replace)
|
506
|
+
{
|
507
|
+
v = new View(session, x, y);
|
508
|
+
views.push_back(v);
|
509
|
+
}
|
510
|
+
v->w = w;
|
511
|
+
v->h = h;
|
512
|
+
session.parseSet(v->properties, properties);
|
513
|
+
debug_print("-- Viewport created at %f,%f %f x %f\n", v->x, v->y, v->w, v->h);
|
514
|
+
}
|
515
|
+
|
501
516
|
void Model::addObject(DrawingObject* obj)
|
502
517
|
{
|
503
518
|
//Check for duplicate names / objects
|
@@ -1992,6 +2007,13 @@ void Model::writeGeometry(Database& outdb, Geometry* g, DrawingObject* obj, int
|
|
1992
2007
|
if (infostream) std::cerr << step << "] Writing geometry (type[" << data_type << "] * " << block->size()
|
1993
2008
|
<< ") for object : " << obj->dbid << " => " << obj->name() << std::endl;
|
1994
2009
|
writeGeometryRecord(outdb, g->type, (lucGeometryDataType)data_type, obj->dbid, data[i], block.get(), step);
|
2010
|
+
|
2011
|
+
/*/TODO: Has texture? write as values/rgba?
|
2012
|
+
//if (g->hasTexture()
|
2013
|
+
if (g->texture->loaded)
|
2014
|
+
{
|
2015
|
+
|
2016
|
+
}*/
|
1995
2017
|
}
|
1996
2018
|
for (unsigned int j=0; j<data[i]->values.size(); j++)
|
1997
2019
|
{
|
@@ -143,6 +143,7 @@ public:
|
|
143
143
|
bool loadFigure(int fig, bool preserveGlobals=false);
|
144
144
|
void storeFigure();
|
145
145
|
int addFigure(std::string name="", const std::string& state="");
|
146
|
+
void addViewport(float x, float y, float w, float h, bool replace, std::string properties);
|
146
147
|
void addObject(DrawingObject* obj);
|
147
148
|
ColourMap* addColourMap(std::string name="", std::string colours="", std::string properties="");
|
148
149
|
void updateColourMap(ColourMap* colourMap, std::string colours="", std::string properties="");
|
@@ -9,6 +9,9 @@ Session::Session() : shaders(), eng0(std::random_device()()), eng1(0), dist(0, 1
|
|
9
9
|
// Saves arrays of x,y points on circle for set segment count
|
10
10
|
x_coords = NULL;
|
11
11
|
y_coords = NULL;
|
12
|
+
frame = 0;
|
13
|
+
time = 0.0;
|
14
|
+
start = std::chrono::system_clock::now();
|
12
15
|
}
|
13
16
|
|
14
17
|
Session::~Session()
|
@@ -33,6 +33,11 @@ public:
|
|
33
33
|
std::vector<TimeStep*> timesteps; //Active model timesteps
|
34
34
|
int gap;
|
35
35
|
|
36
|
+
//Animation
|
37
|
+
int frame;
|
38
|
+
std::chrono::time_point<std::chrono::system_clock> start;
|
39
|
+
float time;
|
40
|
+
|
36
41
|
//Geometry
|
37
42
|
float min[3], max[3], dims[3];
|
38
43
|
float *x_coords, *y_coords; // Saves arrays of x,y points on circle for set segment count
|
@@ -1182,7 +1182,18 @@ void View::drawOverlay()
|
|
1182
1182
|
Colour colour = session.fonts.setFont(properties, adjust);
|
1183
1183
|
if (colour.a == 0.0) colour = textColour; //Use the user defined font colour if valid, otherwise default print colour
|
1184
1184
|
session.fonts.colour = colour;
|
1185
|
-
|
1185
|
+
//Left justify
|
1186
|
+
if (title.at(0) == '-')
|
1187
|
+
session.fonts.print(session.fonts.printWidth("I"),
|
1188
|
+
h - 3 - session.fonts.printWidth("W"), title.c_str()+1);
|
1189
|
+
//Right justify
|
1190
|
+
else if (title.at(0) == '+')
|
1191
|
+
session.fonts.print(w - session.fonts.printWidth(title.c_str()),
|
1192
|
+
h - 3 - session.fonts.printWidth("W"), title.c_str()+1);
|
1193
|
+
//Centred
|
1194
|
+
else
|
1195
|
+
session.fonts.print(0.5 * (w - session.fonts.printWidth(title.c_str())),
|
1196
|
+
h - 3 - session.fonts.printWidth("W"), title.c_str());
|
1186
1197
|
}
|
1187
1198
|
|
1188
1199
|
GL_Error_Check;
|
lavavu-1.8.60/src/version.cpp
DELETED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|