COPASI API  4.16.103
CQLayoutScene.h
Go to the documentation of this file.
1 // Copyright (C) 2013 by Pedro Mendes, Virginia Tech Intellectual
2 // Properties, Inc., University of Heidelberg, and The University
3 // of Manchester.
4 // All rights reserved.
5 
6 #ifndef QLAYOUT_SCENE_H
7 #define QLAYOUT_SCENE_H
8 
9 #include <QtGui/QGraphicsScene>
10 #include <QtCore/QSharedPointer>
11 
12 #include <string>
13 #include <map>
14 
15 class CLayout;
16 class CLGraphicalObject;
17 class CLRenderResolver;
18 class CCopasiDataModel;
20 class CQCopasiEffect;
21 
22 class CQLayoutScene: public QGraphicsScene
23 {
24  Q_OBJECT
25 public:
26  CQLayoutScene(CLayout *layout, CCopasiDataModel* model = NULL, CLRenderInformationBase* renderInformation = NULL);
27  virtual ~CQLayoutScene();
28  void setResolver(CLRenderResolver* resolver);
29  const CLRenderResolver* getResolver() const;
30  void saveToFile(const std::string& fileName, const std::string& fileType = "pdf");
31  void setLayout(CLayout *layout, CCopasiDataModel* model = NULL, CLRenderInformationBase* renderInformation = NULL);
32  void setRenderInformation(CCopasiDataModel* model, CLRenderInformationBase* renderInformation);
33  QGraphicsItem* getItemFor(const std::string& cn);
34  const CLayout* getCurrentLayout() const;
37  void updatePosition(const QString& key, const QPointF& newPos);
38 public slots:
39  void recreate();
40 signals:
41  void recreateNeeded();
42 protected:
43  void initializeResolver(CCopasiDataModel* model, CLRenderInformationBase* renderInformation);
44 private:
45  void addGlyph(const CLGraphicalObject* go);
46  void fillFromLayout(const CLayout* layout);
47 
50  QSharedPointer<CLRenderResolver> mpResolver;
51 
52  std::map< std::string, QGraphicsItem*> mItems;
53 };
54 
55 #endif
std::map< std::string, QGraphicsItem * > mItems
Definition: CQLayoutScene.h:52
const CLayout * getCurrentLayout() const
QSharedPointer< CLRenderResolver > mpResolver
Definition: CQLayoutScene.h:50
virtual ~CQLayoutScene()
void saveToFile(const std::string &fileName, const std::string &fileType="pdf")
CLRenderInformationBase * mpRender
Definition: CQLayoutScene.h:49
void setLayout(CLayout *layout, CCopasiDataModel *model=NULL, CLRenderInformationBase *renderInformation=NULL)
void fillFromLayout(const CLayout *layout)
CLayout * mpLayout
Definition: CQLayoutScene.h:48
const CLRenderInformationBase * getCurrentRenderInfo() const
CQLayoutScene(CLayout *layout, CCopasiDataModel *model=NULL, CLRenderInformationBase *renderInformation=NULL)
void initializeResolver(CCopasiDataModel *model, CLRenderInformationBase *renderInformation)
void setRenderInformation(CCopasiDataModel *model, CLRenderInformationBase *renderInformation)
void updatePosition(const QString &key, const QPointF &newPos)
void recreateNeeded()
void addGlyph(const CLGraphicalObject *go)
void setResolver(CLRenderResolver *resolver)
const CLRenderResolver * getResolver() const
QGraphicsItem * getItemFor(const std::string &cn)