73 ParamsMgr(std::vector<string> appParamNames = std::vector<string>(), std::vector<string> appRenderParamNames = std::vector<string>());
233 void GetRenderParams(
string winName,
string dataSetName, vector<RenderParams *> &rParams)
const;
247 void GetRenderParamNames(
string winName,
string dataSetName,
string classType, vector<string> &instNames)
const;
266 bool RenderParamsLookup(
string instName,
string &winName,
string &dataSetName,
string &className)
const;
391 std::map<string, RenParamsContainer *>::const_iterator itr;
392 itr = _otherRenParams.find(dataSetName);
393 return (itr != _otherRenParams.cend() ? itr->second->GetParams(classType) : NULL);
484 size_t UndoSize()
const {
return (_ssave.UndoSize()); }
486 size_t RedoSize()
const {
return (_ssave.RedoSize()); }
527 if (*(_rootSeparator->GetNode()) == _prevState)
return (
false);
529 _prevState = *(_rootSeparator->GetNode());
536 PMgrStateSave(
int stackSize = 100);
539 void Reinit(
const XmlNode *rootNode)
541 _rootNode = rootNode;
547 if (_state0)
delete _state0;
548 _state0 = _rootNode ?
new XmlNode(*_rootNode) : NULL;
550 void Save(
const XmlNode *node,
string description);
551 void BeginGroup(
string descripion);
553 void IntermediateChange();
555 void SetEnabled(
bool onOff)
557 if (!_groups.empty())
return;
561 bool GetEnabled()
const {
return (_enabled); }
563 void SetUndoEnabled(
bool b)
565 if (!_groups.empty())
return;
566 _addToUndoEnabled = b;
568 bool GetUndoEnabled()
const {
return _addToUndoEnabled; }
570 const XmlNode *GetTopUndo(
string &description)
const;
571 const XmlNode *GetTopRedo(
string &description)
const;
572 const XmlNode *GetBase()
const {
return (_state0); }
578 size_t UndoSize()
const {
return (_undoStack.size()); }
580 size_t RedoSize()
const {
return (_redoStack.size()); }
582 void RegisterStateChangeFlag(
bool *flag) { _stateChangeFlags.push_back(flag); }
583 void RegisterStateChangeCB(std::function<
void()> callback) { _stateChangeCBs.push_back(callback); }
584 void RegisterIntermediateStateChangeCB(std::function<
void()> callback) { _intermediateStateChangeCBs.push_back(callback); }
588 bool _addToUndoEnabled =
true;
590 const XmlNode *_rootNode;
591 const XmlNode *_state0;
593 std::stack<string> _groups;
594 std::deque<std::pair<string, XmlNode *>> _undoStack;
595 std::deque<std::pair<string, XmlNode *>> _redoStack;
597 std::vector<bool *> _stateChangeFlags;
598 std::vector<std::function<void()>> _stateChangeCBs;
599 std::vector<std::function<void()>> _intermediateStateChangeCBs;
601 void cleanStack(
int maxN, std::deque<std::pair<string, XmlNode *>> &s);
602 void emitStateChange();
603 void emitIntermediateStateChange();
606 map<string, DataMgr *> _dataMgrMap;
607 ParamsSeparator * _rootSeparator;
609 std::vector<string> _appParamNames;
610 std::vector<string> _appRenderParamNames;
615 map<string, map<string, map<string, RenParamsContainer *>>> _renderParamsMap;
619 map<string, ViewpointParams *> _viewpointParamsMap;
621 ParamsContainer * _otherParams;
622 std::map<string, RenParamsContainer *> _otherRenParams;
624 PMgrStateSave _ssave;
626 static const string _rootTag;
627 static const string _globalTag;
628 static const string _renderersTag;
629 static const string _appRenderersTag;
630 static const string _windowsTag;
632 void _init(std::vector<string> appParamNames, XmlNode *node);
633 void _createAppRenParams(
string dataSetName);
636 const map<string, map<string, RenParamsContainer *>> *getWinMap3(
const map<
string, map<
string, map<string, RenParamsContainer *>>> &m3,
string key)
const;
638 const map<string, RenParamsContainer *> *getWinMap3(
const map<
string, map<
string, map<string, RenParamsContainer *>>> &m3,
string key1,
string key2)
const;
640 const map<string, RenParamsContainer *> *getWinMap2(
const map<
string, map<string, RenParamsContainer *>> &m2,
string key)
const;
642 RenParamsContainer *get_ren_container(
string winName,
string dataSetName,
string renderName)
const;
644 map<string, map<string, RenParamsContainer *>> *getWinMap3(map<
string, map<
string, map<string, RenParamsContainer *>>> &m3,
string key)
const;
646 map<string, RenParamsContainer *> *getWinMap3(map<
string, map<
string, map<string, RenParamsContainer *>>> &m3,
string key1,
string key2)
const;
648 map<string, RenParamsContainer *> *getWinMap2(map<
string, map<string, RenParamsContainer *>> &m2,
string key)
const;
650 void delete_ren_container(
string winName,
string dataSetName,
string renderName);
652 void delete_ren_containers(
string winName,
string dataSetName);
653 void delete_ren_containers(
string winName);
654 void delete_ren_containers();
655 void delete_datasets(
string dataSetName);
657 RenParamsContainer *make_ren_container(
string winName,
string dataSetName,
string renderName);
659 ViewpointParams *get_vp_params(
string winName)
const;
661 void delete_vp_params(
string winName);
663 ViewpointParams *make_vp_params(
string winName);
665 void addDataMgrNew();
666 void addDataMgrMerge(
string dataSetName);
668 bool undoRedoHelper();
670 RenParamsContainer *createRenderParamsHelper(
string winName,
string dataSetName,
string className,
string instName);
A class for describing visual features displayed in the visualizer.
A cache based data reader.
Nodes with state in Xml tree representation.
A singleton class for managing Params instances.
void RemoveVisualizerParamsInstance(string winName)
void GetRenderParamNames(string winName, string dataSetName, vector< string > &instNames) const
virtual int LoadState(string stateFile)
void RemoveDataMgr(string dataSetName)
void SetSaveStateUndoEnabled(bool enabled)
DatasetsParams * GetDatasetsParams() const
void GetRenderParams(string winName, string dataSetName, vector< RenderParams * > &rParams) const
RegionParams * GetRegionParams(string winName) const
const XmlNode * GetXMLRoot() const
vector< string > GetVisualizerNames() const
bool RenderParamsLookup(string instName, string &winName, string &dataSetName, string &className) const
void RegisterStateChangeFlag(bool *flag)
bool GetSaveStateUndoEnabled() const
Get whether updating the undo list is enabled.
void BeginSaveStateGroup(string description)
void AddDataMgr(string dataSetName, DataMgr *dataMgr)
void GetRenderParamNames(vector< string > &instNames) const
void GetRenderParamNames(string winName, string dataSetName, string classType, vector< string > &instNames) const
void GetRenderParams(string winName, vector< RenderParams * > &rParams) const
ViewpointParams * GetViewpointParams(string winName) const
RenderParams * GetAppRenderParams(string dataSetName, string classType)
string GetTopUndoDesc() const
Return description string for event at top of undo stack.
bool GetSaveStateEnabled() const
static vector< string > GetRenderParamsClassNamesAvail()
void SetSaveStateEnabled(bool enabled)
vector< string > GetRenderParamsClassNames(string winName) const
vector< string > GetDataMgrNames() const
void IntermediateChange()
RenderParams * GetRenderParams(string winName, string dataSetName, string classType, string instName) const
AnnotationParams * GetAnnotationParams(string winName) const
void RegisterIntermediateStateChangeCB(std::function< void()> callback)
void GetRenderParamNames(string winName, vector< string > &instNames) const
void RemoveRenderParamsInstance(string winName, string dataSetName, string classType, string instName)
void GetAppRenderParams(string dataSetName, vector< RenderParams * > &appRenderParams) const
void GetRenderParams(vector< RenderParams * > &rParams) const
string GetTopRedoDesc() const
Return description string for event at top of redo stack.
ViewpointParams * CreateVisualizerParamsInstance(string winName)
ParamsMgr(std::vector< string > appParamNames=std::vector< string >(), std::vector< string > appRenderParamNames=std::vector< string >())
vector< string > GetRenderParamInstances(string winName, string dataSetName, string classType) const
RenderParams * CreateRenderParamsInstance(string winName, string dataSetName, string instName, const RenderParams *rp)
virtual void LoadState(const XmlNode *node)
void RemoveVisualizer(string winName)
void RegisterStateChangeCB(std::function< void()> callback)
vector< string > GetRenderParamInstances(string winName, string classType) const
RenderParams * CreateRenderParamsInstance(string winName, string dataSetName, string classType, string instName)
ParamsBase * GetParams(string classType)
int SaveToFile(string path) const
vector< string > GetRenderParamsClassNames(string winName, string dataSetName) const
A class for describing a 3D axis-aligned region in user space.
A Params subclass for managing parameters used by Renderers.
A class for describing the viewpoint and lights in a 3D VAPOR scene.