Skip to content

Commit 39c6e38

Browse files
utkarshayachitkwrobot
authored andcommitted
Merge topic 'pvweb-support-http-rpc-servers'
ed30e13 Move VTK to support http-only pvweb servers in paraview. b230f65 Support http-only servers (no websockets), plus other fixes.
2 parents 7baaa9f + ed30e13 commit 39c6e38

File tree

9 files changed

+78
-20
lines changed

9 files changed

+78
-20
lines changed
1.38 KB
Loading

Web/Applications/Visualizer/www/index.html

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
<meta content="IE=edge" http-equiv="X-UA-Compatible">
66
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
77
<title>ParaViewWeb - Visualizer</title>
8-
<link rel="icon" type="image/png" href="../../lib/css/assets/favicon-32.png">
8+
<link rel="icon" type="image/png" href="favicon.png">
99
<link rel='stylesheet' href='main.css' type='text/css'>
1010
</head>
1111
<body class='container-fluid' onbeforeunload="stop()" onunload="stop()">
1212
<div class="row-fluid app-wait-start-page">
13-
<img src="../../lib/css/paraview/toolbar/common/logo_title.png" class="span12 start-page-image">
13+
<img src="start_page_image.png" class="span12 start-page-image">
1414
<div class="vtk-icon-cog animate-spin start-page-busy-icon"></div>
1515
</div>
1616
<div class='row pv-gray-darker head-toolbar hide-on-start'>
1717
<div class='col-xs-12 col-sm-5 col-md-4 col-lg-3 '>
18-
<img src='../../lib/css/assets/logo.svg'
18+
<img src='toolbar_logo.svg'
1919
class='clickable toggle-inspector'
2020
height='20'
2121
style='margin: 5px 0;'
@@ -143,21 +143,32 @@
143143
</div>
144144
</div>
145145
<div class="row label-spacing">
146-
<div class="col-xs-12">
146+
<div class="col-xs-4">
147147
Filename
148148
</div>
149+
<div class="col-xs-8 text-right">
150+
<span class="data-save-only active-data-type-label"></span>
151+
</div>
149152
</div>
150153
<div class="row">
151154
<div class="col-xs-12">
152-
<input type="text" class="save-data-filename form-control input-sm"/>
155+
<input type="text" class="save-data-filename form-control input-sm" data-toggle='tooltip' data-placement='bottom' title='Enter relative path and filename to server location where file should be written'/>
153156
</div>
154157
</div>
155158
<div class="row label-spacing">
156159
<div class="col-xs-6">
157-
<button type="button" class="screenshot-save-only screenshot-grab-image-btn btn btn-default btn-sm">Capture</button>
160+
<button type="button"
161+
class="screenshot-save-only screenshot-grab-image-btn btn btn-default btn-sm"
162+
data-toggle="tooltip"
163+
data-placement="bottom"
164+
title="Capture contents of render window">Capture</button>
158165
</div>
159166
<div class="col-xs-6 text-right">
160-
<button type="button" class="save-data-button btn btn-default btn-sm">Save</button>
167+
<button type="button"
168+
class="save-data-button btn btn-default btn-sm"
169+
data-toggle="tooltip"
170+
data-placement="bottom"
171+
title="Save file to server">Save</button>
161172
</div>
162173
</div>
163174
<div class="row label-spacing captured-screenshot-container screenshot-save-only">
@@ -196,9 +207,9 @@
196207
// Update stop method to use the connection
197208
stop = function() {
198209
if (reallyStop === true) {
199-
connection.session.call('application.exit');
210+
connection.session.call('application.exit', []);
200211
}
201-
}
212+
};
202213
};
203214

204215
// Try to launch the Viz process

Web/Applications/Visualizer/www/main.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
.fix-height { position: relative; top: 0; left: 0; }
55
.pv-time-input { position: relative; top: 2px; width: 80px; border: solid 1px white; background: none; padding: 2px 10px; }
66

7+
.active-data-type-label { font-style: italic; }
8+
79
/* ---- Sources/Filters Icons ---- */
810

911
.pv-source-list ul, .pv-filter-list ul {

Web/Applications/Visualizer/www/main.js

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,26 @@
77
rvSettingsProxyId = null,
88
saveOptionsEditor,
99
defaultSaveFilenames = { 'data': 'server-data/savedData.vtk', 'state': 'server-state/savedState.pvsm', 'screen': 'server-images/savedScreen.png' },
10+
saveTypesMap = {
11+
'AMR Dataset (Deprecated)': 'vtm',
12+
'Composite Dataset': 'vtm',
13+
'Hierarchical DataSet (Deprecated)': 'vtm',
14+
'Image (Uniform Rectilinear Grid) with blanking': 'vti',
15+
'Image (Uniform Rectilinear Grid)': 'vti',
16+
'Multi-block Dataset': 'vtm',
17+
'Multi-group Dataset': 'vtm',
18+
'Multi-piece Dataset': 'vtm',
19+
'Non-Overlapping AMR Dataset': 'vtm',
20+
'Overlapping AMR Dataset': 'vtm',
21+
'Point Set': 'vts',
22+
'Polygonal Mesh': 'vtp',
23+
'Polygonal Mesh': 'vtp',
24+
'Rectilinear Grid': 'vtr',
25+
'Structured (Curvilinear) Grid': 'vts',
26+
'Structured Grid': 'vts',
27+
'Table': 'csv',
28+
'Unstructured Grid': 'vtu'
29+
},
1030
currentSaveType = 'state',
1131
infoManager,
1232
busyElement = $('.busy').hide(),
@@ -334,6 +354,8 @@
334354

335355
function updateDataInformationPanel(data) {
336356
if(data) {
357+
$('.active-data-type-label').text(data.type);
358+
updateSaveDataFilename(data.type);
337359
infoManager.pvDataInformation(data);
338360
} else {
339361
infoManager.empty();
@@ -497,7 +519,11 @@
497519

498520
function onProxyDelete(event) {
499521
startWorking();
500-
session.call('pv.proxy.manager.delete', [event.id]).then(invalidatePipeline, invalidatePipeline);
522+
session.call('pv.proxy.manager.delete', [event.id]).then(function(result) {
523+
invalidatePipeline(result);
524+
// Make sure all old tooltips are cleaned up...
525+
$('.tooltip').remove();
526+
}, invalidatePipeline);
501527
}
502528

503529
// ------------------------------------------------------------------------
@@ -776,10 +802,23 @@
776802

777803
startWorking()
778804
session.call('pv.data.save', [filename, saveOptions]).then(function(saveResult) {
805+
if (saveResult.success !== true) {
806+
alert(saveResult.message);
807+
}
779808
workDone();
780809
}, workDone);
781810
}
782811

812+
function updateSaveDataFilename(activeType) {
813+
var xmlExt = saveTypesMap[activeType] || 'vtk';
814+
var replName = defaultSaveFilenames['data'].replace(/\.[^\.]+$/, '.' + xmlExt);
815+
defaultSaveFilenames['data'] = replName;
816+
if ($('.active[data-action=data]').length === 1) {
817+
// Additionally, if 'data' is the active save panel, update the text field itself
818+
$('.save-data-filename').val(replName);
819+
}
820+
}
821+
783822
function setActiveSaveProperties(event) {
784823
var target_container = $(event.target)
785824
action = target_container.attr('data-action');
@@ -790,7 +829,12 @@
790829

791830
if (action === 'screen') {
792831
$('.screenshot-save-only').show();
832+
$('.data-save-only').hide();
833+
} else if (action === 'data') {
834+
$('.data-save-only').show();
835+
$('.screenshot-save-only').hide();
793836
} else {
837+
$('.data-save-only').hide();
794838
$('.screenshot-save-only').hide();
795839
}
796840

92.1 KB
Loading
Lines changed: 5 additions & 0 deletions
Loading

Web/Python/paraview/web/decorators.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11

2-
32
#--------------------------------------------------------------------------
43
# Handle BooleanDomain
54
#--------------------------------------------------------------------------

Web/Python/paraview/web/protocols.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
# vtkDataObject
3535
from vtkCommonDataModelPython import *
3636

37-
3837
# =============================================================================
3938
#
4039
# Base class for any ParaView based protocol
@@ -1741,7 +1740,7 @@ def __init__(self, baseSavePath=''):
17411740
self.baseSavePath = baseSavePath
17421741

17431742
self.imageExtensions = [ 'jpg', 'png' ]
1744-
self.dataExtensions = [ 'vtk', 'ex2' ]
1743+
self.dataExtensions = [ 'vtk', 'ex2', 'vtp', 'vti', 'vtu', 'vtm', 'vts', 'vtr', 'csv' ]
17451744
self.stateExtensions = [ 'pvsm' ]
17461745

17471746
# RpcName: saveData => 'pv.data.save'
@@ -1803,7 +1802,7 @@ def saveData(self, filePath, options=None):
18031802
# simple.SaveState(fullPath) # FIXME: Fixed after 4.3.1
18041803
servermanager.SaveState(fullPath)
18051804
else:
1806-
msg = 'ERROR: Could not recognize type of data to save from filename: %s' % filePath
1805+
msg = 'ERROR: Unrecognized extension (%s) in relative path: %s' % (extension, filePath)
18071806
print msg
18081807
return { 'success': False, 'message': msg }
18091808

Web/Widgets/Pipeline/paraview.ui.proxy.editor.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
"<span class='vtk-icon-resize-horizontal-1 color-customization-button btn btn-default btn-xs' data-action='toggle-scalar-range-editor' data-toggle='tooltip' data-placement='bottom' title='Toggle Color Range Editor'></span>" +
2727
"</div></div></div></div>" +
2828
"<div class='col-sm-8 text-center'>" +
29-
"<select class='form-control pv-form-height array bottom-property top-property' data-cancel-value='VALUES' data-action='rescale-to-data' data-toggle='tooltip' data-placement='bottom' title='Array Name'>ARRAY_OPTIONS</select>" +
30-
"<select class='form-control pv-form-height component bottom-property top-property' data-action='rescale-to-data' data-toggle='tooltip' data-placement='bottom' title='Array Component'></select>" +
31-
"<select class='form-control pv-form-height palette bottom-property top-property' data-action='rescale-to-data' data-toggle='tooltip' data-placement='bottom' title='Preset Color Map'>PALETTE_OPTIONS</select>" +
29+
"<select class='form-control pv-form-height array bottom-property top-property' data-cancel-value='VALUES' data-toggle='tooltip' data-placement='bottom' title='Array Name'>ARRAY_OPTIONS</select>" +
30+
"<select class='form-control pv-form-height component bottom-property top-property' data-toggle='tooltip' data-placement='bottom' title='Array Component'></select>" +
31+
"<select class='form-control pv-form-height palette bottom-property top-property' data-toggle='tooltip' data-placement='bottom' title='Preset Color Map'>PALETTE_OPTIONS</select>" +
3232
"</div>" +
3333
"<div class='scalar-opacity-editor-container'></div>" +
3434
"<div class='color-editor-container row' style='margin-top: 5px; margin-right: 30px; margin-left: 0;'>" +
@@ -463,7 +463,7 @@
463463
for (var rangeIdx = ui.range.length - 1; rangeIdx >= 0; rangeIdx -= 1) {
464464
var ttRegex = new RegExp('TOOLTIPRANGE' + (rangeIdx + 1), 'g');
465465
var range = ui.range[rangeIdx];
466-
html = html.replace(ttRegex, "data-toggle='tooltip' data-placement='right' title='Range: [" + range.min + ', ' + range.max + "]'");
466+
html = html.replace(ttRegex, "data-toggle='tooltip' data-placement='bottom' title='Range: [" + range.min + ', ' + range.max + "]'");
467467
}
468468
} else {
469469
html = html.replace(/TOOLTIPRANGE1/g, '');
@@ -587,8 +587,6 @@
587587
type: 'delete-proxy',
588588
id: target_container.attr('data-proxy-id')
589589
});
590-
// Make sure all old tooltips are cleaned up...
591-
$('.tooltip').remove();
592590
} else if (action === 'apply-property-values') {
593591
apply(me, wantColorManagement);
594592
} else if (action === 'toggle-scalarbar') {

0 commit comments

Comments
 (0)