diff options
Diffstat (limited to 'kig/objects/object_factory.cc')
-rw-r--r-- | kig/objects/object_factory.cc | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/kig/objects/object_factory.cc b/kig/objects/object_factory.cc index f2957a7e..5b1a6add 100644 --- a/kig/objects/object_factory.cc +++ b/kig/objects/object_factory.cc @@ -109,21 +109,21 @@ ObjectTypeCalcer* ObjectFactory::relativePointCalcer( x = loc.x - reference.x; y = loc.y - reference.y; } - std::vector<ObjectCalcer*> parents; - parents.push_back( new ObjectConstCalcer( new DoubleImp( x ) ) ); - parents.push_back( new ObjectConstCalcer( new DoubleImp( y ) ) ); - parents.push_back( o ); - return new ObjectTypeCalcer( RelativePointType::instance(), parents ); + std::vector<ObjectCalcer*> tqparents; + tqparents.push_back( new ObjectConstCalcer( new DoubleImp( x ) ) ); + tqparents.push_back( new ObjectConstCalcer( new DoubleImp( y ) ) ); + tqparents.push_back( o ); + return new ObjectTypeCalcer( RelativePointType::instance(), tqparents ); } ObjectTypeCalcer* ObjectFactory::constrainedPointCalcer( ObjectCalcer* curve, double param ) const { assert( curve->imp()->inherits( CurveImp::stype() ) ); - std::vector<ObjectCalcer*> parents; - parents.push_back( new ObjectConstCalcer( new DoubleImp( param ) ) ); - parents.push_back( curve ); - return new ObjectTypeCalcer( ConstrainedPointType::instance(), parents ); + std::vector<ObjectCalcer*> tqparents; + tqparents.push_back( new ObjectConstCalcer( new DoubleImp( param ) ) ); + tqparents.push_back( curve ); + return new ObjectTypeCalcer( ConstrainedPointType::instance(), tqparents ); } ObjectHolder* ObjectFactory::constrainedPoint( @@ -152,24 +152,24 @@ ObjectTypeCalcer* ObjectFactory::locusCalcer( assert( dynamic_cast<const ObjectTypeCalcer*>( a ) ); ObjectTypeCalcer* constrained = static_cast<ObjectTypeCalcer*>( a ); assert( constrained->type()->inherits( ObjectType::ID_ConstrainedPointType ) ); - assert( constrained->parents().size() == 2 ); - ObjectCalcer* curve = a->parents().back(); + assert( constrained->tqparents().size() == 2 ); + ObjectCalcer* curve = a->tqparents().back(); const ObjectCalcer* moving = b; - std::vector<ObjectCalcer*> hierparents; - hierparents.push_back( constrained ); - std::vector<ObjectCalcer*> sideOfTree = sideOfTreePath( hierparents, moving ); - std::copy( sideOfTree.begin(), sideOfTree.end(), std::back_inserter( hierparents ) ); + std::vector<ObjectCalcer*> hiertqparents; + hiertqparents.push_back( constrained ); + std::vector<ObjectCalcer*> sideOfTree = sideOfTreePath( hiertqparents, moving ); + std::copy( sideOfTree.begin(), sideOfTree.end(), std::back_inserter( hiertqparents ) ); - ObjectHierarchy hier( hierparents, moving ); + ObjectHierarchy hier( hiertqparents, moving ); - std::vector<ObjectCalcer*> realparents( 2 + sideOfTree.size(), 0 ); - realparents[0] = new ObjectConstCalcer( new HierarchyImp( hier ) ); - realparents[1] = curve; - copy( sideOfTree.begin(), sideOfTree.end(), realparents.begin() + 2 ); + std::vector<ObjectCalcer*> realtqparents( 2 + sideOfTree.size(), 0 ); + realtqparents[0] = new ObjectConstCalcer( new HierarchyImp( hier ) ); + realtqparents[1] = curve; + copy( sideOfTree.begin(), sideOfTree.end(), realtqparents.begin() + 2 ); - return new ObjectTypeCalcer( LocusType::instance(), realparents ); + return new ObjectTypeCalcer( LocusType::instance(), realtqparents ); } ObjectHolder* ObjectFactory::locus( ObjectCalcer* a, ObjectCalcer* b ) const @@ -179,35 +179,35 @@ ObjectHolder* ObjectFactory::locus( ObjectCalcer* a, ObjectCalcer* b ) const ObjectHolder* ObjectFactory::label( const TQString& s, const Coordinate& loc, - bool needframe, const std::vector<ObjectCalcer*>& parents, + bool needframe, const std::vector<ObjectCalcer*>& tqparents, const KigDocument& doc ) const { - return new ObjectHolder( labelCalcer( s, loc, needframe, parents, doc ) ); + return new ObjectHolder( labelCalcer( s, loc, needframe, tqparents, doc ) ); } ObjectTypeCalcer* ObjectFactory::labelCalcer( const TQString& s, const Coordinate& loc, - bool needframe, const std::vector<ObjectCalcer*>& parents, + bool needframe, const std::vector<ObjectCalcer*>& tqparents, const KigDocument& doc ) const { - return attachedLabelCalcer( s, 0, loc, needframe, parents, doc ); + return attachedLabelCalcer( s, 0, loc, needframe, tqparents, doc ); } ObjectTypeCalcer* ObjectFactory::attachedLabelCalcer( const TQString& s, ObjectCalcer* p, const Coordinate& loc, bool needframe, - const std::vector<ObjectCalcer*>& nparents, + const std::vector<ObjectCalcer*>& ntqparents, const KigDocument& doc ) const { - std::vector<ObjectCalcer*> parents; - parents.reserve( nparents.size() + 3 ); - parents.push_back( new ObjectConstCalcer( new IntImp( needframe ? 1 : 0 ) ) ); + std::vector<ObjectCalcer*> tqparents; + tqparents.reserve( ntqparents.size() + 3 ); + tqparents.push_back( new ObjectConstCalcer( new IntImp( needframe ? 1 : 0 ) ) ); - parents.push_back( getAttachPoint( p, loc, doc ) ); + tqparents.push_back( getAttachPoint( p, loc, doc ) ); - parents.push_back( new ObjectConstCalcer( new StringImp( s ) ) ); - std::copy( nparents.begin(), nparents.end(), std::back_inserter( parents ) ); - ObjectTypeCalcer* ret = new ObjectTypeCalcer( TextType::instance(), parents ); + tqparents.push_back( new ObjectConstCalcer( new StringImp( s ) ) ); + std::copy( ntqparents.begin(), ntqparents.end(), std::back_inserter( tqparents ) ); + ObjectTypeCalcer* ret = new ObjectTypeCalcer( TextType::instance(), tqparents ); ret->calc( doc ); return ret; } @@ -266,18 +266,18 @@ ObjectCalcer* ObjectFactory::getAttachPoint( } ObjectHolder* ObjectFactory::attachedLabel( - const TQString& s, ObjectCalcer* locationparent, + const TQString& s, ObjectCalcer* locationtqparent, const Coordinate& loc, bool needframe, - const std::vector<ObjectCalcer*>& parents, + const std::vector<ObjectCalcer*>& tqparents, const KigDocument& doc ) const { - return new ObjectHolder( attachedLabelCalcer( s, locationparent, loc, needframe, parents, doc ) ); + return new ObjectHolder( attachedLabelCalcer( s, locationtqparent, loc, needframe, tqparents, doc ) ); } ObjectPropertyCalcer* ObjectFactory::propertyObjectCalcer( ObjectCalcer* o, const char* p ) const { - int wp = o->imp()->propertiesInternalNames().findIndex( p ); + int wp = o->imp()->propertiesInternalNames().tqfindIndex( p ); if ( wp == -1 ) return 0; return new ObjectPropertyCalcer( o, wp ); } @@ -299,12 +299,12 @@ void ObjectFactory::redefinePoint( std::mem_fun( calcmeth ) ); ObjectCalcer* v = 0; - // we don't want one of our children as a parent... - std::set<ObjectCalcer*> children = getAllChildren( point ); + // we don't want one of our tqchildren as a tqparent... + std::set<ObjectCalcer*> tqchildren = getAllChildren( point ); for ( std::vector<ObjectCalcer*>::iterator i = os.begin(); i != os.end(); ++i ) if ( (*i)->imp()->inherits( CurveImp::stype() ) && - children.find( *i ) == children.end() ) + tqchildren.find( *i ) == tqchildren.end() ) { v = *i; break; @@ -321,15 +321,15 @@ void ObjectFactory::redefinePoint( // point already was constrained -> simply update the param // DataObject and make sure point is on the right curve... ObjectCalcer* dataobj = 0; - std::vector<ObjectCalcer*> parents = point->parents(); - assert( parents.size() == 2 ); - assert ( parents[0]->imp()->inherits( DoubleImp::stype() ) ); - dataobj = parents[0]; - - parents.clear(); - parents.push_back( dataobj ); - parents.push_back( v ); - point->setParents( parents ); + std::vector<ObjectCalcer*> tqparents = point->tqparents(); + assert( tqparents.size() == 2 ); + assert ( tqparents[0]->imp()->inherits( DoubleImp::stype() ) ); + dataobj = tqparents[0]; + + tqparents.clear(); + tqparents.push_back( dataobj ); + tqparents.push_back( v ); + point->setParents( tqparents ); assert( dynamic_cast<ObjectConstCalcer*>( dataobj ) ); static_cast<ObjectConstCalcer*>( dataobj )->setImp( |