Skip to content

Commit

Permalink
- Fix svn:eol-style on OMEdit, OMNotebook, msl32
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@6672 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Oct 28, 2010
1 parent 1b0d433 commit 8e5881d
Show file tree
Hide file tree
Showing 57 changed files with 10,269 additions and 10,269 deletions.
454 changes: 227 additions & 227 deletions OMEdit/OMEditGUI/ComponentAnnotation.cpp

Large diffs are not rendered by default.

186 changes: 93 additions & 93 deletions OMEdit/OMEditGUI/ComponentAnnotation.h
@@ -1,93 +1,93 @@
/*
* This file is part of OpenModelica.
*
* Copyright (c) 1998-CurrentYear, Linkoping University,
* Department of Computer and Information Science,
* SE-58183 Linkoping, Sweden.
*
* All rights reserved.
*
* THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3
* AND THIS OSMC PUBLIC LICENSE (OSMC-PL).
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S
* ACCEPTANCE OF THE OSMC PUBLIC LICENSE.
*
* The OpenModelica software and the Open Source Modelica
* Consortium (OSMC) Public License (OSMC-PL) are obtained
* from Linkoping University, either from the above address,
* from the URLs: http://www.ida.liu.se/projects/OpenModelica or
* http://www.openmodelica.org, and in the OpenModelica distribution.
* GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html.
*
* This program is distributed WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH
* IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS
* OF OSMC-PL.
*
* See the full OSMC Public License conditions for more details.
*
* Main Authors 2010: Syed Adeel Asghar, Sonia Tariq
*
*/

#ifndef COMPONENTANNOTATION_H
#define COMPONENTANNOTATION_H

#include "ShapeAnnotation.h"
#include "IconAnnotation.h"
#include "ComponentsProperties.h"

class IconAnnotation;
class LineAnnotation;
class PolygonAnnotation;
class RectangleAnnotation;
class EllipseAnnotation;
class TextAnnotation;

class ComponentAnnotation : public ShapeAnnotation
{
Q_OBJECT
private:
QLineF line;
IconAnnotation *mpParentIcon;
bool mVisible;
qreal mScale;
qreal mAspectRatio;
bool mFlipHorizontal;
bool mFlipVertical;
qreal mRotateAngle;
public:
ComponentAnnotation(QString value, QString className, QString transformationStr,
ComponentsProperties *pComponentProperties, IconAnnotation *pParent);
ComponentAnnotation(QString value, QString className, QString transformationStr,
ComponentsProperties *pComponentProperties, IconAnnotation *pParent, bool libraryIcon);
void setDefaultValues();
void parseTransformationString(QString value);
QRectF boundingRect() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
qreal getRotateAngle();
IconAnnotation* getParentIcon();

QString mClassName;
QString mIconAnnotationString;
QString mTransformationString;
QRectF mRectangle; // stores the extent points
bool mPreserveAspectRatio;
qreal mInitialScale;
QList<qreal> mGrid;
qreal mPositionX;
qreal mPositionY;
ComponentsProperties *mpComponentProperties;
QList<LineAnnotation*> mpLinesList;
QList<PolygonAnnotation*> mpPolygonsList;
QList<RectangleAnnotation*> mpRectanglesList;
QList<EllipseAnnotation*> mpEllipsesList;
QList<TextAnnotation*> mpTextsList;
protected:
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
signals:
void componentClicked(ComponentAnnotation*);
};

#endif // COMPONENTANNOTATION_H
/*
* This file is part of OpenModelica.
*
* Copyright (c) 1998-CurrentYear, Linkoping University,
* Department of Computer and Information Science,
* SE-58183 Linkoping, Sweden.
*
* All rights reserved.
*
* THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3
* AND THIS OSMC PUBLIC LICENSE (OSMC-PL).
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S
* ACCEPTANCE OF THE OSMC PUBLIC LICENSE.
*
* The OpenModelica software and the Open Source Modelica
* Consortium (OSMC) Public License (OSMC-PL) are obtained
* from Linkoping University, either from the above address,
* from the URLs: http://www.ida.liu.se/projects/OpenModelica or
* http://www.openmodelica.org, and in the OpenModelica distribution.
* GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html.
*
* This program is distributed WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH
* IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS
* OF OSMC-PL.
*
* See the full OSMC Public License conditions for more details.
*
* Main Authors 2010: Syed Adeel Asghar, Sonia Tariq
*
*/

#ifndef COMPONENTANNOTATION_H
#define COMPONENTANNOTATION_H

#include "ShapeAnnotation.h"
#include "IconAnnotation.h"
#include "ComponentsProperties.h"

class IconAnnotation;
class LineAnnotation;
class PolygonAnnotation;
class RectangleAnnotation;
class EllipseAnnotation;
class TextAnnotation;

class ComponentAnnotation : public ShapeAnnotation
{
Q_OBJECT
private:
QLineF line;
IconAnnotation *mpParentIcon;
bool mVisible;
qreal mScale;
qreal mAspectRatio;
bool mFlipHorizontal;
bool mFlipVertical;
qreal mRotateAngle;
public:
ComponentAnnotation(QString value, QString className, QString transformationStr,
ComponentsProperties *pComponentProperties, IconAnnotation *pParent);
ComponentAnnotation(QString value, QString className, QString transformationStr,
ComponentsProperties *pComponentProperties, IconAnnotation *pParent, bool libraryIcon);
void setDefaultValues();
void parseTransformationString(QString value);
QRectF boundingRect() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
qreal getRotateAngle();
IconAnnotation* getParentIcon();

QString mClassName;
QString mIconAnnotationString;
QString mTransformationString;
QRectF mRectangle; // stores the extent points
bool mPreserveAspectRatio;
qreal mInitialScale;
QList<qreal> mGrid;
qreal mPositionX;
qreal mPositionY;
ComponentsProperties *mpComponentProperties;
QList<LineAnnotation*> mpLinesList;
QList<PolygonAnnotation*> mpPolygonsList;
QList<RectangleAnnotation*> mpRectanglesList;
QList<EllipseAnnotation*> mpEllipsesList;
QList<TextAnnotation*> mpTextsList;
protected:
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
signals:
void componentClicked(ComponentAnnotation*);
};

#endif // COMPONENTANNOTATION_H
208 changes: 104 additions & 104 deletions OMEdit/OMEditGUI/Components.cpp
@@ -1,104 +1,104 @@
/*
* This file is part of OpenModelica.
*
* Copyright (c) 1998-CurrentYear, Linkoping University,
* Department of Computer and Information Science,
* SE-58183 Linkoping, Sweden.
*
* All rights reserved.
*
* THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3
* AND THIS OSMC PUBLIC LICENSE (OSMC-PL).
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S
* ACCEPTANCE OF THE OSMC PUBLIC LICENSE.
*
* The OpenModelica software and the Open Source Modelica
* Consortium (OSMC) Public License (OSMC-PL) are obtained
* from Linkoping University, either from the above address,
* from the URLs: http://www.ida.liu.se/projects/OpenModelica or
* http://www.openmodelica.org, and in the OpenModelica distribution.
* GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html.
*
* This program is distributed WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH
* IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS
* OF OSMC-PL.
*
* See the full OSMC Public License conditions for more details.
*
* Main Authors 2010: Syed Adeel Asghar, Sonia Tariq
*
*/

#include "Components.h"

Components::Components(QString value, QString className, OMCProxy *omc)
: mIconAnnotationString(value), mClassName(className)
{
mpIcon = new IconAnnotation(value, "", className, omc);
if (mpIcon->mRectangle.width() < 1)
return;
mpIcon->getClassComponents(className, true);

this->mIconPixmap = QPixmap(mpIcon->mRectangle.width() * 0.10, mpIcon->mRectangle.height() * 0.10);
this->mIconPixmap.fill(QColor(Qt::transparent));
QPainter painter(&this->mIconPixmap);
painter.scale(1.0, -1.0);
painter.scale(0.82, 0.82);
painter.setWindow(mpIcon->mRectangle.toRect());

foreach (LineAnnotation *line, mpIcon->mpLinesList)
line->drawLineAnnotaion(&painter);

foreach (PolygonAnnotation *poly, mpIcon->mpPolygonsList)
poly->drawPolygonAnnotaion(&painter);

foreach (RectangleAnnotation *rect, mpIcon->mpRectanglesList)
rect->drawRectangleAnnotaion(&painter);

foreach (EllipseAnnotation *ellipse, mpIcon->mpEllipsesList)
ellipse->drawEllipseAnnotaion(&painter);


foreach (InheritanceAnnotation *inheritance, mpIcon->mpInheritanceList)
{
foreach (LineAnnotation *line, inheritance->mpLinesList)
line->drawLineAnnotaion(&painter);

foreach (PolygonAnnotation *poly, inheritance->mpPolygonsList)
poly->drawPolygonAnnotaion(&painter);

foreach (RectangleAnnotation *rect, inheritance->mpRectanglesList)
rect->drawRectangleAnnotaion(&painter);

foreach (EllipseAnnotation *ellipse, inheritance->mpEllipsesList)
ellipse->drawEllipseAnnotaion(&painter);
}

foreach (ComponentAnnotation *component, mpIcon->mpComponentsList)
{
painter.save();
painter.translate(component->mPositionX, component->mPositionY);
painter.scale(Helper::globalXScale, Helper::globalYScale);
foreach (LineAnnotation *line, component->mpLinesList)
line->drawLineAnnotaion(&painter);

foreach (PolygonAnnotation *poly, component->mpPolygonsList)
poly->drawPolygonAnnotaion(&painter);

foreach (RectangleAnnotation *rect, component->mpRectanglesList)
rect->drawRectangleAnnotaion(&painter);

foreach (EllipseAnnotation *ellipse, component->mpEllipsesList)
ellipse->drawEllipseAnnotaion(&painter);
painter.restore();
}

painter.end();
}

QPixmap Components::getIcon()
{
return mIconPixmap;
}
/*
* This file is part of OpenModelica.
*
* Copyright (c) 1998-CurrentYear, Linkoping University,
* Department of Computer and Information Science,
* SE-58183 Linkoping, Sweden.
*
* All rights reserved.
*
* THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3
* AND THIS OSMC PUBLIC LICENSE (OSMC-PL).
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S
* ACCEPTANCE OF THE OSMC PUBLIC LICENSE.
*
* The OpenModelica software and the Open Source Modelica
* Consortium (OSMC) Public License (OSMC-PL) are obtained
* from Linkoping University, either from the above address,
* from the URLs: http://www.ida.liu.se/projects/OpenModelica or
* http://www.openmodelica.org, and in the OpenModelica distribution.
* GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html.
*
* This program is distributed WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH
* IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS
* OF OSMC-PL.
*
* See the full OSMC Public License conditions for more details.
*
* Main Authors 2010: Syed Adeel Asghar, Sonia Tariq
*
*/

#include "Components.h"

Components::Components(QString value, QString className, OMCProxy *omc)
: mIconAnnotationString(value), mClassName(className)
{
mpIcon = new IconAnnotation(value, "", className, omc);
if (mpIcon->mRectangle.width() < 1)
return;
mpIcon->getClassComponents(className, true);

this->mIconPixmap = QPixmap(mpIcon->mRectangle.width() * 0.10, mpIcon->mRectangle.height() * 0.10);
this->mIconPixmap.fill(QColor(Qt::transparent));
QPainter painter(&this->mIconPixmap);
painter.scale(1.0, -1.0);
painter.scale(0.82, 0.82);
painter.setWindow(mpIcon->mRectangle.toRect());

foreach (LineAnnotation *line, mpIcon->mpLinesList)
line->drawLineAnnotaion(&painter);

foreach (PolygonAnnotation *poly, mpIcon->mpPolygonsList)
poly->drawPolygonAnnotaion(&painter);

foreach (RectangleAnnotation *rect, mpIcon->mpRectanglesList)
rect->drawRectangleAnnotaion(&painter);

foreach (EllipseAnnotation *ellipse, mpIcon->mpEllipsesList)
ellipse->drawEllipseAnnotaion(&painter);


foreach (InheritanceAnnotation *inheritance, mpIcon->mpInheritanceList)
{
foreach (LineAnnotation *line, inheritance->mpLinesList)
line->drawLineAnnotaion(&painter);

foreach (PolygonAnnotation *poly, inheritance->mpPolygonsList)
poly->drawPolygonAnnotaion(&painter);

foreach (RectangleAnnotation *rect, inheritance->mpRectanglesList)
rect->drawRectangleAnnotaion(&painter);

foreach (EllipseAnnotation *ellipse, inheritance->mpEllipsesList)
ellipse->drawEllipseAnnotaion(&painter);
}

foreach (ComponentAnnotation *component, mpIcon->mpComponentsList)
{
painter.save();
painter.translate(component->mPositionX, component->mPositionY);
painter.scale(Helper::globalXScale, Helper::globalYScale);
foreach (LineAnnotation *line, component->mpLinesList)
line->drawLineAnnotaion(&painter);

foreach (PolygonAnnotation *poly, component->mpPolygonsList)
poly->drawPolygonAnnotaion(&painter);

foreach (RectangleAnnotation *rect, component->mpRectanglesList)
rect->drawRectangleAnnotaion(&painter);

foreach (EllipseAnnotation *ellipse, component->mpEllipsesList)
ellipse->drawEllipseAnnotaion(&painter);
painter.restore();
}

painter.end();
}

QPixmap Components::getIcon()
{
return mIconPixmap;
}

0 comments on commit 8e5881d

Please sign in to comment.