COPASI API  4.16.103
Functions | Variables
CLDefaultStyles.h File Reference
#include "copasi/copasi.h"
#include "copasi/utilities/CCopasiVector.h"
#include "copasi/layout/CLGlobalRenderInformation.h"
Include dependency graph for CLDefaultStyles.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

CLGlobalRenderInformationgetDefaultStyle (size_t index)
 
CCopasiVector
< CLGlobalRenderInformation > * 
getDefaultStyles ()
 
size_t getNumDefaultStyles ()
 
CCopasiVector
< CLGlobalRenderInformation > * 
loadDefaultStyles ()
 

Variables

CCopasiVector
< CLGlobalRenderInformation > * 
DEFAULT_STYLES
 

Function Documentation

CLGlobalRenderInformation* getDefaultStyle ( size_t  index)

This method returns the default render information object with the requested index. If the index isinvalid, NULL is returned.

Definition at line 824 of file CLDefaultStyles.cpp.

References loadDefaultStyles(), and pResult.

Referenced by CQNewMainWindow::addDefaultRenderInfoItemsToList(), CSBMLExporter::exportModelToString(), CQLayoutScene::initializeResolver(), CQNewMainWindow::slotRenderInfoChanged(), CQLayoutView::slotRenderInformationChanged(), CQNewMainWindow::updateRenderer(), updateRenderInformationList(), and CQNewMainWindow::updateRenderInformationList().

825 {
826  if (!DEFAULT_STYLES)
827  {
829  }
830 
832 
833  if (DEFAULT_STYLES != NULL && index < DEFAULT_STYLES->size())
834  {
835  pResult = static_cast<CLGlobalRenderInformation*>((*DEFAULT_STYLES)[index]);
836  }
837 
838  return pResult;
839 }
CCopasiVector< CLGlobalRenderInformation > * DEFAULT_STYLES
CCopasiVector< CLGlobalRenderInformation > * loadDefaultStyles()
const CArrayAnnotation * pResult
CCopasiVector<CLGlobalRenderInformation>* getDefaultStyles ( )

This method returns a global render information list that contains the default styles which are built into the renderer.

Definition at line 790 of file CLDefaultStyles.cpp.

References DEFAULT_STYLES, and loadDefaultStyles().

791 {
792  if (!DEFAULT_STYLES)
793  {
795  }
796 
797  return DEFAULT_STYLES;
798 }
CCopasiVector< CLGlobalRenderInformation > * DEFAULT_STYLES
CCopasiVector< CLGlobalRenderInformation > * loadDefaultStyles()
size_t getNumDefaultStyles ( )

This method returns the number of global styles.

Definition at line 803 of file CLDefaultStyles.cpp.

References loadDefaultStyles(), and CCopasiVector< T >::size().

Referenced by CQNewMainWindow::addDefaultRenderInfoItemsToList(), CSBMLExporter::exportModelToString(), CQLayoutView::slotRenderInformationChanged(), updateRenderInformationList(), and CQNewMainWindow::updateRenderInformationList().

804 {
805  size_t result = 0;
806 
807  if (!DEFAULT_STYLES)
808  {
810  }
811 
812  if (DEFAULT_STYLES != NULL)
813  {
814  result = DEFAULT_STYLES->size();
815  }
816 
817  return result;
818 }
virtual size_t size() const
CCopasiVector< CLGlobalRenderInformation > * DEFAULT_STYLES
CCopasiVector< CLGlobalRenderInformation > * loadDefaultStyles()
CCopasiVector<CLGlobalRenderInformation>* loadDefaultStyles ( )

This method is used to initialize the default styles. Normally this does not need to be called since it is called automatically. The method returns a point to a ListOfGlobalRenderInformation object. The caller is responsible for freeing the memory associated with the list.

Definition at line 841 of file CLDefaultStyles.cpp.

References CCopasiVector< T >::add(), DEFAULT_STYLES, DEFAULT_STYLES_STRING, and pResult.

Referenced by CQNewMainWindow::CQNewMainWindow(), getDefaultStyle(), getDefaultStyles(), and getNumDefaultStyles().

842 {
843  // try to initialize the default styles
844  if (DEFAULT_STYLES != NULL)
845  {
846  delete DEFAULT_STYLES;
847  }
848 
849  XMLInputStream stream(DEFAULT_STYLES_STRING, false);
850  ListOfGlobalRenderInformation* pRI = new ListOfGlobalRenderInformation();
851  pRI->parseXML(XMLNode(stream));
852  // convert the SBML objects to COPASI objects
853  size_t i, iMax = pRI->size();
855 
856  for (i = 0; i < iMax; ++i)
857  {
858  pResult->add(new CLGlobalRenderInformation(*static_cast<const GlobalRenderInformation*>(pRI->get((unsigned int) i))), true);
859  }
860 
861  delete pRI;
862 
863  return pResult;
864 }
const char * DEFAULT_STYLES_STRING
CCopasiVector< CLGlobalRenderInformation > * DEFAULT_STYLES
virtual bool add(const CType &src)
const CArrayAnnotation * pResult

Variable Documentation

A pointer to the list of default styles.

Definition at line 22 of file CLDefaultStyles.cpp.