Skip to content

Commit

Permalink
Removed unused constructors of the shapes.
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Oct 13, 2015
1 parent f0d262f commit 4a71f04
Show file tree
Hide file tree
Showing 14 changed files with 161 additions and 218 deletions.
28 changes: 8 additions & 20 deletions OMEdit/OMEditGUI/Annotations/BitmapAnnotation.cpp
Expand Up @@ -38,16 +38,20 @@

#include "BitmapAnnotation.h"

BitmapAnnotation::BitmapAnnotation(QString classFileName, QString annotation, Component *pParent)
: ShapeAnnotation(pParent), mpComponent(pParent)
BitmapAnnotation::BitmapAnnotation(QString classFileName, QString annotation, GraphicsView *pGraphicsView)
: ShapeAnnotation(false, pGraphicsView, 0)
{
mpComponent = 0;
mClassFileName = classFileName;
// set the default values
GraphicItem::setDefaults();
ShapeAnnotation::setDefaults();
// set users default value by reading the settings file.
ShapeAnnotation::setUserDefaults();
parseShapeAnnotation(annotation);
setPos(mOrigin);
setRotation(mRotation);
setShapeFlags(true);
connect(this, SIGNAL(updateClassAnnotation()), this, SIGNAL(updateReferenceShapes()));
connect(this, SIGNAL(updateClassAnnotation()), mpGraphicsView, SLOT(addClassAnnotation()));
}

BitmapAnnotation::BitmapAnnotation(ShapeAnnotation *pShapeAnnotation, Component *pParent)
Expand All @@ -62,22 +66,6 @@ BitmapAnnotation::BitmapAnnotation(ShapeAnnotation *pShapeAnnotation, Component
connect(pShapeAnnotation, SIGNAL(deleted()), this, SLOT(referenceShapeDeleted()));
}

BitmapAnnotation::BitmapAnnotation(QString classFileName, QString annotation, GraphicsView *pGraphicsView)
: ShapeAnnotation(false, pGraphicsView, 0)
{
mpComponent = 0;
mClassFileName = classFileName;
// set the default values
GraphicItem::setDefaults();
ShapeAnnotation::setDefaults();
// set users default value by reading the settings file.
ShapeAnnotation::setUserDefaults();
parseShapeAnnotation(annotation);
setShapeFlags(true);
connect(this, SIGNAL(updateClassAnnotation()), this, SIGNAL(updateReferenceShapes()));
connect(this, SIGNAL(updateClassAnnotation()), mpGraphicsView, SLOT(addClassAnnotation()));
}

BitmapAnnotation::BitmapAnnotation(ShapeAnnotation *pShapeAnnotation, GraphicsView *pGraphicsView)
: ShapeAnnotation(true, pGraphicsView, 0)
{
Expand Down
6 changes: 4 additions & 2 deletions OMEdit/OMEditGUI/Annotations/BitmapAnnotation.h
Expand Up @@ -48,9 +48,11 @@ class BitmapAnnotation : public ShapeAnnotation
{
Q_OBJECT
public:
BitmapAnnotation(QString classFileName, QString annotation, Component *pParent);
BitmapAnnotation(ShapeAnnotation *pShapeAnnotation, Component *pParent);
// Used for icon/diagram shape
BitmapAnnotation(QString classFileName, QString annotation, GraphicsView *pGraphicsView);
// Used for shape inside a component
BitmapAnnotation(ShapeAnnotation *pShapeAnnotation, Component *pParent);
// Used for icon/diagram inherited shape
BitmapAnnotation(ShapeAnnotation *pShapeAnnotation, GraphicsView *pGraphicsView);
void parseShapeAnnotation(QString annotation);
QRectF boundingRect() const;
Expand Down
26 changes: 7 additions & 19 deletions OMEdit/OMEditGUI/Annotations/EllipseAnnotation.cpp
Expand Up @@ -38,16 +38,19 @@

#include "EllipseAnnotation.h"

EllipseAnnotation::EllipseAnnotation(QString annotation, Component *pParent)
: ShapeAnnotation(pParent)
EllipseAnnotation::EllipseAnnotation(QString annotation, GraphicsView *pGraphicsView)
: ShapeAnnotation(false, pGraphicsView, 0)
{
// set the default values
GraphicItem::setDefaults();
FilledShape::setDefaults();
ShapeAnnotation::setDefaults();
// set users default value by reading the settings file.
ShapeAnnotation::setUserDefaults();
parseShapeAnnotation(annotation);
setPos(mOrigin);
setRotation(mRotation);
setShapeFlags(true);
connect(this, SIGNAL(updateClassAnnotation()), this, SIGNAL(updateReferenceShapes()));
connect(this, SIGNAL(updateClassAnnotation()), mpGraphicsView, SLOT(addClassAnnotation()));
}

EllipseAnnotation::EllipseAnnotation(ShapeAnnotation *pShapeAnnotation, Component *pParent)
Expand All @@ -62,21 +65,6 @@ EllipseAnnotation::EllipseAnnotation(ShapeAnnotation *pShapeAnnotation, Componen
connect(pShapeAnnotation, SIGNAL(deleted()), this, SLOT(referenceShapeDeleted()));
}

EllipseAnnotation::EllipseAnnotation(QString annotation, GraphicsView *pGraphicsView)
: ShapeAnnotation(false, pGraphicsView, 0)
{
// set the default values
GraphicItem::setDefaults();
FilledShape::setDefaults();
ShapeAnnotation::setDefaults();
// set users default value by reading the settings file.
ShapeAnnotation::setUserDefaults();
parseShapeAnnotation(annotation);
setShapeFlags(true);
connect(this, SIGNAL(updateClassAnnotation()), this, SIGNAL(updateReferenceShapes()));
connect(this, SIGNAL(updateClassAnnotation()), mpGraphicsView, SLOT(addClassAnnotation()));
}

EllipseAnnotation::EllipseAnnotation(ShapeAnnotation *pShapeAnnotation, GraphicsView *pGraphicsView)
: ShapeAnnotation(true, pGraphicsView, 0)
{
Expand Down
6 changes: 4 additions & 2 deletions OMEdit/OMEditGUI/Annotations/EllipseAnnotation.h
Expand Up @@ -48,9 +48,11 @@ class EllipseAnnotation : public ShapeAnnotation
{
Q_OBJECT
public:
EllipseAnnotation(QString annotation, Component *pParent);
EllipseAnnotation(ShapeAnnotation *pShapeAnnotation, Component *pParent);
// Used for icon/diagram shape
EllipseAnnotation(QString annotation, GraphicsView *pGraphicsView);
// Used for shape inside a component
EllipseAnnotation(ShapeAnnotation *pShapeAnnotation, Component *pParent);
// Used for icon/diagram inherited shape
EllipseAnnotation(ShapeAnnotation *pShapeAnnotation, GraphicsView *pGraphicsView);
void parseShapeAnnotation(QString annotation);
QRectF boundingRect() const;
Expand Down
130 changes: 58 additions & 72 deletions OMEdit/OMEditGUI/Annotations/LineAnnotation.cpp
Expand Up @@ -38,18 +38,21 @@

#include "LineAnnotation.h"

LineAnnotation::LineAnnotation(QString annotation, Component *pParent)
: ShapeAnnotation(pParent)
LineAnnotation::LineAnnotation(QString annotation, GraphicsView *pGraphicsView)
: ShapeAnnotation(false, pGraphicsView, 0)
{
setLineType(LineAnnotation::ComponentType);
setLineType(LineAnnotation::ShapeType);
setStartComponent(0);
setEndComponent(0);
// set the default values
GraphicItem::setDefaults();
ShapeAnnotation::setDefaults();
// set users default value by reading the settings file.
ShapeAnnotation::setUserDefaults();
parseShapeAnnotation(annotation);
setPos(mOrigin);
setRotation(mRotation);
setShapeFlags(true);
connect(this, SIGNAL(updateClassAnnotation()), this, SIGNAL(updateReferenceShapes()));
connect(this, SIGNAL(updateClassAnnotation()), mpGraphicsView, SLOT(addClassAnnotation()));
}

LineAnnotation::LineAnnotation(ShapeAnnotation *pShapeAnnotation, Component *pParent)
Expand All @@ -67,73 +70,6 @@ LineAnnotation::LineAnnotation(ShapeAnnotation *pShapeAnnotation, Component *pPa
connect(pShapeAnnotation, SIGNAL(deleted()), this, SLOT(referenceShapeDeleted()));
}

LineAnnotation::LineAnnotation(Component *pParent)
: ShapeAnnotation(pParent)
{
setLineType(LineAnnotation::ComponentType);
setStartComponent(0);
setEndComponent(0);
// set the default values
GraphicItem::setDefaults();
ShapeAnnotation::setDefaults();
// create a red cross
setLineColor(QColor(255, 0, 0));
// create a red cross with points
addPoint(QPointF(-100, -100));
addPoint(QPointF(100, 100));
addPoint(QPointF(-100, 100));
addPoint(QPointF(100, -100));
addPoint(QPointF(-100, -100));
addPoint(QPointF(-100, 100));
addPoint(QPointF(100, 100));
addPoint(QPointF(100, -100));
setPos(mOrigin);
setRotation(mRotation);
}

LineAnnotation::LineAnnotation(QString annotation, GraphicsView *pGraphicsView)
: ShapeAnnotation(false, pGraphicsView, 0)
{
setLineType(LineAnnotation::ShapeType);
setStartComponent(0);
setEndComponent(0);
// set the default values
GraphicItem::setDefaults();
ShapeAnnotation::setDefaults();
// set users default value by reading the settings file.
ShapeAnnotation::setUserDefaults();
parseShapeAnnotation(annotation);
setShapeFlags(true);
connect(this, SIGNAL(updateClassAnnotation()), this, SIGNAL(updateReferenceShapes()));
connect(this, SIGNAL(updateClassAnnotation()), mpGraphicsView, SLOT(addClassAnnotation()));
}

LineAnnotation::LineAnnotation(GraphicsView *pGraphicsView)
: ShapeAnnotation(true, pGraphicsView, 0)
{
setLineType(LineAnnotation::ShapeType);
setStartComponent(0);
setEndComponent(0);
// set the default values
GraphicItem::setDefaults();
ShapeAnnotation::setDefaults();
// set users default value by reading the settings file.
ShapeAnnotation::setUserDefaults();
// create a red cross
setLineColor(QColor(255, 0, 0));
// create a red cross with points
addPoint(QPointF(-100, -100));
addPoint(QPointF(100, 100));
addPoint(QPointF(-100, 100));
addPoint(QPointF(100, -100));
addPoint(QPointF(-100, -100));
addPoint(QPointF(-100, 100));
addPoint(QPointF(100, 100));
addPoint(QPointF(100, -100));
setShapeFlags(true);
mpGraphicsView->addItem(this);
}

LineAnnotation::LineAnnotation(ShapeAnnotation *pShapeAnnotation, GraphicsView *pGraphicsView)
: ShapeAnnotation(true, pGraphicsView, 0)
{
Expand Down Expand Up @@ -193,6 +129,56 @@ LineAnnotation::LineAnnotation(QString annotation, Component *pStartComponent, C
mpGraphicsView->addItem(this);
}

LineAnnotation::LineAnnotation(Component *pParent)
: ShapeAnnotation(pParent)
{
setLineType(LineAnnotation::ComponentType);
setStartComponent(0);
setEndComponent(0);
// set the default values
GraphicItem::setDefaults();
ShapeAnnotation::setDefaults();
// create a red cross
setLineColor(QColor(255, 0, 0));
// create a red cross with points
addPoint(QPointF(-100, -100));
addPoint(QPointF(100, 100));
addPoint(QPointF(-100, 100));
addPoint(QPointF(100, -100));
addPoint(QPointF(-100, -100));
addPoint(QPointF(-100, 100));
addPoint(QPointF(100, 100));
addPoint(QPointF(100, -100));
setPos(mOrigin);
setRotation(mRotation);
}

LineAnnotation::LineAnnotation(GraphicsView *pGraphicsView)
: ShapeAnnotation(true, pGraphicsView, 0)
{
setLineType(LineAnnotation::ShapeType);
setStartComponent(0);
setEndComponent(0);
// set the default values
GraphicItem::setDefaults();
ShapeAnnotation::setDefaults();
// set users default value by reading the settings file.
ShapeAnnotation::setUserDefaults();
// create a red cross
setLineColor(QColor(255, 0, 0));
// create a red cross with points
addPoint(QPointF(-100, -100));
addPoint(QPointF(100, 100));
addPoint(QPointF(-100, 100));
addPoint(QPointF(100, -100));
addPoint(QPointF(-100, -100));
addPoint(QPointF(-100, 100));
addPoint(QPointF(100, 100));
addPoint(QPointF(100, -100));
setShapeFlags(true);
mpGraphicsView->addItem(this);
}

void LineAnnotation::parseShapeAnnotation(QString annotation)
{
GraphicItem::parseShapeAnnotation(annotation);
Expand Down
14 changes: 10 additions & 4 deletions OMEdit/OMEditGUI/Annotations/LineAnnotation.h
Expand Up @@ -53,14 +53,20 @@ class LineAnnotation : public ShapeAnnotation
ConnectionType, /* Line is a connection. */
ShapeType /* Line is a custom shape. */
};
LineAnnotation(QString annotation, Component *pParent);
LineAnnotation(ShapeAnnotation *pShapeAnnotation, Component *pParent);
LineAnnotation(Component *pParent);
// Used for icon/diagram shape
LineAnnotation(QString annotation, GraphicsView *pGraphicsView);
LineAnnotation(GraphicsView *pGraphicsView);
// Used for shape inside a component
LineAnnotation(ShapeAnnotation *pShapeAnnotation, Component *pParent);
// Used for icon/diagram inherited shape
LineAnnotation(ShapeAnnotation *pShapeAnnotation, GraphicsView *pGraphicsView);
// Used for creating connection
LineAnnotation(Component *pStartComponent, GraphicsView *pGraphicsView);
// Used for reading a connection
LineAnnotation(QString annotation, Component *pStartComponent, Component *pEndComponent, GraphicsView *pGraphicsView);
// Used for non-exisiting component
LineAnnotation(Component *pParent);
// Used for non-existing class
LineAnnotation(GraphicsView *pGraphicsView);
void parseShapeAnnotation(QString annotation);
QPainterPath getShape() const;
QRectF boundingRect() const;
Expand Down
26 changes: 7 additions & 19 deletions OMEdit/OMEditGUI/Annotations/PolygonAnnotation.cpp
Expand Up @@ -38,16 +38,19 @@

#include "PolygonAnnotation.h"

PolygonAnnotation::PolygonAnnotation(QString annotation, Component *pParent)
: ShapeAnnotation(pParent)
PolygonAnnotation::PolygonAnnotation(QString annotation, GraphicsView *pGraphicsView)
: ShapeAnnotation(false, pGraphicsView, 0)
{
// set the default values
GraphicItem::setDefaults();
FilledShape::setDefaults();
ShapeAnnotation::setDefaults();
// set users default value by reading the settings file.
ShapeAnnotation::setUserDefaults();
parseShapeAnnotation(annotation);
setPos(mOrigin);
setRotation(mRotation);
setShapeFlags(true);
connect(this, SIGNAL(updateClassAnnotation()), this, SIGNAL(updateReferenceShapes()));
connect(this, SIGNAL(updateClassAnnotation()), mpGraphicsView, SLOT(addClassAnnotation()));
}

PolygonAnnotation::PolygonAnnotation(ShapeAnnotation *pShapeAnnotation, Component *pParent)
Expand All @@ -62,21 +65,6 @@ PolygonAnnotation::PolygonAnnotation(ShapeAnnotation *pShapeAnnotation, Componen
connect(pShapeAnnotation, SIGNAL(deleted()), this, SLOT(referenceShapeDeleted()));
}

PolygonAnnotation::PolygonAnnotation(QString annotation, GraphicsView *pGraphicsView)
: ShapeAnnotation(false, pGraphicsView, 0)
{
// set the default values
GraphicItem::setDefaults();
FilledShape::setDefaults();
ShapeAnnotation::setDefaults();
// set users default value by reading the settings file.
ShapeAnnotation::setUserDefaults();
parseShapeAnnotation(annotation);
setShapeFlags(true);
connect(this, SIGNAL(updateClassAnnotation()), this, SIGNAL(updateReferenceShapes()));
connect(this, SIGNAL(updateClassAnnotation()), mpGraphicsView, SLOT(addClassAnnotation()));
}

PolygonAnnotation::PolygonAnnotation(ShapeAnnotation *pShapeAnnotation, GraphicsView *pGraphicsView)
: ShapeAnnotation(true, pGraphicsView, 0)
{
Expand Down
6 changes: 4 additions & 2 deletions OMEdit/OMEditGUI/Annotations/PolygonAnnotation.h
Expand Up @@ -48,9 +48,11 @@ class PolygonAnnotation : public ShapeAnnotation
{
Q_OBJECT
public:
PolygonAnnotation(QString annotation, Component *pParent);
PolygonAnnotation(ShapeAnnotation *pShapeAnnotation, Component *pParent);
// Used for icon/diagram shape
PolygonAnnotation(QString annotation, GraphicsView *pGraphicsView);
// Used for shape inside a component
PolygonAnnotation(ShapeAnnotation *pShapeAnnotation, Component *pParent);
// Used for icon/diagram inherited shape
PolygonAnnotation(ShapeAnnotation *pShapeAnnotation, GraphicsView *pGraphicsView);
void parseShapeAnnotation(QString annotation);
QPainterPath getShape() const;
Expand Down

0 comments on commit 4a71f04

Please sign in to comment.