File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,6 +71,8 @@ def hash_file(filename):
7171 chunk = file .read (32768 )
7272 h .update (chunk )
7373 return h .hexdigest ()
74+
75+
7476class PlotModel ():
7577 """ Geometry and plot settings for OpenMC Plot Explorer model
7678
@@ -272,15 +274,17 @@ def makePlot(self):
272274 Creates corresponding .xml files from user-chosen settings.
273275 Runs OpenMC in plot mode to generate new plot image.
274276 """
277+ # update/call maps under 2 circumstances
278+ # 1. this is the intial plot (ids_map/properties are None)
279+ # 2. The active (desired) view differs from the current view parameters
280+ if (self .currentView .view_params != self .activeView .view_params ) or \
281+ (self .ids_map is None ) or (self .properties is None ):
282+ # get ids from the active (desired) view
283+ self .ids_map = openmc .lib .id_map (self .activeView .view_params )
284+ self .properties = openmc .lib .property_map (self .activeView .view_params )
285+
286+ # update current view
275287 cv = self .currentView = copy .deepcopy (self .activeView )
276- pv = self .previousViews [- 1 ]
277-
278- if (self .properties is None ) or (self .ids_map is None ) or \
279- (cv .view_params != pv .view_params ):
280- # we are at the first view and need to populate OR
281- # view has changed and need to populate
282- self .ids_map = openmc .lib .id_map (cv .view_params )
283- self .properties = openmc .lib .property_map (cv .view_params )
284288
285289 # set model ids based on domain
286290 if cv .colorby == 'cell' :
You can’t perform that action at this time.
0 commit comments