Exemple #1
0
AGE_Vector3D::AGE_Vector3D(const AGE_Vector2D &vector, float zpos)
{
    setX(vector.x());
    setY(vector.y());
    setZ(zpos);

}
StereotypePropertiesCanvas::StereotypePropertiesCanvas(UmlCanvas * canvas,
        DiagramItem * it,
        QString s)
    : NoteCanvas(canvas, 0, 0, 0), di(it)
{
    connect(DrawingSettings::instance(), SIGNAL(changed()), this, SLOT(update()));

    note = s;	// already unicode

    QFontMetrics fm(the_canvas()->get_font(itsfont));
    QSize sz = fm.size(0, s);
    const int margin = (int)(2 * NOTE_MARGIN * the_canvas()->zoom());
    int w = sz.width() + margin;
    int h = sz.height() + margin;

    if (w < width())
        w = width();

    if (h < height())
        h = height();

    DiagramCanvas::resize(w, h);
    setZ(it->get_z());

    width_scale100 = w;
    height_scale100 = h;
    set_center100();
}
HomogenusPosition::HomogenusPosition(const Vector3& vec)
{
	setX(vec.getX());
	setY(vec.getY());
	setZ(vec.getZ());
	setW(1.0f);
};
DataSetView::DataSetView() : _metricsFont(_font)
{
	setFlag(QQuickItem::ItemHasContents, true);

	material.setColor(Qt::black);

	connect(this, &DataSetView::parentChanged, this, &DataSetView::myParentChanged);

	connect(this, &DataSetView::viewportXChanged, this, &DataSetView::viewportChanged);
	connect(this, &DataSetView::viewportYChanged, this, &DataSetView::viewportChanged);
	connect(this, &DataSetView::viewportWChanged, this, &DataSetView::viewportChanged);
	connect(this, &DataSetView::viewportHChanged, this, &DataSetView::viewportChanged);

	connect(this, &DataSetView::itemDelegateChanged, this, &DataSetView::reloadTextItems);
	connect(this, &DataSetView::rowNumberDelegateChanged, this, &DataSetView::reloadRowNumbers);
	connect(this, &DataSetView::columnHeaderDelegateChanged, this, &DataSetView::reloadColumnHeaders);
	connect(this, &DataSetView::leftTopCornerDelegateChanged, this, &DataSetView::reloadLeftTopCorner);

	connect(this, &DataSetView::itemHorizontalPaddingChanged, this, &DataSetView::calculateCellSizes);
	connect(this, &DataSetView::itemVerticalPaddingChanged, this, &DataSetView::calculateCellSizes);

	connect(this, &DataSetView::itemSizeChanged, this, &DataSetView::reloadTextItems);
	connect(this, &DataSetView::itemSizeChanged, this, &DataSetView::reloadRowNumbers);
	connect(this, &DataSetView::itemSizeChanged, this, &DataSetView::reloadColumnHeaders);
	connect(this, &DataSetView::itemSizeChanged, this, &DataSetView::reloadLeftTopCorner);

	setZ(10);
}
Exemple #5
0
const Vec3f& Vec3f::operator*=(float fValue)
{
    setX(X()*fValue);
    setY(Y()*fValue);
    setZ(Z()*fValue);
    return (*this);
}
Exemple #6
0
            Point3& Point3::rotate(const Point3 direction, const double &angle) {
                const double cosTheta = cos(angle);
                const double sinTheta = sin(angle);
                const double x = direction.getX();
                const double y = direction.getY();
                const double z = direction.getZ();

                Point3 p;
                double newX = (cosTheta + (1 - cosTheta) * x * x) * m_x;
                newX += ((1 - cosTheta) * x * y - z * sinTheta) * m_y;
                newX += ((1 - cosTheta) * x * z + y * sinTheta) * m_z;

                double newY = ((1 - cosTheta) * x * y + z * sinTheta) * m_x;
                newY += (cosTheta + (1 - cosTheta) * y * y) * m_y;
                newY += ((1 - cosTheta) * y * z - x * sinTheta) * m_z;

                double newZ = ((1 - cosTheta) * x * z - y * sinTheta) * m_x;
                newZ += ((1 - cosTheta) * y * z + x * sinTheta) * m_y;
                newZ += (cosTheta + (1 - cosTheta) * z * z) * m_z;

                setX(newX);
                setY(newY);
                setZ(newZ);

                return *this;
            }
Exemple #7
0
const Vec3f& Vec3f::operator*=(unsigned int uiValue)
{
    setX(X()*uiValue);
    setY(Y()*uiValue);
    setZ(Z()*uiValue);
    return (*this);
}
Exemple #8
0
const Vec3f& Vec3f::operator*=(double lfValue)
{
    setX(X()*lfValue);
    setY(Y()*lfValue);
    setZ(Z()*lfValue);
    return (*this);
}
Exemple #9
0
	void Rotation::set(const Double& av, const Double& ax, const Double& ay, const Double& az)
	{
		a = av;
		setX(ax);
		setY(ay);
		setZ(az);
	}
Exemple #10
0
const Vec3f& Vec3f::operator*=(int iValue)
{
    setX(X()*iValue);
    setY(Y()*iValue);
    setZ(Z()*iValue);
    return (*this);
}
Exemple #11
0
KReportItemCheckBox::KReportItemCheckBox(const QDomNode &element)
{
    createProperties();
    QDomNodeList nl = element.childNodes();
    QString n;
    QDomNode node;

    nameProperty()->setValue(element.toElement().attribute(QLatin1String("report:name")));
    m_controlSource->setValue(element.toElement().attribute(QLatin1String("report:item-data-source")));
    setZ(element.toElement().attribute(QLatin1String("report:z-index")).toDouble());
    m_foregroundColor->setValue(QColor(element.toElement().attribute(QLatin1String("fo:foreground-color"))));
    m_checkStyle->setValue(element.toElement().attribute(QLatin1String("report:check-style")));
    m_staticValue->setValue(QVariant(element.toElement().attribute(QLatin1String("report:value"))).toBool());

    parseReportRect(element.toElement());

    for (int i = 0; i < nl.count(); i++) {
        node = nl.item(i);
        n = node.nodeName();

        if (n == QLatin1String("report:line-style")) {
            KReportLineStyle ls;
            if (parseReportLineStyleData(node.toElement(), &ls)) {
                m_lineWeight->setValue(ls.width());
                m_lineColor->setValue(ls.color());
                m_lineStyle->setValue(QPen(ls.penStyle()));
            }
        } else {
            kreportpluginWarning() << "while parsing check element encountered unknow element: " << n;
        }
    }

}
    PfPvPlotZoneLabel(PfPvPlot *_parent, int _zone_number)
    {
        parent = _parent;
        zone_number = _zone_number;

        RideItem *rideItem = parent->rideItem;
        const Zones *zones = rideItem->zones;
        int zone_range = rideItem->zoneRange();

        setZ(1.0 + zone_number / 100.0);

        // create new zone labels if we're shading
        if (zone_range >= 0) {

            // retrieve zone setup
            QList <int> zone_lows = zones->getZoneLows(zone_range);
            QList <QString> zone_names = zones->getZoneNames(zone_range);
            int num_zones = zone_lows.size();
            assert(zone_names.size() == num_zones);

            if (zone_number < num_zones) {

                watts = ((zone_number + 1 < num_zones) ?  0.5 * (zone_lows[zone_number] + zone_lows[zone_number + 1]) : ( (zone_number > 0) ?  (1.5 * zone_lows[zone_number] - 0.5 * zone_lows[zone_number - 1]) : 2.0 * zone_lows[zone_number]));

                text = QwtText(zone_names[zone_number]);
                text.setFont(QFont("Helvetica",24, QFont::Bold));
                QColor text_color = zoneColor(zone_number, num_zones);
                text_color.setAlpha(64);
                text.setColor(text_color);
            }
        }
    }
Exemple #13
0
LedgerLine::LedgerLine(Score* s)
   : Line(s, false)
      {
      setZ(int(Element::Type::NOTE) * 100 - 50);
      setSelectable(false);
      _next = 0;
      }
Exemple #14
0
Vertex& Vertex::operator=(const Vect &other) {
    setX(other.getX());
    setY(other.getY());
    setZ(other.getZ());
    
    return *this;
}
Exemple #15
0
void SColor::B(float b) {
    if (b > 1.0f)
        b = 1;
    if (b < 0)
        b = 0;
    setZ(b);
}
PacketMotion::PacketMotion(int8_t x, int8_t y, int8_t z, int8_t rot) {
	setX(x);
	setY(y);
	setZ(z);
	setRot(rot);

	mCurrentField = 0;
}
Exemple #17
0
Triangle::Triangle(float x, float y, float z, float size, int farbindex):size(size)
{
	setX(x);
	setY(y);
	setZ(z);
	setFilled(true);
	setActiveColorByIndex(farbindex);
}
Exemple #18
0
void Poly::transform(const Matrix4d &T) {
  for (uint i = 0; i < vertices.size();  i++) {
    const Vector3d v = T * getVertexCircular3(i) ;
    vertices[i].set(v.x(),v.y());
  }
  setZ((T * Vector3d(0,0,z)).z());
  calcHole();
}
// Initialize internal members
void AllPlotSlopeCurve::init()
{

    d_data = new PrivateData;
    setData( new QwtPointSeriesData() );

    setZ( 25.0 );
}
            Point3& Point3::rotateX(const double &angle) {
                double y = cos(angle) * getY() - sin(angle) * getZ();
                double z = sin(angle) * getY() + cos(angle) * getZ();
                setY(y);
                setZ(z);

                return (*this);
            }
Exemple #21
0
void FragmentCanvas::set_z(double z) {
  setZ(z);
  
  Q3PtrListIterator<FragmentSeparatorCanvas> it(separators);
  
  for (; it.current(); ++it)
    it.current()->update();
}
//! Constructor 
QwtPlotLegendItem::QwtPlotLegendItem():
    QwtPlotItem( QwtText( "Legend" ) )
{
    d_data = new PrivateData;

    setItemInterest( QwtPlotItem::LegendInterest, true );
    setZ( 100.0 );
}
Exemple #23
0
Vector4D& Vector4D::operator*=(float m)
{
	setX(x() * m);
	setY(y() * m);
	setZ(z() * m);
	setW(w() * m);
	return *this;
}
Exemple #24
0
Decoration::Decoration( Cell * parent, QCanvas *canvas)
	: GraphicalCell( parent->getRow(), parent->getCol(), canvas )
{
	_parent = parent;
	setZ( CAN_DECO );
	setSequence( ImageTheme.decoration );
	setFrame( 0 );
}
Exemple #25
0
Vector4D& Vector4D::operator/=(float d)
{
	setX(x() / d);
	setY(y() / d);
	setZ(z() / d);
	setW(w() / d);
	return *this;
}
            Point3& Point3::rotateY(const double &angle) {
                double x = cos(angle) * getX() - sin(angle) * getZ();
                double z = sin(angle) * getX() + cos(angle) * getZ();
                setX(x);
                setZ(z);

                return (*this);
            }
Exemple #27
0
Vector4D& Vector4D::operator/=(const Vector4D& vector)
{
	setX(x() / vector.x());
	setY(y() / vector.y());
	setZ(z() / vector.z());
	setW(w() / vector.w());
	return *this;
}
Exemple #28
0
BoxWidget::BoxWidget(UMLView * view, Uml::IDType id)
        : UMLWidget(view, id) {
    setSize(100,80);
    UMLWidget::setBaseType( Uml::wt_Box );
    WidgetBase::m_bUsesDiagramLineColour = false;  // boxes be black
    WidgetBase::m_LineColour = QColor("black");
    setZ(m_origZ = 0);
}
// Sets all data automatically
void cUOTxConfirmLogin::fromChar( P_CHAR pChar )
{
	setSerial( pChar->serial );
	setBody( pChar->id() );
	setDirection( pChar->dir );
	setX( pChar->pos.x );
	setY( pChar->pos.y );
	setZ( pChar->pos.z );
}
Exemple #30
0
    PfPvPlotZoneLabel(PfPvPlot *_parent, int _zone_number)
    {
        parent = _parent;
        RideItem *rideItem = parent->rideItem;
        zone_number = _zone_number;

        // get zone data from ride or athlete ...
        const Zones *zones;
        int zone_range = -1;

        if (parent->context->isCompareIntervals) {

            zones = parent->context->athlete->zones();
            if (!zones) return;

            // use first compare interval date
            if (parent->context->compareIntervals.count())
                zone_range = zones->whichRange(parent->context->compareIntervals[0].data->startTime().date());

            // still not set 
            if (zone_range == -1)
                zone_range = zones->whichRange(QDate::currentDate());

        } else if (rideItem) {

            zones = rideItem->zones;
            zone_range = rideItem->zoneRange();

        } else {

            return; // nulls

        }

        setZ(1.0 + zone_number / 100.0);

        // create new zone labels if we're shading
        if (zone_range >= 0) {

            // retrieve zone setup
            QList <int> zone_lows = zones->getZoneLows(zone_range);
            QList <QString> zone_names = zones->getZoneNames(zone_range);
            int num_zones = zone_lows.size();
            if(zone_names.size() != num_zones) return;

            if (zone_number < num_zones) {

                watts = ((zone_number + 1 < num_zones) ?  0.5 * (zone_lows[zone_number] + zone_lows[zone_number + 1]) : ( (zone_number > 0) ?  (1.5 * zone_lows[zone_number] - 0.5 * zone_lows[zone_number - 1]) : 2.0 * zone_lows[zone_number]));

                text = QwtText(zone_names[zone_number]);
                text.setFont(QFont("Helvetica",24, QFont::Bold));
                QColor text_color = zoneColor(zone_number, num_zones);
                text_color.setAlpha(64);
                text.setColor(text_color);
            }
        }
    }