diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-08-10 22:19:39 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-08-10 22:19:39 +0000 |
commit | eb570158698cf61dad4f77d950ef908160f6c3cc (patch) | |
tree | 649bf182bcf0a20bed5035d25ffd77de5aee138a /kig/objects/object_imp_factory.cc | |
parent | d8762de95349dc6edaa34db9bf699b367c1af6b1 (diff) | |
download | tdeedu-eb570158698cf61dad4f77d950ef908160f6c3cc.tar.gz tdeedu-eb570158698cf61dad4f77d950ef908160f6c3cc.zip |
rename the following methods:
tqparent parent
tqmask mask
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1246260 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kig/objects/object_imp_factory.cc')
-rw-r--r-- | kig/objects/object_imp_factory.cc | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/kig/objects/object_imp_factory.cc b/kig/objects/object_imp_factory.cc index 116f0d0d..a29cf5e8 100644 --- a/kig/objects/object_imp_factory.cc +++ b/kig/objects/object_imp_factory.cc @@ -48,25 +48,25 @@ ObjectImpFactory::~ObjectImpFactory() { } -static void addXYElements( const Coordinate& c, TQDomElement& tqparent, TQDomDocument& doc ) +static void addXYElements( const Coordinate& c, TQDomElement& parent, TQDomDocument& doc ) { TQDomElement xe = doc.createElement( "x" ); xe.appendChild( doc.createTextNode( TQString::number( c.x ) ) ); - tqparent.appendChild( xe ); + parent.appendChild( xe ); TQDomElement ye = doc.createElement( "y" ); ye.appendChild( doc.createTextNode( TQString::number( c.y ) ) ); - tqparent.appendChild( ye ); + parent.appendChild( ye ); } -static void addDoubleElement( const char* name, double d, TQDomElement& tqparent, TQDomDocument& doc ) +static void addDoubleElement( const char* name, double d, TQDomElement& parent, TQDomDocument& doc ) { TQDomElement e = doc.createElement( name ); e.appendChild( doc.createTextNode( TQString::number( d ) ) ); - tqparent.appendChild( e ); + parent.appendChild( e ); } static void addCoordinateElement( const char* name, const Coordinate& d, TQDomElement& p, TQDomDocument& doc ) @@ -76,40 +76,40 @@ static void addCoordinateElement( const char* name, const Coordinate& d, TQDomEl p.appendChild( e ); } -TQString ObjectImpFactory::serialize( const ObjectImp& d, TQDomElement& tqparent, +TQString ObjectImpFactory::serialize( const ObjectImp& d, TQDomElement& parent, TQDomDocument& doc ) const { if( d.inherits( IntImp::stype() ) ) { - tqparent.appendChild( + parent.appendChild( doc.createTextNode( TQString::number( static_cast<const IntImp&>( d ).data() ) ) ); return TQString::tqfromLatin1( "int" ); } else if ( d.inherits( DoubleImp::stype() ) ) { - tqparent.appendChild( + parent.appendChild( doc.createTextNode( TQString::number( static_cast<const DoubleImp&>( d ).data() ) ) ); return TQString::tqfromLatin1( "double" ); } else if( d.inherits( StringImp::stype() ) ) { - tqparent.appendChild( + parent.appendChild( doc.createTextNode( static_cast<const StringImp&>( d ).data() ) ); return TQString::tqfromLatin1( "string" ); } else if ( d.inherits( TestResultImp::stype() ) ) { - tqparent.appendChild( + parent.appendChild( doc.createTextNode( static_cast<const TestResultImp&>( d ).data() ) ); return TQString::tqfromLatin1( "testresult" ); } else if( d.inherits( HierarchyImp::stype() ) ) { - static_cast<const HierarchyImp&>( d ).data().serialize( tqparent, doc ); + static_cast<const HierarchyImp&>( d ).data().serialize( parent, doc ); return TQString::tqfromLatin1( "hierarchy" ); } else if ( d.inherits( TransformationImp::stype() ) ) @@ -128,20 +128,20 @@ TQString ObjectImpFactory::serialize( const ObjectImp& d, TQDomElement& tqparent matrixe.appendChild( elel ); }; } - tqparent.appendChild( matrixe ); + parent.appendChild( matrixe ); TQDomElement homothetye = doc.createElement( "homothetic" ); const char* ishomothety = trans.isHomothetic() ? "true" : "false"; homothetye.appendChild( doc.createTextNode( ishomothety ) ); - tqparent.appendChild( homothetye ); + parent.appendChild( homothetye ); return TQString::tqfromLatin1( "transformation" ); } else if( d.inherits( AbstractLineImp::stype() ) ) { LineData l = static_cast<const AbstractLineImp&>( d ).data(); - addCoordinateElement( "a", l.a, tqparent, doc ); - addCoordinateElement( "b", l.b, tqparent, doc ); + addCoordinateElement( "a", l.a, parent, doc ); + addCoordinateElement( "b", l.b, parent, doc ); if( d.inherits( SegmentImp::stype() ) ) return TQString::tqfromLatin1( "segment" ); else if( d.inherits( RayImp::stype() ) ) @@ -151,34 +151,34 @@ TQString ObjectImpFactory::serialize( const ObjectImp& d, TQDomElement& tqparent else if( d.inherits( PointImp::stype() ) ) { addXYElements( static_cast<const PointImp&>( d ).coordinate(), - tqparent, doc ); + parent, doc ); return TQString::tqfromLatin1( "point" ); } else if( d.inherits( TextImp::stype() ) ) { TQString text = static_cast<const TextImp&>( d ).text(); - tqparent.appendChild( + parent.appendChild( doc.createTextNode( text ) ); return TQString::tqfromLatin1( "text" ); } else if( d.inherits( AngleImp::stype() ) ) { - addDoubleElement( "size", static_cast<const AngleImp&>( d ).size(), tqparent, doc ); + addDoubleElement( "size", static_cast<const AngleImp&>( d ).size(), parent, doc ); return TQString::tqfromLatin1( "angle" ); } else if ( d.inherits( ArcImp::stype() ) ) { const ArcImp& a = static_cast<const ArcImp&>( d ); - addCoordinateElement( "center", a.center(), tqparent, doc ); - addDoubleElement( "radius", a.radius(), tqparent, doc ); - addDoubleElement( "startangle", a.startAngle(), tqparent, doc ); - addDoubleElement( "angle", a.angle(), tqparent, doc ); + addCoordinateElement( "center", a.center(), parent, doc ); + addDoubleElement( "radius", a.radius(), parent, doc ); + addDoubleElement( "startangle", a.startAngle(), parent, doc ); + addDoubleElement( "angle", a.angle(), parent, doc ); return TQString::tqfromLatin1( "arc" ); } else if( d.inherits( VectorImp::stype() ) ) { Coordinate dir = static_cast<const VectorImp&>( d ).dir(); - addXYElements( dir, tqparent, doc ); + addXYElements( dir, parent, doc ); return TQString::tqfromLatin1( "vector" ); } else if( d.inherits( LocusImp::stype() ) ) @@ -190,29 +190,29 @@ TQString ObjectImpFactory::serialize( const ObjectImp& d, TQDomElement& tqparent const CurveImp& curveimp = *locus.curve(); TQString type = serialize( curveimp, curve, doc ); curve.setAttribute( "type", type ); - tqparent.appendChild( curve ); + parent.appendChild( curve ); // serialize the hierarchy.. TQDomElement hier = doc.createElement( "calculation" ); locus.hierarchy().serialize( hier, doc ); - tqparent.appendChild( hier ); + parent.appendChild( hier ); return TQString::tqfromLatin1( "locus" ); } else if( d.inherits( CircleImp::stype() ) ) { const CircleImp& c = static_cast<const CircleImp&>( d ); - addCoordinateElement( "center", c.center(), tqparent, doc ); - addDoubleElement( "radius", c.radius(), tqparent, doc ); + addCoordinateElement( "center", c.center(), parent, doc ); + addDoubleElement( "radius", c.radius(), parent, doc ); return TQString::tqfromLatin1( "circle" ); } else if( d.inherits( ConicImp::stype() ) ) { const ConicPolarData data = static_cast<const ConicImp&>( d ).polarData(); - addCoordinateElement( "focus1", data.focus1, tqparent, doc ); - addDoubleElement( "pdimen", data.pdimen, tqparent, doc ); - addDoubleElement( "ecostheta0", data.ecostheta0, tqparent, doc ); - addDoubleElement( "esintheta0", data.esintheta0, tqparent, doc ); + addCoordinateElement( "focus1", data.focus1, parent, doc ); + addDoubleElement( "pdimen", data.pdimen, parent, doc ); + addDoubleElement( "ecostheta0", data.ecostheta0, parent, doc ); + addDoubleElement( "esintheta0", data.esintheta0, parent, doc ); return TQString::tqfromLatin1( "conic" ); } else if( d.inherits( CubicImp::stype() ) ) @@ -229,7 +229,7 @@ TQString ObjectImpFactory::serialize( const ObjectImp& d, TQDomElement& tqparent addDoubleElement( "a112", data.coeffs[7], coeffs, doc ); addDoubleElement( "a122", data.coeffs[8], coeffs, doc ); addDoubleElement( "a222", data.coeffs[9], coeffs, doc ); - tqparent.appendChild( coeffs ); + parent.appendChild( coeffs ); return TQString::tqfromLatin1( "cubic" ); } assert( false ); @@ -285,7 +285,7 @@ static double readDoubleElement( TQDomNode n, bool& ok, } ObjectImp* ObjectImpFactory::deserialize( const TQString& type, - const TQDomElement& tqparent, + const TQDomElement& parent, TQString& error ) const { #define KIG_GENERIC_PARSE_ERROR \ @@ -298,27 +298,27 @@ ObjectImp* ObjectImpFactory::deserialize( const TQString& type, bool ok = true; if ( type == "int" ) { - int ret = tqparent.text().toInt( &ok ); + int ret = parent.text().toInt( &ok ); if ( ! ok ) KIG_GENERIC_PARSE_ERROR; return new IntImp( ret ); } else if ( type == "double" ) { - double ret = tqparent.text().toDouble( &ok ); + double ret = parent.text().toDouble( &ok ); if ( ! ok ) KIG_GENERIC_PARSE_ERROR; return new DoubleImp( ret ); } else if ( type == "string" ) { - return new StringImp( tqparent.text() ); + return new StringImp( parent.text() ); } else if ( type == "testresult" ) { - return new TestResultImp( tqparent.text() ); + return new TestResultImp( parent.text() ); } else if ( type == "hierarchy" ) { - ObjectHierarchy* hier = ObjectHierarchy::buildSafeObjectHierarchy( tqparent, error ); + ObjectHierarchy* hier = ObjectHierarchy::buildSafeObjectHierarchy( parent, error ); if ( ! hier ) return 0; HierarchyImp* imp = new HierarchyImp( *hier ); delete hier; @@ -328,7 +328,7 @@ ObjectImp* ObjectImpFactory::deserialize( const TQString& type, { double data[3][3]; bool homothetic = false; - for ( TQDomElement childe = tqparent.firstChild().toElement(); + for ( TQDomElement childe = parent.firstChild().toElement(); ! childe.isNull(); childe = childe.nextSibling().toElement() ) { if ( childe.tagName() == "matrix" ) @@ -357,13 +357,13 @@ ObjectImp* ObjectImpFactory::deserialize( const TQString& type, } else if ( type == "point" ) { - Coordinate ret = readXYElements( tqparent, ok ); + Coordinate ret = readXYElements( parent, ok ); if ( ! ok ) KIG_GENERIC_PARSE_ERROR; return new PointImp( ret ); } else if ( type == "line" || type == "segment" || type == "ray" ) { - TQDomNode n = tqparent.firstChild(); + TQDomNode n = parent.firstChild(); Coordinate a = readCoordinateElement( n, ok, "a" ); if ( !ok ) KIG_GENERIC_PARSE_ERROR; n = n.nextSibling(); @@ -375,13 +375,13 @@ ObjectImp* ObjectImpFactory::deserialize( const TQString& type, } else if( type == "angle" ) { - double size = readDoubleElement( tqparent.firstChild(), ok, "size" ); + double size = readDoubleElement( parent.firstChild(), ok, "size" ); if ( ! ok ) KIG_GENERIC_PARSE_ERROR; return new AngleImp( Coordinate(), 0, size ); } else if ( type == "arc" ) { - TQDomNode n = tqparent.firstChild(); + TQDomNode n = parent.firstChild(); Coordinate center = readCoordinateElement( n, ok, "center" ); if ( ! ok ) KIG_GENERIC_PARSE_ERROR; n = n.nextSibling(); @@ -397,13 +397,13 @@ ObjectImp* ObjectImpFactory::deserialize( const TQString& type, } else if( type == "vector" ) { - Coordinate dir = readXYElements( tqparent, ok ); + Coordinate dir = readXYElements( parent, ok ); if ( ! ok ) KIG_GENERIC_PARSE_ERROR; return new VectorImp( Coordinate(), dir ); } else if( type == "locus" ) { - TQDomElement curvee = tqparent.firstChild().toElement(); + TQDomElement curvee = parent.firstChild().toElement(); if ( curvee.isNull() || curvee.tagName() != "curve" ) KIG_GENERIC_PARSE_ERROR; TQString type = curvee.attribute( "type" ); ObjectImp* oi = deserialize( type, curvee, error ); @@ -417,7 +417,7 @@ ObjectImp* ObjectImpFactory::deserialize( const TQString& type, } else if( type == "circle" ) { - TQDomNode n = tqparent.firstChild(); + TQDomNode n = parent.firstChild(); Coordinate center = readCoordinateElement( n, ok, "center" ); if ( ! ok ) KIG_GENERIC_PARSE_ERROR; @@ -429,7 +429,7 @@ ObjectImp* ObjectImpFactory::deserialize( const TQString& type, } else if( type == "conic" ) { - TQDomNode n = tqparent.firstChild(); + TQDomNode n = parent.firstChild(); Coordinate focus1 = readCoordinateElement( n, ok, "focus1" ); if ( ! ok ) KIG_GENERIC_PARSE_ERROR; @@ -450,7 +450,7 @@ ObjectImp* ObjectImpFactory::deserialize( const TQString& type, } else if( type == "cubic" ) { - TQDomElement coeffse = tqparent.firstChild().toElement(); + TQDomElement coeffse = parent.firstChild().toElement(); if ( coeffse.isNull() || coeffse.tagName() != "coefficients" ) KIG_GENERIC_PARSE_ERROR; |