#include <QtXMLController.h>
Inheritance diagram for QtXMLController:
Definition at line 36 of file QtXMLController.h.
Public Types | |
enum | Status { Success, OpenError, ParseError, NTupleError } |
Return codes of opening file. More... | |
Public Member Functions | |
virtual XmlElement * | addDataSource (const DataSource *ntuple) |
Adds the DataSource to the document if it doesn't already exist. | |
void | addViews (const std::vector< const ViewBase * > &views) |
Adds ViewBase elements to the root of the document. | |
bool | areDataSourcesSaved (const std::vector< const ViewBase * > &views) |
Returns true if all the NTuple objects used by the views have been saved to or read from a file. | |
PlotterBase * | createDisplay () |
Creates a new empty display and makes it the curent one. | |
virtual void | createDocument (const std::string &doc_name) |
Creates an DOM Document with name doc_name. | |
FontBase * | createFont () const |
Creates a empty QtFont object. | |
ViewBase * | createView (PlotterBase *) |
Creates a new view for the current PlotterBase object and adds it to the list of views. | |
DataRep * | getDataRep (int ref) |
Returns a pointer to the DataRep from the xml reference Id. | |
const DataSource * | getDataSource (int ref_id) |
Returns pointer to data source from the xml reference ID. | |
const std::list< ViewBase * > & | getFromPasteboard (ViewFactory *factory, const std::vector< const ViewBase * > &views) |
Creates and eturns a list of objects that was copied to the pasteboard. | |
const std::list< ViewBase * > & | getFromSelectionCopy (ViewFactory *factory, const std::vector< const ViewBase * > &views) |
Creates and returns objects that were copied to the selcection copy. | |
int | getId (const void *address) |
Returns the unique integer identifier for given address. | |
PlotterBase * | getPlotter (int ref) |
Returns a pointer to the PlotterBase object from the XML referend Id. | |
const TupleCut * | getTupleCut (int ref_id) |
Returns pointer to the TupleCut from the xml reference Id. | |
virtual const std::list< ViewBase * > & | getViews (ViewFactory *) |
Returns the list of views in the current document. | |
bool | isPasteboardEmpty () |
Returns true if global pasteboard is empty. | |
Status | openFile (const std::string &filename) |
Attempts to open and parse the specified HippoDraw document. | |
void | registerPlotter (int id, PlotterBase *plotter) |
Registers the plotter with id. | |
Status | saveToFile (const std::vector< const ViewBase * > &views, const std::string &filename) |
Saves the document represented by list of ViewBase objects to file with name filename. | |
void | saveToPasteboard (const std::vector< const ViewBase * > &) |
Saves the document represented by the list of ViewBase objects to the pasteboard. | |
void | saveToSelectionCopy (const std::vector< const ViewBase * > &views) |
Saves the document represented by the list of ViewBase objects to the selection copy. | |
virtual bool | serializeViews (const std::vector< const ViewBase * > &views) |
Serializes the ViewBase objects in views and their appropriate subcomponents. | |
Static Public Member Functions | |
static QtXMLController * | instance () |
Returns the pointer to the singleton instance. | |
Static Public Attributes | |
static XmlDocument * | m_xml_doc = 0 |
The current document being generated or read. | |
Protected Member Functions | |
virtual bool | fileExists (const std::string &filename) const |
Returns true if the specified file exists. | |
virtual void | newDocument (const std::string &name) |
Creates a new document. | |
QtXMLController () | |
A default constructor for avoiding creation except by itself or with derived classes. | |
Private Member Functions | |
QtXMLController (const QtXMLController &) | |
A private copy constructor in order to avoid copying. | |
Static Private Attributes | |
static QtXMLController * | s_instance = 0 |
The pointer to the singleton object. |
|
Return codes of opening file.
Definition at line 58 of file XmlController.h. |
|
A private copy constructor in order to avoid copying.
|
|
A default constructor for avoiding creation except by itself or with derived classes.
Definition at line 21 of file QtXMLController.cxx. Referenced by instance(). |
|
Adds the DataSource to the document if it doesn't already exist. Returns the Dom element corresponding to the DataSource. Definition at line 282 of file XmlController.cxx. References XmlNode::appendChild(), HiNTupleXML::createElement(), XmlDocument::documentElement(), XmlController::m_data, XmlController::m_ntuple, and XmlController::m_xml_doc. Referenced by NTupleProjectorXML::createElement(). |
|
Adds ViewBase elements to the root of the document.
Definition at line 255 of file XmlController.cxx. References XmlNode::appendChild(), ViewBaseXML::createElement(), XmlDocument::documentElement(), XmlController::m_view, and XmlController::m_xml_doc. Referenced by XmlController::serializeViews(). |
|
Returns
Definition at line 180 of file XmlController.cxx. References ViewBaseXML::areDataSourcesSaved(), and XmlController::m_view. Referenced by CanvasWindow::areDataSourcesSaved(). |
|
Creates a new empty display and makes it the curent one.
|
|
Creates an DOM Document with name doc_name. The document becomes the current document. Definition at line 60 of file XmlController.cxx. References XmlDocument::appendChild(), XmlDocument::createElement(), XmlController::m_xml_doc, and XmlController::newDocument(). Referenced by XmlController::serializeViews(). |
|
Creates a empty QtFont object.
Definition at line 277 of file XmlController.cxx. References XmlController::m_view_factory. |
|
Creates a new view for the current PlotterBase object and adds it to the list of views.
Definition at line 267 of file XmlController.cxx. References ViewFactory::createView(), XmlController::m_view_factory, and XmlController::m_views. Referenced by ViewBaseXML::getObjects(). |
|
Returns
Implements XmlController. Definition at line 35 of file QtXMLController.cxx. References QFile::exists(). |
|
Returns a pointer to the DataRep from the xml reference Id.
Definition at line 327 of file XmlController.cxx. References XmlController::m_datarep_map. Referenced by DataRepXML::createObject(), PlotterBaseXML::getCutTargets(), PlotterBaseXML::getObject(), PlotterBaseXML::handleFunction(), and PlotterBaseXML::handleTextPlotter(). |
|
Returns pointer to data source from the xml reference ID.
Definition at line 299 of file XmlController.cxx. References XmlController::m_tuple_map. Referenced by DataRepXML::createDataRep(). |
|
Creates and eturns a list of objects that was copied to the pasteboard. The parameter views is used when the an object makes a reference to object already on the canvas. For example, if an object was a DataRep with a TupleCut applied, then newly created object needs to have a reference to that TupleCut. Definition at line 133 of file XmlController.cxx. References XmlController::getFromDocument(), XmlController::m_pasteboard, and XmlController::m_xml_doc. Referenced by CanvasView::addFromPasteboard(), and CanvasView::copyFromPasteboard(). |
|
Creates and returns objects that were copied to the selcection copy.
Definition at line 143 of file XmlController.cxx. References XmlController::getFromDocument(), XmlController::m_selectboard, and XmlController::m_xml_doc. Referenced by CanvasView::restoreFromSelectCopy(). |
|
Returns the unique integer identifier for given address.
Definition at line 467 of file XmlController.cxx. References XmlController::m_addr_map, and XmlController::m_id. Referenced by XmlController::fillNTupleMap(), and XmlController::fillTupleCutMap(). |
|
Returns a pointer to the PlotterBase object from the XML referend Id.
Definition at line 339 of file XmlController.cxx. References XmlController::m_plotter_map. |
|
Returns pointer to the TupleCut from the xml reference Id.
Definition at line 310 of file XmlController.cxx. References XmlController::m_tuple_cut_map. Referenced by NTupleProjectorXML::addCuts(), and PlotterBaseXML::handleCutPlotter(). |
|
Returns the list of views in the current document. The views are created using the specified view factory. Definition at line 169 of file XmlController.cxx. References XmlController::getViews(), XmlController::m_view_factory, XmlController::m_views, and XmlController::m_xml_doc. |
|
Returns the pointer to the singleton instance.
Definition at line 25 of file QtXMLController.cxx. References QtXMLController(), and s_instance. Referenced by CanvasView::CanvasView(), CanvasWindow::CanvasWindow(), and CanvasWindow::updateActions(). |
|
Returns
Definition at line 126 of file XmlController.cxx. References XmlController::m_pasteboard. |
|
Creates a new document. A derived class should set the member m_xml_doc to point to a concrete class derived from the abstract class XmlDocument. Implements XmlController. Definition at line 44 of file QtXMLController.cxx. References XmlController::m_xml_doc. |
|
Attempts to open and parse the specified HippoDraw document. Returns Success if successful, otherwise returns another member of the OpenStatus enumeration. Definition at line 83 of file XmlController.cxx. References XmlController::m_tuple_cut_map, XmlController::m_tuple_map, XmlController::m_views, XmlController::openDocument(), XmlController::openNTuples(), and XmlController::Success. Referenced by CanvasView::initFromFile(). |
|
Registers the plotter with id.
Definition at line 351 of file XmlController.cxx. References XmlController::m_plotter_map. |
|
Saves the document represented by list of ViewBase objects to file with name filename. Returns 0 if successful. Definition at line 240 of file XmlController.cxx. References XmlController::m_data, XmlController::m_xml_doc, XmlController::OpenError, XmlDocument::saveToFile(), XmlController::serializeViews(), XmlController::Success, and XmlDocument::Success. Referenced by CanvasView::saveAs(). |
|
Saves the document represented by the list of ViewBase objects to the pasteboard. If any ViewBase objects in allviews is an Observer of selviews, then save it as well. Returns the list of ViewBase objects actually saved to pasteboard. Definition at line 220 of file XmlController.cxx. References XmlController::m_pasteboard, XmlController::m_xml_doc, and XmlController::saveToDocument(). Referenced by CanvasView::copySelectedToPasteboard(), and CanvasView::deleteSelected(). |
|
Saves the document represented by the list of ViewBase objects to the selection copy. If any ViewBase objects in allviews is an Observer of selviews, then save it as well. Returns the list of ViewBase objects actually saved to pasteboard. Definition at line 230 of file XmlController.cxx. References XmlController::m_selectboard, XmlController::m_xml_doc, and XmlController::saveToDocument(). Referenced by CanvasView::contentsMousePressEvent(). |
|
Serializes the ViewBase objects in views and their appropriate subcomponents.
Returns Definition at line 198 of file XmlController.cxx. References XmlController::addViews(), XmlController::createDocument(), and XmlController::m_xml_doc. Referenced by XmlController::saveToDocument(), and XmlController::saveToFile(). |
|
The current document being generated or read. This member is made public so that element creator that need it do not need to have it passed as argument. Definition at line 39 of file XmlController.cxx. Referenced by XmlController::addDataSource(), XmlController::addViews(), NTupleProjectorXML::createChildren(), NTupleXML::createChildren2D(), NTupleXML::createChildren3D(), PlotterBaseXML::createCutChildren(), XmlController::createDocument(), TupleCutXML::createElement(), BinToColorXML::createElement(), BaseXML::createElement(), DataRepXML::createFunctionTargetChild(), PlotterBaseXML::createTextChildren(), XmlController::getDataReps(), XmlController::getFromPasteboard(), XmlController::getFromSelectionCopy(), XmlController::getTupleCuts(), XmlController::getViews(), newDocument(), XmlController::openDocument(), XmlController::openNTuples(), XmlController::saveToFile(), XmlController::saveToPasteboard(), XmlController::saveToSelectionCopy(), and XmlController::serializeViews(). |
|
The pointer to the singleton object.
Definition at line 19 of file QtXMLController.cxx. Referenced by instance(). |