diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:44:41 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:44:41 +0000 |
commit | a374efce3a207b39514be3c52264091400ce297e (patch) | |
tree | 77bdf654b55826d4f59b53a5621310206bcaead1 /kig/objects/intersection_types.cc | |
parent | f81a494f3957d5cf38c787973415597941934727 (diff) | |
download | tdeedu-a374efce3a207b39514be3c52264091400ce297e.tar.gz tdeedu-a374efce3a207b39514be3c52264091400ce297e.zip |
TQt4 port kdeedu
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1236073 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kig/objects/intersection_types.cc')
-rw-r--r-- | kig/objects/intersection_types.cc | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/kig/objects/intersection_types.cc b/kig/objects/intersection_types.cc index 804d498d..92cbefff 100644 --- a/kig/objects/intersection_types.cc +++ b/kig/objects/intersection_types.cc @@ -55,19 +55,19 @@ const ConicLineIntersectionType* ConicLineIntersectionType::instance() return &t; } -ObjectImp* ConicLineIntersectionType::calc( const Args& parents, const KigDocument& ) const +ObjectImp* ConicLineIntersectionType::calc( const Args& tqparents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; + if ( ! margsparser.checkArgs( tqparents ) ) return new InvalidImp; - int side = static_cast<const IntImp*>( parents[2] )->data(); + int side = static_cast<const IntImp*>( tqparents[2] )->data(); assert( side == 1 || side == -1 ); - const LineData line = static_cast<const AbstractLineImp*>( parents[1] )->data(); + const LineData line = static_cast<const AbstractLineImp*>( tqparents[1] )->data(); Coordinate ret; - if ( parents[0]->inherits( CircleImp::stype() ) ) + if ( tqparents[0]->inherits( CircleImp::stype() ) ) { // easy case.. - const CircleImp* c = static_cast<const CircleImp*>( parents[0] ); + const CircleImp* c = static_cast<const CircleImp*>( tqparents[0] ); ret = calcCircleLineIntersect( c->center(), c->squareRadius(), line, side ); } @@ -75,7 +75,7 @@ ObjectImp* ConicLineIntersectionType::calc( const Args& parents, const KigDocume { // harder case.. ret = calcConicLineIntersect( - static_cast<const ConicImp*>( parents[0] )->cartesianData(), + static_cast<const ConicImp*>( tqparents[0] )->cartesianData(), line, 0.0, side ); } if ( ret.valid() ) return new PointImp( ret ); @@ -109,18 +109,18 @@ const ConicLineOtherIntersectionType* ConicLineOtherIntersectionType::instance() return &t; } -ObjectImp* ConicLineOtherIntersectionType::calc( const Args& parents, const KigDocument& ) const +ObjectImp* ConicLineOtherIntersectionType::calc( const Args& tqparents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; + if ( ! margsparser.checkArgs( tqparents ) ) return new InvalidImp; - Coordinate p = static_cast<const PointImp*>( parents[2] )->coordinate(); - const LineData line = static_cast<const AbstractLineImp*>( parents[1] )->data(); + Coordinate p = static_cast<const PointImp*>( tqparents[2] )->coordinate(); + const LineData line = static_cast<const AbstractLineImp*>( tqparents[1] )->data(); Coordinate ret; -// if ( parents[0]->inherits( CircleImp::stype() ) ) +// if ( tqparents[0]->inherits( CircleImp::stype() ) ) // { // // easy case.. -// const CircleImp* c = static_cast<const CircleImp*>( parents[0] ); +// const CircleImp* c = static_cast<const CircleImp*>( tqparents[0] ); // ret = calcCircleLineIntersect( // c->center(), c->squareRadius(), line, side, valid ); // } @@ -133,7 +133,7 @@ ObjectImp* ConicLineOtherIntersectionType::calc( const Args& parents, const KigD double bay = line.b.y - line.a.y; double knownparam = (pax*bax + pay*bay)/(bax*bax + bay*bay); ret = calcConicLineIntersect( - static_cast<const ConicImp*>( parents[0] )->cartesianData(), + static_cast<const ConicImp*>( tqparents[0] )->cartesianData(), line, knownparam, 0 ); // } if ( ret.valid() ) return new PointImp( ret ); @@ -164,16 +164,16 @@ const LineLineIntersectionType* LineLineIntersectionType::instance() return &t; } -ObjectImp* LineLineIntersectionType::calc( const Args& parents, const KigDocument& d ) const +ObjectImp* LineLineIntersectionType::calc( const Args& tqparents, const KigDocument& d ) const { - if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; + if ( ! margsparser.checkArgs( tqparents ) ) return new InvalidImp; Coordinate p = calcIntersectionPoint( - static_cast<const AbstractLineImp*>( parents[0] )->data(), - static_cast<const AbstractLineImp*>( parents[1] )->data() ); - if ( static_cast<const AbstractLineImp*>( parents[0] )->containsPoint( p, d ) && - static_cast<const AbstractLineImp*>( parents[1] )->containsPoint( p, d ) ) + static_cast<const AbstractLineImp*>( tqparents[0] )->data(), + static_cast<const AbstractLineImp*>( tqparents[1] )->data() ); + if ( static_cast<const AbstractLineImp*>( tqparents[0] )->containsPoint( p, d ) && + static_cast<const AbstractLineImp*>( tqparents[1] )->containsPoint( p, d ) ) return new PointImp( p ); else return new InvalidImp(); } @@ -204,15 +204,15 @@ const LineCubicIntersectionType* LineCubicIntersectionType::instance() return &t; } -ObjectImp* LineCubicIntersectionType::calc( const Args& parents, const KigDocument& ) const +ObjectImp* LineCubicIntersectionType::calc( const Args& tqparents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; + if ( ! margsparser.checkArgs( tqparents ) ) return new InvalidImp; - int which = static_cast<const IntImp*>( parents[2] )->data(); + int which = static_cast<const IntImp*>( tqparents[2] )->data(); bool valid = true; const Coordinate c = calcCubicLineIntersect( - static_cast<const CubicImp*>( parents[0] )->data(), - static_cast<const AbstractLineImp*>( parents[1] )->data(), + static_cast<const CubicImp*>( tqparents[0] )->data(), + static_cast<const AbstractLineImp*>( tqparents[1] )->data(), which, valid ); if ( valid ) return new PointImp( c ); else return new InvalidImp; @@ -265,14 +265,14 @@ const CircleCircleIntersectionType* CircleCircleIntersectionType::instance() return &t; } -ObjectImp* CircleCircleIntersectionType::calc( const Args& parents, const KigDocument& ) const +ObjectImp* CircleCircleIntersectionType::calc( const Args& tqparents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; + if ( ! margsparser.checkArgs( tqparents ) ) return new InvalidImp; - int side = static_cast<const IntImp*>( parents[2] )->data(); + int side = static_cast<const IntImp*>( tqparents[2] )->data(); assert( side == 1 || side == -1 ); - const CircleImp* c1 = static_cast<const CircleImp*>( parents[0] ); - const CircleImp* c2 = static_cast<const CircleImp*>( parents[1] ); + const CircleImp* c1 = static_cast<const CircleImp*>( tqparents[0] ); + const CircleImp* c2 = static_cast<const CircleImp*>( tqparents[1] ); const Coordinate o1 = c1->center(); const Coordinate o2 = c2->center(); const double r1sq = c1->squareRadius(); @@ -316,15 +316,15 @@ const ArcLineIntersectionType* ArcLineIntersectionType::instance() return &t; } -ObjectImp* ArcLineIntersectionType::calc( const Args& parents, const KigDocument& ) const +ObjectImp* ArcLineIntersectionType::calc( const Args& tqparents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; + if ( ! margsparser.checkArgs( tqparents ) ) return new InvalidImp; - int side = static_cast<const IntImp*>( parents[2] )->data(); + int side = static_cast<const IntImp*>( tqparents[2] )->data(); assert( side == 1 || side == -1 ); - const LineData line = static_cast<const AbstractLineImp*>( parents[1] )->data(); + const LineData line = static_cast<const AbstractLineImp*>( tqparents[1] )->data(); - const ArcImp* c = static_cast<const ArcImp*>( parents[0] ); + const ArcImp* c = static_cast<const ArcImp*>( tqparents[0] ); const double r = c->radius(); Coordinate ret = calcArcLineIntersect( c->center(), r*r, c->startAngle(), c->angle(), line, side ); |