diff --git a/lib/script_controller.cpp b/lib/script_controller.cpp index adb3e729..7ca40933 100644 --- a/lib/script_controller.cpp +++ b/lib/script_controller.cpp @@ -258,7 +258,7 @@ int ScriptController::ScriptReadParQuadrature(istream &scr, DataState &state) int ScriptController::ScriptReadDisplMesh(istream &scr, DataState &state) { - DataState meshstate; + DataState meshstate = state.CloneEmpty(); string word; cout << "Script: mesh: " << flush; @@ -428,7 +428,7 @@ bool ScriptController::ExecuteScriptCommand() case Command::DataCollField: case Command::DataCollQuad: { - DataState new_state; + DataState new_state = win.data_state.CloneEmpty(); switch (cmd) { diff --git a/lib/threads.cpp b/lib/threads.cpp index e6dd8b6c..20883c8e 100644 --- a/lib/threads.cpp +++ b/lib/threads.cpp @@ -1045,8 +1045,7 @@ bool communication_thread::execute_one(std::string ident) // new solution handled by StreamReader if (StreamReader::SupportsDataType(ident)) { - DataState tmp; - tmp.fix_elem_orient = glvis_command->FixElementOrientations(); + DataState tmp = glvis_command->CurrentDataState().CloneEmpty(); StreamReader reader(tmp); reader.ReadStream(*is[0], ident); @@ -1115,9 +1114,7 @@ bool communication_thread::execute_one(std::string ident) } while (1); - DataState tmp; - tmp.fix_elem_orient = glvis_command->FixElementOrientations(); - tmp.keep_attr = glvis_command->KeepAttrib(); + DataState tmp = glvis_command->CurrentDataState().CloneEmpty(); StreamReader reader(tmp); reader.ReadStreams(is); diff --git a/lib/threads.hpp b/lib/threads.hpp index 4217a32a..265708f5 100644 --- a/lib/threads.hpp +++ b/lib/threads.hpp @@ -113,8 +113,7 @@ class GLVisCommand GLVisCommand(Window &win); // to be used by worker threads - bool KeepAttrib() { return win.data_state.keep_attr; } // may need to sync this - bool FixElementOrientations() { return win.data_state.fix_elem_orient; } + const DataState& CurrentDataState() const { return win.data_state; } // called by worker threads int NewMeshAndSolution(DataState &&ss);