3d CaveView regeneates .3d file in cache

This commit is contained in:
Philip Sargent
2021-04-03 20:52:35 +01:00
parent 7ee7a05ea1
commit f6ae46e352
3 changed files with 158 additions and 90 deletions

View File

@@ -3,7 +3,10 @@
{% block extraheaders %}
{% if cave.survex_file %}
<style>
# This is presumably very similar caveview.css but why is it copied here ?
# Because it is NOT the same as the distrubuted CaveView code.
# Needs to be separated out into JSLIB local. (PMS 3/4/2021)
div.cv-panel {
position: absolute;
@@ -420,16 +423,17 @@ div#scene {
// the configuration object specifies the location of CaveView, surveys and terrain files
CV.UI.init( 'scene', {
home: '/javascript/CaveView/',
surveyDirectory: '/cave/3d/',
terrainDirectory: '/loser/surface/terrain/'
surveyDirectory: '/expowebcache/3d/',
terrainDirectory: '/loser/surface/terrain/'
} );
// load a single survey to display
CV.UI.loadCave( '{% if cave.kataster_number %}{{ cave.kataster_number }}{% else %}{{ cave.unofficial_number }}{% endif %}.3d' );
// Note the special code in views.caves.py to do this. The appropriate .svx/.3d file may not be simply the cave name +.3d
CV.UI.loadCave('{{svx3d}}.3d');
}
window.onload = onLoad;
</script>
{% endif %}
{% endif %} <!-- all the above only loads if cave.survex_file is not empty-->
{% endblock %}
@@ -460,6 +464,52 @@ div#scene {
{% block related %}
{% endblock %}{% endblock %}
<div id="Description">
<p>{% if cave.explorers %}
<h2>Explorers</h2>
{{ cave.explorers|safe }}
{% endif %}
{% if cave.underground_description %}
<h2>Underground Description</h2>
{{ cave.underground_description|safe }}
{% endif %}
{% if cave.equipment %}
<h2>Equipment</h2>
{{ cave.equipment|safe }}
{% endif %}
{% if cave.references %}
<h2>References</h2>
{{ cave.references|safe }}
{% endif %}
{% if cave.survey %}
<h2>Survey</h2>
{{ cave.survey|safe }}
{% endif %}
{% if cave.kataster_status %}
<h2>Kataster_status</h2>
{{ cave.kataster_status|safe }}
{% endif %}
{% if cave.underground_centre_line %}
<h2>Underground Centre Line</h2>
{{ cave.underground_centre_line|safe }}
{% endif %}
{% if cave.survex_file %}
<h2>Survex File</h2>
<a href="{% url "survexcavessingle" cave.kataster_number %}">All survex files</a> &nbsp;&nbsp;&nbsp;
<a href="{% if cave.kataster_number %}{% url "cave3d" cave.kataster_number %}{% else %}{% url "cave3d" cave.unofficial_number %}{% endif %}">3d file download</a>&nbsp;&nbsp;&nbsp;
<a href="{% url "svx" svxstem %}">This survex file</a> &nbsp;&nbsp;&nbsp;
<div id='scene'></div>
{% endif %}
{% if cave.notes %}
<h2>Notes</h2>
{{ cave.notes|safe }}
{% endif %}</p>
</div>
<div id="entrances">
<p>{% if cave.entrances %}
<h2>Entrances</h2>
@@ -531,47 +581,4 @@ div#scene {
{% endif %}</p>
<a href="{% url "newentrance" cave.slug %}">New Entrance</a>
</div>
<div id="Description">
<p>{% if cave.explorers %}
<h2>Explorers</h2>
{{ cave.explorers|safe }}
{% endif %}
{% if cave.underground_description %}
<h2>Underground Description</h2>
{{ cave.underground_description|safe }}
{% endif %}
{% if cave.equipment %}
<h2>Equipment</h2>
{{ cave.equipment|safe }}
{% endif %}
{% if cave.references %}
<h2>References</h2>
{{ cave.references|safe }}
{% endif %}
{% if cave.survey %}
<h2>Survey</h2>
{{ cave.survey|safe }}
{% endif %}
{% if cave.kataster_status %}
<h2>Kataster_status</h2>
{{ cave.kataster_status|safe }}
{% endif %}
{% if cave.underground_centre_line %}
<h2>Underground Centre Line</h2>
{{ cave.underground_centre_line|safe }}
{% endif %}
{% if cave.survex_file %}
<h2>Survex File</h2>
{{ cave.survex_file|safe }} <a href="{% if cave.kataster_number %}{% url "cave3d" cave.kataster_number %}{% else %}{% url "cave3d" cave.unofficial_number %}{% endif %}">3d file</a>
<div id='scene'></div>
{% endif %}
{% if cave.notes %}
<h2>Notes</h2>
{{ cave.notes|safe }}
{% endif %}</p>
</div>
{% endblock content %}