lavavu 1.8.75__tar.gz → 1.8.76__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.75/lavavu.egg-info → lavavu-1.8.76}/PKG-INFO +1 -1
- {lavavu-1.8.75 → lavavu-1.8.76}/README.md +1 -1
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/html/webview.html +1 -1
- {lavavu-1.8.75 → lavavu-1.8.76/lavavu.egg-info}/PKG-INFO +1 -1
- {lavavu-1.8.75 → lavavu-1.8.76}/setup.py +1 -1
- {lavavu-1.8.75 → lavavu-1.8.76}/src/DrawingObject.h +3 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Geometry.cpp +70 -24
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Geometry.h +3 -4
- {lavavu-1.8.75 → lavavu-1.8.76}/src/InteractiveViewer.cpp +2 -1
- {lavavu-1.8.75 → lavavu-1.8.76}/src/LavaVu.cpp +6 -6
- {lavavu-1.8.75 → lavavu-1.8.76}/src/LavaVu.h +3 -3
- {lavavu-1.8.75 → lavavu-1.8.76}/src/LavaVuPython_wrap.cxx +2015 -1180
- {lavavu-1.8.75 → lavavu-1.8.76}/src/VideoEncoder.cpp +5 -4
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Volumes.cpp +0 -3
- lavavu-1.8.76/src/version.cpp +2 -0
- lavavu-1.8.75/src/version.cpp +0 -2
- {lavavu-1.8.75 → lavavu-1.8.76}/LICENSE.md +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/MANIFEST.in +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/Makefile +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/dict.json +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/font.bin +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/html/LavaVu-amalgamated.css +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/html/OK-min.js +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/html/baseviewer.js +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/html/control.css +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/html/control.js +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/html/dat-gui-light-theme.css +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/html/dat.gui.min.js +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/html/draw.js +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/html/drawbox.js +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/html/emscripten-template.js +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/html/emscripten.css +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/html/favicon.ico +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/html/gl-matrix-min.js +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/html/gui.css +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/html/menu.js +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/html/server.js +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/html/stats.min.js +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/html/styles.css +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/html/webview-template.html +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/shaders/default.frag +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/shaders/default.vert +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/shaders/fontShader.frag +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/shaders/fontShader.vert +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/shaders/lineShader.frag +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/shaders/lineShader.vert +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/shaders/pointShader.frag +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/shaders/pointShader.vert +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/shaders/triShader.frag +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/shaders/triShader.vert +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/shaders/volumeShader.frag +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu/shaders/volumeShader.vert +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu.egg-info/SOURCES.txt +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu.egg-info/dependency_links.txt +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/lavavu.egg-info/top_level.txt +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/pyproject.toml +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/requirements.txt +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/setup.cfg +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/ApplicationInterface.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/ColourMap.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/ColourMap.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Colours.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Colours.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Contour.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Contour.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/DrawingObject.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Extensions.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Extensions.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/FontLine.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/FontSans.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/GLUtils.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/GLUtils.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/GraphicsUtil.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/GraphicsUtil.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Include.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/InputInterface.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/IsoSurface.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/IsoSurface.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Lines.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/LinesSorted.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Links.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Main/CGLViewer.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Main/CGLViewer.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Main/CocoaViewer.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Main/CocoaViewer.mm +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Main/EGLViewer.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Main/EGLViewer.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Main/GLFWViewer.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Main/GLFWViewer.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Main/OSMesaViewer.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Main/OSMesaViewer.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Main/X11Viewer.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Main/X11Viewer.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Main/main.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Model.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Model.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/OpenGLViewer.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/OpenGLViewer.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/OutputInterface.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Points.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/QuadSurfaces.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/RenderContext.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/RenderContext.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Session.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Session.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Shaders.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Shaders.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Shapes.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/TimeStep.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Tracers.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/TriSurfaces.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Triangles.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Util.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Util.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/Vectors.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/VideoEncoder.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/View.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/View.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/ViewerApp.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/ViewerTypes.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/base64.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/base64.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/fifo_map.hpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/jpeg/jpgd.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/jpeg/jpgd.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/jpeg/jpge.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/jpeg/jpge.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/json.hpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/linalg.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/miniz/miniz.c +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/miniz/miniz.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/png/lodepng.cpp +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/png/lodepng.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/sqlite3/sqlite3.c +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/sqlite3/sqlite3.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/stb_image_resize.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/src/tiny_obj_loader.h +0 -0
- {lavavu-1.8.75 → lavavu-1.8.76}/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.76)
|
7
7
|
|
8
8
|
A scientific visualisation tool with a python interface for fast and flexible visual analysis.
|
9
9
|
|
@@ -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.76/LavaVu-amalgamated.min.js"></script>
|
31
31
|
<!--script src="dat.gui.min.js"></script>
|
32
32
|
<script src="OK-min.js"></script>
|
33
33
|
|
@@ -73,6 +73,9 @@ public:
|
|
73
73
|
Properties properties;
|
74
74
|
//Default texture
|
75
75
|
Texture_Ptr texture;
|
76
|
+
//Additional textures (stored by label / uniform name)
|
77
|
+
std::map<std::string, Texture_Ptr> textures;
|
78
|
+
std::map<std::string, GLuint> texture_units;
|
76
79
|
|
77
80
|
DrawingObject(Session& session, std::string name="", std::string props="", unsigned int id=0);
|
78
81
|
~DrawingObject();
|
@@ -1405,24 +1405,39 @@ void Geometry::setState(Geom_Ptr g)
|
|
1405
1405
|
{
|
1406
1406
|
std::string texfn = prop;
|
1407
1407
|
//Support multiple textures, load subsequent from custom props
|
1408
|
-
if (textures.find(
|
1408
|
+
if (draw->textures.find(label) == draw->textures.end() || draw->textures[label]->fn.full != texfn)
|
1409
1409
|
{
|
1410
1410
|
//Add a new empty texture container
|
1411
|
-
textures[
|
1412
|
-
|
1411
|
+
draw->textures[label] = std::make_shared<ImageLoader>();
|
1412
|
+
//Default to the object flip setting
|
1413
|
+
bool flip = draw->properties["fliptexture"];
|
1414
|
+
//Allow override by setting "flip" or "noflip" in uniform name
|
1415
|
+
if (label.find("flip") != std::string::npos)
|
1416
|
+
{
|
1417
|
+
flip = true;
|
1418
|
+
if (label.find("noflip") != std::string::npos)
|
1419
|
+
flip = false;
|
1420
|
+
}
|
1421
|
+
draw->textures[label]->flip = flip;
|
1422
|
+
draw->textures[label]->fn = texfn;
|
1413
1423
|
//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
1424
|
}
|
1418
|
-
|
1419
|
-
|
1420
|
-
auto the_texture = textures[texfn];
|
1425
|
+
|
1426
|
+
auto the_texture = draw->textures[label];
|
1421
1427
|
TextureData* texture_data = draw->useTexture(the_texture);
|
1422
1428
|
if (texture_data)
|
1423
1429
|
{
|
1424
1430
|
if (!texture_data->unit)
|
1425
|
-
|
1431
|
+
{
|
1432
|
+
if (draw->texture_units.find(label) == draw->texture_units.end())
|
1433
|
+
{
|
1434
|
+
//Set the texture unit, starting from 2 (1 reserved for 3d)
|
1435
|
+
texture_data->unit = draw->texture_units.size()+2; //Set the texture unit, starting from 2 (1 reserved for 3d)
|
1436
|
+
draw->texture_units[label] = texture_data->unit; //Associate this texture unit with this uniform name
|
1437
|
+
}
|
1438
|
+
else
|
1439
|
+
texture_data->unit = draw->texture_units[label];
|
1440
|
+
}
|
1426
1441
|
prog->setUniformi(label, texture_data->unit);
|
1427
1442
|
//printf("Texture unit set %d \n", texture_data->unit);
|
1428
1443
|
}
|
@@ -1462,6 +1477,11 @@ void Geometry::setState(Geom_Ptr g)
|
|
1462
1477
|
prog->setUniformi("uFrame", session.frame);
|
1463
1478
|
prog->setUniformf("uTime", session.time);
|
1464
1479
|
|
1480
|
+
//Viewport size uniform
|
1481
|
+
float viewport[4];
|
1482
|
+
glGetFloatv(GL_VIEWPORT, viewport);
|
1483
|
+
prog->setUniform4f("uViewport", viewport);
|
1484
|
+
|
1465
1485
|
if (texture)
|
1466
1486
|
prog->setUniform("uTexture", (int)texture->unit);
|
1467
1487
|
|
@@ -2427,13 +2447,22 @@ void Geometry::toImage(unsigned int idx)
|
|
2427
2447
|
image.write(path);
|
2428
2448
|
}
|
2429
2449
|
|
2430
|
-
void Geometry::setTexture(DrawingObject* draw, Texture_Ptr tex)
|
2450
|
+
void Geometry::setTexture(DrawingObject* draw, Texture_Ptr tex, std::string label)
|
2431
2451
|
{
|
2432
|
-
|
2433
|
-
if (geomdata)
|
2452
|
+
if (label.length() == 0)
|
2434
2453
|
{
|
2435
|
-
|
2436
|
-
geomdata
|
2454
|
+
Geom_Ptr geomdata = getObjectStore(draw);
|
2455
|
+
if (geomdata)
|
2456
|
+
{
|
2457
|
+
//printf("(%s) Set texture on %p to %p\n", GeomData::names[type].c_str(), geomdata.get(), tex.get());
|
2458
|
+
geomdata->texture = tex;
|
2459
|
+
}
|
2460
|
+
}
|
2461
|
+
else
|
2462
|
+
{
|
2463
|
+
//Custom texture load by uniform name label
|
2464
|
+
//std::cout << "LOAD TEXTURE " << tex->fn.full << " BY LABEL " << label << " ON " << draw->name() << std::endl;
|
2465
|
+
draw->textures[label] = tex;
|
2437
2466
|
}
|
2438
2467
|
}
|
2439
2468
|
|
@@ -2449,17 +2478,34 @@ void Geometry::clearTexture(DrawingObject* draw)
|
|
2449
2478
|
geomdata->texture = std::make_shared<ImageLoader>(); //Add a new empty texture container
|
2450
2479
|
}
|
2451
2480
|
|
2452
|
-
void Geometry::loadTexture(DrawingObject* draw, GLubyte* data, GLuint width, GLuint height, GLuint channels, bool flip, int filter, bool bgr)
|
2481
|
+
void Geometry::loadTexture(DrawingObject* draw, GLubyte* data, GLuint width, GLuint height, GLuint channels, bool flip, int filter, bool bgr, std::string label)
|
2453
2482
|
{
|
2454
|
-
|
2455
|
-
if (geomdata)
|
2483
|
+
if (label.length() == 0)
|
2456
2484
|
{
|
2457
|
-
|
2458
|
-
|
2459
|
-
|
2460
|
-
|
2461
|
-
|
2462
|
-
|
2485
|
+
Geom_Ptr geomdata = getObjectStore(draw);
|
2486
|
+
if (geomdata)
|
2487
|
+
{
|
2488
|
+
//printf("(%s) Load texture on %p to %p\n", GeomData::names[type].c_str(), geomdata.get(), geomdata->texture.get());
|
2489
|
+
//std::cout << "LOAD TEXTURE " << width << " x " << height << " x " << channels << " BGR " << bgr << " ON " << draw->name() << std::endl;
|
2490
|
+
//NOTE: must only load the data here, can't make OpenGL calls as can be called async
|
2491
|
+
//
|
2492
|
+
geomdata->texture->filter = filter;
|
2493
|
+
geomdata->texture->bgr = bgr;
|
2494
|
+
geomdata->texture->loadData(data, width, height, channels, flip);
|
2495
|
+
}
|
2496
|
+
}
|
2497
|
+
else
|
2498
|
+
{
|
2499
|
+
//Custom texture load by uniform name label
|
2500
|
+
if (draw->textures.find(label) != draw->textures.end())
|
2501
|
+
{
|
2502
|
+
//std::cout << "LOAD TEXTURE BY LABEL" << label << " : " << width << " x " << height << " x " << channels << " BGR " << bgr << " ON " << draw->name() << std::endl;
|
2503
|
+
draw->textures[label]->filter = filter;
|
2504
|
+
draw->textures[label]->bgr = bgr;
|
2505
|
+
draw->textures[label]->loadData(data, width, height, channels, flip);
|
2506
|
+
}
|
2507
|
+
else
|
2508
|
+
std::cout << "LOAD TEXTURE, LABEL NOT FOUND: " << label << std::endl;
|
2463
2509
|
}
|
2464
2510
|
}
|
2465
2511
|
|
@@ -485,6 +485,7 @@ public:
|
|
485
485
|
{
|
486
486
|
if (texture->loaded || texture->source || !texture->fn.empty()) return true;
|
487
487
|
if (draw->texture) return true;
|
488
|
+
if (draw->textures.size() > 0) return true;
|
488
489
|
if (draw->properties.has("texture"))
|
489
490
|
{
|
490
491
|
std::string tex = draw->properties["texture"];
|
@@ -556,8 +557,6 @@ protected:
|
|
556
557
|
std::vector<Geom_Ptr> records;
|
557
558
|
std::vector<Geom_Ptr> geom;
|
558
559
|
std::vector<bool> hidden;
|
559
|
-
//Additional textures (stored by filename)
|
560
|
-
std::map<std::string, Texture_Ptr> textures;
|
561
560
|
unsigned int elements;
|
562
561
|
unsigned int drawcount;
|
563
562
|
DrawingObject* cached;
|
@@ -640,9 +639,9 @@ public:
|
|
640
639
|
void objectBounds(DrawingObject* draw, float* min, float* max, bool allsteps=false);
|
641
640
|
void move(Geometry* other);
|
642
641
|
void toImage(unsigned int idx);
|
643
|
-
void setTexture(DrawingObject* draw, Texture_Ptr tex);
|
642
|
+
void setTexture(DrawingObject* draw, Texture_Ptr tex, std::string label="");
|
644
643
|
void clearTexture(DrawingObject* draw);
|
645
|
-
void loadTexture(DrawingObject* draw, GLubyte* data, GLuint width, GLuint height, GLuint channels, bool flip=true, int filter=2, bool bgr=false);
|
644
|
+
void loadTexture(DrawingObject* draw, GLubyte* data, GLuint width, GLuint height, GLuint channels, bool flip=true, int filter=2, bool bgr=false, std::string label="");
|
646
645
|
Quaternion vectorRotation(Vec3d rvector);
|
647
646
|
void drawVector(DrawingObject *draw, const Vec3d& translate, const Vec3d& vector, bool scale3d, float scale, float radius0, float radius1, float head_scale, int segment_count=24, Colour* colour=NULL);
|
648
647
|
void drawTrajectory(DrawingObject *draw, float coord0[3], float coord1[3], float radius0, float radius1, float arrowHeadSize, float scale[3], float maxLength=0.f, int segment_count=24, Colour* colour=NULL);
|
@@ -585,6 +585,8 @@ bool LavaVu::parseChar(unsigned char key)
|
|
585
585
|
return parseCommands("help");
|
586
586
|
case KEY_F2:
|
587
587
|
return parseCommands("antialias");
|
588
|
+
case KEY_F3:
|
589
|
+
return parseCommands("shaders");
|
588
590
|
case KEY_TAB:
|
589
591
|
//Tab-completion from history
|
590
592
|
for (int l=history.size()-1; l>=0; l--)
|
@@ -2890,7 +2892,6 @@ bool LavaVu::parseCommand(std::string cmd, bool gethelp)
|
|
2890
2892
|
|
2891
2893
|
printMessage("Reloading shaders");
|
2892
2894
|
reloadShaders();
|
2893
|
-
return true;
|
2894
2895
|
}
|
2895
2896
|
else if (parsed.exists("blend"))
|
2896
2897
|
{
|
@@ -3639,7 +3639,7 @@ void LavaVu::clearTexture(DrawingObject* target)
|
|
3639
3639
|
std::cerr << "Container not found object:" << target->name() << std::endl;
|
3640
3640
|
}
|
3641
3641
|
|
3642
|
-
void LavaVu::setTexture(DrawingObject* target, std::string texpath, bool flip, int filter, bool bgr)
|
3642
|
+
void LavaVu::setTexture(DrawingObject* target, std::string texpath, bool flip, int filter, bool bgr, std::string label)
|
3643
3643
|
{
|
3644
3644
|
//GL_Check_Thread(viewer->render_thread);
|
3645
3645
|
if (!amodel || !target) return;
|
@@ -3649,33 +3649,33 @@ void LavaVu::setTexture(DrawingObject* target, std::string texpath, bool flip, i
|
|
3649
3649
|
Texture_Ptr texture = std::make_shared<ImageLoader>(texpath, flip);
|
3650
3650
|
texture->filter = filter;
|
3651
3651
|
texture->bgr = bgr;
|
3652
|
-
container->setTexture(target, texture);
|
3652
|
+
container->setTexture(target, texture, label);
|
3653
3653
|
reloadObject(target);
|
3654
3654
|
}
|
3655
3655
|
else
|
3656
3656
|
std::cerr << "Container not found object:" << target->name() << std::endl;
|
3657
3657
|
}
|
3658
3658
|
|
3659
|
-
void LavaVu::textureUChar(DrawingObject* target, unsigned char* array, int len, unsigned int width, unsigned int height, unsigned int channels, bool flip, int filter, bool bgr)
|
3659
|
+
void LavaVu::textureUChar(DrawingObject* target, unsigned char* array, int len, unsigned int width, unsigned int height, unsigned int channels, bool flip, int filter, bool bgr, std::string label)
|
3660
3660
|
{
|
3661
3661
|
if (!amodel || !target) return;
|
3662
3662
|
Geometry* container = amodel->lookupObjectRenderer(target);
|
3663
3663
|
if (container)
|
3664
3664
|
{
|
3665
|
-
container->loadTexture(target, array, width, height, channels, flip, filter, bgr);
|
3665
|
+
container->loadTexture(target, array, width, height, channels, flip, filter, bgr, label);
|
3666
3666
|
reloadObject(target);
|
3667
3667
|
}
|
3668
3668
|
else
|
3669
3669
|
std::cerr << "Container not found object:" << target->name() << std::endl;
|
3670
3670
|
}
|
3671
3671
|
|
3672
|
-
void LavaVu::textureUInt(DrawingObject* target, unsigned int* array, int len, unsigned int width, unsigned int height, unsigned int channels, bool flip, int filter, bool bgr)
|
3672
|
+
void LavaVu::textureUInt(DrawingObject* target, unsigned int* array, int len, unsigned int width, unsigned int height, unsigned int channels, bool flip, int filter, bool bgr, std::string label)
|
3673
3673
|
{
|
3674
3674
|
if (!amodel || !target) return;
|
3675
3675
|
Geometry* container = amodel->lookupObjectRenderer(target);
|
3676
3676
|
if (container)
|
3677
3677
|
{
|
3678
|
-
container->loadTexture(target, (GLubyte*)array, width, height, channels, flip, filter, bgr);
|
3678
|
+
container->loadTexture(target, (GLubyte*)array, width, height, channels, flip, filter, bgr, label);
|
3679
3679
|
reloadObject(target);
|
3680
3680
|
}
|
3681
3681
|
else
|
@@ -259,9 +259,9 @@ public:
|
|
259
259
|
Geom_Ptr arrayFloat(DrawingObject* target, float* array, int len, lucGeometryDataType type=lucVertexData, int width=0, int height=0, int depth=0);
|
260
260
|
Geom_Ptr arrayFloat(DrawingObject* target, float* array, int len, std::string label, int width=0, int height=0, int depth=0);
|
261
261
|
void clearTexture(DrawingObject* target);
|
262
|
-
void setTexture(DrawingObject* target, std::string texpath, bool flip=true, int filter=2, bool bgr=false);
|
263
|
-
void textureUChar(DrawingObject* target, unsigned char* array, int len, unsigned int width, unsigned int height, unsigned int channels, bool flip=true, int filter=2, bool bgr=false);
|
264
|
-
void textureUInt(DrawingObject* target, unsigned int* array, int len, unsigned int width, unsigned int height, unsigned int channels, bool flip=true, int filter=2, bool bgr=false);
|
262
|
+
void setTexture(DrawingObject* target, std::string texpath, bool flip=true, int filter=2, bool bgr=false, std::string label="");
|
263
|
+
void textureUChar(DrawingObject* target, unsigned char* array, int len, unsigned int width, unsigned int height, unsigned int channels, bool flip=true, int filter=2, bool bgr=false, std::string label="");
|
264
|
+
void textureUInt(DrawingObject* target, unsigned int* array, int len, unsigned int width, unsigned int height, unsigned int channels, bool flip=true, int filter=2, bool bgr=false, std::string label="");
|
265
265
|
|
266
266
|
std::vector<Geom_Ptr> getGeometry(DrawingObject* target);
|
267
267
|
std::vector<Geom_Ptr> getGeometryAt(DrawingObject* target, int timestep=-2);
|