|
QElectroTech
0.70
|
The ElementPictureFactory class This class is singleton factory, use to create and get the picture use by elements. More...
#include <elementpicturefactory.h>
Classes | |
| struct | primitives |
Public Member Functions | |
| void | getPictures (const ElementsLocation &location, QPicture &picture, QPicture &low_picture) |
| ElementPictureFactory::getPictures Set the picture of the element at location. Note, picture can be null. More... | |
| QPixmap | pixmap (const ElementsLocation &location) |
| ElementPictureFactory::pixmap. More... | |
| ElementPictureFactory::primitives | getPrimitives (const ElementsLocation &location) |
| ElementPictureFactory::getPrimitives. More... | |
Static Public Member Functions | |
| static ElementPictureFactory * | instance () |
| instance More... | |
| static void | dropInstance () |
| dropInstance Drop the instance of factory More... | |
Private Member Functions | |
| ElementPictureFactory () | |
| ElementPictureFactory (const ElementPictureFactory &) | |
| ElementPictureFactory | operator= (const ElementPictureFactory &) |
| ~ElementPictureFactory () | |
| bool | build (const ElementsLocation &location, QPicture *picture=nullptr, QPicture *low_picture=nullptr) |
| ElementPictureFactory::build Build the picture from location. More... | |
| void | parseElement (const QDomElement &dom, QPainter &painter, primitives &prim) const |
| void | parseLine (const QDomElement &dom, QPainter &painter, primitives &prim) const |
| void | parseRect (const QDomElement &dom, QPainter &painter, primitives &prim) const |
| void | parseEllipse (const QDomElement &dom, QPainter &painter, primitives &prim) const |
| void | parseCircle (const QDomElement &dom, QPainter &painter, primitives &prim) const |
| void | parseArc (const QDomElement &dom, QPainter &painter, primitives &prim) const |
| void | parsePolygon (const QDomElement &dom, QPainter &painter, primitives &prim) const |
| void | parseText (const QDomElement &dom, QPainter &painter, primitives &prim) const |
| void | setPainterStyle (const QDomElement &dom, QPainter &painter) const |
| ElementPictureFactory::setPainterStyle apply the style store in dom to painter. More... | |
Private Attributes | |
| QHash< QUuid, QPicture > | m_pictures_H |
| QHash< QUuid, QPicture > | m_low_pictures_H |
| QHash< QUuid, QPixmap > | m_pixmap_H |
| QHash< QUuid, primitives > | m_primitives_H |
Static Private Attributes | |
| static ElementPictureFactory * | m_factory = nullptr |
The ElementPictureFactory class This class is singleton factory, use to create and get the picture use by elements.
Definition at line 37 of file elementpicturefactory.h.
|
inlineprivate |
Definition at line 90 of file elementpicturefactory.h.
Referenced by instance().
|
private |
|
private |
Definition at line 128 of file elementpicturefactory.cpp.
References m_primitives_H.
|
private |
ElementPictureFactory::build Build the picture from location.
| location | |
| picture | |
| low_picture | if and/or are not null this function draw on it and don't store it. if null, this function create a QPicture for normal and low zoom, draw on it and store it in m_pictures_H and m_low_pictures_H |
Definition at line 144 of file elementpicturefactory.cpp.
References QET::attributeIsAnInteger(), m_low_pictures_H, m_pictures_H, m_primitives_H, parseElement(), QET::Icons::tr, ElementsLocation::uuid(), QET::version, and ElementsLocation::xml().
Referenced by getPictures(), getPrimitives(), and pixmap().
|
inlinestatic |
dropInstance Drop the instance of factory
Definition at line 73 of file elementpicturefactory.h.
References m_factory.
Referenced by QETApp::~QETApp().
| void ElementPictureFactory::getPictures | ( | const ElementsLocation & | location, |
| QPicture & | picture, | ||
| QPicture & | low_picture | ||
| ) |
ElementPictureFactory::getPictures Set the picture of the element at location. Note, picture can be null.
| location | |
| picture | |
| low_picture |
Definition at line 42 of file elementpicturefactory.cpp.
References build(), ElementsLocation::exist(), m_low_pictures_H, m_pictures_H, and ElementsLocation::uuid().
Referenced by Element::buildFromXml().
| ElementPictureFactory::primitives ElementPictureFactory::getPrimitives | ( | const ElementsLocation & | location | ) |
ElementPictureFactory::getPrimitives.
| location |
Definition at line 120 of file elementpicturefactory.cpp.
References build(), m_primitives_H, and ElementsLocation::uuid().
Referenced by ExportDialog::generateDxf().
|
inlinestatic |
instance
Definition at line 55 of file elementpicturefactory.h.
References ElementPictureFactory(), and m_factory.
Referenced by Element::buildFromXml(), ExportDialog::generateDxf(), ElementsLocation::icon(), and Element::pixmap().
|
private |
|
private |
Definition at line 418 of file elementpicturefactory.cpp.
References QET::attributeIsAReal(), ElementPictureFactory::primitives::m_arcs, and setPainterStyle().
Referenced by parseElement().
|
private |
Definition at line 401 of file elementpicturefactory.cpp.
References QET::attributeIsAReal(), ElementPictureFactory::primitives::m_circles, and setPainterStyle().
Referenced by parseElement().
|
private |
Definition at line 243 of file elementpicturefactory.cpp.
References parseArc(), parseCircle(), parseEllipse(), parseLine(), parsePolygon(), parseRect(), and parseText().
Referenced by build().
|
private |
Definition at line 377 of file elementpicturefactory.cpp.
References QET::attributeIsAReal(), ElementPictureFactory::primitives::m_arcs, and setPainterStyle().
Referenced by parseElement().
|
private |
Definition at line 254 of file elementpicturefactory.cpp.
References QET::attributeIsAReal(), Qet::Circle, Qet::Diamond, Qet::endTypeFromString(), PartLine::fourEndPoints(), ElementPictureFactory::primitives::m_lines, PartLine::requiredLengthForEndType(), setPainterStyle(), Qet::Simple, and Qet::Triangle.
Referenced by parseElement().
|
private |
Definition at line 445 of file elementpicturefactory.cpp.
References QET::attributeIsAReal(), ElementPictureFactory::primitives::m_polygons, and setPainterStyle().
Referenced by parseElement().
|
private |
Definition at line 353 of file elementpicturefactory.cpp.
References QET::attributeIsAReal(), ElementPictureFactory::primitives::m_rectangles, and setPainterStyle().
Referenced by parseElement().
|
private |
Definition at line 482 of file elementpicturefactory.cpp.
References QETApp::diagramTextsFont(), ElementPictureFactory::primitives::m_texts, and setPainterStyle().
Referenced by parseElement().
| QPixmap ElementPictureFactory::pixmap | ( | const ElementsLocation & | location | ) |
ElementPictureFactory::pixmap.
| location |
Definition at line 76 of file elementpicturefactory.cpp.
References build(), m_pictures_H, m_pixmap_H, ElementsLocation::uuid(), and ElementsLocation::xml().
Referenced by Element::pixmap().
|
private |
ElementPictureFactory::setPainterStyle apply the style store in dom to painter.
| dom | |
| painter |
Definition at line 550 of file elementpicturefactory.cpp.
Referenced by parseArc(), parseCircle(), parseEllipse(), parseLine(), parsePolygon(), parseRect(), and parseText().
|
staticprivate |
Definition at line 110 of file elementpicturefactory.h.
Referenced by dropInstance(), and instance().
|
private |
Definition at line 107 of file elementpicturefactory.h.
Referenced by build(), and getPictures().
|
private |
Definition at line 106 of file elementpicturefactory.h.
Referenced by build(), getPictures(), and pixmap().
|
private |
Definition at line 108 of file elementpicturefactory.h.
Referenced by pixmap().
|
private |
Definition at line 109 of file elementpicturefactory.h.
Referenced by build(), getPrimitives(), and ~ElementPictureFactory().
1.8.15