COPASI API  4.16.103
Static Public Member Functions | List of all members
CQRenderConverter Class Reference

#include <CQRenderConverter.h>

Static Public Member Functions

static void applyStyle (QGraphicsTextItem *item, const CLBoundingBox *bounds, const CLGroup *style, const CLRenderResolver *resolver)
 
static void applyStyle (QGraphicsPathItem *item, const CLBoundingBox *bounds, const CLGroup *style, const CLRenderResolver *resolver, QGraphicsItemGroup *itemGroup)
 
static void applyStyle (QGraphicsItemGroup *item, const CLBoundingBox *bounds, const CLGroup *style, const CLRenderResolver *resolver)
 
static void fillGroupFromStyle (QGraphicsItemGroup *group, const CLBoundingBox *bounds, const CLStyle *style, const CLRenderResolver *resolver)
 
static void setBackground (QGraphicsScene *scene, const std::string &fill, const CLRenderResolver *resolver)
 

Detailed Description

Definition at line 20 of file CQRenderConverter.h.

Member Function Documentation

void CQRenderConverter::applyStyle ( QGraphicsTextItem *  item,
const CLBoundingBox bounds,
const CLGroup style,
const CLRenderResolver resolver 
)
static

Definition at line 1083 of file CQRenderConverter.cpp.

References adjustPosition(), getColor(), getFont(), CLGraphicalPrimitive1D::getStroke(), and CLGraphicalPrimitive1D::isSetStroke().

Referenced by CQConnectionGraphicsItem::CQConnectionGraphicsItem(), and CQLabelGraphicsItem::CQLabelGraphicsItem().

1084 {
1085  if (resolver == NULL || style == NULL || bounds == NULL || item == NULL)
1086  return;
1087 
1088  if (style->isSetStroke())
1089  item->setDefaultTextColor(getColor(style->getStroke(), resolver));
1090 
1091  QSharedPointer<QFont> font = getFont(NULL, style, resolver, bounds);
1092 
1093  if (!font.isNull())
1094  {
1095  item->setFont(*font);
1096 
1097  adjustPosition(item, bounds, NULL, style);
1098  }
1099 }
QSharedPointer< QFont > getFont(const CLText *item, const CLGroup *group, const CLRenderResolver *, const CLBoundingBox *pBB)
const std::string & getStroke() const
QColor getColor(const CLColorDefinition *cd)
void adjustPosition(QGraphicsTextItem *item, const CLBoundingBox *pBB, const CLText *pText, const CLGroup *group)
void CQRenderConverter::applyStyle ( QGraphicsPathItem *  item,
const CLBoundingBox bounds,
const CLGroup style,
const CLRenderResolver resolver,
QGraphicsItemGroup *  itemGroup 
)
static

Definition at line 1044 of file CQRenderConverter.cpp.

References addLineEndingToItem(), CLGroup::getEndHead(), CLRenderResolver::getLineEnding(), getPen(), CLGroup::getStartHead(), and CLGroup::isSetEndHead().

1045 {
1046  if (resolver == NULL || group == NULL || bounds == NULL || item == NULL)
1047  return;
1048 
1049  QSharedPointer<QPen> pen = getPen(NULL, group, resolver, bounds);
1050  item->setPen(*pen);
1051 
1052  if (item->path().elementCount() < 2)
1053  return;
1054 
1055  QPointF start = item->path().elementAt(0);
1056  QPointF second = item->path().elementAt(1);
1057  QPointF end = item->path().elementAt(item->path().elementCount() - 1);
1058  QPointF secondLast = item->path().elementAt(item->path().elementCount() - 2);
1059 
1060  if (group -> isSetStartHead())
1061  {
1062  const CLLineEnding *line = resolver->getLineEnding(group->getStartHead());
1063  addLineEndingToItem(item, line, group, resolver, start, second, itemGroup);
1064  }
1065 
1066  if (group->isSetEndHead())
1067  {
1068  const CLLineEnding *line = resolver->getLineEnding(group->getEndHead());
1069  addLineEndingToItem(item, line, group, resolver, end, secondLast, itemGroup);
1070  }
1071 }
QSharedPointer< QPen > getPen(const CLGraphicalPrimitive1D *item, const CLGroup *group, const CLRenderResolver *resolver, const CLBoundingBox *)
void addLineEndingToItem(QGraphicsPathItem *item, const CLLineEnding *ending, const CLGroup *group, const CLRenderResolver *resolver, QPointF point, QPointF second, QGraphicsItemGroup *itemGroup)
const CLLineEnding * getLineEnding(const std::string &id) const
void CQRenderConverter::applyStyle ( QGraphicsItemGroup *  item,
const CLBoundingBox bounds,
const CLGroup style,
const CLRenderResolver resolver 
)
static

Definition at line 1073 of file CQRenderConverter.cpp.

1074 {
1075  if (resolver == NULL || style == NULL || bounds == NULL || group == NULL)
1076  return;
1077 
1078  for (int i = 0; i < group->childItems().size(); ++i)
1079  {
1080  }
1081 }
void CQRenderConverter::fillGroupFromStyle ( QGraphicsItemGroup *  group,
const CLBoundingBox bounds,
const CLStyle style,
const CLRenderResolver resolver 
)
static

Definition at line 1101 of file CQRenderConverter.cpp.

References fillItemFromGroup(), and CLStyle::getGroup().

Referenced by CQConnectionGraphicsItem::CQConnectionGraphicsItem(), and CQStyledGraphicsItem::CQStyledGraphicsItem().

1102 {
1103  if (resolver == NULL || style == NULL || bounds == NULL || group == NULL)
1104  return;
1105 
1106  fillItemFromGroup(group, bounds, style->getGroup(), resolver);
1107 }
const CLGroup * getGroup() const
Definition: CLStyle.cpp:91
void fillItemFromGroup(QGraphicsItemGroup *item, const CLBoundingBox *bounds, const CLGroup *group, const CLRenderResolver *resolver)
void CQRenderConverter::setBackground ( QGraphicsScene *  scene,
const std::string &  fill,
const CLRenderResolver resolver 
)
static

Definition at line 1109 of file CQRenderConverter.cpp.

References getColor().

Referenced by CQLayoutScene::fillFromLayout().

1110 {
1111  if (resolver == NULL || scene == NULL) return;
1112 
1113  QBrush brush(getColor(fill, resolver));
1114  scene->setBackgroundBrush(brush);
1115 }
QColor getColor(const CLColorDefinition *cd)

The documentation for this class was generated from the following files: