From 96698e12d1d6ba8072e9365334277438c3cf0e4a Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 9 Jul 2011 02:23:29 +0000 Subject: Remove the tq in front of these incorrectly TQt4-converted methods/data members: tqrepaint[...] tqinvalidate[...] tqparent[...] tqmask[...] tqlayout[...] tqalignment[...] git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1240522 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kig/ChangeLog | 6 +- kig/DESIGN | 24 ++-- kig/TODO | 4 +- kig/examples/figure_angle.fgeo | 12 +- kig/examples/figure_manyobjects.fgeo | 32 ++--- kig/examples/session_alotofthings.fgeo | 64 +++++----- kig/filters/cabri-filter.cc | 24 ++-- kig/filters/drgeo-filter-chooserbase.ui | 2 +- kig/filters/drgeo-filter.cc | 202 ++++++++++++++++---------------- kig/filters/imageexporteroptionsbase.ui | 2 +- kig/filters/kgeo-filter.cc | 132 ++++++++++----------- kig/filters/kseg-filter.cc | 174 +++++++++++++-------------- kig/filters/kseg-filter.h | 2 +- kig/filters/latexexporteroptions.ui | 2 +- kig/filters/native-filter.cc | 56 ++++----- kig/filters/svgexporteroptions.ui | 2 +- kig/filters/tests/locus.fgeo | 2 +- kig/kig/kig_commands.cpp | 30 ++--- kig/kig/kig_commands.h | 6 +- kig/kig/kig_part.cpp | 4 +- kig/kig/kig_part.h | 2 +- kig/kig/kig_view.h | 2 +- kig/misc/argsparser.cpp | 14 +-- kig/misc/argsparser.h | 14 +-- kig/misc/calcpaths.cc | 30 ++--- kig/misc/calcpaths.h | 2 +- kig/misc/cubic-common.cc | 2 +- kig/misc/object_constructor.cc | 20 ++-- kig/misc/object_constructor.h | 8 +- kig/misc/object_hierarchy.cc | 80 ++++++------- kig/misc/object_hierarchy.h | 2 +- kig/misc/special_constructors.cc | 148 +++++++++++------------ kig/misc/special_constructors.h | 18 +-- kig/modes/base_mode.cc | 2 +- kig/modes/construct_mode.cc | 60 +++++----- kig/modes/construct_mode.h | 2 +- kig/modes/edittypebase.ui | 2 +- kig/modes/label.cc | 22 ++-- kig/modes/macrowizardbase.ui | 2 +- kig/modes/moving.cc | 32 ++--- kig/modes/moving.h | 2 +- kig/modes/textlabelwizard.cc | 2 +- kig/modes/textlabelwizard.h | 2 +- kig/modes/textlabelwizardbase.ui | 2 +- kig/modes/typesdialogbase.ui | 2 +- kig/objects/angle_type.cc | 30 ++--- kig/objects/arc_type.h | 4 +- kig/objects/base_type.cc | 42 +++---- kig/objects/conic_types.cc | 104 ++++++++-------- kig/objects/conic_types.h | 22 ++-- kig/objects/cubic_type.cc | 12 +- kig/objects/cubic_type.h | 6 +- kig/objects/intersection_types.cc | 70 +++++------ kig/objects/intersection_types.h | 12 +- kig/objects/line_type.cc | 12 +- kig/objects/locus_imp.h | 4 +- kig/objects/object_calcer.cc | 34 +++--- kig/objects/object_calcer.h | 44 +++---- kig/objects/object_factory.cc | 88 +++++++------- kig/objects/object_factory.h | 10 +- kig/objects/object_type.cc | 8 +- kig/objects/object_type.h | 18 +-- kig/objects/other_type.cc | 18 +-- kig/objects/other_type.h | 8 +- kig/objects/point_type.cc | 104 ++++++++-------- kig/objects/point_type.h | 20 ++-- kig/objects/polygon_type.cc | 184 ++++++++++++++--------------- kig/objects/polygon_type.h | 22 ++-- kig/objects/special_calcers.cc | 4 +- kig/objects/special_calcers.h | 2 +- kig/objects/tests_type.cc | 66 +++++------ kig/objects/tests_type.h | 16 +-- kig/objects/text_type.cc | 28 ++--- kig/objects/text_type.h | 6 +- kig/scripting/newscriptwizardbase.ui | 2 +- kig/scripting/python_type.cc | 22 ++-- kig/scripting/python_type.h | 12 +- kig/scripting/script_mode.cc | 4 +- 78 files changed, 1147 insertions(+), 1147 deletions(-) (limited to 'kig') diff --git a/kig/ChangeLog b/kig/ChangeLog index 8c60c89f..3cbd6c2f 100644 --- a/kig/ChangeLog +++ b/kig/ChangeLog @@ -1142,7 +1142,7 @@ * Fix the moving system again, it now only redraws exactly those objects that need to be redrawn. E.g. when a constrained point - was moved, before it was assumed that all of its tqparents, and + was moved, before it was assumed that all of its parents, and their tqchildren would move, whereas in reality, a constrained point does not move the curve it is constrained to. This is now taken into account for. This much optimizes the case where we move the @@ -1200,7 +1200,7 @@ could not open.. I'm backporting this into Kig 0.6.0 and informing the packager.. - * clean up: Objects now store their tqparents in order, so that no + * clean up: Objects now store their parents in order, so that no parsing has to be done in the calc() function.. Also some more modifications making that function a bit simpler are included. Specifically, ArgsParser now does the checking of the arguments, @@ -1218,7 +1218,7 @@ 2003-09-01 Dominique Devriese - * only move an object if its tqparents are not yet moving.. This + * only move an object if its parents are not yet moving.. This fixes bug #63250. * remove the defective operator| and operator& implementations for diff --git a/kig/DESIGN b/kig/DESIGN index 6d4a8c37..3c922c67 100644 --- a/kig/DESIGN +++ b/kig/DESIGN @@ -19,7 +19,7 @@ An ObjectImp represents the current state of an object in Kig. It keeps information about what type of object it is ( e.g. a line, a point, a circle etc. ), and its exact data ( e.g. the center and radius of the circle ). It is *not* in any way aware of how the -object was calculated from its tqparents (e.g. is this a line that is +object was calculated from its parents (e.g. is this a line that is constructed as the parallel of another line, or as the line going through two given points ? ) or how it is drawn on the window ( e.g. the thickness of the line, its color etc. ). @@ -50,21 +50,21 @@ calculating an ObjectImp from other ObjectImp's. It is also a node in the dependency graph of a certain document. E.g. a LineImp can be calculated from the two PointImp's it has to go through; every time either of them moves, this calculation is redone. In this case, there -would be an ObjectCalcer that keeps a reference to its two tqparents ( +would be an ObjectCalcer that keeps a reference to its two parents ( the ObjectCalcer's representing the points ), and that will calculate its ObjectImp value every time it is asked to do so ( i.e. every time -one of its tqparents moves.. ). +one of its parents moves.. ). Because of the complex relations that ObjectCalcer's hold to other ObjectCalcer's and to other classes, they have been made reference-counted. This means that they keep a count internally of how much times a pointer to them is held. If this count reaches 0, this means that nobody needs them anymore, and they delete themselves. -E.g. an ObjectCalcer always keeps a reference to its tqparents, to +E.g. an ObjectCalcer always keeps a reference to its parents, to ensure that those aren't deleted before it is deleted. In the inheritance graph of a document, the lowermost objects keep -references to their tqparents and those keep reference to their tqparents, +references to their parents and those keep reference to their parents, so that all of the top of the graph is kept alive. Of course, someone needs to keep a reference to the bottommost objects in the graph, because otherwise, the entire graph would be deleted. As we will see @@ -76,7 +76,7 @@ At the end of the program, this reference is released, and all the objects are deleted. A special case of an ObjectCalcer is the ObjectConstCalcer. This is -an ObjectCalcer that has no tqparents, and only holds some data. The +an ObjectCalcer that has no parents, and only holds some data. The data is held as an ObjectImp of some type, and it will remain constant, and no calculation needs to be done to get it, it is just returned every time it is needed. @@ -159,9 +159,9 @@ Most of this is handled by the TextType class. 2.1.2 TextType The TextType class is an implementation of an ObjectType. It tqcontains -code specifying how to calculate a TextImp from its tqparents, and for +code specifying how to calculate a TextImp from its parents, and for how it behaves on user input. A text object has at least three -tqparents, and can handle any number of optional arguments. The three +parents, and can handle any number of optional arguments. The three mandatory arguments are an int, which is set to 1 or 0 depending on whether the label needs a surrounding box, a PointImp, containing the location of the text label, and a string containing the text of the @@ -170,7 +170,7 @@ additional argument is used to replace the lowest-numbered of those tokens, with its string representation. The function ObjectImp::fillInNextEscape is used for this. -For example, if a TextType has the following tqparents: +For example, if a TextType has the following parents: a IntImp with value 0 a PointImp with value (0,0) a String with value "This segment is %1 units long." @@ -197,7 +197,7 @@ proud of this design. In the implementation of this, we use the concept of constrained points. This is a point that is attached to a certain curve. It is implemented in Kig by the ConstrainedPointType, which takes a CurveImp -and a DoubleImp as tqparents and calculates a Point from these by using +and a DoubleImp as parents and calculates a Point from these by using the CurveImp::getPoint function. 2.2.2 The Implementation @@ -213,7 +213,7 @@ smallest part of the hierarchy that contains all paths from the first point to the second point. We then determine all objects that are not *on* one of those paths ( meaning that they are not calculated from the first point, or another object that is on one of those paths ), -but that are tqparents of one or more objects that are on those paths. +but that are parents of one or more objects that are on those paths. I call this set of objects the "side of the path" sometimes in the code. The function that finds them is called sideOfTreePath. @@ -260,7 +260,7 @@ does by definition not change. Also, if the constrained point is redefined so that it is no longer constrained to any curve, this is a major problem, because it would tqinvalidate the locus. Another point is that in practice, the locus depends on more objects than its -tqparents alone. This is not a good thing, because it makes it +parents alone. This is not a good thing, because it makes it impossible to optimise drawing of the objects, using the information about which objects depend on which others, because this information is invalid. diff --git a/kig/TODO b/kig/TODO index a6f97fe3..717d5124 100644 --- a/kig/TODO +++ b/kig/TODO @@ -102,8 +102,8 @@ - extend ObjectFactory::sensiblePointCalcer to also construct intersection points of stuff... (pino: done for lines) -- when moving an object that wants to move its tqparents, try to check if - it is itself not an indirect child of one of the tqparents it is +- when moving an object that wants to move its parents, try to check if + it is itself not an indirect child of one of the parents it is trying to move, and forbid the move in that case, as it will lead to chaotic behaviour. I am not sure if this is really well possible, but I have to look at it. diff --git a/kig/examples/figure_angle.fgeo b/kig/examples/figure_angle.fgeo index 47076564..6265e7e4 100644 --- a/kig/examples/figure_angle.fgeo +++ b/kig/examples/figure_angle.fgeo @@ -1,27 +1,27 @@ - + -5.833333 2.950000 - + -4.666666 -0.783334 - + 2.333334 -0.216667 - + - + - + diff --git a/kig/examples/figure_manyobjects.fgeo b/kig/examples/figure_manyobjects.fgeo index c89c976f..1e50da51 100644 --- a/kig/examples/figure_manyobjects.fgeo +++ b/kig/examples/figure_manyobjects.fgeo @@ -1,69 +1,69 @@ - + -6.700000 2.250000 - + 0.266667 2.083333 - + -0.800000 -2.516667 - + -2.766667 1.883333 - + - + - + -2.833333 -0.983334 - + 1.500000 1.883333 - + -0.566667 3.983333 - + - + - + -5.533333 -0.383333 - + -2.800000 1.883333 - + 3.166667 -0.683333 - + - + diff --git a/kig/examples/session_alotofthings.fgeo b/kig/examples/session_alotofthings.fgeo index dc8bb729..b47c31d9 100644 --- a/kig/examples/session_alotofthings.fgeo +++ b/kig/examples/session_alotofthings.fgeo @@ -1,64 +1,64 @@ - + 0.766667 2.450000 - + -3.300000 2.650000 - + -7.900000 -2.583333 - + -7.800000 0.116667 - + -4.533333 1.216667 - + -8.566667 3.116667 - + -7.066667 1.783334 - + - + - + - + -1.066667 -0.416667 - + - + - + - + @@ -86,75 +86,75 @@ Figure 3 tqcontains: - a moved circle; - + -5.200000 0.216667 - + 1.200000 3.116667 - + -7.666667 1.650000 - + - + - + - + -6.200000 -1.483334 - + - + - + - + -6.433334 2.050000 - + -1.400000 2.583333 - + -1.300000 -0.350000 - + -3.433333 -0.883333 - + -6.433334 2.050000 - + - + diff --git a/kig/filters/cabri-filter.cc b/kig/filters/cabri-filter.cc index 55ecf939..2348af86 100644 --- a/kig/filters/cabri-filter.cc +++ b/kig/filters/cabri-filter.cc @@ -56,7 +56,7 @@ * * Nr: Simple sequential numbering of the objects in a file. * Type: seen so far: Pt, Axes, Line, Cir - * NumberOfParents: The number of tqparents that will be specified in + * NumberOfParents: The number of parents that will be specified in * Parents * Color: * R -> red @@ -96,7 +96,7 @@ * Visible: * V means visible, I means invisible * Fixed: - * St means fix this object ( if you move one of its tqparents, it + * St means fix this object ( if you move one of its parents, it * won't move ), nSt ( the default ) means don't fix this object. * Parents: * The numbers of the objects this object depends on @@ -118,7 +118,7 @@ struct CabriObject int specialAppearanceSwitch; bool visible; bool fixed; - std::vector tqparents; + std::vector parents; std::vector data; }; @@ -246,14 +246,14 @@ bool KigFilterCabri::readObject( TQFile& f, CabriObject& myobj ) KIG_FILTER_PARSE_ERROR; tmp = thirdlinere.cap( 2 ); - TQStringList tqparentsids = TQStringList::split( ' ', tmp ); - for ( TQStringList::iterator i = tqparentsids.begin(); - i != tqparentsids.end(); ++i ) + TQStringList parentsids = TQStringList::split( ' ', tmp ); + for ( TQStringList::iterator i = parentsids.begin(); + i != parentsids.end(); ++i ) { - myobj.tqparents.push_back( ( *i ).toInt( &ok ) ); + myobj.parents.push_back( ( *i ).toInt( &ok ) ); if ( ! ok ) KIG_FILTER_PARSE_ERROR; } - if ( myobj.tqparents.size() != myobj.numberOfParents ) + if ( myobj.parents.size() != myobj.numberOfParents ) KIG_FILTER_PARSE_ERROR; tmp = thirdlinere.cap( 4 ); @@ -277,8 +277,8 @@ bool KigFilterCabri::readObject( TQFile& f, CabriObject& myobj ) // << "specialAppearanceSwitch = " << myobj.specialAppearanceSwitch << endl // << "visible = " << visible << endl // << "fixed = " << myobj.fixed << endl -// << "tqparents =" << endl; -// for ( std::vector::iterator i = myobj.tqparents.begin(); i != myobj.tqparents.end(); ++i ) +// << "parents =" << endl; +// for ( std::vector::iterator i = myobj.parents.begin(); i != myobj.parents.end(); ++i ) // kdDebug() << " " << *i << endl; // kdDebug() << "vals = " << endl; // for ( std::vector::iterator i = myobj.data.begin(); i != myobj.data.end(); ++i ) @@ -352,8 +352,8 @@ KigDocument* KigFilterCabri::load( const TQString& file ) int ps = 0; args.clear(); - for ( std::vector::iterator i = obj.tqparents.begin(); - i != obj.tqparents.end(); ++i ) + for ( std::vector::iterator i = obj.parents.begin(); + i != obj.parents.end(); ++i ) args.push_back( calcers[*i-3] ); // two fake objects at the start ( origin and axes.. ) diff --git a/kig/filters/drgeo-filter-chooserbase.ui b/kig/filters/drgeo-filter-chooserbase.ui index b58e3dc1..1a9589b2 100644 --- a/kig/filters/drgeo-filter-chooserbase.ui +++ b/kig/filters/drgeo-filter-chooserbase.ui @@ -131,7 +131,7 @@ Please select which to import: - + klistbox.h kpushbutton.h diff --git a/kig/filters/drgeo-filter.cc b/kig/filters/drgeo-filter.cc index 3f213146..856d995c 100644 --- a/kig/filters/drgeo-filter.cc +++ b/kig/filters/drgeo-filter.cc @@ -62,7 +62,7 @@ struct DrGeoHierarchyElement { TQString id; - std::vector tqparents; + std::vector parents; }; KigFilterDrgeo::KigFilterDrgeo() @@ -202,7 +202,7 @@ KigDocument* KigFilterDrgeo::importFigure( TQDomNode f, const TQString& file, co TQDomElement ce = c.toElement(); if ( ce.isNull() ) continue; else if ( ce.tagName() == "tqparent" ) - elem.tqparents.push_back( ce.attribute( "ref" ) ); + elem.parents.push_back( ce.attribute( "ref" ) ); } TQString curid = domelem.attribute( "id" ); elem.id = !curid.isNull() ? curid : TQString::number( withoutid++ ) ; @@ -216,9 +216,9 @@ KigDocument* KigFilterDrgeo::importFigure( TQDomNode f, const TQString& file, co for ( uint i = 0; i < elems.size(); ++i ) { x = ""; - for ( uint j = 0; j < elems[i].tqparents.size(); ++j ) + for ( uint j = 0; j < elems[i].parents.size(); ++j ) { - x += elems[i].tqparents[j] + "_"; + x += elems[i].parents[j] + "_"; } kdDebug() << " --> " << i << " - " << elems[i].id << " - " << x << endl; } @@ -241,25 +241,25 @@ KigDocument* KigFilterDrgeo::importFigure( TQDomNode f, const TQString& file, co kdDebug() << "+++ id: " << curid << endl; #endif const DrGeoHierarchyElement& el = elems[curid]; - std::vector tqparents; - for ( uint j = 0; j < el.tqparents.size(); ++j ) + std::vector parents; + for ( uint j = 0; j < el.parents.size(); ++j ) { - int tqparentid = convertDrgeoIndex( elems, el.tqparents[j] ); - if ( tqparentid == -1 ) + int parentid = convertDrgeoIndex( elems, el.parents[j] ); + if ( parentid == -1 ) KIG_FILTER_PARSE_ERROR; - tqparents.push_back( holders[tqparentid-nignored]->calcer() ); + parents.push_back( holders[parentid-nignored]->calcer() ); }; TQDomElement domelem = a.toElement(); #ifdef DRGEO_DEBUG - if ( tqparents.size() > 0 ) - for ( uint j = 0; j < tqparents.size(); ++j ) + if ( parents.size() > 0 ) + for ( uint j = 0; j < parents.size(); ++j ) { - kdDebug() << "+++++++++ tqparent[" << j << "]: " << tqparents[j] << " - " - << tqparents[j]->imp()->type()->internalName() << endl; + kdDebug() << "+++++++++ tqparent[" << j << "]: " << parents[j] << " - " + << parents[j]->imp()->type()->internalName() << endl; } else - kdDebug() << "+++++++++ tqparents: NO" << endl; + kdDebug() << "+++++++++ parents: NO" << endl; kdDebug() << "+++++++++ " << domelem.tagName() << " - " << domelem.attribute("type") << endl; #endif @@ -291,15 +291,15 @@ KigDocument* KigFilterDrgeo::importFigure( TQDomNode f, const TQString& file, co oc = fact->fixedPointCalcer( Coordinate( x, y ) ); } else if ( domelem.attribute( "type" ) == "Middle_2pts" ) - oc = new ObjectTypeCalcer( MidPointType::instance(), tqparents ); + oc = new ObjectTypeCalcer( MidPointType::instance(), parents ); else if ( domelem.attribute( "type" ) == "Middle_segment" ) { - if ( tqparents.size() != 1 ) KIG_FILTER_PARSE_ERROR; - if ( !tqparents[0]->imp()->inherits( SegmentImp::stype() ) ) + if ( parents.size() != 1 ) KIG_FILTER_PARSE_ERROR; + if ( !parents[0]->imp()->inherits( SegmentImp::stype() ) ) KIG_FILTER_PARSE_ERROR; - ObjectPropertyCalcer* o1 = fact->propertyObjectCalcer( tqparents[0], "end-point-A" ); + ObjectPropertyCalcer* o1 = fact->propertyObjectCalcer( parents[0], "end-point-A" ); o1->calc( *ret ); - ObjectPropertyCalcer* o2 = fact->propertyObjectCalcer( tqparents[0], "end-point-B" ); + ObjectPropertyCalcer* o2 = fact->propertyObjectCalcer( parents[0], "end-point-B" ); o2->calc( *ret ); std::vector args; args.push_back( o1 ); @@ -312,26 +312,26 @@ KigDocument* KigFilterDrgeo::importFigure( TQDomNode f, const TQString& file, co double value = values.toDouble( &ok3 ); if ( ! ok3 ) KIG_FILTER_PARSE_ERROR; - if ( ( tqparents[0]->imp()->inherits( CircleImp::stype() ) ) || - ( tqparents[0]->imp()->inherits( SegmentImp::stype() ) ) ) - oc = fact->constrainedPointCalcer( tqparents[0], value ); - else if ( tqparents[0]->imp()->inherits( LineImp::stype() ) ) + if ( ( parents[0]->imp()->inherits( CircleImp::stype() ) ) || + ( parents[0]->imp()->inherits( SegmentImp::stype() ) ) ) + oc = fact->constrainedPointCalcer( parents[0], value ); + else if ( parents[0]->imp()->inherits( LineImp::stype() ) ) { - const LineData l = static_cast( tqparents[0]->imp() )->data(); + const LineData l = static_cast( parents[0]->imp() )->data(); const Coordinate p = convertDrgeoLineParam( value, l ); - oc = fact->constrainedPointCalcer( tqparents[0], p, *ret ); + oc = fact->constrainedPointCalcer( parents[0], p, *ret ); } - else if ( tqparents[0]->imp()->inherits( RayImp::stype() ) ) + else if ( parents[0]->imp()->inherits( RayImp::stype() ) ) { - const LineData l = static_cast( tqparents[0]->imp() )->data(); + const LineData l = static_cast( parents[0]->imp() )->data(); const Coordinate p = convertDrgeoHalflineParam( value, l ); - oc = fact->constrainedPointCalcer( tqparents[0], p, *ret ); + oc = fact->constrainedPointCalcer( parents[0], p, *ret ); } - else if ( tqparents[0]->imp()->inherits( ArcImp::stype() ) ) - oc = fact->constrainedPointCalcer( tqparents[0], 1 - value ); + else if ( parents[0]->imp()->inherits( ArcImp::stype() ) ) + oc = fact->constrainedPointCalcer( parents[0], 1 - value ); else { -// oc = fact->constrainedPointCalcer( tqparents[0], value ); +// oc = fact->constrainedPointCalcer( parents[0], value ); notSupported( file, i18n( "This Dr. Geo file contains a \"%1 %2\" object, " "which Kig does not currently support." ).tqarg( domelem.tagName() ).tqarg( domelem.attribute( "type" ) ) ); @@ -340,9 +340,9 @@ KigDocument* KigFilterDrgeo::importFigure( TQDomNode f, const TQString& file, co } else if ( domelem.attribute( "type" ) == "Intersection" ) { - if ( ( tqparents[0]->imp()->inherits( AbstractLineImp::stype() ) ) && - ( tqparents[1]->imp()->inherits( AbstractLineImp::stype() ) ) ) - oc = new ObjectTypeCalcer( LineLineIntersectionType::instance(), tqparents ); + if ( ( parents[0]->imp()->inherits( AbstractLineImp::stype() ) ) && + ( parents[1]->imp()->inherits( AbstractLineImp::stype() ) ) ) + oc = new ObjectTypeCalcer( LineLineIntersectionType::instance(), parents ); else { bool ok; @@ -351,21 +351,21 @@ KigDocument* KigFilterDrgeo::importFigure( TQDomNode f, const TQString& file, co if ( which == 1 ) which = -1; else if ( which == 0 ) which = 1; else KIG_FILTER_PARSE_ERROR; - std::vector args = tqparents; + std::vector args = parents; const ObjectType* type = 0; args.push_back( new ObjectConstCalcer( new IntImp( which ) ) ); - if ( ( tqparents[0]->imp()->inherits( CircleImp::stype() ) ) && - ( tqparents[1]->imp()->inherits( CircleImp::stype() ) ) ) + if ( ( parents[0]->imp()->inherits( CircleImp::stype() ) ) && + ( parents[1]->imp()->inherits( CircleImp::stype() ) ) ) type = CircleCircleIntersectionType::instance(); - else if ( ( tqparents[0]->imp()->inherits( CircleImp::stype() ) && - tqparents[1]->imp()->inherits( AbstractLineImp::stype() ) ) || - ( tqparents[1]->imp()->inherits( CircleImp::stype() ) && - tqparents[0]->imp()->inherits( AbstractLineImp::stype() ) ) ) + else if ( ( parents[0]->imp()->inherits( CircleImp::stype() ) && + parents[1]->imp()->inherits( AbstractLineImp::stype() ) ) || + ( parents[1]->imp()->inherits( CircleImp::stype() ) && + parents[0]->imp()->inherits( AbstractLineImp::stype() ) ) ) type = ConicLineIntersectionType::instance(); - else if ( ( tqparents[0]->imp()->inherits( ArcImp::stype() ) && - tqparents[1]->imp()->inherits( AbstractLineImp::stype() ) ) || - ( tqparents[1]->imp()->inherits( ArcImp::stype() ) && - tqparents[0]->imp()->inherits( AbstractLineImp::stype() ) ) ) + else if ( ( parents[0]->imp()->inherits( ArcImp::stype() ) && + parents[1]->imp()->inherits( AbstractLineImp::stype() ) ) || + ( parents[1]->imp()->inherits( ArcImp::stype() ) && + parents[0]->imp()->inherits( AbstractLineImp::stype() ) ) ) type = ArcLineIntersectionType::instance(); else { @@ -377,13 +377,13 @@ KigDocument* KigFilterDrgeo::importFigure( TQDomNode f, const TQString& file, co } } else if ( domelem.attribute( "type" ) == "Reflexion" ) - oc = new ObjectTypeCalcer( LineReflectionType::instance(), tqparents ); + oc = new ObjectTypeCalcer( LineReflectionType::instance(), parents ); else if ( domelem.attribute( "type" ) == "Symmetry" ) - oc = new ObjectTypeCalcer( PointReflectionType::instance(), tqparents ); + oc = new ObjectTypeCalcer( PointReflectionType::instance(), parents ); else if ( domelem.attribute( "type" ) == "Translation" ) - oc = new ObjectTypeCalcer( TranslatedType::instance(), tqparents ); + oc = new ObjectTypeCalcer( TranslatedType::instance(), parents ); else if ( domelem.attribute( "type" ) == "Rotation" ) - oc = new ObjectTypeCalcer( RotationType::instance(), tqparents ); + oc = new ObjectTypeCalcer( RotationType::instance(), parents ); else { notSupported( file, i18n( "This Dr. Geo file contains a \"%1 %2\" object, " @@ -423,7 +423,7 @@ KigDocument* KigFilterDrgeo::importFigure( TQDomNode f, const TQString& file, co domelem.attribute( "type" ) ) ); return false; } - oc = new ObjectTypeCalcer( type, tqparents ); + oc = new ObjectTypeCalcer( type, parents ); } else if( domelem.attribute( "type" ) == "3pts" ) { @@ -436,19 +436,19 @@ KigDocument* KigFilterDrgeo::importFigure( TQDomNode f, const TQString& file, co domelem.attribute( "type" ) ) ); return false; } - oc = new ObjectTypeCalcer( type, tqparents ); + oc = new ObjectTypeCalcer( type, parents ); } else if( domelem.attribute( "type" ) == "segment" ) { if( domelem.tagName() == "circle" ) { type = CircleBPRType::instance(); - ObjectPropertyCalcer* o = fact->propertyObjectCalcer( tqparents[1], "length" ); + ObjectPropertyCalcer* o = fact->propertyObjectCalcer( parents[1], "length" ); o->calc( *ret ); - ObjectCalcer* a = tqparents[0]; - tqparents.clear(); - tqparents.push_back( a ); - tqparents.push_back( o ); + ObjectCalcer* a = parents[0]; + parents.clear(); + parents.push_back( a ); + parents.push_back( o ); } else { @@ -457,13 +457,13 @@ KigDocument* KigFilterDrgeo::importFigure( TQDomNode f, const TQString& file, co domelem.attribute( "type" ) ) ); return false; } - oc = new ObjectTypeCalcer( type, tqparents ); + oc = new ObjectTypeCalcer( type, parents ); } else if( domelem.attribute( "type" ) == "npts" ) { if( domelem.tagName() == "polygon" ) { - if ( tqparents.size() < 3 ) KIG_FILTER_PARSE_ERROR; + if ( parents.size() < 3 ) KIG_FILTER_PARSE_ERROR; type = PolygonBNPType::instance(); } else @@ -473,20 +473,20 @@ KigDocument* KigFilterDrgeo::importFigure( TQDomNode f, const TQString& file, co domelem.attribute( "type" ) ) ); return false; } - oc = new ObjectTypeCalcer( type, tqparents ); + oc = new ObjectTypeCalcer( type, parents ); } else if ( domelem.attribute( "type" ) == "perpendicular" ) - oc = new ObjectTypeCalcer( LinePerpendLPType::instance(), tqparents ); + oc = new ObjectTypeCalcer( LinePerpendLPType::instance(), parents ); else if ( domelem.attribute( "type" ) == "parallel" ) - oc = new ObjectTypeCalcer( LineParallelLPType::instance(), tqparents ); + oc = new ObjectTypeCalcer( LineParallelLPType::instance(), parents ); else if ( domelem.attribute( "type" ) == "Reflexion" ) - oc = new ObjectTypeCalcer( LineReflectionType::instance(), tqparents ); + oc = new ObjectTypeCalcer( LineReflectionType::instance(), parents ); else if ( domelem.attribute( "type" ) == "Symmetry" ) - oc = new ObjectTypeCalcer( PointReflectionType::instance(), tqparents ); + oc = new ObjectTypeCalcer( PointReflectionType::instance(), parents ); else if ( domelem.attribute( "type" ) == "Translation" ) - oc = new ObjectTypeCalcer( TranslatedType::instance(), tqparents ); + oc = new ObjectTypeCalcer( TranslatedType::instance(), parents ); else if ( domelem.attribute( "type" ) == "Rotation" ) - oc = new ObjectTypeCalcer( RotationType::instance(), tqparents ); + oc = new ObjectTypeCalcer( RotationType::instance(), parents ); else { notSupported( file, i18n( "This Dr. Geo file contains a \"%1 %2\" object, " @@ -534,71 +534,71 @@ KigDocument* KigFilterDrgeo::importFigure( TQDomNode f, const TQString& file, co } else if ( domelem.attribute( "type" ) == "pt_abscissa" ) { - if ( tqparents.size() != 1 ) KIG_FILTER_PARSE_ERROR; - oc = filtersConstructTextObject( m, tqparents[0], "coordinate-x", *ret, false ); + if ( parents.size() != 1 ) KIG_FILTER_PARSE_ERROR; + oc = filtersConstructTextObject( m, parents[0], "coordinate-x", *ret, false ); } else if ( domelem.attribute( "type" ) == "pt_ordinate" ) { - if ( tqparents.size() != 1 ) KIG_FILTER_PARSE_ERROR; - oc = filtersConstructTextObject( m, tqparents[0], "coordinate-y", *ret, false ); + if ( parents.size() != 1 ) KIG_FILTER_PARSE_ERROR; + oc = filtersConstructTextObject( m, parents[0], "coordinate-y", *ret, false ); } else if ( domelem.attribute( "type" ) == "segment_length" ) { - if ( tqparents.size() != 1 ) KIG_FILTER_PARSE_ERROR; - oc = filtersConstructTextObject( m, tqparents[0], "length", *ret, false ); + if ( parents.size() != 1 ) KIG_FILTER_PARSE_ERROR; + oc = filtersConstructTextObject( m, parents[0], "length", *ret, false ); } else if ( domelem.attribute( "type" ) == "circle_perimeter" ) { - if ( tqparents.size() != 1 ) KIG_FILTER_PARSE_ERROR; - oc = filtersConstructTextObject( m, tqparents[0], "circumference", *ret, false ); + if ( parents.size() != 1 ) KIG_FILTER_PARSE_ERROR; + oc = filtersConstructTextObject( m, parents[0], "circumference", *ret, false ); } else if ( domelem.attribute( "type" ) == "arc_length" ) { - if ( tqparents.size() != 1 ) KIG_FILTER_PARSE_ERROR; - oc = filtersConstructTextObject( m, tqparents[0], "arc-length", *ret, false ); + if ( parents.size() != 1 ) KIG_FILTER_PARSE_ERROR; + oc = filtersConstructTextObject( m, parents[0], "arc-length", *ret, false ); } else if ( domelem.attribute( "type" ) == "distance_2pts" ) { - if ( tqparents.size() != 2 ) KIG_FILTER_PARSE_ERROR; - ObjectTypeCalcer* so = new ObjectTypeCalcer( SegmentABType::instance(), tqparents ); + if ( parents.size() != 2 ) KIG_FILTER_PARSE_ERROR; + ObjectTypeCalcer* so = new ObjectTypeCalcer( SegmentABType::instance(), parents ); so->calc( *ret ); oc = filtersConstructTextObject( m, so, "length", *ret, false ); } else if ( domelem.attribute( "type" ) == "vector_norm" ) { - if ( tqparents.size() != 1 ) KIG_FILTER_PARSE_ERROR; - oc = filtersConstructTextObject( m, tqparents[0], "length", *ret, false ); + if ( parents.size() != 1 ) KIG_FILTER_PARSE_ERROR; + oc = filtersConstructTextObject( m, parents[0], "length", *ret, false ); } else if ( domelem.attribute( "type" ) == "vector_abscissa" ) { - if ( tqparents.size() != 1 ) KIG_FILTER_PARSE_ERROR; - oc = filtersConstructTextObject( m, tqparents[0], "length-x", *ret, false ); + if ( parents.size() != 1 ) KIG_FILTER_PARSE_ERROR; + oc = filtersConstructTextObject( m, parents[0], "length-x", *ret, false ); } else if ( domelem.attribute( "type" ) == "vector_ordinate" ) { - if ( tqparents.size() != 1 ) KIG_FILTER_PARSE_ERROR; - oc = filtersConstructTextObject( m, tqparents[0], "length-y", *ret, false ); + if ( parents.size() != 1 ) KIG_FILTER_PARSE_ERROR; + oc = filtersConstructTextObject( m, parents[0], "length-y", *ret, false ); } else if ( domelem.attribute( "type" ) == "slope" ) { - if ( tqparents.size() != 1 ) KIG_FILTER_PARSE_ERROR; - oc = filtersConstructTextObject( m, tqparents[0], "slope", *ret, false ); + if ( parents.size() != 1 ) KIG_FILTER_PARSE_ERROR; + oc = filtersConstructTextObject( m, parents[0], "slope", *ret, false ); } else if ( domelem.attribute( "type" ) == "distance_pt_line" ) { - if ( tqparents.size() != 2 ) KIG_FILTER_PARSE_ERROR; + if ( parents.size() != 2 ) KIG_FILTER_PARSE_ERROR; std::vector args; - args.push_back( tqparents[1] ); - args.push_back( tqparents[0] ); + args.push_back( parents[1] ); + args.push_back( parents[0] ); ObjectTypeCalcer* po = new ObjectTypeCalcer( LinePerpendLPType::instance(), args ); po->calc( *ret ); args.clear(); - args.push_back( tqparents[1] ); + args.push_back( parents[1] ); args.push_back( po ); ObjectTypeCalcer* io = new ObjectTypeCalcer( LineLineIntersectionType::instance(), args ); io->calc( *ret ); args.clear(); - args.push_back( tqparents[0] ); + args.push_back( parents[0] ); args.push_back( io ); ObjectTypeCalcer* so = new ObjectTypeCalcer( SegmentABType::instance(), args ); so->calc( *ret ); @@ -607,13 +607,13 @@ KigDocument* KigFilterDrgeo::importFigure( TQDomNode f, const TQString& file, co // types of 'equation' else if ( domelem.attribute( "type" ) == "line" ) { - if ( tqparents.size() != 1 ) KIG_FILTER_PARSE_ERROR; - oc = filtersConstructTextObject( m, tqparents[0], "equation", *ret, false ); + if ( parents.size() != 1 ) KIG_FILTER_PARSE_ERROR; + oc = filtersConstructTextObject( m, parents[0], "equation", *ret, false ); } else if ( domelem.attribute( "type" ) == "circle" ) { - if ( tqparents.size() != 1 ) KIG_FILTER_PARSE_ERROR; - oc = filtersConstructTextObject( m, tqparents[0], "simply-cartesian-equation", *ret, false ); + if ( parents.size() != 1 ) KIG_FILTER_PARSE_ERROR; + oc = filtersConstructTextObject( m, parents[0], "simply-cartesian-equation", *ret, false ); } else { @@ -630,8 +630,8 @@ KigDocument* KigFilterDrgeo::importFigure( TQDomNode f, const TQString& file, co { if ( domelem.attribute( "type" ) == "3pts" ) { - if ( tqparents.size() != 3 ) KIG_FILTER_PARSE_ERROR; - oc = new ObjectTypeCalcer( HalfAngleType::instance(), tqparents ); + if ( parents.size() != 3 ) KIG_FILTER_PARSE_ERROR; + oc = new ObjectTypeCalcer( HalfAngleType::instance(), parents ); } else { @@ -669,7 +669,7 @@ KigDocument* KigFilterDrgeo::importFigure( TQDomNode f, const TQString& file, co // since Kig doesn't support Guile scripts, it will write script's text // in a label, so the user can freely see the code and make whatever // he/she wants - // possible idea: construct a new script object with the tqparents of Guile + // possible idea: construct a new script object with the parents of Guile // one and the Guile code inserted commented... depends on a better // handling of arguments in scripts? if ( domelem.attribute( "type" ) == "nitems" ) @@ -685,7 +685,7 @@ KigDocument* KigFilterDrgeo::importFigure( TQDomNode f, const TQString& file, co else if ( domelem.tagName() == "locus" ) { if ( domelem.attribute( "type" ) == "None" ) - oc = fact->locusCalcer( tqparents[0], tqparents[1] ); + oc = fact->locusCalcer( parents[0], parents[1] ); else { notSupported( file, i18n( "This Dr. Geo file contains a \"%1 %2\" object, " @@ -747,8 +747,8 @@ KigDocument* KigFilterDrgeo::importFigure( TQDomNode f, const TQString& file, co TQString ps = domelem.attribute( "style" ); int pointstyle = ObjectDrawer::pointStyleFromString( ps ); // show this object? - bool show = ( ( domelem.attribute( "tqmasked" ) != "True" ) && - ( domelem.attribute( "tqmasked" ) != "Alway" ) ); + bool show = ( ( domelem.attribute( "masked" ) != "True" ) && + ( domelem.attribute( "masked" ) != "Alway" ) ); // costructing the ObjectDrawer* ObjectDrawer* d = new ObjectDrawer( co, w, show, s, pointstyle ); // reading object name @@ -779,7 +779,7 @@ KigDocument* KigFilterDrgeo::importFigure( TQDomNode f, const TQString& file, co else if ( domelem.tagName() == "angle" ) { oc2 = filtersConstructTextObject( - static_cast( holders[curid-1-nignored]->calcer()->tqparents()[1]->imp() )->coordinate(), + static_cast( holders[curid-1-nignored]->calcer()->parents()[1]->imp() )->coordinate(), holders[curid-1-nignored]->calcer(), "angle-degrees", *ret, false ); } diff --git a/kig/filters/imageexporteroptionsbase.ui b/kig/filters/imageexporteroptionsbase.ui index 5b2fbb67..2a9156bf 100644 --- a/kig/filters/imageexporteroptionsbase.ui +++ b/kig/filters/imageexporteroptionsbase.ui @@ -144,7 +144,7 @@ - + knuminput.h knuminput.h diff --git a/kig/filters/kgeo-filter.cc b/kig/filters/kgeo-filter.cc index 379af11d..2405e46b 100644 --- a/kig/filters/kgeo-filter.cc +++ b/kig/filters/kgeo-filter.cc @@ -74,7 +74,7 @@ void KigFilterKGeo::loadMetrics(KSimpleConfig* c ) struct KGeoHierarchyElement { int id; - std::vector tqparents; + std::vector parents; }; static void visitElem( std::vector& ret, @@ -84,8 +84,8 @@ static void visitElem( std::vector& ret, { if ( !seen[i] ) { - for ( uint j = 0; j < elems[i].tqparents.size(); ++j ) - visitElem( ret, elems, seen, elems[i].tqparents[j] ); + for ( uint j = 0; j < elems[i].parents.size(); ++j ) + visitElem( ret, elems, seen, elems[i].parents[j] ); ret.push_back( elems[i] ); seen[i] = true; }; @@ -113,7 +113,7 @@ KigDocument* KigFilterKGeo::loadObjects( const TQString& file, KSimpleConfig* c // first we determine the tqparent relationships, and sort the // elements in an order that we can be sure all of an object's - // tqparents will have been handled before it is handled itself.. + // parents will have been handled before it is handled itself.. // ( aka topological sort of the tqparent relations graph.. std::vector elems; elems.reserve( number ); @@ -125,15 +125,15 @@ KigDocument* KigFilterKGeo::loadObjects( const TQString& file, KSimpleConfig* c group.setNum( i + 1 ); group.prepend( "Object " ); c->setGroup( group ); - TQStrList tqparents; - c->readListEntry( "Parents", tqparents ); + TQStrList parents; + c->readListEntry( "Parents", parents ); elems.push_back( elem ); - for ( const char* tqparent = tqparents.first(); tqparent; tqparent = tqparents.next() ) + for ( const char* tqparent = parents.first(); tqparent; tqparent = parents.next() ) { - int tqparentIndex = TQString::tqfromLatin1( tqparent ).toInt( &ok ); + int parentIndex = TQString::tqfromLatin1( tqparent ).toInt( &ok ); if ( ! ok ) KIG_FILTER_PARSE_ERROR; - if ( tqparentIndex != 0 ) - elems[i].tqparents.push_back( tqparentIndex - 1 ); + if ( parentIndex != 0 ) + elems[i].parents.push_back( parentIndex - 1 ); }; }; @@ -153,11 +153,11 @@ KigDocument* KigFilterKGeo::loadObjects( const TQString& file, KSimpleConfig* c c->setGroup( group ); int objID = c->readNumEntry( "Geo" ); - std::vector tqparents; - for ( uint j = 0; j < e.tqparents.size(); ++j ) + std::vector parents; + for ( uint j = 0; j < e.parents.size(); ++j ) { - int tqparentid = e.tqparents[j]; - tqparents.push_back( os[tqparentid]->calcer() ); + int parentid = e.parents[j]; + parents.push_back( os[parentid]->calcer() ); }; ObjectCalcer* o = 0; @@ -173,77 +173,77 @@ KigDocument* KigFilterKGeo::loadObjects( const TQString& file, KSimpleConfig* c double y = strY.toDouble(&ok); if (!ok) KIG_FILTER_PARSE_ERROR; Coordinate m( x, y ); - uint ntqparents = tqparents.size(); - if ( ntqparents == 0 ) + uint nparents = parents.size(); + if ( nparents == 0 ) o = factory->fixedPointCalcer( m ); - else if ( ntqparents == 1 ) - o = factory->constrainedPointCalcer( tqparents[0], m, *ret ); + else if ( nparents == 1 ) + o = factory->constrainedPointCalcer( parents[0], m, *ret ); else KIG_FILTER_PARSE_ERROR; break; } case ID_segment: { - o = new ObjectTypeCalcer( SegmentABType::instance(), tqparents ); + o = new ObjectTypeCalcer( SegmentABType::instance(), parents ); break; } case ID_circle: { - o = new ObjectTypeCalcer( CircleBCPType::instance(), tqparents ); + o = new ObjectTypeCalcer( CircleBCPType::instance(), parents ); break; } case ID_line: { - o = new ObjectTypeCalcer( LineABType::instance(), tqparents ); + o = new ObjectTypeCalcer( LineABType::instance(), parents ); break; } case ID_bisection: { // if this is the bisection of two points, first build a segment // between them.. - if ( tqparents.size() == 2 ) + if ( parents.size() == 2 ) { - ObjectTypeCalcer* seg = new ObjectTypeCalcer( SegmentABType::instance(), tqparents ); - tqparents.clear(); - tqparents.push_back( seg ); + ObjectTypeCalcer* seg = new ObjectTypeCalcer( SegmentABType::instance(), parents ); + parents.clear(); + parents.push_back( seg ); } - if ( tqparents.size() != 1 ) KIG_FILTER_PARSE_ERROR; - o = factory->propertyObjectCalcer( tqparents[0], "mid-point" ); + if ( parents.size() != 1 ) KIG_FILTER_PARSE_ERROR; + o = factory->propertyObjectCalcer( parents[0], "mid-point" ); break; }; case ID_perpendicular: { - o = new ObjectTypeCalcer( LinePerpendLPType::instance(), tqparents ); + o = new ObjectTypeCalcer( LinePerpendLPType::instance(), parents ); break; } case ID_parallel: { - o = new ObjectTypeCalcer( LineParallelLPType::instance(), tqparents ); + o = new ObjectTypeCalcer( LineParallelLPType::instance(), parents ); break; } case ID_vector: { - o = new ObjectTypeCalcer( VectorType::instance(), tqparents ); + o = new ObjectTypeCalcer( VectorType::instance(), parents ); break; } case ID_ray: { - o = new ObjectTypeCalcer( RayABType::instance(), tqparents ); + o = new ObjectTypeCalcer( RayABType::instance(), parents ); break; } case ID_move: { - o = new ObjectTypeCalcer( TranslatedType::instance(), tqparents ); + o = new ObjectTypeCalcer( TranslatedType::instance(), parents ); break; } case ID_mirrorPoint: { - o = new ObjectTypeCalcer( PointReflectionType::instance(), tqparents ); + o = new ObjectTypeCalcer( PointReflectionType::instance(), parents ); break; } case ID_pointOfConc: { - o = new ObjectTypeCalcer( LineLineIntersectionType::instance(), tqparents ); + o = new ObjectTypeCalcer( LineLineIntersectionType::instance(), parents ); break; } case ID_text: @@ -264,79 +264,79 @@ KigDocument* KigFilterKGeo::loadObjects( const TQString& file, KSimpleConfig* c case ID_fixedCircle: { double r = c->readDoubleNumEntry( "Radius" ); - tqparents.push_back( new ObjectConstCalcer( new DoubleImp( r ) ) ); - o = new ObjectTypeCalcer( CircleBPRType::instance(), tqparents ); + parents.push_back( new ObjectConstCalcer( new DoubleImp( r ) ) ); + o = new ObjectTypeCalcer( CircleBPRType::instance(), parents ); break; } case ID_angle: { - if ( tqparents.size() == 3 ) + if ( parents.size() == 3 ) { - ObjectTypeCalcer* ao = new ObjectTypeCalcer( AngleType::instance(), tqparents ); + ObjectTypeCalcer* ao = new ObjectTypeCalcer( AngleType::instance(), parents ); ao->calc( *ret ); - tqparents.clear(); - tqparents.push_back( ao ); + parents.clear(); + parents.push_back( ao ); }; - if ( tqparents.size() != 1 ) KIG_FILTER_PARSE_ERROR; - ObjectCalcer* angle = tqparents[0]; - tqparents.clear(); + if ( parents.size() != 1 ) KIG_FILTER_PARSE_ERROR; + ObjectCalcer* angle = parents[0]; + parents.clear(); const Coordinate c = - static_cast( angle->tqparents()[1]->imp() )->coordinate(); + static_cast( angle->parents()[1]->imp() )->coordinate(); o = filtersConstructTextObject( c, angle, "angle-degrees", *ret, true ); break; } case ID_distance: { - if ( tqparents.size() != 2 ) KIG_FILTER_PARSE_ERROR; - ObjectTypeCalcer* segment = new ObjectTypeCalcer( SegmentABType::instance(), tqparents ); + if ( parents.size() != 2 ) KIG_FILTER_PARSE_ERROR; + ObjectTypeCalcer* segment = new ObjectTypeCalcer( SegmentABType::instance(), parents ); segment->calc( *ret ); - Coordinate m = ( static_cast( tqparents[0]->imp() )->coordinate() + - static_cast( tqparents[1]->imp() )->coordinate() ) / 2; + Coordinate m = ( static_cast( parents[0]->imp() )->coordinate() + + static_cast( parents[1]->imp() )->coordinate() ) / 2; o = filtersConstructTextObject( m, segment, "length", *ret, true ); break; } case ID_arc: { - o = new ObjectTypeCalcer( AngleType::instance(), tqparents ); + o = new ObjectTypeCalcer( AngleType::instance(), parents ); break; } case ID_area: { - if ( tqparents.size() != 1 ) KIG_FILTER_PARSE_ERROR; - const CircleImp* circle = static_cast( tqparents[0]->imp() ); + if ( parents.size() != 1 ) KIG_FILTER_PARSE_ERROR; + const CircleImp* circle = static_cast( parents[0]->imp() ); const Coordinate c = circle->center() + Coordinate( circle->radius(), 0 ); - o = filtersConstructTextObject( c, tqparents[0], "surface", *ret, true ); + o = filtersConstructTextObject( c, parents[0], "surface", *ret, true ); break; } case ID_slope: { - // if tqparents contains a segment, line, vector or whatever, we - // take its tqparents cause we want points.. - if ( tqparents.size() == 1 ) tqparents = tqparents[0]->tqparents(); - if ( tqparents.size() != 2 ) KIG_FILTER_PARSE_ERROR; + // if parents contains a segment, line, vector or whatever, we + // take its parents cause we want points.. + if ( parents.size() == 1 ) parents = parents[0]->parents(); + if ( parents.size() != 2 ) KIG_FILTER_PARSE_ERROR; const Coordinate c = ( - static_cast( tqparents[0]->imp() )->coordinate() + - static_cast( tqparents[1]->imp() )->coordinate() ) / 2; - ObjectTypeCalcer* line = new ObjectTypeCalcer( LineABType::instance(), tqparents ); + static_cast( parents[0]->imp() )->coordinate() + + static_cast( parents[1]->imp() )->coordinate() ) / 2; + ObjectTypeCalcer* line = new ObjectTypeCalcer( LineABType::instance(), parents ); line->calc( *ret ); o = filtersConstructTextObject( c, line, "slope", *ret, true ); break; } case ID_circumference: { - if ( tqparents.size() != 1 ) KIG_FILTER_PARSE_ERROR; - const CircleImp* c = static_cast( tqparents[0]->imp() ); + if ( parents.size() != 1 ) KIG_FILTER_PARSE_ERROR; + const CircleImp* c = static_cast( parents[0]->imp() ); const Coordinate m = c->center() + Coordinate( c->radius(), 0 ); - o = filtersConstructTextObject( m, tqparents[0], "circumference", *ret, true ); + o = filtersConstructTextObject( m, parents[0], "circumference", *ret, true ); break; } case ID_rotation: { // in kig, the rotated object should be last.. - ObjectCalcer* t = tqparents[2]; - tqparents[2] = tqparents[0]; - tqparents[0] = t; - o = new ObjectTypeCalcer( RotationType::instance(), tqparents ); + ObjectCalcer* t = parents[2]; + parents[2] = parents[0]; + parents[0] = t; + o = new ObjectTypeCalcer( RotationType::instance(), parents ); break; } default: diff --git a/kig/filters/kseg-filter.cc b/kig/filters/kseg-filter.cc index 6f784759..27edc762 100644 --- a/kig/filters/kseg-filter.cc +++ b/kig/filters/kseg-filter.cc @@ -93,50 +93,50 @@ static Coordinate readKSegCoordinate( TQDataStream& stream ) return t + Coordinate( -7, -7 ); } -static ObjectTypeCalcer* intersectionPoint( const std::vector& tqparents, int which ) +static ObjectTypeCalcer* intersectionPoint( const std::vector& parents, int which ) { - if ( tqparents.size() != 2 ) return 0; + if ( parents.size() != 2 ) return 0; int nlines = 0; int nconics = 0; int narcs = 0; for ( int i = 0; i < 2; ++i ) { - if ( tqparents[i]->imp()->inherits( AbstractLineImp::stype() ) ) ++nlines; - else if ( tqparents[i]->imp()->inherits( ConicImp::stype() ) ) ++nconics; - else if ( tqparents[i]->imp()->inherits( ArcImp::stype() ) ) ++narcs; + if ( parents[i]->imp()->inherits( AbstractLineImp::stype() ) ) ++nlines; + else if ( parents[i]->imp()->inherits( ConicImp::stype() ) ) ++nconics; + else if ( parents[i]->imp()->inherits( ArcImp::stype() ) ) ++narcs; else return 0; }; if ( nlines == 2 ) - return which == -1 ? new ObjectTypeCalcer( LineLineIntersectionType::instance(), tqparents ) : 0; + return which == -1 ? new ObjectTypeCalcer( LineLineIntersectionType::instance(), parents ) : 0; else if ( nlines == 1 && nconics == 1 ) { - std::vector inttqparents( tqparents ); - inttqparents.push_back( new ObjectConstCalcer( new IntImp( which ) ) ); - return new ObjectTypeCalcer( ConicLineIntersectionType::instance(), inttqparents ); + std::vector intparents( parents ); + intparents.push_back( new ObjectConstCalcer( new IntImp( which ) ) ); + return new ObjectTypeCalcer( ConicLineIntersectionType::instance(), intparents ); } else if ( nlines == 0 && nconics == 2 ) { - std::vector rtqparents( tqparents ); - rtqparents.push_back( new ObjectConstCalcer( new IntImp( 1 ) ) ); - rtqparents.push_back( new ObjectConstCalcer( new IntImp( 1 ) ) ); - rtqparents.push_back( new ObjectTypeCalcer( ConicRadicalType::instance(), rtqparents ) ); - std::vector itqparents; - itqparents.push_back( tqparents[0] ); - itqparents.push_back( rtqparents.back() ); - itqparents.push_back( new ObjectConstCalcer( new IntImp( which ) ) ); - return new ObjectTypeCalcer( ConicLineIntersectionType::instance(), itqparents ); + std::vector rparents( parents ); + rparents.push_back( new ObjectConstCalcer( new IntImp( 1 ) ) ); + rparents.push_back( new ObjectConstCalcer( new IntImp( 1 ) ) ); + rparents.push_back( new ObjectTypeCalcer( ConicRadicalType::instance(), rparents ) ); + std::vector iparents; + iparents.push_back( parents[0] ); + iparents.push_back( rparents.back() ); + iparents.push_back( new ObjectConstCalcer( new IntImp( which ) ) ); + return new ObjectTypeCalcer( ConicLineIntersectionType::instance(), iparents ); } else if ( nlines == 1 && narcs == 1 ) { - std::vector inttqparents( tqparents ); - inttqparents.push_back( new ObjectConstCalcer( new IntImp( which ) ) ); - return new ObjectTypeCalcer( ArcLineIntersectionType::instance(), inttqparents ); + std::vector intparents( parents ); + intparents.push_back( new ObjectConstCalcer( new IntImp( which ) ) ); + return new ObjectTypeCalcer( ArcLineIntersectionType::instance(), intparents ); } else return 0; } ObjectCalcer* KigFilterKSeg::transformObject( const TQString& file, KigDocument& kigdoc, - std::vector& tqparents, + std::vector& parents, int subtype, bool& ok ) { ok = true; @@ -145,34 +145,34 @@ ObjectCalcer* KigFilterKSeg::transformObject( const TQString& file, KigDocument& { case G_TRANSLATED: { - std::vector vectortqparents( tqparents.begin() + 1, tqparents.end() ); - ObjectTypeCalcer* vector = new ObjectTypeCalcer( VectorType::instance(), vectortqparents ); + std::vector vectorparents( parents.begin() + 1, parents.end() ); + ObjectTypeCalcer* vector = new ObjectTypeCalcer( VectorType::instance(), vectorparents ); vector->calc( kigdoc ); std::vector transparents; - transparents.push_back( tqparents[0] ); + transparents.push_back( parents[0] ); transparents.push_back( vector ); retobj = new ObjectTypeCalcer( TranslatedType::instance(), transparents ); break; } case G_ROTATED: { - std::vector angletqparents( tqparents.begin() + 2, tqparents.end() ); - ObjectTypeCalcer* angle = new ObjectTypeCalcer( AngleType::instance(), angletqparents ); + std::vector angleparents( parents.begin() + 2, parents.end() ); + ObjectTypeCalcer* angle = new ObjectTypeCalcer( AngleType::instance(), angleparents ); angle->calc( kigdoc ); - std::vector rottqparents; - rottqparents.push_back( tqparents[0] ); - rottqparents.push_back( tqparents[1] ); - rottqparents.push_back( angle ); - retobj = new ObjectTypeCalcer( RotationType::instance(), rottqparents ); + std::vector rotparents; + rotparents.push_back( parents[0] ); + rotparents.push_back( parents[1] ); + rotparents.push_back( angle ); + retobj = new ObjectTypeCalcer( RotationType::instance(), rotparents ); break; } case G_SCALED: { - if ( tqparents.size() == 4 ) + if ( parents.size() == 4 ) { - retobj = new ObjectTypeCalcer( ScalingOverCenter2Type::instance(), tqparents ); + retobj = new ObjectTypeCalcer( ScalingOverCenter2Type::instance(), parents ); } else { @@ -187,8 +187,8 @@ ObjectCalcer* KigFilterKSeg::transformObject( const TQString& file, KigDocument& } case G_REFLECTED: { - std::vector mirtqparents( tqparents.begin(), tqparents.end() ); - retobj = new ObjectTypeCalcer( LineReflectionType::instance(), mirtqparents ); + std::vector mirparents( parents.begin(), parents.end() ); + retobj = new ObjectTypeCalcer( LineReflectionType::instance(), mirparents ); break; } } @@ -250,14 +250,14 @@ KigDocument* KigFilterKSeg::load( const TQString& file ) { short styleid; stream >> styleid; - short ntqparents; - stream >> ntqparents; - std::vector tqparents( ntqparents, 0 ); - for ( short j = 0; j < ntqparents; ++j ) + short nparents; + stream >> nparents; + std::vector parents( nparents, 0 ); + for ( short j = 0; j < nparents; ++j ) { int tqparent; stream >> tqparent; - tqparents[j] = ret[tqparent]->calcer(); + parents[j] = ret[tqparent]->calcer(); }; // read the object.. @@ -318,13 +318,13 @@ KigDocument* KigFilterKSeg::load( const TQString& file ) case G_SCALED: case G_REFLECTED: { - o = transformObject( file, *retdoc, tqparents, descendtype, ok ); + o = transformObject( file, *retdoc, parents, descendtype, ok ); break; } case G_FREE_POINT: { // fixed point - if ( ntqparents != 0 ) KIG_FILTER_PARSE_ERROR; + if ( nparents != 0 ) KIG_FILTER_PARSE_ERROR; Coordinate c = readKSegCoordinate( stream ); o = fact->fixedPointCalcer( c ); break; @@ -334,8 +334,8 @@ KigDocument* KigFilterKSeg::load( const TQString& file ) // constrained point double p; stream >> p; - if ( ntqparents != 1 ) KIG_FILTER_PARSE_ERROR; - ObjectCalcer* tqparent = tqparents[0]; + if ( nparents != 1 ) KIG_FILTER_PARSE_ERROR; + ObjectCalcer* tqparent = parents[0]; assert( tqparent ); o = fact->constrainedPointCalcer( tqparent, p ); break; @@ -344,27 +344,27 @@ KigDocument* KigFilterKSeg::load( const TQString& file ) { // KSeg has somewhat weird intersection objects.. // for all objects G_INTERSECTION_POINT gets the - // first intersection of its tqparents, G_INTERSECTION2_POINT + // first intersection of its parents, G_INTERSECTION2_POINT // represents the second, if present. - o = intersectionPoint( tqparents, -1 ); + o = intersectionPoint( parents, -1 ); if ( ! o ) KIG_FILTER_PARSE_ERROR; break; } case G_INTERSECTION2_POINT: { - o = intersectionPoint( tqparents, 1 ); + o = intersectionPoint( parents, 1 ); if ( ! o ) KIG_FILTER_PARSE_ERROR; break; } case G_MID_POINT: { // midpoint of a segment.. - if ( tqparents.size() != 1 ) KIG_FILTER_PARSE_ERROR; - if ( !tqparents[0]->imp()->inherits( SegmentImp::stype() ) ) + if ( parents.size() != 1 ) KIG_FILTER_PARSE_ERROR; + if ( !parents[0]->imp()->inherits( SegmentImp::stype() ) ) KIG_FILTER_PARSE_ERROR; - int index = tqparents[0]->imp()->propertiesInternalNames().tqfindIndex( "mid-point" ); + int index = parents[0]->imp()->propertiesInternalNames().tqfindIndex( "mid-point" ); assert( index != -1 ); - o = new ObjectPropertyCalcer( tqparents[0], index ); + o = new ObjectPropertyCalcer( parents[0], index ); break; } default: @@ -383,13 +383,13 @@ KigDocument* KigFilterKSeg::load( const TQString& file ) case G_SCALED: case G_REFLECTED: { - o = transformObject( file, *retdoc, tqparents, descendtype, ok ); + o = transformObject( file, *retdoc, parents, descendtype, ok ); break; } case G_ENDPOINTS_SEGMENT: { - if ( ntqparents != 2 ) KIG_FILTER_PARSE_ERROR; - o = new ObjectTypeCalcer( SegmentABType::instance(), tqparents ); + if ( nparents != 2 ) KIG_FILTER_PARSE_ERROR; + o = new ObjectTypeCalcer( SegmentABType::instance(), parents ); break; } default: @@ -406,18 +406,18 @@ KigDocument* KigFilterKSeg::load( const TQString& file ) case G_SCALED: case G_REFLECTED: { - o = transformObject( file, *retdoc, tqparents, descendtype, ok ); + o = transformObject( file, *retdoc, parents, descendtype, ok ); break; } case G_TWOPOINTS_RAY: { - if ( ntqparents != 2 ) KIG_FILTER_PARSE_ERROR; - o = new ObjectTypeCalcer( RayABType::instance(), tqparents ); + if ( nparents != 2 ) KIG_FILTER_PARSE_ERROR; + o = new ObjectTypeCalcer( RayABType::instance(), parents ); break; } case G_BISECTOR_RAY: { - ObjectTypeCalcer* angle = new ObjectTypeCalcer( HalfAngleType::instance(), tqparents ); + ObjectTypeCalcer* angle = new ObjectTypeCalcer( HalfAngleType::instance(), parents ); angle->calc( *retdoc ); o = fact->propertyObjectCalcer( angle, "angle-bisector" ); break; @@ -436,25 +436,25 @@ KigDocument* KigFilterKSeg::load( const TQString& file ) case G_SCALED: case G_REFLECTED: { - o = transformObject( file, *retdoc, tqparents, descendtype, ok ); + o = transformObject( file, *retdoc, parents, descendtype, ok ); break; } case G_TWOPOINTS_LINE: { - if ( ntqparents != 2 ) KIG_FILTER_PARSE_ERROR; - o = new ObjectTypeCalcer( LineABType::instance(), tqparents ); + if ( nparents != 2 ) KIG_FILTER_PARSE_ERROR; + o = new ObjectTypeCalcer( LineABType::instance(), parents ); break; } case G_PARALLEL_LINE: { - if ( ntqparents != 2 ) KIG_FILTER_PARSE_ERROR; - o = new ObjectTypeCalcer( LineParallelLPType::instance(), tqparents ); + if ( nparents != 2 ) KIG_FILTER_PARSE_ERROR; + o = new ObjectTypeCalcer( LineParallelLPType::instance(), parents ); break; } case G_PERPENDICULAR_LINE: { - if ( ntqparents != 2 ) KIG_FILTER_PARSE_ERROR; - o = new ObjectTypeCalcer( LinePerpendLPType::instance(), tqparents ); + if ( nparents != 2 ) KIG_FILTER_PARSE_ERROR; + o = new ObjectTypeCalcer( LinePerpendLPType::instance(), parents ); break; } default: @@ -471,37 +471,37 @@ KigDocument* KigFilterKSeg::load( const TQString& file ) case G_SCALED: case G_REFLECTED: { - o = transformObject( file, *retdoc, tqparents, descendtype, ok ); + o = transformObject( file, *retdoc, parents, descendtype, ok ); break; } case G_CENTERPOINT_CIRCLE: { - if ( ntqparents != 2 ) KIG_FILTER_PARSE_ERROR; - o = new ObjectTypeCalcer( CircleBCPType::instance(), tqparents ); + if ( nparents != 2 ) KIG_FILTER_PARSE_ERROR; + o = new ObjectTypeCalcer( CircleBCPType::instance(), parents ); break; } case G_CENTERRADIUS_CIRCLE: { ObjectCalcer* point; ObjectCalcer* segment; - if ( tqparents[0]->imp()->inherits( PointImp::stype() ) ) + if ( parents[0]->imp()->inherits( PointImp::stype() ) ) { - point = tqparents[0]; - segment = tqparents[1]; + point = parents[0]; + segment = parents[1]; } else { - point = tqparents[1]; - segment = tqparents[0]; + point = parents[1]; + segment = parents[0]; }; int index = segment->imp()->propertiesInternalNames().tqfindIndex( "length" ); if ( index == -1 ) KIG_FILTER_PARSE_ERROR; ObjectPropertyCalcer* length = new ObjectPropertyCalcer( segment, index ); length->calc( *retdoc ); - std::vector ctqparents; - ctqparents.push_back( point ); - ctqparents.push_back( length ); - o = new ObjectTypeCalcer( CircleBPRType::instance(), ctqparents ); + std::vector cparents; + cparents.push_back( point ); + cparents.push_back( length ); + o = new ObjectTypeCalcer( CircleBPRType::instance(), cparents ); break; } default: @@ -518,13 +518,13 @@ KigDocument* KigFilterKSeg::load( const TQString& file ) case G_SCALED: case G_REFLECTED: { - o = transformObject( file, *retdoc, tqparents, descendtype, ok ); + o = transformObject( file, *retdoc, parents, descendtype, ok ); break; } case G_THREEPOINTS_ARC: { - if ( ntqparents != 3 ) KIG_FILTER_PARSE_ERROR; - o = new ObjectTypeCalcer( ArcBTPType::instance(), tqparents ); + if ( nparents != 3 ) KIG_FILTER_PARSE_ERROR; + o = new ObjectTypeCalcer( ArcBTPType::instance(), parents ); break; } default: @@ -541,13 +541,13 @@ KigDocument* KigFilterKSeg::load( const TQString& file ) case G_SCALED: case G_REFLECTED: { - o = transformObject( file, *retdoc, tqparents, descendtype, ok ); + o = transformObject( file, *retdoc, parents, descendtype, ok ); break; } default: { - if ( ntqparents < 3 ) KIG_FILTER_PARSE_ERROR; - o = new ObjectTypeCalcer( PolygonBNPType::instance(), tqparents ); + if ( nparents < 3 ) KIG_FILTER_PARSE_ERROR; + o = new ObjectTypeCalcer( PolygonBNPType::instance(), parents ); } } // default: @@ -581,13 +581,13 @@ KigDocument* KigFilterKSeg::load( const TQString& file ) case G_SCALED: case G_REFLECTED: { - o = transformObject( file, *retdoc, tqparents, descendtype, ok ); + o = transformObject( file, *retdoc, parents, descendtype, ok ); break; } case G_OBJECT_LOCUS: { - if ( ntqparents != 2 ) KIG_FILTER_PARSE_ERROR; - o = fact->locusCalcer( tqparents[0], tqparents[1] ); + if ( nparents != 2 ) KIG_FILTER_PARSE_ERROR; + o = fact->locusCalcer( parents[0], parents[1] ); break; } default: diff --git a/kig/filters/kseg-filter.h b/kig/filters/kseg-filter.h index d8909282..03d03958 100644 --- a/kig/filters/kseg-filter.h +++ b/kig/filters/kseg-filter.h @@ -29,7 +29,7 @@ class KigFilterKSeg ~KigFilterKSeg(); ObjectCalcer* transformObject( const TQString& file, KigDocument& kigdoc, - std::vector& tqparents, + std::vector& parents, int subtype, bool& ok ); public: diff --git a/kig/filters/latexexporteroptions.ui b/kig/filters/latexexporteroptions.ui index 2e9354bc..6db39ed9 100644 --- a/kig/filters/latexexporteroptions.ui +++ b/kig/filters/latexexporteroptions.ui @@ -63,7 +63,7 @@ - + diff --git a/kig/filters/native-filter.cc b/kig/filters/native-filter.cc index 4a3d0a04..9e92130d 100644 --- a/kig/filters/native-filter.cc +++ b/kig/filters/native-filter.cc @@ -51,7 +51,7 @@ struct HierElem { int id; - std::vector tqparents; + std::vector parents; TQDomElement el; }; @@ -73,8 +73,8 @@ static void visitElem( std::vector& ret, { if ( !seen[i] ) { - for ( uint j = 0; j < elems[i].tqparents.size(); ++j ) - visitElem( ret, elems, seen, elems[i].tqparents[j] - 1); + for ( uint j = 0; j < elems[i].parents.size(); ++j ) + visitElem( ret, elems, seen, elems[i].parents[j] - 1); ret.push_back( elems[i] ); seen[i] = true; }; @@ -273,7 +273,7 @@ KigDocument* KigFilterNative::load04( const TQString& file, const TQDomElement& if ( ! ok ) KIG_FILTER_PARSE_ERROR; extendVect( elems, id ); - elems[id-1].tqparents.push_back( pid ); + elems[id-1].parents.push_back( pid ); } } }; @@ -315,8 +315,8 @@ KigDocument* KigFilterNative::load04( const TQString& file, const TQDomElement& propname = ec.text().latin1(); }; - if ( i->tqparents.size() != 1 ) KIG_FILTER_PARSE_ERROR; - ObjectCalcer* tqparent = retcalcers[i->tqparents[0] -1]; + if ( i->parents.size() != 1 ) KIG_FILTER_PARSE_ERROR; + ObjectCalcer* tqparent = retcalcers[i->parents[0] -1]; QCStringList propnames = tqparent->imp()->propertiesInternalNames(); int propid = propnames.tqfindIndex( propname ); if ( propid == -1 ) @@ -342,12 +342,12 @@ KigDocument* KigFilterNative::load04( const TQString& file, const TQDomElement& return false; }; - std::vector tqparents; - for ( std::vector::iterator j = i->tqparents.begin(); - j != i->tqparents.end(); ++j ) - tqparents.push_back( retcalcers[*j - 1] ); + std::vector parents; + for ( std::vector::iterator j = i->parents.begin(); + j != i->parents.end(); ++j ) + parents.push_back( retcalcers[*j - 1] ); - o = new ObjectTypeCalcer( type, tqparents ); + o = new ObjectTypeCalcer( type, parents ); } else continue; @@ -434,25 +434,25 @@ KigDocument* KigFilterNative::load07( const TQString& file, const TQDomElement& uint id = tmp.toInt( &ok ); if ( id <= 0 ) KIG_FILTER_PARSE_ERROR; - std::vector tqparents; - for ( TQDomElement tqparentel = e.firstChild().toElement(); ! tqparentel.isNull(); - tqparentel = tqparentel.nextSibling().toElement() ) + std::vector parents; + for ( TQDomElement parentel = e.firstChild().toElement(); ! parentel.isNull(); + parentel = parentel.nextSibling().toElement() ) { - if ( tqparentel.tagName() != "Parent" ) continue; - TQString tmp = tqparentel.attribute( "id" ); - uint tqparentid = tmp.toInt( &ok ); + if ( parentel.tagName() != "Parent" ) continue; + TQString tmp = parentel.attribute( "id" ); + uint parentid = tmp.toInt( &ok ); if ( ! ok ) KIG_FILTER_PARSE_ERROR; - if ( tqparentid == 0 || tqparentid > calcers.size() ) KIG_FILTER_PARSE_ERROR; - ObjectCalcer* tqparent = calcers[tqparentid - 1].get(); + if ( parentid == 0 || parentid > calcers.size() ) KIG_FILTER_PARSE_ERROR; + ObjectCalcer* tqparent = calcers[parentid - 1].get(); if ( ! tqparent ) KIG_FILTER_PARSE_ERROR; - tqparents.push_back( tqparent ); + parents.push_back( tqparent ); } ObjectCalcer* o = 0; if ( e.tagName() == "Data" ) { - if ( !tqparents.empty() ) KIG_FILTER_PARSE_ERROR; + if ( !parents.empty() ) KIG_FILTER_PARSE_ERROR; TQString tmp = e.attribute( "type" ); TQString error; ObjectImp* imp = ObjectImpFactory::instance()->deserialize( tmp, e, error ); @@ -465,10 +465,10 @@ KigDocument* KigFilterNative::load07( const TQString& file, const TQDomElement& } else if ( e.tagName() == "Property" ) { - if ( tqparents.size() != 1 ) KIG_FILTER_PARSE_ERROR; + if ( parents.size() != 1 ) KIG_FILTER_PARSE_ERROR; TQCString propname = e.attribute( "which" ).latin1(); - ObjectCalcer* tqparent = tqparents[0]; + ObjectCalcer* tqparent = parents[0]; int propid = tqparent->imp()->propertiesInternalNames().tqfindIndex( propname ); if ( propid == -1 ) KIG_FILTER_PARSE_ERROR; @@ -490,17 +490,17 @@ KigDocument* KigFilterNative::load07( const TQString& file, const TQDomElement& } // mp: (I take the responsibility for this!) explanation: the usual ObjectTypeCalcer - // constructor also "sortArgs" the tqparents. I believe that this *must not* be done + // constructor also "sortArgs" the parents. I believe that this *must not* be done // when loading from a saved kig file for the following reasons: // 1. the arguments should already be in their intended order, since the file was // saved from a working hierarchy; furthermore we actually want to restore the original // hierarchy, not really to also fix possible problems with the original hierarchy; // 2. calling sortArgs could have undesirable side effects in particular situations, // since kig actually allow an ObjectType to produce different type of ObjectImp's - // it may happen that the tqparents of an object do not satisfy the requirements + // it may happen that the parents of an object do not satisfy the requirements // enforced by sortArgs (while moving around the free objects) but still be // perfectly valid - o = new ObjectTypeCalcer( type, tqparents, false ); + o = new ObjectTypeCalcer( type, parents, false ); } else KIG_FILTER_PARSE_ERROR; @@ -615,8 +615,8 @@ bool KigFilterNative::save07( const KigDocument& kdoc, TQTextStream& stream ) } else assert( false ); - const std::vector tqparents = ( *i )->tqparents(); - for ( std::vector::const_iterator i = tqparents.begin(); i != tqparents.end(); ++i ) + const std::vector parents = ( *i )->parents(); + for ( std::vector::const_iterator i = parents.begin(); i != parents.end(); ++i ) { std::map::const_iterator idp = idmap.find( *i ); assert( idp != idmap.end() ); diff --git a/kig/filters/svgexporteroptions.ui b/kig/filters/svgexporteroptions.ui index feca8ca1..2677650d 100644 --- a/kig/filters/svgexporteroptions.ui +++ b/kig/filters/svgexporteroptions.ui @@ -55,7 +55,7 @@ - + diff --git a/kig/filters/tests/locus.fgeo b/kig/filters/tests/locus.fgeo index 4ad79bbd..55fa562f 100644 --- a/kig/filters/tests/locus.fgeo +++ b/kig/filters/tests/locus.fgeo @@ -1,2 +1,2 @@ --1.6666663.216667-2.7666670.5500000.0806913.0000003.0166672.866667-0.7500002.6000003.816667 +-1.6666663.216667-2.7666670.5500000.0806913.0000003.0166672.866667-0.7500002.6000003.816667 diff --git a/kig/kig/kig_commands.cpp b/kig/kig/kig_commands.cpp index d6b79805..bcf26969 100644 --- a/kig/kig/kig_commands.cpp +++ b/kig/kig/kig_commands.cpp @@ -274,7 +274,7 @@ class ChangeParentsAndTypeTask::Private { public: ObjectTypeCalcer* o; - std::vector newtqparents; + std::vector newparents; const ObjectType* newtype; }; @@ -284,13 +284,13 @@ ChangeParentsAndTypeTask::~ChangeParentsAndTypeTask() } ChangeParentsAndTypeTask::ChangeParentsAndTypeTask( - ObjectTypeCalcer* o, const std::vector& newtqparents, + ObjectTypeCalcer* o, const std::vector& newparents, const ObjectType* newtype ) : KigCommandTask(), d( new Private ) { d->o = o; - std::copy( newtqparents.begin(), newtqparents.end(), - std::back_inserter( d->newtqparents ) ); + std::copy( newparents.begin(), newparents.end(), + std::back_inserter( d->newparents ) ); d->newtype = newtype; } @@ -300,17 +300,17 @@ void ChangeParentsAndTypeTask::execute( KigPart& doc ) d->o->setType( d->newtype ); d->newtype = oldtype; - std::vector oldtqparentso = d->o->tqparents(); - std::vector oldtqparents( - oldtqparentso.begin(), oldtqparentso.end() ); - std::vector newtqparents; - for ( std::vector::iterator i = d->newtqparents.begin(); - i != d->newtqparents.end(); ++i ) - newtqparents.push_back( i->get() ); - d->o->setParents( newtqparents ); - d->newtqparents = oldtqparents; - - for ( std::vector::iterator i = newtqparents.begin(); i != newtqparents.end(); ++i ) + std::vector oldparentso = d->o->parents(); + std::vector oldparents( + oldparentso.begin(), oldparentso.end() ); + std::vector newparents; + for ( std::vector::iterator i = d->newparents.begin(); + i != d->newparents.end(); ++i ) + newparents.push_back( i->get() ); + d->o->setParents( newparents ); + d->newparents = oldparents; + + for ( std::vector::iterator i = newparents.begin(); i != newparents.end(); ++i ) ( *i )->calc( doc.document() ); d->o->calc( doc.document() ); std::set alltqchildren = getAllChildren( d->o ); diff --git a/kig/kig/kig_commands.h b/kig/kig/kig_commands.h index e9df77c1..5bd3ae29 100644 --- a/kig/kig/kig_commands.h +++ b/kig/kig/kig_commands.h @@ -59,7 +59,7 @@ public: static KigCommand* addCommand( KigPart& doc, ObjectHolder* os ); /** * make sure that when you delete something, you are also deleting - * its tqparents. This class assumes you've done that. + * its parents. This class assumes you've done that. * \ref KigDocument::delObjects() takes care of this for you. */ static KigCommand* removeCommand( KigPart& doc, const std::vector& os ); @@ -124,7 +124,7 @@ protected: * this class monitors a set of DataObjects for changes and returns an * appropriate ChangeObjectImpsCommand if necessary.. * E.g. MovingMode wants to move certain objects, so it monitors all - * the tqparents of the explicitly moving objects: + * the parents of the explicitly moving objects: * \code * MonitorDataObjects mon( getAllParents( emo ) ); * \endcode @@ -181,7 +181,7 @@ class ChangeParentsAndTypeTask class Private; Private* d; public: - ChangeParentsAndTypeTask( ObjectTypeCalcer* o, const std::vector& newtqparents, + ChangeParentsAndTypeTask( ObjectTypeCalcer* o, const std::vector& newparents, const ObjectType* newtype ); ~ChangeParentsAndTypeTask(); diff --git a/kig/kig/kig_part.cpp b/kig/kig/kig_part.cpp index 137d0096..f59559d1 100644 --- a/kig/kig/kig_part.cpp +++ b/kig/kig/kig_part.cpp @@ -165,7 +165,7 @@ bool KigPrintDialogPage::isValid( TQString& ) return true; } -KigPart::KigPart( TQWidget *tqparentWidget, const char *, +KigPart::KigPart( TQWidget *parentWidget, const char *, TQObject *tqparent, const char *name, const TQStringList& ) : KParts::ReadWritePart( tqparent, name ), @@ -177,7 +177,7 @@ KigPart::KigPart( TQWidget *tqparentWidget, const char *, mMode = new NormalMode( *this ); // we need a widget, to actually show the document - m_widget = new KigView(this, false, tqparentWidget, "kig_view"); + m_widget = new KigView(this, false, parentWidget, "kig_view"); // notify the part that this is our internal widget setWidget( m_widget ); diff --git a/kig/kig/kig_part.h b/kig/kig/kig_part.h index 187f559e..677c9037 100644 --- a/kig/kig/kig_part.h +++ b/kig/kig/kig_part.h @@ -66,7 +66,7 @@ public: /** * Default constructor */ - KigPart( TQWidget* tqparentWidget, const char* widgetName, + KigPart( TQWidget* parentWidget, const char* widgetName, TQObject* tqparent = 0, const char* name = 0, const TQStringList& = TQStringList() ); diff --git a/kig/kig/kig_view.h b/kig/kig/kig_view.h index 4c167d7a..9d3ebab2 100644 --- a/kig/kig/kig_view.h +++ b/kig/kig/kig_view.h @@ -235,7 +235,7 @@ class KigView TQScrollBar* mbottomscroll; /** - * aptqparently, TQScrollBar also emits its signals when you update it + * apparently, TQScrollBar also emits its signals when you update it * manually, so we ignore them while we're in \ref updateScrollBars()... */ bool mupdatingscrollbars; diff --git a/kig/misc/argsparser.cpp b/kig/misc/argsparser.cpp index 9d722752..c2387970 100644 --- a/kig/misc/argsparser.cpp +++ b/kig/misc/argsparser.cpp @@ -152,15 +152,15 @@ ArgsParser ArgsParser::without( const ObjectImpType* type ) const return ArgsParser( ret ); } -ArgsParser::spec ArgsParser::findSpec( const ObjectImp* obj, const Args& tqparents ) const +ArgsParser::spec ArgsParser::findSpec( const ObjectImp* obj, const Args& parents ) const { spec ret; ret.type = 0; std::vector found( margs.size(), false ); - for ( Args::const_iterator o = tqparents.begin(); - o != tqparents.end(); ++o ) + for ( Args::const_iterator o = parents.begin(); + o != parents.end(); ++o ) { for ( uint i = 0; i < margs.size(); ++i ) { @@ -183,9 +183,9 @@ ArgsParser::spec ArgsParser::findSpec( const ObjectImp* obj, const Args& tqparen } const ObjectImpType* ArgsParser::impRequirement( - const ObjectImp* o, const Args& tqparents ) const + const ObjectImp* o, const Args& parents ) const { - spec s = findSpec( o, tqparents ); + spec s = findSpec( o, parents ); return s.type; } @@ -233,9 +233,9 @@ ArgsParser::~ArgsParser() { } -bool ArgsParser::isDefinedOnOrThrough( const ObjectImp* o, const Args& tqparents ) const +bool ArgsParser::isDefinedOnOrThrough( const ObjectImp* o, const Args& parents ) const { - spec s = findSpec( o, tqparents ); + spec s = findSpec( o, parents ); return s.onOrThrough; } diff --git a/kig/misc/argsparser.h b/kig/misc/argsparser.h index a3aff562..001d9359 100644 --- a/kig/misc/argsparser.h +++ b/kig/misc/argsparser.h @@ -26,7 +26,7 @@ class ObjectImpType; /** * This class is meant to take care of checking the types of the - * tqparents to ObjectCalcer's, and to put them in the correct order. + * parents to ObjectCalcer's, and to put them in the correct order. * An ObjectType should construct an ArgsParser with a specification * of the arguments it wants. This specification is given as an array * of ArgsParser::spec structs. This struct contains a pointer to an @@ -117,7 +117,7 @@ private: */ std::vector margs; - spec findSpec( const ObjectImp* o, const Args& tqparents ) const; + spec findSpec( const ObjectImp* o, const Args& parents ) const; public: ArgsParser( const struct spec* args, int n ); ArgsParser( const std::vector& args ); @@ -137,7 +137,7 @@ public: int check( const std::vector& os ) const; /** * returns the usetext for the argument that o would be used for, - * if sel were used as tqparents.. + * if sel were used as parents.. * \p o should be in \p sel ... */ std::string usetext( const ObjectImp* o, const Args& sel ) const; @@ -155,16 +155,16 @@ public: /** * returns the minimal ObjectImp ID that \p o needs to inherit in order - * to be useful.. \p o should be part of \p tqparents . + * to be useful.. \p o should be part of \p parents . */ - const ObjectImpType* impRequirement( const ObjectImp* o, const Args& tqparents ) const; + const ObjectImpType* impRequirement( const ObjectImp* o, const Args& parents ) const; /** - * Supposing that \p tqparents would be given as tqparents, this function + * Supposing that \p parents would be given as parents, this function * returns whether the returned ObjectImp will be, by construction, * on \p o ( if \p o is a curve ), or through \p o ( if \p o is a point ). */ - bool isDefinedOnOrThrough( const ObjectImp* o, const Args& tqparents ) const; + bool isDefinedOnOrThrough( const ObjectImp* o, const Args& parents ) const; // Checks the args according to this args specification. If the // objects should never have occurred, then an assertion failure diff --git a/kig/misc/calcpaths.cc b/kig/misc/calcpaths.cc index 55787518..15dd9d98 100644 --- a/kig/misc/calcpaths.cc +++ b/kig/misc/calcpaths.cc @@ -124,7 +124,7 @@ std::vector calcPath( const std::vector& os ) }; // now we know that if all objects appear at least once after all of - // their tqparents. So, we take all, and of every object, we remove + // their parents. So, we take all, and of every object, we remove // every reference except the last one... std::vector ret; ret.reserve( os.size() ); @@ -182,9 +182,9 @@ static void addNonCache( ObjectCalcer* o, std::vector& ret ) ret.push_back( o ); else { - std::vector tqparents = o->tqparents(); - for ( uint i = 0; i < tqparents.size(); ++i ) - addNonCache( tqparents[i], ret ); + std::vector parents = o->parents(); + for ( uint i = 0; i < parents.size(); ++i ) + addNonCache( parents[i], ret ); }; } @@ -196,13 +196,13 @@ static bool visit( const ObjectCalcer* o, const std::vector& from // but their direct tqchildren do ), then we add them to ret. if ( std::find( from.begin(), from.end(), o ) != from.end() ) return true; - std::vector deps( o->tqparents().size(), false ); + std::vector deps( o->parents().size(), false ); bool somedepend = false; bool alldepend = true; - std::vector tqparents = o->tqparents(); - for ( uint i = 0; i < tqparents.size(); ++i ) + std::vector parents = o->parents(); + for ( uint i = 0; i < parents.size(); ++i ) { - bool v = visit( tqparents[i], from, ret ); + bool v = visit( parents[i], from, ret ); somedepend |= v; alldepend &= v; deps[i] = v; @@ -211,7 +211,7 @@ static bool visit( const ObjectCalcer* o, const std::vector& from { for ( uint i = 0; i < deps.size(); ++i ) if ( ! deps[i] ) - addNonCache( tqparents[i], ret ); + addNonCache( parents[i], ret ); }; return somedepend; @@ -234,8 +234,8 @@ std::vector getAllParents( const std::vector& objs std::set next; for ( std::set::const_iterator i = cur.begin(); i != cur.end(); ++i ) { - std::vector tqparents = (*i)->tqparents(); - next.insert( tqparents.begin(), tqparents.end() ); + std::vector parents = (*i)->parents(); + next.insert( parents.begin(), parents.end() ); }; ret.insert( next.begin(), next.end() ); @@ -253,16 +253,16 @@ std::vector getAllParents( ObjectCalcer* obj ) bool isChild( const ObjectCalcer* o, const std::vector& os ) { - std::vector tqparents = o->tqparents(); - std::set cur( tqparents.begin(), tqparents.end() ); + std::vector parents = o->parents(); + std::set cur( parents.begin(), parents.end() ); while ( ! cur.empty() ) { std::set next; for ( std::set::const_iterator i = cur.begin(); i != cur.end(); ++i ) { if ( std::find( os.begin(), os.end(), *i ) != os.end() ) return true; - std::vector tqparents = (*i)->tqparents(); - next.insert( tqparents.begin(), tqparents.end() ); + std::vector parents = (*i)->parents(); + next.insert( parents.begin(), parents.end() ); }; cur = next; }; diff --git a/kig/misc/calcpaths.h b/kig/misc/calcpaths.h index 3abf19a6..f81ddc09 100644 --- a/kig/misc/calcpaths.h +++ b/kig/misc/calcpaths.h @@ -23,7 +23,7 @@ /** * This function sorts \p os such that they're in the right order for * calc()-ing. This means that child objects must appear after their - * tqparents ( for you graph people, this is just a topological sort.. ) + * parents ( for you graph people, this is just a topological sort.. ) */ std::vector calcPath( const std::vector& os ); diff --git a/kig/misc/cubic-common.cc b/kig/misc/cubic-common.cc index 6bdf3aca..029f1194 100644 --- a/kig/misc/cubic-common.cc +++ b/kig/misc/cubic-common.cc @@ -486,7 +486,7 @@ const CubicCartesianData calcCubicTransformation ( // assert (fabs(b[0][1][2] - b[1][2][0]) < 1e-8); // test a couple of cases // assert (fabs(b[0][1][1] - b[1][1][0]) < 1e-8); - // aptqparently, the above assertions are wrong ( due to rounding + // apparently, the above assertions are wrong ( due to rounding // errors, Maurizio and I hope :) ), so since the symmetry is not // present, we just take the sum of the parts of the matrix elements // that should be symmetric, instead of taking one of them, and diff --git a/kig/misc/object_constructor.cc b/kig/misc/object_constructor.cc index a5802d45..5522a598 100644 --- a/kig/misc/object_constructor.cc +++ b/kig/misc/object_constructor.cc @@ -124,12 +124,12 @@ SimpleObjectTypeConstructor::~SimpleObjectTypeConstructor() { } -void SimpleObjectTypeConstructor::drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& tqparents, +void SimpleObjectTypeConstructor::drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& parents, const KigDocument& doc ) const { Args args; using namespace std; - transform( tqparents.begin(), tqparents.end(), + transform( parents.begin(), parents.end(), back_inserter( args ), mem_fun( &ObjectCalcer::imp ) ); ObjectImp* data = mtype->calc( args, doc ); drawer.draw( *data, p, true ); @@ -178,12 +178,12 @@ MultiObjectTypeConstructor::~MultiObjectTypeConstructor() { } -void MultiObjectTypeConstructor::drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& tqparents, +void MultiObjectTypeConstructor::drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& parents, const KigDocument& doc ) const { Args args; using namespace std; - transform( tqparents.begin(), tqparents.end(), + transform( parents.begin(), parents.end(), back_inserter( args ), mem_fun( &ObjectCalcer::imp ) ); for ( vector::const_iterator i = mparams.begin(); i != mparams.end(); ++i ) @@ -551,26 +551,26 @@ PropertyObjectConstructor::~PropertyObjectConstructor() } void PropertyObjectConstructor::drawprelim( - const ObjectDrawer& drawer, KigPainter& p, const std::vector& tqparents, + const ObjectDrawer& drawer, KigPainter& p, const std::vector& parents, const KigDocument& d ) const { - int index = tqparents[0]->imp()->propertiesInternalNames().tqfindIndex( mpropinternalname ); + int index = parents[0]->imp()->propertiesInternalNames().tqfindIndex( mpropinternalname ); assert ( index != -1 ); - ObjectImp* imp = tqparents[0]->imp()->property( index, d ); + ObjectImp* imp = parents[0]->imp()->property( index, d ); drawer.draw( *imp, p, true ); delete imp; } std::vector PropertyObjectConstructor::build( - const std::vector& tqparents, KigDocument&, + const std::vector& parents, KigDocument&, KigWidget& ) const { - int index = tqparents[0]->imp()->propertiesInternalNames().tqfindIndex( mpropinternalname ); + int index = parents[0]->imp()->propertiesInternalNames().tqfindIndex( mpropinternalname ); assert( index != -1 ); std::vector ret; ret.push_back( new ObjectHolder( - new ObjectPropertyCalcer( tqparents[0], index ) ) ); + new ObjectPropertyCalcer( parents[0], index ) ) ); return ret; } diff --git a/kig/misc/object_constructor.h b/kig/misc/object_constructor.h index 9233426f..9b03ece0 100644 --- a/kig/misc/object_constructor.h +++ b/kig/misc/object_constructor.h @@ -165,7 +165,7 @@ public: const KigDocument& d, const KigWidget& v ) const; - virtual void drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& tqparents, + virtual void drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& parents, const KigDocument& ) const = 0; TQString useText( const ObjectCalcer& o, const std::vector& sel, @@ -196,7 +196,7 @@ public: ~SimpleObjectTypeConstructor(); - void drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& tqparents, + void drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& parents, const KigDocument& ) const; std::vector build( const std::vector& os, @@ -225,7 +225,7 @@ public: ~PropertyObjectConstructor(); - void drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& tqparents, + void drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& parents, const KigDocument& ) const; std::vector build( const std::vector& os, @@ -265,7 +265,7 @@ public: int a, int b, int c = -999, int d = -999 ); ~MultiObjectTypeConstructor(); - void drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& tqparents, + void drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& parents, const KigDocument& ) const; std::vector build( diff --git a/kig/misc/object_hierarchy.cc b/kig/misc/object_hierarchy.cc index 7a977e63..264f7e8c 100644 --- a/kig/misc/object_hierarchy.cc +++ b/kig/misc/object_hierarchy.cc @@ -47,14 +47,14 @@ public: // on the given objects. The dependsstack contains a set of // booleans telling which parts of the hierarchy certainly depend on // the given objects. In this function, the node should check - // whether any of its tqparents have true set, and if so, set its own + // whether any of its parents have true set, and if so, set its own // value to true. virtual void checkDependsOnGiven( std::vector& dependsstack, int loc ) const = 0; // this function is used to check whether the given objects are all // used by one or more of the final objects. The usedstack tqcontains // a set of booleans telling which parts of the hierarchy are // certainly ancestors of the final objects. In this function, the - // node should set all of its tqparents' booleans to true. + // node should set all of its parents' booleans to true. virtual void checkArgumentsUsed( std::vector& usedstack ) const = 0; }; @@ -118,15 +118,15 @@ class ApplyTypeNode : public ObjectHierarchy::Node { const ObjectType* mtype; - std::vector mtqparents; + std::vector mparents; public: - ApplyTypeNode( const ObjectType* type, const std::vector& tqparents ) - : mtype( type ), mtqparents( tqparents ) {} + ApplyTypeNode( const ObjectType* type, const std::vector& parents ) + : mtype( type ), mparents( parents ) {} ~ApplyTypeNode(); Node* copy() const; const ObjectType* type() const { return mtype; } - const std::vector& tqparents() const { return mtqparents; } + const std::vector& parents() const { return mparents; } int id() const; void apply( std::vector& stack, @@ -141,17 +141,17 @@ int ApplyTypeNode::id() const { return ID_ApplyType; } void ApplyTypeNode::checkArgumentsUsed( std::vector& usedstack ) const { - for ( uint i = 0; i < mtqparents.size(); ++i ) + for ( uint i = 0; i < mparents.size(); ++i ) { - usedstack[mtqparents[i]] = true; + usedstack[mparents[i]] = true; } } void ApplyTypeNode::checkDependsOnGiven( std::vector& dependsstack, int loc ) const { bool result = false; - for ( uint i = 0; i < mtqparents.size(); ++i ) - if ( dependsstack[mtqparents[i]] == true ) result = true; + for ( uint i = 0; i < mparents.size(); ++i ) + if ( dependsstack[mparents[i]] == true ) result = true; dependsstack[loc] = result; } @@ -161,23 +161,23 @@ ApplyTypeNode::~ApplyTypeNode() ObjectHierarchy::Node* ApplyTypeNode::copy() const { - return new ApplyTypeNode( mtype, mtqparents ); + return new ApplyTypeNode( mtype, mparents ); } void ApplyTypeNode::apply( std::vector& stack, int loc ) const { - std::vector tqparents; - for ( uint i = 0; i < mtqparents.size(); ++i ) - tqparents.push_back( stack[ mtqparents[i] ] ); - stack[loc] = new ObjectTypeCalcer( mtype, tqparents ); + std::vector parents; + for ( uint i = 0; i < mparents.size(); ++i ) + parents.push_back( stack[ mparents[i] ] ); + stack[loc] = new ObjectTypeCalcer( mtype, parents ); } void ApplyTypeNode::apply( std::vector& stack, int loc, const KigDocument& doc ) const { Args args; - for ( uint i = 0; i < mtqparents.size(); ++i ) - args.push_back( stack[mtqparents[i]] ); + for ( uint i = 0; i < mparents.size(); ++i ) + args.push_back( stack[mparents[i]] ); args = mtype->sortArgs( args ); stack[loc] = mtype->calc( args, doc ); } @@ -297,23 +297,23 @@ int ObjectHierarchy::visit( const ObjectCalcer* o, std::map tqparents; - tqparents.push_back( smi->second ); - mnodes.push_back( new ApplyTypeNode( CopyObjectType::instance(), tqparents ) ); + std::vector parents; + parents.push_back( smi->second ); + mnodes.push_back( new ApplyTypeNode( CopyObjectType::instance(), parents ) ); return ret; } else return smi->second; } - std::vector p( o->tqparents() ); + std::vector p( o->parents() ); // we check if o descends from the given objects.. bool descendsfromgiven = false; - std::vector tqparents; - tqparents.resize( p.size(), -1 ); + std::vector parents; + parents.resize( p.size(), -1 ); for ( uint i = 0; i < p.size(); ++i ) { int v = visit( p[i], seenmap, false ); - tqparents[i] = v; + parents[i] = v; descendsfromgiven |= (v != -1); }; @@ -335,7 +335,7 @@ int ObjectHierarchy::visit( const ObjectCalcer* o, std::map& from, const std::v seenmap[from[i]] = i; for ( std::vector::const_iterator i = to.begin(); i != to.end(); ++i ) { - std::vector tqparents = (*i)->tqparents(); - for ( std::vector::const_iterator j = tqparents.begin(); - j != tqparents.end(); ++j ) + std::vector parents = (*i)->parents(); + for ( std::vector::const_iterator j = parents.begin(); + j != parents.end(); ++j ) visit( *j, seenmap, true ); } for ( std::vector::const_iterator i = to.begin(); i != to.end(); ++i ) @@ -438,9 +438,9 @@ void ObjectHierarchy::serialize( TQDomElement& tqparent, TQDomDocument& doc ) co const ApplyTypeNode* node = static_cast( mnodes[i] ); e.setAttribute( "action", "calc" ); e.setAttribute( "type", TQString::tqfromLatin1( node->type()->fullName() ) ); - for ( uint i = 0; i < node->tqparents().size(); ++i ) + for ( uint i = 0; i < node->parents().size(); ++i ) { - int tqparent = node->tqparents()[i] + 1; + int tqparent = node->parents()[i] + 1; TQDomElement arge = doc.createElement( "arg" ); arge.appendChild( doc.createTextNode( TQString::number( tqparent ) ) ); e.appendChild( arge ); @@ -548,7 +548,7 @@ ObjectHierarchy* ObjectHierarchy::buildSafeObjectHierarchy( const TQDomElement& return 0; } - std::vector tqparents; + std::vector parents; for ( TQDomNode p = e.firstChild(); !p.isNull(); p = p.nextSibling() ) { TQDomElement q = p.toElement(); @@ -556,9 +556,9 @@ ObjectHierarchy* ObjectHierarchy::buildSafeObjectHierarchy( const TQDomElement& if ( q.tagName() != "arg" ) KIG_GENERIC_PARSE_ERROR; int pid = q.text().toInt(&ok ); if ( !ok ) KIG_GENERIC_PARSE_ERROR; - tqparents.push_back( pid - 1 ); + parents.push_back( pid - 1 ); }; - newnode = new ApplyTypeNode( type, tqparents ); + newnode = new ApplyTypeNode( type, parents ); } else if ( tmp == "fetch-property" ) { @@ -640,11 +640,11 @@ ObjectHierarchy ObjectHierarchy::transformFinalObject( const Transformation& t ) ObjectHierarchy ret( *this ); ret.mnodes.push_back( new PushStackNode( new TransformationImp( t ) ) ); - std::vector tqparents; - tqparents.push_back( ret.mnodes.size() - 1); - tqparents.push_back( ret.mnodes.size() ); + std::vector parents; + parents.push_back( ret.mnodes.size() - 1); + parents.push_back( ret.mnodes.size() ); const ObjectType* type = ApplyTransformationObjectType::instance(); - ret.mnodes.push_back( new ApplyTypeNode( type, tqparents ) ); + ret.mnodes.push_back( new ApplyTypeNode( type, parents ) ); return ret; } @@ -696,7 +696,7 @@ const ObjectImpType* lowermost( const ObjectImpType* a, const ObjectImpType* b ) // this function is part of the visit procedure really. It is // factored out, because it recurses for cache ObjectImp's. What this // does is, it makes sure that object o is calcable, by putting -// appropriate Node's in mnodes.. po is o->tqparents() and pl tqcontains +// appropriate Node's in mnodes.. po is o->parents() and pl tqcontains // the location of objects that are already in mnodes and -1 // otherwise.. -1 means we have to store their ObjectImp, unless // they're cache ObjectImp's etc. @@ -723,8 +723,8 @@ int ObjectHierarchy::storeObject( const ObjectCalcer* o, const std::vectortqparents()[i]; - std::vector opl = o->tqparents(); + ObjectCalcer* tqparent = o->parents()[i]; + std::vector opl = o->parents(); margrequirements[pl[i]] = lowermost( margrequirements[pl[i]], diff --git a/kig/misc/object_hierarchy.h b/kig/misc/object_hierarchy.h index cda2615f..35e7cbef 100644 --- a/kig/misc/object_hierarchy.h +++ b/kig/misc/object_hierarchy.h @@ -88,7 +88,7 @@ public: * build a set of objects that interdepend according to this * ObjectHierarchy.. Only the result objects are returned. Helper * objects that connect the given objects with the returned objects, - * can only be found by following the returned objects' tqparents() + * can only be found by following the returned objects' parents() * methods.. */ std::vector buildObjects( const std::vector& os, const KigDocument& ) const; diff --git a/kig/misc/special_constructors.cc b/kig/misc/special_constructors.cc index ccb92ac6..0806f09b 100644 --- a/kig/misc/special_constructors.cc +++ b/kig/misc/special_constructors.cc @@ -68,7 +68,7 @@ public: ConicConicIntersectionConstructor(); ~ConicConicIntersectionConstructor(); - void drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& tqparents, + void drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& parents, const KigDocument& ) const; std::vector build( const std::vector& os, KigDocument& d, KigWidget& w ) const; void plug( KigPart* doc, KigGUIAction* kact ); @@ -109,13 +109,13 @@ ConicRadicalConstructor::~ConicRadicalConstructor() } void ConicRadicalConstructor::drawprelim( - const ObjectDrawer& drawer, KigPainter& p, const std::vector& tqparents, const KigDocument& doc ) const + const ObjectDrawer& drawer, KigPainter& p, const std::vector& parents, const KigDocument& doc ) const { - if ( tqparents.size() == 2 && tqparents[0]->imp()->inherits( ConicImp::stype() ) && - tqparents[1]->imp()->inherits( ConicImp::stype() ) ) + if ( parents.size() == 2 && parents[0]->imp()->inherits( ConicImp::stype() ) && + parents[1]->imp()->inherits( ConicImp::stype() ) ) { Args args; - std::transform( tqparents.begin(), tqparents.end(), + std::transform( parents.begin(), parents.end(), std::back_inserter( args ), std::mem_fun( &ObjectCalcer::imp ) ); for ( int i = -1; i < 2; i += 2 ) { @@ -170,27 +170,27 @@ LocusConstructor::~LocusConstructor() { } -void LocusConstructor::drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& tqparents, +void LocusConstructor::drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& parents, const KigDocument& ) const { // this function is rather ugly, but it is necessary to do it this // way in order to play nice with Kig's design.. - if ( tqparents.size() != 2 ) return; - const ObjectTypeCalcer* constrained = dynamic_cast( tqparents.front() ); - const ObjectCalcer* moving = tqparents.back(); + if ( parents.size() != 2 ) return; + const ObjectTypeCalcer* constrained = dynamic_cast( parents.front() ); + const ObjectCalcer* moving = parents.back(); if ( ! constrained || ! constrained->type()->inherits( ObjectType::ID_ConstrainedPointType ) ) { // moving is in fact the constrained point.. swap them.. - moving = tqparents.front(); - constrained = dynamic_cast( tqparents.back() ); + moving = parents.front(); + constrained = dynamic_cast( parents.back() ); assert( constrained ); }; assert( constrained->type()->inherits( ObjectType::ID_ConstrainedPointType ) ); - const ObjectImp* oimp = constrained->tqparents().back()->imp(); + const ObjectImp* oimp = constrained->parents().back()->imp(); if( !oimp->inherits( CurveImp::stype() ) ) - oimp = constrained->tqparents().front()->imp(); + oimp = constrained->parents().front()->imp(); assert( oimp->inherits( CurveImp::stype() ) ); const CurveImp* cimp = static_cast( oimp ); @@ -222,18 +222,18 @@ const int LocusConstructor::wantArgs( return ArgsParser::Invalid; } -std::vector LocusConstructor::build( const std::vector& tqparents, KigDocument&, KigWidget& ) const +std::vector LocusConstructor::build( const std::vector& parents, KigDocument&, KigWidget& ) const { std::vector ret; - assert( tqparents.size() == 2 ); + assert( parents.size() == 2 ); - ObjectTypeCalcer* constrained = dynamic_cast( tqparents.front() ); - ObjectCalcer* moving = tqparents.back(); + ObjectTypeCalcer* constrained = dynamic_cast( parents.front() ); + ObjectCalcer* moving = parents.back(); if ( ! constrained || ! constrained->type()->inherits( ObjectType::ID_ConstrainedPointType ) ) { // moving is in fact the constrained point.. swap them.. - moving = tqparents.front(); - constrained = dynamic_cast( tqparents.back() ); + moving = parents.front(); + constrained = dynamic_cast( parents.back() ); assert( constrained ); }; assert( constrained->type()->inherits( ObjectType::ID_ConstrainedPointType ) ); @@ -374,21 +374,21 @@ TQString PolygonBNPTypeConstructor::selectStatement( return i18n("Select a point to be a vertex of the new polygon..."); } -void PolygonBNPTypeConstructor::drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& tqparents, +void PolygonBNPTypeConstructor::drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& parents, const KigDocument& ) const { - if ( tqparents.size() < 2 ) return; + if ( parents.size() < 2 ) return; std::vector points; - for ( uint i = 0; i < tqparents.size(); ++i ) + for ( uint i = 0; i < parents.size(); ++i ) { const Coordinate vertex = - static_cast( tqparents[i]->imp() )->coordinate(); + static_cast( parents[i]->imp() )->coordinate(); points.push_back( vertex ); } - if ( tqparents.size() == 2 ) + if ( parents.size() == 2 ) { SegmentImp segment = SegmentImp( points[0], points[1] ); drawer.draw( segment, p, true ); @@ -398,12 +398,12 @@ void PolygonBNPTypeConstructor::drawprelim( const ObjectDrawer& drawer, KigPaint } } -std::vector PolygonBNPTypeConstructor::build( const std::vector& tqparents, KigDocument&, KigWidget& ) const +std::vector PolygonBNPTypeConstructor::build( const std::vector& parents, KigDocument&, KigWidget& ) const { - uint count = tqparents.size() - 1; + uint count = parents.size() - 1; assert ( count >= 3 ); std::vector args; - for ( uint i = 0; i < count; ++i ) args.push_back( tqparents[i] ); + for ( uint i = 0; i < count; ++i ) args.push_back( parents[i] ); ObjectTypeCalcer* calcer = new ObjectTypeCalcer( mtype, args ); ObjectHolder* h = new ObjectHolder( calcer ); std::vector ret; @@ -443,12 +443,12 @@ PolygonVertexTypeConstructor::~PolygonVertexTypeConstructor() { } -void PolygonVertexTypeConstructor::drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& tqparents, +void PolygonVertexTypeConstructor::drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& parents, const KigDocument& ) const { - if ( tqparents.size() != 1 ) return; + if ( parents.size() != 1 ) return; - const PolygonImp* polygon = dynamic_cast( tqparents.front()->imp() ); + const PolygonImp* polygon = dynamic_cast( parents.front()->imp() ); const std::vector points = polygon->points(); int sides = points.size(); @@ -459,11 +459,11 @@ void PolygonVertexTypeConstructor::drawprelim( const ObjectDrawer& drawer, KigPa } } -std::vector PolygonVertexTypeConstructor::build( const std::vector& tqparents, KigDocument&, KigWidget& ) const +std::vector PolygonVertexTypeConstructor::build( const std::vector& parents, KigDocument&, KigWidget& ) const { std::vector ret; - assert( tqparents.size() == 1 ); - const PolygonImp* polygon = dynamic_cast( tqparents.front()->imp() ); + assert( parents.size() == 1 ); + const PolygonImp* polygon = dynamic_cast( parents.front()->imp() ); const std::vector points = polygon->points(); int sides = points.size(); @@ -471,7 +471,7 @@ std::vector PolygonVertexTypeConstructor::build( const std::vecto for ( int i = 0; i < sides; ++i ) { ObjectConstCalcer* d = new ObjectConstCalcer( new IntImp( i ) ); - std::vector args( tqparents ); + std::vector args( parents ); args.push_back( d ); ret.push_back( new ObjectHolder( new ObjectTypeCalcer( mtype, args ) ) ); } @@ -510,12 +510,12 @@ PolygonSideTypeConstructor::~PolygonSideTypeConstructor() { } -void PolygonSideTypeConstructor::drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& tqparents, +void PolygonSideTypeConstructor::drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& parents, const KigDocument& ) const { - if ( tqparents.size() != 1 ) return; + if ( parents.size() != 1 ) return; - const PolygonImp* polygon = dynamic_cast( tqparents.front()->imp() ); + const PolygonImp* polygon = dynamic_cast( parents.front()->imp() ); const std::vector points = polygon->points(); uint sides = points.size(); @@ -527,11 +527,11 @@ void PolygonSideTypeConstructor::drawprelim( const ObjectDrawer& drawer, KigPain } } -std::vector PolygonSideTypeConstructor::build( const std::vector& tqparents, KigDocument&, KigWidget& ) const +std::vector PolygonSideTypeConstructor::build( const std::vector& parents, KigDocument&, KigWidget& ) const { std::vector ret; - assert( tqparents.size() == 1 ); - const PolygonImp* polygon = dynamic_cast( tqparents.front()->imp() ); + assert( parents.size() == 1 ); + const PolygonImp* polygon = dynamic_cast( parents.front()->imp() ); const std::vector points = polygon->points(); uint sides = points.size(); @@ -539,7 +539,7 @@ std::vector PolygonSideTypeConstructor::build( const std::vector< for ( uint i = 0; i < sides; ++i ) { ObjectConstCalcer* d = new ObjectConstCalcer( new IntImp( i ) ); - std::vector args( tqparents ); + std::vector args( parents ); args.push_back( d ); ret.push_back( new ObjectHolder( new ObjectTypeCalcer( mtype, args ) ) ); } @@ -700,17 +700,17 @@ void PolygonBCVConstructor::handlePrelim( delete_all( args.begin() + 2, args.end() ); } -std::vector PolygonBCVConstructor::build( const std::vector& tqparents, KigDocument&, KigWidget& ) const +std::vector PolygonBCVConstructor::build( const std::vector& parents, KigDocument&, KigWidget& ) const { - assert ( tqparents.size() == 3 ); + assert ( parents.size() == 3 ); std::vector args; - Coordinate c = static_cast( tqparents[0]->imp() )->coordinate(); - Coordinate v = static_cast( tqparents[1]->imp() )->coordinate(); - Coordinate cntrl = static_cast( tqparents[2]->imp() )->coordinate(); + Coordinate c = static_cast( parents[0]->imp() )->coordinate(); + Coordinate v = static_cast( parents[1]->imp() )->coordinate(); + Coordinate cntrl = static_cast( parents[2]->imp() )->coordinate(); - args.push_back( tqparents[0] ); - args.push_back( tqparents[1] ); + args.push_back( parents[0] ); + args.push_back( parents[1] ); int winding = 0; int nsides = computeNsides( c, v, cntrl, winding ); ObjectConstCalcer* d = new ObjectConstCalcer( new IntImp( nsides ) ); @@ -789,20 +789,20 @@ TQString PolygonBCVConstructor::selectStatement( return ""; } -void PolygonBCVConstructor::drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& tqparents, +void PolygonBCVConstructor::drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& parents, const KigDocument& doc ) const { - if ( tqparents.size() < 3 || tqparents.size() > 4 ) return; + if ( parents.size() < 3 || parents.size() > 4 ) return; - assert ( tqparents[0]->imp()->inherits( PointImp::stype() ) && - tqparents[1]->imp()->inherits( PointImp::stype() ) && - tqparents[2]->imp()->inherits( IntImp::stype() ) ); + assert ( parents[0]->imp()->inherits( PointImp::stype() ) && + parents[1]->imp()->inherits( PointImp::stype() ) && + parents[2]->imp()->inherits( IntImp::stype() ) ); - if ( tqparents.size() == 4 ) - assert ( tqparents[3]->imp()->inherits( IntImp::stype() ) ); + if ( parents.size() == 4 ) + assert ( parents[3]->imp()->inherits( IntImp::stype() ) ); Args args; - std::transform( tqparents.begin(), tqparents.end(), + std::transform( parents.begin(), parents.end(), std::back_inserter( args ), std::mem_fun( &ObjectCalcer::imp ) ); ObjectImp* data = mtype->calc( args, doc ); @@ -878,16 +878,16 @@ ConicConicIntersectionConstructor::~ConicConicIntersectionConstructor() { } -void ConicConicIntersectionConstructor::drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& tqparents, +void ConicConicIntersectionConstructor::drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& parents, const KigDocument& ) const { - if ( tqparents.size() != 2 ) return; - assert ( tqparents[0]->imp()->inherits( ConicImp::stype() ) && - tqparents[1]->imp()->inherits( ConicImp::stype() ) ); + if ( parents.size() != 2 ) return; + assert ( parents[0]->imp()->inherits( ConicImp::stype() ) && + parents[1]->imp()->inherits( ConicImp::stype() ) ); const ConicCartesianData conica = - static_cast( tqparents[0]->imp() )->cartesianData(); + static_cast( parents[0]->imp() )->cartesianData(); const ConicCartesianData conicb = - static_cast( tqparents[1]->imp() )->cartesianData(); + static_cast( parents[1]->imp() )->cartesianData(); bool ok = true; for ( int wr = -1; wr < 2; wr += 2 ) { @@ -1190,12 +1190,12 @@ void MeasureTransportConstructor::handlePrelim( void MeasureTransportConstructor::drawprelim( const ObjectDrawer& drawer, KigPainter& p, - const std::vector& tqparents, + const std::vector& parents, const KigDocument& doc ) const { Args args; using namespace std; - transform( tqparents.begin(), tqparents.end(), + transform( parents.begin(), parents.end(), back_inserter( args ), mem_fun( &ObjectCalcer::imp ) ); ObjectImp* data = mtype->calc( args, doc ); drawer.draw( *data, p, true ); @@ -1236,13 +1236,13 @@ TQString MeasureTransportConstructor::selectStatement( } std::vector MeasureTransportConstructor::build( - const std::vector& tqparents, + const std::vector& parents, KigDocument&, KigWidget& ) const { - assert ( tqparents.size() == 3 ); + assert ( parents.size() == 3 ); // std::vector args; -// for ( uint i = 0; i < count; ++i ) args.push_back( tqparents[i] ); - ObjectTypeCalcer* calcer = new ObjectTypeCalcer( mtype, tqparents ); +// for ( uint i = 0; i < count; ++i ) args.push_back( parents[i] ); + ObjectTypeCalcer* calcer = new ObjectTypeCalcer( mtype, parents ); ObjectHolder* h = new ObjectHolder( calcer ); std::vector ret; ret.push_back( h ); @@ -1386,15 +1386,15 @@ MidPointOfTwoPointsConstructor::~MidPointOfTwoPointsConstructor() } void MidPointOfTwoPointsConstructor::drawprelim( - const ObjectDrawer& drawer, KigPainter& p, const std::vector& tqparents, + const ObjectDrawer& drawer, KigPainter& p, const std::vector& parents, const KigDocument& ) const { - if ( tqparents.size() != 2 ) return; - assert( tqparents[0]->imp()->inherits( PointImp::stype() ) ); - assert( tqparents[1]->imp()->inherits( PointImp::stype() ) ); + if ( parents.size() != 2 ) return; + assert( parents[0]->imp()->inherits( PointImp::stype() ) ); + assert( parents[1]->imp()->inherits( PointImp::stype() ) ); const Coordinate m = - ( static_cast( tqparents[0]->imp() )->coordinate() + - static_cast( tqparents[1]->imp() )->coordinate() ) / 2; + ( static_cast( parents[0]->imp() )->coordinate() + + static_cast( parents[1]->imp() )->coordinate() ) / 2; drawer.draw( PointImp( m ), p, true ); } diff --git a/kig/misc/special_constructors.h b/kig/misc/special_constructors.h index 796c8cd0..5b80693c 100644 --- a/kig/misc/special_constructors.h +++ b/kig/misc/special_constructors.h @@ -29,7 +29,7 @@ public: PolygonVertexTypeConstructor(); ~PolygonVertexTypeConstructor(); - void drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& tqparents, const KigDocument& ) const; + void drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& parents, const KigDocument& ) const; std::vector build( const std::vector& os, KigDocument& d, KigWidget& w ) const; void plug( KigPart* doc, KigGUIAction* kact ); bool isTransform() const; @@ -44,7 +44,7 @@ public: PolygonSideTypeConstructor(); ~PolygonSideTypeConstructor(); - void drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& tqparents, const KigDocument& ) const; + void drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& parents, const KigDocument& ) const; std::vector build( const std::vector& os, KigDocument& d, KigWidget& w ) const; void plug( KigPart* doc, KigGUIAction* kact ); bool isTransform() const; @@ -83,7 +83,7 @@ public: const KigWidget& v ) const; - void drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& tqparents, const KigDocument& ) const; + void drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& parents, const KigDocument& ) const; std::vector build( const std::vector& os, KigDocument& d, KigWidget& w ) const; void plug( KigPart* doc, KigGUIAction* kact ); bool isTransform() const; @@ -121,7 +121,7 @@ public: const KigDocument& d, const KigWidget& v ) const; - void drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& tqparents, const KigDocument& ) const; + void drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& parents, const KigDocument& ) const; std::vector build( const std::vector& os, KigDocument& d, KigWidget& w ) const; void plug( KigPart* doc, KigGUIAction* kact ); bool isTransform() const; @@ -163,7 +163,7 @@ public: const KigWidget& v ) const; - void drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& tqparents, const KigDocument& ) const; + void drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& parents, const KigDocument& ) const; std::vector build( const std::vector& os, KigDocument& d, KigWidget& w ) const; void plug( KigPart* doc, KigGUIAction* kact ); bool isTransform() const; @@ -179,7 +179,7 @@ public: ~ConicRadicalConstructor(); TQString useText( const ObjectCalcer& o, const std::vector& sel, const KigDocument& d, const KigWidget& v ) const; - void drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& tqparents, const KigDocument& ) const; + void drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& parents, const KigDocument& ) const; std::vector build( const std::vector& os, KigDocument& d, KigWidget& w ) const; void plug( KigPart* doc, KigGUIAction* kact ); @@ -205,7 +205,7 @@ public: TQString useText( const ObjectCalcer& o, const std::vector& sel, const KigDocument& d, const KigWidget& v ) const; - void drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& tqparents, const KigDocument& ) const; + void drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& parents, const KigDocument& ) const; std::vector build( const std::vector& os, KigDocument& d, KigWidget& w ) const; void plug( KigPart* doc, KigGUIAction* kact ); @@ -259,7 +259,7 @@ class MidPointOfTwoPointsConstructor public: MidPointOfTwoPointsConstructor(); ~MidPointOfTwoPointsConstructor(); - void drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& tqparents, + void drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& parents, const KigDocument& ) const; std::vector build( const std::vector& os, KigDocument& d, KigWidget& w ) const; @@ -275,7 +275,7 @@ public: TestConstructor( const ArgsParserObjectType* type, const char* descname, const char* desc, const char* iconfile ); ~TestConstructor(); - void drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& tqparents, + void drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& parents, const KigDocument& ) const; std::vector build( const std::vector& os, KigDocument& d, KigWidget& w ) const; diff --git a/kig/modes/base_mode.cc b/kig/modes/base_mode.cc index e470f938..b4f33b21 100644 --- a/kig/modes/base_mode.cc +++ b/kig/modes/base_mode.cc @@ -38,7 +38,7 @@ BaseMode::~BaseMode() void BaseMode::leftClicked( TQMouseEvent* e, KigWidget* v ) { // touch screens don't send a mouseMoved event before a click event, - // aptqparently, so we simulate it. + // apparently, so we simulate it. mouseMoved( e, v ); // get rid of text still showing... diff --git a/kig/modes/construct_mode.cc b/kig/modes/construct_mode.cc index 67f83632..d4702314 100644 --- a/kig/modes/construct_mode.cc +++ b/kig/modes/construct_mode.cc @@ -76,13 +76,13 @@ void BaseConstructMode::leftReleased( TQMouseEvent* e, KigWidget* v ) if ( !tqmoco.empty() ) { std::vector::const_iterator it; - std::vector testargs = getCalcers( mtqparents ); + std::vector testargs = getCalcers( mparents ); for ( std::vector::const_iterator i = tqmoco.begin(); i != tqmoco.end(); ++i ) { - it = std::find( mtqparents.begin(), mtqparents.end(), *i ); + it = std::find( mparents.begin(), mparents.end(), *i ); bool newdup = - ( it == mtqparents.end() ) || - isAlreadySelectedOK( testargs, it - mtqparents.begin() ); + ( it == mparents.end() ) || + isAlreadySelectedOK( testargs, it - mparents.begin() ); if ( newdup ) { testargs.push_back( ( *i )->calcer() ); @@ -103,16 +103,16 @@ void BaseConstructMode::leftReleased( TQMouseEvent* e, KigWidget* v ) void BaseConstructMode::leftClickedObject( ObjectHolder* o, const TQPoint& p, KigWidget& w, bool ) { - std::vector::iterator it = std::find( mtqparents.begin(), mtqparents.end(), o ); - std::vector nargs = getCalcers( mtqparents ); + std::vector::iterator it = std::find( mparents.begin(), mparents.end(), o ); + std::vector nargs = getCalcers( mparents ); // // mp: duplicationchecked controls whether the arguments list is // free of duplications or if a duplication is safe (asking this to // the Constructor class through the "isAlreadySelectedOK" method). // bool duplicationchecked = - ( it == mtqparents.end() ) || - isAlreadySelectedOK( nargs, it - mtqparents.begin() ); + ( it == mparents.end() ) || + isAlreadySelectedOK( nargs, it - mparents.begin() ); if ( o && duplicationchecked ) { nargs.push_back( o->calcer() ); @@ -123,7 +123,7 @@ void BaseConstructMode::leftClickedObject( } } - nargs = getCalcers( mtqparents ); + nargs = getCalcers( mparents ); nargs.push_back( mpt.get() ); if ( wantArgs( nargs, mdoc.document(), w ) ) { @@ -137,7 +137,7 @@ void BaseConstructMode::leftClickedObject( return; } - nargs = getCalcers( mtqparents ); + nargs = getCalcers( mparents ); nargs.push_back( mcursor ); if ( wantArgs( nargs, mdoc.document(), w ) ) @@ -157,7 +157,7 @@ void BaseConstructMode::leftClickedObject( void BaseConstructMode::midClicked( const TQPoint& p, KigWidget& w ) { - std::vector args = getCalcers( mtqparents ); + std::vector args = getCalcers( mparents ); args.push_back( mpt.get() ); if ( wantArgs( args, mdoc.document(), w ) ) { @@ -179,7 +179,7 @@ void BaseConstructMode::rightClicked( const std::vector&, const T void BaseConstructMode::mouseMoved( const std::vector& os, const TQPoint& p, KigWidget& w, bool shiftpressed ) { - mdoc.emitStatusBarText( selectStatement( getCalcers( mtqparents ), w ) ); + mdoc.emitStatusBarText( selectStatement( getCalcers( mparents ), w ) ); w.updateCurPix(); KigPainter pter( w.screenInfo(), TQT_TQPAINTDEVICE(&w.curPix), mdoc.document() ); @@ -192,19 +192,19 @@ void BaseConstructMode::mouseMoved( const std::vector& os, const mcursor->move( ncoord, mdoc.document() ); mcursor->calc( mdoc.document() ); - std::vector args = getCalcers( mtqparents ); + std::vector args = getCalcers( mparents ); bool duplicationchecked = false; std::vector goodargs; if ( ! os.empty() ) { std::vector::const_iterator it; - std::vector testargs = getCalcers( mtqparents ); + std::vector testargs = getCalcers( mparents ); for ( std::vector::const_iterator i = os.begin(); i != os.end(); ++i ) { - it = std::find( mtqparents.begin(), mtqparents.end(), *i ); + it = std::find( mparents.begin(), mparents.end(), *i ); bool newdup = - ( it == mtqparents.end() ) || - isAlreadySelectedOK( args, it - mtqparents.begin() ); + ( it == mparents.end() ) || + isAlreadySelectedOK( args, it - mparents.begin() ); if ( newdup ) { testargs.push_back( ( *i )->calcer() ); @@ -229,9 +229,9 @@ void BaseConstructMode::mouseMoved( const std::vector& os, const } else { - std::vector args = getCalcers( mtqparents ); + std::vector args = getCalcers( mparents ); args.push_back( mpt.get() ); - std::vector argscursor = getCalcers( mtqparents ); + std::vector argscursor = getCalcers( mparents ); argscursor.push_back( mcursor ); bool text = true; if ( wantArgs( args, mdoc.document(), w ) ) @@ -274,15 +274,15 @@ void BaseConstructMode::mouseMoved( const std::vector& os, const void BaseConstructMode::selectObject( ObjectHolder* o, KigWidget& w ) { - mtqparents.push_back( o ); - std::vector args = getCalcers( mtqparents ); + mparents.push_back( o ); + std::vector args = getCalcers( mparents ); if ( wantArgs( args, mdoc.document(), w ) == ArgsParser::Complete ) { handleArgs( args, w ); }; - w.redrawScreen( mtqparents ); + w.redrawScreen( mparents ); } PointConstructMode::PointConstructMode( KigPart& d ) @@ -373,7 +373,7 @@ void BaseConstructMode::selectObjects( const std::vector& os, Kig { for ( std::vector::const_iterator i = os.begin(); i != os.end(); ++i ) { - std::vector args = getCalcers( mtqparents ); + std::vector args = getCalcers( mparents ); assert( wantArgs( args, mdoc.document(), w ) != ArgsParser::Complete ); selectObject( *i, w ); }; @@ -482,17 +482,17 @@ void TestConstructMode::leftClickedObject( ObjectHolder* o, const TQPoint& p, TQPoint qloc = p + TQPoint( -40, 0 ); Coordinate loc = w.fromScreen( qloc ); - std::vector tqparents; - tqparents.push_back( new ObjectConstCalcer( new IntImp( test_has_frame_dflt ) ) ); - tqparents.push_back( new ObjectConstCalcer( new PointImp( loc ) ) ); - tqparents.push_back( new ObjectConstCalcer( new StringImp( TQString::tqfromLatin1( "%1" ) ) ) ); + std::vector parents; + parents.push_back( new ObjectConstCalcer( new IntImp( test_has_frame_dflt ) ) ); + parents.push_back( new ObjectConstCalcer( new PointImp( loc ) ) ); + parents.push_back( new ObjectConstCalcer( new StringImp( TQString::tqfromLatin1( "%1" ) ) ) ); assert( mresult->imp()->inherits( TestResultImp::stype() ) ); - tqparents.push_back( + parents.push_back( new ObjectPropertyCalcer( mresult.get(), mresult->imp()->propertiesInternalNames().tqfindIndex( "test-result" ) ) ); - tqparents.back()->calc( mdoc.document() ); + parents.back()->calc( mdoc.document() ); - ObjectCalcer* ret = new ObjectTypeCalcer( TextType::instance(), tqparents ); + ObjectCalcer* ret = new ObjectTypeCalcer( TextType::instance(), parents ); ret->calc( mdoc.document() ); mdoc.addObject( new ObjectHolder( ret ) ); diff --git a/kig/modes/construct_mode.h b/kig/modes/construct_mode.h index 67fe5e28..be937723 100644 --- a/kig/modes/construct_mode.h +++ b/kig/modes/construct_mode.h @@ -71,7 +71,7 @@ class BaseConstructMode // only sensible place where to deallocate it is in the destructor // of this class // ObjectHolder* mcursorholder; - std::vector mtqparents; + std::vector mparents; void leftReleased( TQMouseEvent* e, KigWidget* v ); diff --git a/kig/modes/edittypebase.ui b/kig/modes/edittypebase.ui index cdcdded6..e69d9f13 100644 --- a/kig/modes/edittypebase.ui +++ b/kig/modes/edittypebase.ui @@ -275,7 +275,7 @@ okSlot() cancelSlot() - + klineedit.h klineedit.h diff --git a/kig/modes/label.cc b/kig/modes/label.cc index 3471d6dc..298e75d0 100644 --- a/kig/modes/label.cc +++ b/kig/modes/label.cc @@ -64,7 +64,7 @@ public: // the property objects we'll be using as args, we keep a reference // to them in the args object, and keep a pointer to them ( or 0 ) // in the correct order in args ( separately, because we can't use - // the order of the tqparents of a ReferenceObject, and certainly + // the order of the parents of a ReferenceObject, and certainly // can't give 0 as a tqparent.. argvect args; @@ -391,7 +391,7 @@ void TextLabelModeBase::updateLinksLabel() d->wiz->myCustomWidget1->addText( s.mid( prevpos ), buf ); d->wiz->myCustomWidget1->applyEdit( buf ); - d->wiz->retqlayoutArgsPage(); + d->wiz->relayoutArgsPage(); d->wiz->resize( d->wiz->size() ); } @@ -471,10 +471,10 @@ TextLabelRedefineMode::TextLabelRedefineMode( KigPart& d, ObjectTypeCalcer* labe : TextLabelModeBase( d ), mlabel( label ) { assert( label->imp()->inherits( TextImp::stype() ) ); - std::vector tqparents = label->tqparents(); - assert( tqparents.size() >= 3 ); - std::vector firstthree( tqparents.begin(), tqparents.begin() + 3 ); - std::vector rest( tqparents.begin() + 3, tqparents.end() ); + std::vector parents = label->parents(); + assert( parents.size() >= 3 ); + std::vector firstthree( parents.begin(), parents.begin() + 3 ); + std::vector rest( parents.begin() + 3, parents.end() ); firstthree = TextType::instance()->argParser().parse( firstthree ); assert( firstthree[0]->imp()->inherits( IntImp::stype() ) ); @@ -509,10 +509,10 @@ void TextLabelRedefineMode::finish( const argvect& props, bool needframe, ObjectCalcer* locationtqparent ) { - std::vector tqparents = mlabel->tqparents(); - assert( tqparents.size() >= 3 ); - std::vector firstthree( tqparents.begin(), tqparents.begin() + 3 ); - std::vector rest( tqparents.begin() + 3, tqparents.end() ); + std::vector parents = mlabel->parents(); + assert( parents.size() >= 3 ); + std::vector firstthree( parents.begin(), parents.begin() + 3 ); + std::vector rest( parents.begin() + 3, parents.end() ); firstthree = TextType::instance()->argParser().parse( firstthree ); KigCommand* kc = new KigCommand( mdoc, i18n( "Change Label" ) ); @@ -538,7 +538,7 @@ void TextLabelRedefineMode::finish( static_cast( firstthree[2] )->setImp( new StringImp( s ) ); mon.finish( kc ); - std::vector oldtqparents = mlabel->tqparents(); + std::vector oldparents = mlabel->parents(); std::vector p; for ( argvect::const_iterator i = props.begin(); i != props.end(); ++i ) diff --git a/kig/modes/macrowizardbase.ui b/kig/modes/macrowizardbase.ui index 54fd95b2..fefd5c6f 100644 --- a/kig/modes/macrowizardbase.ui +++ b/kig/modes/macrowizardbase.ui @@ -180,7 +180,7 @@ - + klineedit.h klineedit.h diff --git a/kig/modes/moving.cc b/kig/modes/moving.cc index 980a5feb..d6f2c74b 100644 --- a/kig/modes/moving.cc +++ b/kig/modes/moving.cc @@ -129,8 +129,8 @@ MovingMode::MovingMode( const std::vector& os, const Coordinate& emo.push_back( ( *i )->calcer() ); d->refmap[( *i )->calcer()] = (*i)->moveReferencePoint(); objs.insert( ( *i )->calcer() ); - std::vector tqparents = ( *i )->calcer()->movableParents(); - objs.insert( tqparents.begin(), tqparents.end() ); + std::vector parents = ( *i )->calcer()->movableParents(); + objs.insert( parents.begin(), parents.end() ); }; emo = calcPath( emo ); @@ -176,12 +176,12 @@ PointRedefineMode::PointRedefineMode( ObjectHolder* p, KigPart& d, KigWidget& v { assert( dynamic_cast( p->calcer() ) ); moldtype = static_cast( p->calcer() )->type(); - std::vector oldtqparents = p->calcer()->tqparents(); - std::copy( oldtqparents.begin(), oldtqparents.end(), std::back_inserter( moldtqparents ) ); + std::vector oldparents = p->calcer()->parents(); + std::copy( oldparents.begin(), oldparents.end(), std::back_inserter( moldparents ) ); - std::vector tqparents = getAllParents( mp->calcer() ); - mmon = new MonitorDataObjects( tqparents ); - std::vector moving = tqparents; + std::vector parents = getAllParents( mp->calcer() ); + mmon = new MonitorDataObjects( parents ); + std::vector moving = parents; std::set tqchildren = getAllChildren( mp->calcer() ); std::copy( tqchildren.begin(), tqchildren.end(), std::back_inserter( moving ) ); initScreen( moving ); @@ -224,22 +224,22 @@ void PointRedefineMode::stopMove() assert( dynamic_cast( mp->calcer() ) ); ObjectTypeCalcer* mpcalc = static_cast( mp->calcer() ); - std::vector newtqparents = mpcalc->tqparents(); - std::vector newtqparentsref( - newtqparents.begin(), newtqparents.end() ); + std::vector newparents = mpcalc->parents(); + std::vector newparentsref( + newparents.begin(), newparents.end() ); const ObjectType* newtype = mpcalc->type(); - std::vector oldtqparents; - for( std::vector::iterator i = moldtqparents.begin(); - i != moldtqparents.end(); ++i ) - oldtqparents.push_back( i->get() ); + std::vector oldparents; + for( std::vector::iterator i = moldparents.begin(); + i != moldparents.end(); ++i ) + oldparents.push_back( i->get() ); mpcalc->setType( moldtype ); - mpcalc->setParents( oldtqparents ); + mpcalc->setParents( oldparents ); mp->calc( mdoc.document() ); KigCommand* command = new KigCommand( mdoc, i18n( "Redefine Point" ) ); command->addTask( - new ChangeParentsAndTypeTask( mpcalc, newtqparents, newtype ) ); + new ChangeParentsAndTypeTask( mpcalc, newparents, newtype ) ); mmon->finish( command ); mdoc.history()->addCommand( command ); } diff --git a/kig/modes/moving.h b/kig/modes/moving.h index 8a75e62a..7c27aa4e 100644 --- a/kig/modes/moving.h +++ b/kig/modes/moving.h @@ -88,7 +88,7 @@ class PointRedefineMode : public MovingModeBase { ObjectHolder* mp; - std::vector moldtqparents; + std::vector moldparents; const ObjectType* moldtype; MonitorDataObjects* mmon; void stopMove(); diff --git a/kig/modes/textlabelwizard.cc b/kig/modes/textlabelwizard.cc index 70f484d8..b79f4a5e 100644 --- a/kig/modes/textlabelwizard.cc +++ b/kig/modes/textlabelwizard.cc @@ -81,7 +81,7 @@ void TextLabelWizard::linkClicked( int which ) mmode->linkClicked( which ); } -void TextLabelWizard::retqlayoutArgsPage() +void TextLabelWizard::relayoutArgsPage() { select_arguments_pageLayout->activate(); tqrepaint(); diff --git a/kig/modes/textlabelwizard.h b/kig/modes/textlabelwizard.h index 2d192e7c..c6f0a7ca 100644 --- a/kig/modes/textlabelwizard.h +++ b/kig/modes/textlabelwizard.h @@ -35,7 +35,7 @@ public: void reject(); void accept(); - void retqlayoutArgsPage(); + void relayoutArgsPage(); private slots: void textChanged(); void linkClicked( int which ); diff --git a/kig/modes/textlabelwizardbase.ui b/kig/modes/textlabelwizardbase.ui index c4b7979e..8f12ca3c 100644 --- a/kig/modes/textlabelwizardbase.ui +++ b/kig/modes/textlabelwizardbase.ui @@ -106,7 +106,7 @@ If you want to show variable parts, then put %1, %2, ... at the appropriate plac 789c9d97c76e24490e86effd1442f3d65870d2451a0ce6206f5adeb4cc620f8c34f2553225b5a4c1befb46927fe6a1d4c0ccac4287fa8a0c26834193f5dbb785b3fd9d856fbf7d799ec9ecba5ea8afe469e15bf3727ffffeeffffcf1e797af49b2d0ffc7d142f2f55f5fbe1ecc16ea85dde9a4ed81290045faa77ca49cf4ab67ba1e3953969173651ab9d4fdf1c8a27c3872ad7c3c72d3b32c2a67c3f3444636fbef23eb7e590267e68fcc4656395d8dacf6d938ef97eaef289781cddebdb2846fccff44b989ba58e3411f3dc75158e6df1d3889539517ca49bf54fe43398d1dec4f46567f685fd9c539f43fc025f80c1c3ce8d93f28e77185f8bf0c6cfae4c0b5f9c3c6e5c0542a4b5876fe13708df39d2bd7716372aa8c93c4e4723bb2f977aadc26ceec4bdb7310e6b0bfab9c2445ecd49f1370694cebca65d260ffa6711a41aef14d24e94cee6be3348e0ae5e9c8765f07ca3e8db17f0f9c825794eb3489351fe9bb7217e4969f29388bd51ee9fda5715a19730696b852fea95c6471647ca95cf64bcf43e0cef4657b647bfe6acf213d6bb32f9a9f5992b5a64f9a8f990b6cf9ecc15d6cf9acf6b2da55a8a75cb973dee4b2d1b38b5c05de02434e87e01aacfb351df5bebddea74b5c67f9c795711ea15e357e2ecde358fb87efc0a867df8cac728a074e62e527706afb59f3cf6583be5c28bb3c35f693812d1fbdc6dbe57966fec932d899ffa4f7e38adca17e34beaeca4b9c271a18f1d5fc739257b0d70d9c68be7bed7fcee7827ab91cd8e4740cf6b19d4ffb87ab07b9bf516e72d4a3ac821b9cef6e60d84f47367ded2fae1d9f7704f6163f79000ffde27660f387ed3c5dbf54dfeebb0bf6acbe6b706bfa5ef32f8f8b18f5bf0f463f20edb77956a4e68fbc80b3c4facd163847be6bfde72ec86dbeac82715fbc0286be683cf3bc081d44f7df80d344fb0b6b7de64581fb916765297263d6fccd9b7ee97e566e8b06cfdb1f59cf2bda2f8bbc2c11df0c5c41aefdb328ca22b1feb0012eedbce24736f91b18fb796d64eb87cb60817dcdafb07d906bfd14d22f659d8785ef97b2f6d7b2df6ef1d6fb2babaac6f92e8c25b27ecc1f239b7f3a5fca5a8678ea7c2d9bc0e6ef1238b3fca2c7814d5f4cbf9334b5f833384bed3c7a5f5514f4adbe2ec07962e7590457f06f6f649b977afe2a16f42f5e070bfc591e18f7a5f1a812a9e0df39d827da4fbd8c6ccfd7785569bf945f953371a9d5a3de67950bfa2d75c63eb2fb15bdcfaaf011e6c7263846bf8f4636f91618f3c7d3c0f047fb69550efab2074e12bd6fd27957553ec33c5b043bcc7f9d0795f818fdb501a3df8ae673e507ff69021eea37063bc45ffb73550736ff36c0a84f3e0317a86f8b5f139e6ffe1f821de6d9127898ff3be00a7c3ab2cd03e3d697560ff40016e47b3bb2e96bbd559d8f32bbff4b7065f193042c98873acf240af6adbf3c83c5f2954bb0c7bcd77c107d81d2fdebc63e33ff640aaecc9e1c8151df5c803dfaadc64b52dfa03ed64636ffb4ff4b2867f453ede7227586fcd3f9264ded91fffafe236d5da37fe83c91ceb7b9e5b7f6731ff92ed7f747d6fbf7e185cf58347e3e6932e47b3430fa893edf87d795c2fc3f003b67f5f902cec17abfde0dfa3c053b3c5ffb832fc2eb8fddcf233887fc195c801f46b6f3cdc02558fba72f7d2d1a7f7e321ee58fe0cad86bbff24dd3e2fe74fef836b0c6eb60d62fa6bf5e07b3419f853dd7dc70fb8bd5f1255fd90ed30f9f3c5ff30ddff21ddff384a7fcc08ffcc4cf61cdf8855ff9e79c7e1db4dff89d3f7891977899577895d7789d377893b7f83b6fcfe937bc13b477798ff7f9800ff928ac633ee11f7cca6761d7f99c7e1b3cb908da11c7413be1943376e153cc39175c72f549ff9e17c31744429e6a6aa8a58e2ee98aaee9866e7f617fc24b7417a4f734a1293dd0233dd133cd8285177aa5f9f3b63ca5377aa78f607b919668995682e62aadd17ab0b1419b9ff41f682b48bed336edd02eed05ed7d5ea3033a0cdf1ed1f127fd273ae123fa41a774a6b685cee982228a837e42e927fd47caf8985c38651eb40b2ac38e4a5842658a97fab33fd248cb87d2c9a55cc9b5dcc82d1fc99ddccb44a6f230af2f8ff224cf417f262ff22a3fe54ddee543166549966545567f617f4dd66523dc6b2c9bb225df655b7682f692ecca9eeccfe97772c09b722847722c27c1f3eb70f66bf9116c9fca999ccbc59cfe25bf4a143a5ef8992561324a78bd92522acf9ebc78efe7cf7b153276db37bef59dbff457fedadff85b7f27abfede4ffcd4cf9ff76faeff4fffefeff8c7f5fedfdfbffc0fa355c495 - + linkslabel.h diff --git a/kig/modes/typesdialogbase.ui b/kig/modes/typesdialogbase.ui index 3001454b..8da4d05a 100644 --- a/kig/modes/typesdialogbase.ui +++ b/kig/modes/typesdialogbase.ui @@ -323,7 +323,7 @@ contextMenuRequested( TQListViewItem* i, const QPoint& p, int c ) cancelSlot() - + klistview.h kpushbutton.h diff --git a/kig/objects/angle_type.cc b/kig/objects/angle_type.cc index b0dc09c1..7b86411b 100644 --- a/kig/objects/angle_type.cc +++ b/kig/objects/angle_type.cc @@ -65,14 +65,14 @@ const AngleType* AngleType::instance() return &t; } -ObjectImp* AngleType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* AngleType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents, 2 ) ) return new InvalidImp; + if ( ! margsparser.checkArgs( parents, 2 ) ) return new InvalidImp; std::vector points; - for ( uint i = 0; i < tqparents.size(); ++i ) + for ( uint i = 0; i < parents.size(); ++i ) points.push_back( - static_cast( tqparents[i] )->coordinate() ); + static_cast( parents[i] )->coordinate() ); Coordinate lvect = points[0] - points[1]; Coordinate rvect; @@ -112,13 +112,13 @@ void AngleType::executeAction( // pretend to use this var.. (void) i; - std::vector tqparents = t.tqparents(); + std::vector parents = t.parents(); - assert( margsparser.checkArgs( tqparents ) ); + assert( margsparser.checkArgs( parents ) ); - Coordinate a = static_cast( tqparents[0]->imp() )->coordinate(); - Coordinate b = static_cast( tqparents[1]->imp() )->coordinate(); - Coordinate c = static_cast( tqparents[2]->imp() )->coordinate(); + Coordinate a = static_cast( parents[0]->imp() )->coordinate(); + Coordinate b = static_cast( parents[1]->imp() )->coordinate(); + Coordinate c = static_cast( parents[2]->imp() )->coordinate(); Coordinate lvect = a - b; Coordinate rvect = c - b; @@ -142,8 +142,8 @@ void AngleType::executeAction( Coordinate cdir( cos( newcangle ), sin( newcangle ) ); Coordinate nc = b + cdir.normalize( rvect.length() ); - MonitorDataObjects mon( getAllParents( tqparents ) ); - tqparents[2]->move( nc, d.document() ); + MonitorDataObjects mon( getAllParents( parents ) ); + parents[2]->move( nc, d.document() ); KigCommand* kc = new KigCommand( d, i18n( "Resize Angle" ) ); mon.finish( kc ); d.history()->addCommand( kc ); @@ -166,14 +166,14 @@ const HalfAngleType* HalfAngleType::instance() return &t; } -ObjectImp* HalfAngleType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* HalfAngleType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents, 2 ) ) return new InvalidImp; + if ( ! margsparser.checkArgs( parents, 2 ) ) return new InvalidImp; std::vector points; - for ( uint i = 0; i < tqparents.size(); ++i ) + for ( uint i = 0; i < parents.size(); ++i ) points.push_back( - static_cast( tqparents[i] )->coordinate() ); + static_cast( parents[i] )->coordinate() ); Coordinate lvect = points[0] - points[1]; Coordinate rvect; diff --git a/kig/objects/arc_type.h b/kig/objects/arc_type.h index cb0a4c5f..cdfe0294 100644 --- a/kig/objects/arc_type.h +++ b/kig/objects/arc_type.h @@ -35,7 +35,7 @@ public: ObjectImp* calc( const Args& args, const KigDocument& ) const; - const ObjectImpType* impRequirement( const ObjectImp* o, const Args& tqparents ) const; + const ObjectImpType* impRequirement( const ObjectImp* o, const Args& parents ) const; bool inherits( int type ) const; const ObjectImpType* resultId() const; @@ -55,7 +55,7 @@ public: ObjectImp* calc( const Args& args, const KigDocument& ) const; - const ObjectImpType* impRequirement( const ObjectImp* o, const Args& tqparents ) const; + const ObjectImpType* impRequirement( const ObjectImp* o, const Args& parents ) const; bool inherits( int type ) const; const ObjectImpType* resultId() const; diff --git a/kig/objects/base_type.cc b/kig/objects/base_type.cc index 77b9dc6a..0f8eecec 100644 --- a/kig/objects/base_type.cc +++ b/kig/objects/base_type.cc @@ -33,13 +33,13 @@ ObjectABType::~ObjectABType() { } -ObjectImp* ObjectABType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* ObjectABType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents ) ) + if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; - Coordinate a = static_cast( tqparents[0] )->coordinate(); - Coordinate b = static_cast( tqparents[1] )->coordinate(); + Coordinate a = static_cast( parents[0] )->coordinate(); + Coordinate b = static_cast( parents[1] )->coordinate(); return calc( a, b ); } @@ -57,22 +57,22 @@ bool ObjectABType::canMove( const ObjectTypeCalcer& o ) const bool ObjectABType::isFreelyTranslatable( const ObjectTypeCalcer& o ) const { - std::vector tqparents = o.tqparents(); - return tqparents[0]->isFreelyTranslatable() && tqparents[1]->isFreelyTranslatable(); + std::vector parents = o.parents(); + return parents[0]->isFreelyTranslatable() && parents[1]->isFreelyTranslatable(); } void ObjectABType::move( ObjectTypeCalcer& o, const Coordinate& to, const KigDocument& d ) const { - std::vector tqparents = o.tqparents(); - assert( margsparser.checkArgs( tqparents ) ); - const Coordinate a = static_cast( tqparents[0]->imp() )->coordinate(); - const Coordinate b = static_cast( tqparents[1]->imp() )->coordinate(); + std::vector parents = o.parents(); + assert( margsparser.checkArgs( parents ) ); + const Coordinate a = static_cast( parents[0]->imp() )->coordinate(); + const Coordinate b = static_cast( parents[1]->imp() )->coordinate(); const Coordinate dist = b - a; - if ( tqparents[0]->canMove() ) - tqparents[0]->move( to, d ); - if ( tqparents[1]->canMove() ) - tqparents[1]->move( to + dist, d ); + if ( parents[0]->canMove() ) + parents[0]->move( to, d ); + if ( parents[1]->canMove() ) + parents[1]->move( to + dist, d ); } ObjectLPType::ObjectLPType( const char* fullname, const ArgsParser::spec* spec, int n ) @@ -94,19 +94,19 @@ ObjectImp* ObjectLPType::calc( const Args& args, const KigDocument& ) const const Coordinate ObjectABType::moveReferencePoint( const ObjectTypeCalcer& o ) const { - std::vector tqparents = o.tqparents(); - assert( margsparser.checkArgs( tqparents ) ); - return static_cast( tqparents[0]->imp() )->coordinate(); + std::vector parents = o.parents(); + assert( margsparser.checkArgs( parents ) ); + return static_cast( parents[0]->imp() )->coordinate(); } std::vector ObjectABType::movableParents( const ObjectTypeCalcer& ourobj ) const { - std::vector tqparents = ourobj.tqparents(); + std::vector parents = ourobj.parents(); std::set ret; - std::vector tmp = tqparents[0]->movableParents(); + std::vector tmp = parents[0]->movableParents(); ret.insert( tmp.begin(), tmp.end() ); - tmp = tqparents[1]->movableParents(); + tmp = parents[1]->movableParents(); ret.insert( tmp.begin(), tmp.end() ); - ret.insert( tqparents.begin(), tqparents.end() ); + ret.insert( parents.begin(), parents.end() ); return std::vector( ret.begin(), ret.end() ); } diff --git a/kig/objects/conic_types.cc b/kig/objects/conic_types.cc index 58209011..34396369 100644 --- a/kig/objects/conic_types.cc +++ b/kig/objects/conic_types.cc @@ -57,12 +57,12 @@ ConicB5PType::~ConicB5PType() { } -ObjectImp* ConicB5PType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* ConicB5PType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents, 1 ) ) return new InvalidImp; + if ( ! margsparser.checkArgs( parents, 1 ) ) return new InvalidImp; std::vector points; - for ( Args::const_iterator i = tqparents.begin(); i != tqparents.end(); ++i ) + for ( Args::const_iterator i = parents.begin(); i != parents.end(); ++i ) points.push_back( static_cast( *i )->coordinate() ); ConicCartesianData d = @@ -105,23 +105,23 @@ const ConicBAAPType* ConicBAAPType::instance() return &t; } -ObjectImp* ConicBAAPType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* ConicBAAPType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents ) ) + if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; - const LineData la = static_cast( tqparents[0] )->data(); - const LineData lb = static_cast( tqparents[1] )->data(); - const Coordinate c = static_cast( tqparents[2] )->coordinate(); + const LineData la = static_cast( parents[0] )->data(); + const LineData lb = static_cast( parents[1] )->data(); + const Coordinate c = static_cast( parents[2] )->coordinate(); return new ConicImpCart( calcConicByAsymptotes( la, lb, c ) ); } -ObjectImp* ConicBFFPType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* ConicBFFPType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents, 2 ) ) return new InvalidImp; + if ( ! margsparser.checkArgs( parents, 2 ) ) return new InvalidImp; std::vector cs; - for ( Args::const_iterator i = tqparents.begin(); i != tqparents.end(); ++i ) + for ( Args::const_iterator i = parents.begin(); i != parents.end(); ++i ) cs.push_back( static_cast( *i )->coordinate() ); return new ConicImpPolar( calcConicBFFP( cs, type() ) ); @@ -233,17 +233,17 @@ ConicBDFPType::~ConicBDFPType() { } -ObjectImp* ConicBDFPType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* ConicBDFPType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents, 2 ) ) return new InvalidImp; + if ( ! margsparser.checkArgs( parents, 2 ) ) return new InvalidImp; - const LineData line = static_cast( tqparents[0] )->data(); + const LineData line = static_cast( parents[0] )->data(); const Coordinate focus = - static_cast( tqparents[1] )->coordinate(); + static_cast( parents[1] )->coordinate(); Coordinate point; - if ( tqparents.size() == 3 ) - point = static_cast( tqparents[2] )->coordinate(); + if ( parents.size() == 3 ) + point = static_cast( parents[2] )->coordinate(); else { /* !!!! costruisci point come punto medio dell'altezza tra fuoco e d. */ @@ -286,12 +286,12 @@ const ParabolaBTPType* ParabolaBTPType::instance() return &t; } -ObjectImp* ParabolaBTPType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* ParabolaBTPType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents, 2 ) ) return new InvalidImp; + if ( ! margsparser.checkArgs( parents, 2 ) ) return new InvalidImp; std::vector points; - for ( Args::const_iterator i = tqparents.begin(); i != tqparents.end(); ++i ) + for ( Args::const_iterator i = parents.begin(); i != parents.end(); ++i ) points.push_back( static_cast( *i )->coordinate() ); ConicCartesianData d = @@ -327,12 +327,12 @@ const ConicPolarPointType* ConicPolarPointType::instance() return &t; } -ObjectImp* ConicPolarPointType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* ConicPolarPointType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents ) ) return new InvalidImp; + if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; - const ConicCartesianData c = static_cast( tqparents[0] )->cartesianData(); - const LineData l = static_cast( tqparents[1] )->data(); + const ConicCartesianData c = static_cast( parents[0] )->cartesianData(); + const LineData l = static_cast( parents[1] )->data(); const Coordinate p = calcConicPolarPoint( c, l ); if ( p.valid() ) return new PointImp( p ); else return new InvalidImp; @@ -363,12 +363,12 @@ const ConicPolarLineType* ConicPolarLineType::instance() return &t; } -ObjectImp* ConicPolarLineType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* ConicPolarLineType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents ) ) return new InvalidImp; + if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; - const ConicCartesianData c = static_cast( tqparents[0] )->cartesianData(); - const Coordinate p = static_cast( tqparents[1] )->coordinate(); + const ConicCartesianData c = static_cast( parents[0] )->cartesianData(); + const Coordinate p = static_cast( parents[1] )->coordinate(); bool valid = true; const LineData l = calcConicPolarLine( c, p, valid ); if ( valid ) return new LineImp( l ); @@ -398,12 +398,12 @@ const ConicDirectrixType* ConicDirectrixType::instance() return &t; } -ObjectImp* ConicDirectrixType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* ConicDirectrixType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents ) ) return new InvalidImp; + if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; const ConicPolarData data = - static_cast( tqparents[0] )->polarData(); + static_cast( parents[0] )->polarData(); double ec = data.ecostheta0; double es = data.esintheta0; @@ -445,12 +445,12 @@ const EquilateralHyperbolaB4PType* EquilateralHyperbolaB4PType::instance() return &t; } -ObjectImp* EquilateralHyperbolaB4PType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* EquilateralHyperbolaB4PType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents, 1 ) ) return new InvalidImp; + if ( ! margsparser.checkArgs( parents, 1 ) ) return new InvalidImp; std::vector pts; - for ( Args::const_iterator i = tqparents.begin(); i != tqparents.end(); ++i ) + for ( Args::const_iterator i = parents.begin(); i != parents.end(); ++i ) pts.push_back( static_cast( *i )->coordinate() ); ConicCartesianData d = calcConicThroughPoints( pts, equilateral ); @@ -524,14 +524,14 @@ const ConicAsymptoteType* ConicAsymptoteType::instance() return &t; } -ObjectImp* ConicAsymptoteType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* ConicAsymptoteType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents ) ) return new InvalidImp; + if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; bool valid = true; const LineData ret = calcConicAsymptote( - static_cast( tqparents[0] )->cartesianData(), - static_cast( tqparents[1] )->data(), + static_cast( parents[0] )->cartesianData(), + static_cast( parents[1] )->data(), valid ); if ( valid ) @@ -565,18 +565,18 @@ const ConicRadicalType* ConicRadicalType::instance() return &t; } -ObjectImp* ConicRadicalType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* ConicRadicalType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents ) ) return new InvalidImp; - if ( tqparents[0]->inherits( CircleImp::stype() ) && - tqparents[1]->inherits( CircleImp::stype() ) ) + if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; + if ( parents[0]->inherits( CircleImp::stype() ) && + parents[1]->inherits( CircleImp::stype() ) ) { - if( static_cast( tqparents[2] )->data() != 1 ) + if( static_cast( parents[2] )->data() != 1 ) return new InvalidImp; else { - const CircleImp* c1 = static_cast( tqparents[0] ); - const CircleImp* c2 = static_cast( tqparents[1] ); + const CircleImp* c1 = static_cast( parents[0] ); + const CircleImp* c2 = static_cast( parents[1] ); const Coordinate a = calcCircleRadicalStartPoint( c1->center(), c2->center(), c1->squareRadius(), c2->squareRadius() ); @@ -588,10 +588,10 @@ ObjectImp* ConicRadicalType::calc( const Args& tqparents, const KigDocument& ) c { bool valid = true; const LineData l = calcConicRadical( - static_cast( tqparents[0] )->cartesianData(), - static_cast( tqparents[1] )->cartesianData(), - static_cast( tqparents[2] )->data(), - static_cast( tqparents[3] )->data(), valid ); + static_cast( parents[0] )->cartesianData(), + static_cast( parents[1] )->cartesianData(), + static_cast( parents[2] )->data(), + static_cast( parents[3] )->data(), valid ); if ( valid ) return new LineImp( l ); else @@ -674,9 +674,9 @@ void ConicRadicalType::executeAction( int i, ObjectHolder&, ObjectTypeCalcer& t, KigPart& d, KigWidget&, NormalMode& ) const { assert( i == 0 ); - std::vector tqparents = t.tqparents(); - assert( dynamic_cast( tqparents[3] ) ); - ObjectConstCalcer* zeroindexo = static_cast( tqparents[3] ); + std::vector parents = t.parents(); + assert( dynamic_cast( parents[3] ) ); + ObjectConstCalcer* zeroindexo = static_cast( parents[3] ); MonitorDataObjects mon( zeroindexo ); assert( zeroindexo->imp()->inherits( IntImp::stype() ) ); int oldzeroindex = static_cast( zeroindexo->imp() )->data(); diff --git a/kig/objects/conic_types.h b/kig/objects/conic_types.h index e3c44c01..858ca057 100644 --- a/kig/objects/conic_types.h +++ b/kig/objects/conic_types.h @@ -27,7 +27,7 @@ class ConicB5PType ~ConicB5PType(); public: static const ConicB5PType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; }; @@ -38,7 +38,7 @@ class ConicBAAPType ~ConicBAAPType(); public: static const ConicBAAPType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; }; @@ -49,7 +49,7 @@ protected: ConicBFFPType( const char* fullname, const ArgsParser::spec*, int n ); ~ConicBFFPType(); public: - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; /** * -1 for hyperbola, 1 for ellipse.. @@ -85,7 +85,7 @@ class ConicBDFPType ~ConicBDFPType(); public: static const ConicBDFPType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; }; @@ -96,7 +96,7 @@ class ParabolaBTPType ~ParabolaBTPType(); public: static const ParabolaBTPType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; }; @@ -107,7 +107,7 @@ class EquilateralHyperbolaB4PType ~EquilateralHyperbolaB4PType(); public: static const EquilateralHyperbolaB4PType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; }; @@ -118,7 +118,7 @@ class ConicPolarPointType ~ConicPolarPointType(); public: static const ConicPolarPointType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; }; @@ -129,7 +129,7 @@ class ConicPolarLineType ~ConicPolarLineType(); public: static const ConicPolarLineType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; }; @@ -140,7 +140,7 @@ class ConicDirectrixType ~ConicDirectrixType(); public: static const ConicDirectrixType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; }; @@ -162,7 +162,7 @@ class ConicAsymptoteType ~ConicAsymptoteType(); public: static const ConicAsymptoteType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; }; @@ -173,7 +173,7 @@ class ConicRadicalType ~ConicRadicalType(); public: static const ConicRadicalType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; TQStringList specialActions() const; void executeAction( int i, ObjectHolder& o, ObjectTypeCalcer& t, diff --git a/kig/objects/cubic_type.cc b/kig/objects/cubic_type.cc index 1878128a..c322b8c3 100644 --- a/kig/objects/cubic_type.cc +++ b/kig/objects/cubic_type.cc @@ -112,12 +112,12 @@ const CubicNodeB6PType* CubicNodeB6PType::instance() return &t; } -ObjectImp* CubicNodeB6PType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* CubicNodeB6PType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents, 2 ) ) return new InvalidImp; + if ( ! margsparser.checkArgs( parents, 2 ) ) return new InvalidImp; std::vector points; - for ( Args::const_iterator i = tqparents.begin(); i != tqparents.end(); ++i ) + for ( Args::const_iterator i = parents.begin(); i != parents.end(); ++i ) points.push_back( static_cast( *i )->coordinate() ); CubicCartesianData d = calcCubicNodeThroughPoints( points ); @@ -156,12 +156,12 @@ const CubicCuspB4PType* CubicCuspB4PType::instance() return &t; } -ObjectImp* CubicCuspB4PType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* CubicCuspB4PType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents, 2 ) ) return new InvalidImp; + if ( ! margsparser.checkArgs( parents, 2 ) ) return new InvalidImp; std::vector points; - for ( Args::const_iterator i = tqparents.begin(); i != tqparents.end(); ++i ) + for ( Args::const_iterator i = parents.begin(); i != parents.end(); ++i ) points.push_back( static_cast( *i )->coordinate() ); CubicCartesianData d = calcCubicCuspThroughPoints( points ); diff --git a/kig/objects/cubic_type.h b/kig/objects/cubic_type.h index 439c7367..39be7387 100644 --- a/kig/objects/cubic_type.h +++ b/kig/objects/cubic_type.h @@ -27,7 +27,7 @@ class CubicB9PType ~CubicB9PType(); public: static const CubicB9PType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; }; @@ -38,7 +38,7 @@ class CubicNodeB6PType ~CubicNodeB6PType(); public: static const CubicNodeB6PType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; }; @@ -49,7 +49,7 @@ class CubicCuspB4PType ~CubicCuspB4PType(); public: static const CubicCuspB4PType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; }; diff --git a/kig/objects/intersection_types.cc b/kig/objects/intersection_types.cc index 92cbefff..804d498d 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& tqparents, const KigDocument& ) const +ObjectImp* ConicLineIntersectionType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents ) ) return new InvalidImp; + if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; - int side = static_cast( tqparents[2] )->data(); + int side = static_cast( parents[2] )->data(); assert( side == 1 || side == -1 ); - const LineData line = static_cast( tqparents[1] )->data(); + const LineData line = static_cast( parents[1] )->data(); Coordinate ret; - if ( tqparents[0]->inherits( CircleImp::stype() ) ) + if ( parents[0]->inherits( CircleImp::stype() ) ) { // easy case.. - const CircleImp* c = static_cast( tqparents[0] ); + const CircleImp* c = static_cast( parents[0] ); ret = calcCircleLineIntersect( c->center(), c->squareRadius(), line, side ); } @@ -75,7 +75,7 @@ ObjectImp* ConicLineIntersectionType::calc( const Args& tqparents, const KigDocu { // harder case.. ret = calcConicLineIntersect( - static_cast( tqparents[0] )->cartesianData(), + static_cast( parents[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& tqparents, const KigDocument& ) const +ObjectImp* ConicLineOtherIntersectionType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents ) ) return new InvalidImp; + if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; - Coordinate p = static_cast( tqparents[2] )->coordinate(); - const LineData line = static_cast( tqparents[1] )->data(); + Coordinate p = static_cast( parents[2] )->coordinate(); + const LineData line = static_cast( parents[1] )->data(); Coordinate ret; -// if ( tqparents[0]->inherits( CircleImp::stype() ) ) +// if ( parents[0]->inherits( CircleImp::stype() ) ) // { // // easy case.. -// const CircleImp* c = static_cast( tqparents[0] ); +// const CircleImp* c = static_cast( parents[0] ); // ret = calcCircleLineIntersect( // c->center(), c->squareRadius(), line, side, valid ); // } @@ -133,7 +133,7 @@ ObjectImp* ConicLineOtherIntersectionType::calc( const Args& tqparents, const Ki double bay = line.b.y - line.a.y; double knownparam = (pax*bax + pay*bay)/(bax*bax + bay*bay); ret = calcConicLineIntersect( - static_cast( tqparents[0] )->cartesianData(), + static_cast( parents[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& tqparents, const KigDocument& d ) const +ObjectImp* LineLineIntersectionType::calc( const Args& parents, const KigDocument& d ) const { - if ( ! margsparser.checkArgs( tqparents ) ) return new InvalidImp; + if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; Coordinate p = calcIntersectionPoint( - static_cast( tqparents[0] )->data(), - static_cast( tqparents[1] )->data() ); - if ( static_cast( tqparents[0] )->containsPoint( p, d ) && - static_cast( tqparents[1] )->containsPoint( p, d ) ) + static_cast( parents[0] )->data(), + static_cast( parents[1] )->data() ); + if ( static_cast( parents[0] )->containsPoint( p, d ) && + static_cast( parents[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& tqparents, const KigDocument& ) const +ObjectImp* LineCubicIntersectionType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents ) ) return new InvalidImp; + if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; - int which = static_cast( tqparents[2] )->data(); + int which = static_cast( parents[2] )->data(); bool valid = true; const Coordinate c = calcCubicLineIntersect( - static_cast( tqparents[0] )->data(), - static_cast( tqparents[1] )->data(), + static_cast( parents[0] )->data(), + static_cast( parents[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& tqparents, const KigDocument& ) const +ObjectImp* CircleCircleIntersectionType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents ) ) return new InvalidImp; + if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; - int side = static_cast( tqparents[2] )->data(); + int side = static_cast( parents[2] )->data(); assert( side == 1 || side == -1 ); - const CircleImp* c1 = static_cast( tqparents[0] ); - const CircleImp* c2 = static_cast( tqparents[1] ); + const CircleImp* c1 = static_cast( parents[0] ); + const CircleImp* c2 = static_cast( parents[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& tqparents, const KigDocument& ) const +ObjectImp* ArcLineIntersectionType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents ) ) return new InvalidImp; + if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; - int side = static_cast( tqparents[2] )->data(); + int side = static_cast( parents[2] )->data(); assert( side == 1 || side == -1 ); - const LineData line = static_cast( tqparents[1] )->data(); + const LineData line = static_cast( parents[1] )->data(); - const ArcImp* c = static_cast( tqparents[0] ); + const ArcImp* c = static_cast( parents[0] ); const double r = c->radius(); Coordinate ret = calcArcLineIntersect( c->center(), r*r, c->startAngle(), c->angle(), line, side ); diff --git a/kig/objects/intersection_types.h b/kig/objects/intersection_types.h index 46d60199..9e1df62e 100644 --- a/kig/objects/intersection_types.h +++ b/kig/objects/intersection_types.h @@ -36,7 +36,7 @@ class ConicLineIntersectionType ~ConicLineIntersectionType(); public: static const ConicLineIntersectionType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; }; @@ -51,7 +51,7 @@ class ConicLineOtherIntersectionType ~ConicLineOtherIntersectionType(); public: static const ConicLineOtherIntersectionType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; }; @@ -62,7 +62,7 @@ class LineLineIntersectionType ~LineLineIntersectionType(); public: static const LineLineIntersectionType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; }; @@ -73,7 +73,7 @@ class LineCubicIntersectionType ~LineCubicIntersectionType(); public: static const LineCubicIntersectionType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; }; @@ -84,7 +84,7 @@ class CircleCircleIntersectionType ~CircleCircleIntersectionType(); public: static const CircleCircleIntersectionType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; }; @@ -98,7 +98,7 @@ class ArcLineIntersectionType ~ArcLineIntersectionType(); public: static const ArcLineIntersectionType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; }; diff --git a/kig/objects/line_type.cc b/kig/objects/line_type.cc index 84deb46e..a02cc80b 100644 --- a/kig/objects/line_type.cc +++ b/kig/objects/line_type.cc @@ -232,11 +232,11 @@ void SegmentABType::executeAction( int i, ObjectHolder&, ObjectTypeCalcer& c, // pretend to use this var.. (void) i; - std::vector tqparents = c.tqparents(); - assert( margsparser.checkArgs( tqparents ) ); + std::vector parents = c.parents(); + assert( margsparser.checkArgs( parents ) ); - Coordinate a = static_cast( tqparents[0]->imp() )->coordinate(); - Coordinate b = static_cast( tqparents[1]->imp() )->coordinate(); + Coordinate a = static_cast( parents[0]->imp() )->coordinate(); + Coordinate b = static_cast( parents[1]->imp() )->coordinate(); bool ok = true; double length = getDoubleFromUser( @@ -246,8 +246,8 @@ void SegmentABType::executeAction( int i, ObjectHolder&, ObjectTypeCalcer& c, Coordinate nb = a + ( b - a ).normalize( length ); - MonitorDataObjects mon( getAllParents( tqparents ) ); - tqparents[1]->move( nb, d.document() ); + MonitorDataObjects mon( getAllParents( parents ) ); + parents[1]->move( nb, d.document() ); KigCommand* cd = new KigCommand( d, i18n( "Resize Segment" ) ); mon.finish( cd ); d.history()->addCommand( cd ); diff --git a/kig/objects/locus_imp.h b/kig/objects/locus_imp.h index b2100634..54ec7f13 100644 --- a/kig/objects/locus_imp.h +++ b/kig/objects/locus_imp.h @@ -33,9 +33,9 @@ * * This may seem rather complicated, but I think it is absolutely * necessary to support locuses using Kig's object system. It would - * be very bad for LocusImp to have to keep references to its tqparents + * be very bad for LocusImp to have to keep references to its parents * as Objects ( since only the objects know how they are related to - * their tqparents ). This is how we used to do it, but the current + * their parents ). This is how we used to do it, but the current * method is far superior. First and foremost because the separation * between ObjectImp and Object is something that Kig depends on very * much, and because every ObjectImp should contain all the data it diff --git a/kig/objects/object_calcer.cc b/kig/objects/object_calcer.cc index ae442aae..38c0b194 100644 --- a/kig/objects/object_calcer.cc +++ b/kig/objects/object_calcer.cc @@ -29,8 +29,8 @@ void ObjectTypeCalcer::calc( const KigDocument& doc ) { Args a; - a.reserve( mtqparents.size() ); - std::transform( mtqparents.begin(), mtqparents.end(), + a.reserve( mparents.size() ); + std::transform( mparents.begin(), mparents.end(), std::back_inserter( a ), std::mem_fun( &ObjectCalcer::imp ) ); ObjectImp* n = mtype->calc( a, doc ); delete mimp; @@ -38,10 +38,10 @@ void ObjectTypeCalcer::calc( const KigDocument& doc ) } ObjectTypeCalcer::ObjectTypeCalcer( const ObjectType* type, - const std::vector& tqparents, bool sort ) - : mtqparents( ( sort )?type->sortArgs( tqparents ):tqparents ), mtype( type ), mimp( 0 ) + const std::vector& parents, bool sort ) + : mparents( ( sort )?type->sortArgs( parents ):parents ), mtype( type ), mimp( 0 ) { - std::for_each( mtqparents.begin(), mtqparents.end(), + std::for_each( mparents.begin(), mparents.end(), std::bind2nd( std::mem_fun( &ObjectCalcer::addChild ), this ) ); } @@ -68,9 +68,9 @@ void ObjectConstCalcer::calc( const KigDocument& ) { } -std::vector ObjectConstCalcer::tqparents() const +std::vector ObjectConstCalcer::parents() const { - // we have no tqparents.. + // we have no parents.. return std::vector(); } @@ -99,9 +99,9 @@ const ObjectImp* ObjectTypeCalcer::imp() const return mimp; } -std::vector ObjectTypeCalcer::tqparents() const +std::vector ObjectTypeCalcer::parents() const { - return mtqparents; + return mparents; } void ObjectCalcer::addChild( ObjectCalcer* c ) @@ -121,7 +121,7 @@ void ObjectCalcer::delChild( ObjectCalcer* c ) ObjectTypeCalcer::~ObjectTypeCalcer() { - std::for_each( mtqparents.begin(), mtqparents.end(), + std::for_each( mparents.begin(), mparents.end(), std::bind2nd( std::mem_fun( &ObjectCalcer::delChild ), this ) ); delete mimp; } @@ -154,7 +154,7 @@ const ObjectImp* ObjectPropertyCalcer::imp() const return mimp; } -std::vector ObjectPropertyCalcer::tqparents() const +std::vector ObjectPropertyCalcer::parents() const { std::vector ret; ret.push_back( mtqparent ); @@ -197,7 +197,7 @@ const ObjectImpType* ObjectTypeCalcer::impRequirement( ObjectCalcer* o, const std::vector& os ) const { Args args; - args.reserve( mtqparents.size() ); + args.reserve( mparents.size() ); std::transform( os.begin(), os.end(), std::back_inserter( args ), @@ -220,9 +220,9 @@ void ObjectTypeCalcer::setParents( const std::vector np ) { std::for_each( np.begin(), np.end(), std::bind2nd( std::mem_fun( &ObjectCalcer::addChild ), this ) ); - std::for_each( mtqparents.begin(), mtqparents.end(), + std::for_each( mparents.begin(), mparents.end(), std::bind2nd( std::mem_fun( &ObjectCalcer::delChild ), this ) ); - mtqparents = np; + mparents = np; } void ObjectTypeCalcer::setType( const ObjectType* t ) @@ -270,7 +270,7 @@ void ObjectTypeCalcer::move( const Coordinate& to, const KigDocument& doc ) { // we need to check if type can in fact move, because this check is // not done for us in all circumstances ( e.g. LineABType::move uses - // move on its tqparents to move them ), and the ObjectType's depend + // move on its parents to move them ), and the ObjectType's depend // on move only being called if canMove() returns true.. if ( mtype->canMove( *this ) ) mtype->move( *this, to, doc ); @@ -310,9 +310,9 @@ bool ObjectPropertyCalcer::isDefinedOnOrThrough( const ObjectCalcer* o ) const bool ObjectTypeCalcer::isDefinedOnOrThrough( const ObjectCalcer* o ) const { Args args; - args.reserve( mtqparents.size() ); + args.reserve( mparents.size() ); std::transform( - mtqparents.begin(), mtqparents.end(), + mparents.begin(), mparents.end(), std::back_inserter( args ), std::mem_fun( &ObjectCalcer::imp ) ); if ( std::find( args.begin(), args.end(), o->imp() ) == args.end() ) diff --git a/kig/objects/object_calcer.h b/kig/objects/object_calcer.h index 1aa83db4..92eebc8e 100644 --- a/kig/objects/object_calcer.h +++ b/kig/objects/object_calcer.h @@ -33,12 +33,12 @@ void intrusive_ptr_release( ObjectCalcer* p ); * be calculated from the two PointImp's it has to go through; every * time either of them moves, this calculation is redone. In this * case, there would be an ObjectCalcer that keeps a reference to its - * two tqparents ( the ObjectCalcer's representing the points ), and + * two parents ( the ObjectCalcer's representing the points ), and * that will calculate its ObjectImp value every time it is asked to - * do so ( i.e. every time one of its tqparents moves.. ). + * do so ( i.e. every time one of its parents moves.. ). * * Each ObjectHolder keeps its ObjectImp itself, and recalculates it - * from its tqparents in its calc() method ( if necessary ). + * from its parents in its calc() method ( if necessary ). * * Because of the complex relations that ObjectCalcer's hold to other * ObjectCalcer's and to other classes, they have been made @@ -46,12 +46,12 @@ void intrusive_ptr_release( ObjectCalcer* p ); * how much times a pointer to them is held. If this count reaches 0, * this means that nobody needs them anymore, and they delete * themselves. E.g. an ObjectCalcer always keeps a reference to its - * tqparents, to ensure that those aren't deleted before it is deleted. + * parents, to ensure that those aren't deleted before it is deleted. * * At runtime, there will be an entire graph of ObjectCalcer that - * depend on their tqparents.. At the bottom, there are Calcer's that + * depend on their parents.. At the bottom, there are Calcer's that * the user is aware of, and that are held by ObjectHolder's. At the - * top, there are Calcer's without tqparents that serve only to hold + * top, there are Calcer's without parents that serve only to hold * some data. Those are most likely ObjectConstCalcer's. There are * some algorithms to work with the dependency graph in various ways * in ../misc/calcpath.h @@ -67,7 +67,7 @@ class ObjectCalcer protected: /** * ObjectCalcer's are reference counted.. They all take a reference - * to their tqparents, and some other classes like ObjectHolder take a + * to their parents, and some other classes like ObjectHolder take a * reference to some ObjectCalcer's that they don't want to see * deleted.. */ @@ -108,21 +108,21 @@ public: /** * Returns the tqparent ObjectCalcer's of this ObjectCalcer. */ - virtual std::vector tqparents() const = 0; + virtual std::vector parents() const = 0; /** * Returns the ObjectImp of this ObjectCalcer. */ virtual const ObjectImp* imp() const = 0; /** * Makes the ObjectCalcer recalculate its ObjectImp from its - * tqparents. + * parents. */ virtual void calc( const KigDocument& ) = 0; /** - * An ObjectCalcer expects its tqparents to have an ObjectImp of a + * An ObjectCalcer expects its parents to have an ObjectImp of a * certain type. This method returns the ObjectImpType that \p o - * should have. \p os is a list of all the tqparents in order, and + * should have. \p os is a list of all the parents in order, and * \p o is part of it. This method will return the ObjectImpType * that the tqparent should *at least* be. For example, a Translated * object can translate any sort of object, so it will return @@ -144,7 +144,7 @@ public: virtual bool isFreelyTranslatable() const; /** * Moving an object most of the time signifies invoking changes in - * some of its tqparents. This method returns the set of tqparents that + * some of its parents. This method returns the set of parents that * will be changed in the move() method. The object itself should * not be included. */ @@ -182,30 +182,30 @@ public: class ObjectTypeCalcer : public ObjectCalcer { - std::vector mtqparents; + std::vector mparents; const ObjectType* mtype; ObjectImp* mimp; public: typedef myboost::intrusive_ptr shared_ptr; /** - * Construct a new ObjectTypeCalcer with a given type and tqparents. + * Construct a new ObjectTypeCalcer with a given type and parents. */ -// ObjectTypeCalcer( const ObjectType* type, const std::vector& tqparents ); +// ObjectTypeCalcer( const ObjectType* type, const std::vector& parents ); /** * the sort boolean tells whether the sortArgs method should be invoked or not; * if not present */ - ObjectTypeCalcer( const ObjectType* type, const std::vector& tqparents, bool sort=true ); + ObjectTypeCalcer( const ObjectType* type, const std::vector& parents, bool sort=true ); ~ObjectTypeCalcer(); const ObjectImp* imp() const; - std::vector tqparents() const; + std::vector parents() const; void calc( const KigDocument& doc ); /** - * Set the tqparents of this ObjectTypeCalcer to np. This object will - * release the reference it had to its old tqparents, and take a new - * one on the new tqparents. + * Set the parents of this ObjectTypeCalcer to np. This object will + * release the reference it had to its old parents, and take a new + * one on the new parents. */ void setParents( const std::vector np ); void setType( const ObjectType* t ); @@ -248,7 +248,7 @@ public: const ObjectImp* imp() const; void calc( const KigDocument& doc ); - std::vector tqparents() const; + std::vector parents() const; /** * Set the ObjectImp of this ObjectConstCalcer to the given @@ -287,7 +287,7 @@ public: ~ObjectPropertyCalcer(); const ObjectImp* imp() const; - std::vector tqparents() const; + std::vector parents() const; void calc( const KigDocument& doc ); int propId() const; diff --git a/kig/objects/object_factory.cc b/kig/objects/object_factory.cc index 5b1a6add..c2d7b3b5 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 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 ); + std::vector 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 ); } ObjectTypeCalcer* ObjectFactory::constrainedPointCalcer( ObjectCalcer* curve, double param ) const { assert( curve->imp()->inherits( CurveImp::stype() ) ); - std::vector tqparents; - tqparents.push_back( new ObjectConstCalcer( new DoubleImp( param ) ) ); - tqparents.push_back( curve ); - return new ObjectTypeCalcer( ConstrainedPointType::instance(), tqparents ); + std::vector parents; + parents.push_back( new ObjectConstCalcer( new DoubleImp( param ) ) ); + parents.push_back( curve ); + return new ObjectTypeCalcer( ConstrainedPointType::instance(), parents ); } ObjectHolder* ObjectFactory::constrainedPoint( @@ -152,24 +152,24 @@ ObjectTypeCalcer* ObjectFactory::locusCalcer( assert( dynamic_cast( a ) ); ObjectTypeCalcer* constrained = static_cast( a ); assert( constrained->type()->inherits( ObjectType::ID_ConstrainedPointType ) ); - assert( constrained->tqparents().size() == 2 ); - ObjectCalcer* curve = a->tqparents().back(); + assert( constrained->parents().size() == 2 ); + ObjectCalcer* curve = a->parents().back(); const ObjectCalcer* moving = b; - std::vector hiertqparents; - hiertqparents.push_back( constrained ); - std::vector sideOfTree = sideOfTreePath( hiertqparents, moving ); - std::copy( sideOfTree.begin(), sideOfTree.end(), std::back_inserter( hiertqparents ) ); + std::vector hierparents; + hierparents.push_back( constrained ); + std::vector sideOfTree = sideOfTreePath( hierparents, moving ); + std::copy( sideOfTree.begin(), sideOfTree.end(), std::back_inserter( hierparents ) ); - ObjectHierarchy hier( hiertqparents, moving ); + ObjectHierarchy hier( hierparents, moving ); - std::vector realtqparents( 2 + sideOfTree.size(), 0 ); - realtqparents[0] = new ObjectConstCalcer( new HierarchyImp( hier ) ); - realtqparents[1] = curve; - copy( sideOfTree.begin(), sideOfTree.end(), realtqparents.begin() + 2 ); + std::vector realparents( 2 + sideOfTree.size(), 0 ); + realparents[0] = new ObjectConstCalcer( new HierarchyImp( hier ) ); + realparents[1] = curve; + copy( sideOfTree.begin(), sideOfTree.end(), realparents.begin() + 2 ); - return new ObjectTypeCalcer( LocusType::instance(), realtqparents ); + return new ObjectTypeCalcer( LocusType::instance(), realparents ); } 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& tqparents, + bool needframe, const std::vector& parents, const KigDocument& doc ) const { - return new ObjectHolder( labelCalcer( s, loc, needframe, tqparents, doc ) ); + return new ObjectHolder( labelCalcer( s, loc, needframe, parents, doc ) ); } ObjectTypeCalcer* ObjectFactory::labelCalcer( const TQString& s, const Coordinate& loc, - bool needframe, const std::vector& tqparents, + bool needframe, const std::vector& parents, const KigDocument& doc ) const { - return attachedLabelCalcer( s, 0, loc, needframe, tqparents, doc ); + return attachedLabelCalcer( s, 0, loc, needframe, parents, doc ); } ObjectTypeCalcer* ObjectFactory::attachedLabelCalcer( const TQString& s, ObjectCalcer* p, const Coordinate& loc, bool needframe, - const std::vector& ntqparents, + const std::vector& nparents, const KigDocument& doc ) const { - std::vector tqparents; - tqparents.reserve( ntqparents.size() + 3 ); - tqparents.push_back( new ObjectConstCalcer( new IntImp( needframe ? 1 : 0 ) ) ); + std::vector parents; + parents.reserve( nparents.size() + 3 ); + parents.push_back( new ObjectConstCalcer( new IntImp( needframe ? 1 : 0 ) ) ); - tqparents.push_back( getAttachPoint( p, loc, doc ) ); + parents.push_back( getAttachPoint( p, loc, doc ) ); - 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 ); + 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 ); ret->calc( doc ); return ret; } @@ -268,10 +268,10 @@ ObjectCalcer* ObjectFactory::getAttachPoint( ObjectHolder* ObjectFactory::attachedLabel( const TQString& s, ObjectCalcer* locationtqparent, const Coordinate& loc, bool needframe, - const std::vector& tqparents, + const std::vector& parents, const KigDocument& doc ) const { - return new ObjectHolder( attachedLabelCalcer( s, locationtqparent, loc, needframe, tqparents, doc ) ); + return new ObjectHolder( attachedLabelCalcer( s, locationtqparent, loc, needframe, parents, doc ) ); } ObjectPropertyCalcer* ObjectFactory::propertyObjectCalcer( @@ -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 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 ); + std::vector 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 ); assert( dynamic_cast( dataobj ) ); static_cast( dataobj )->setImp( diff --git a/kig/objects/object_factory.h b/kig/objects/object_factory.h index f3a28d66..d99cce8b 100644 --- a/kig/objects/object_factory.h +++ b/kig/objects/object_factory.h @@ -94,16 +94,16 @@ public: ObjectHolder* locus( ObjectCalcer* a, ObjectCalcer* b ) const; /** - * returns a label with text \p s at point \p c .. It ( and its tqparents ) + * returns a label with text \p s at point \p c .. It ( and its parents ) * is calced already... */ ObjectHolder* label( const TQString& s, const Coordinate& loc, - bool needframe, const std::vector& tqparents, + bool needframe, const std::vector& parents, const KigDocument& doc ) const; ObjectTypeCalcer* labelCalcer( const TQString& s, const Coordinate& loc, - bool needframe, const std::vector& tqparents, + bool needframe, const std::vector& parents, const KigDocument& doc ) const; /** @@ -113,7 +113,7 @@ public: ObjectTypeCalcer* attachedLabelCalcer( const TQString& s, ObjectCalcer* locationtqparent, const Coordinate& loc, bool needframe, - const std::vector& tqparents, + const std::vector& parents, const KigDocument& doc ) const; /** * this has been added because it comes handy when redefining @@ -127,7 +127,7 @@ public: ObjectHolder* attachedLabel( const TQString& s, ObjectCalcer* locationtqparent, const Coordinate& loc, bool needframe, - const std::vector& tqparents, + const std::vector& parents, const KigDocument& doc ) const; /** diff --git a/kig/objects/object_type.cc b/kig/objects/object_type.cc index 93634b63..ea85e4f8 100644 --- a/kig/objects/object_type.cc +++ b/kig/objects/object_type.cc @@ -71,9 +71,9 @@ ArgsParserObjectType::ArgsParserObjectType( const char fulltypename[], { } -const ObjectImpType* ArgsParserObjectType::impRequirement( const ObjectImp* o, const Args& tqparents ) const +const ObjectImpType* ArgsParserObjectType::impRequirement( const ObjectImp* o, const Args& parents ) const { - return margsparser.impRequirement( o, tqparents ); + return margsparser.impRequirement( o, parents ); } const ArgsParser& ArgsParserObjectType::argsParser() const @@ -118,8 +118,8 @@ std::vector ObjectType::movableParents( const ObjectTypeCalcer& ) return std::vector(); } -bool ArgsParserObjectType::isDefinedOnOrThrough( const ObjectImp* o, const Args& tqparents ) const +bool ArgsParserObjectType::isDefinedOnOrThrough( const ObjectImp* o, const Args& parents ) const { - return margsparser.isDefinedOnOrThrough( o, tqparents ); + return margsparser.isDefinedOnOrThrough( o, parents ); } diff --git a/kig/objects/object_type.h b/kig/objects/object_type.h index 60b32026..54471e46 100644 --- a/kig/objects/object_type.h +++ b/kig/objects/object_type.h @@ -45,7 +45,7 @@ public: virtual bool inherits( int type ) const; - virtual ObjectImp* calc( const Args& tqparents, const KigDocument& d ) const = 0; + virtual ObjectImp* calc( const Args& parents, const KigDocument& d ) const = 0; virtual bool canMove( const ObjectTypeCalcer& ourobj ) const; virtual bool isFreelyTranslatable( const ObjectTypeCalcer& ourobj ) const; @@ -57,19 +57,19 @@ public: const char* fullName() const; /** - * Supposing that \p tqparents would be given as tqparents to + * Supposing that \p parents would be given as parents to * this type's calc function, this function returns the ObjectImp id - * that \p o should at least have.. ( \p o should be part of \p tqparents ) + * that \p o should at least have.. ( \p o should be part of \p parents ) */ - virtual const ObjectImpType* impRequirement( const ObjectImp* o, const Args& tqparents ) const = 0; + virtual const ObjectImpType* impRequirement( const ObjectImp* o, const Args& parents ) const = 0; /** - * Supposing that \p tqparents would be given as tqparents to this type's + * Supposing that \p parents would be given as parents to this type's * calc function, this function returns whether the returned * ObjectImp will be, by construction, on \p o ( if \p o is a curve ), or * through \p o ( if \p o is a point ). */ - virtual bool isDefinedOnOrThrough( const ObjectImp* o, const Args& tqparents ) const = 0; + virtual bool isDefinedOnOrThrough( const ObjectImp* o, const Args& parents ) const = 0; /** * returns the ObjectImp id of the ObjectImp's produced by this @@ -108,7 +108,7 @@ public: /** * This is a convenience subclass of ObjectType that a type should - * inherit from if its tqparents can be specified in an ArgsParser.. + * inherit from if its parents can be specified in an ArgsParser.. */ class ArgsParserObjectType : public ObjectType @@ -119,8 +119,8 @@ protected: const struct ArgsParser::spec argsspec[], int n ); public: - const ObjectImpType* impRequirement( const ObjectImp* o, const Args& tqparents ) const; - bool isDefinedOnOrThrough( const ObjectImp* o, const Args& tqparents ) const; + const ObjectImpType* impRequirement( const ObjectImp* o, const Args& parents ) const; + bool isDefinedOnOrThrough( const ObjectImp* o, const Args& parents ) const; const ArgsParser& argsParser() const; std::vector sortArgs( const std::vector& args ) const; diff --git a/kig/objects/other_type.cc b/kig/objects/other_type.cc index 7d632524..80986e82 100644 --- a/kig/objects/other_type.cc +++ b/kig/objects/other_type.cc @@ -103,10 +103,10 @@ bool CopyObjectType::inherits( int ) const return false; } -ObjectImp* CopyObjectType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* CopyObjectType::calc( const Args& parents, const KigDocument& ) const { - assert( tqparents.size() == 1 ); - return tqparents[0]->copy(); + assert( parents.size() == 1 ); + return parents[0]->copy(); } const ObjectImpType* CopyObjectType::impRequirement( const ObjectImp*, const Args& ) const @@ -120,19 +120,19 @@ const ObjectImpType* CopyObjectType::resultId() const return ObjectImp::stype(); } -const ObjectImpType* LocusType::impRequirement( const ObjectImp* o, const Args& tqparents ) const +const ObjectImpType* LocusType::impRequirement( const ObjectImp* o, const Args& parents ) const { - assert( tqparents.size() >= 2 ); - Args firsttwo( tqparents.begin(), tqparents.begin() + 2 ); - if ( o == tqparents[0] || o == tqparents[1] ) + assert( parents.size() >= 2 ); + Args firsttwo( parents.begin(), parents.begin() + 2 ); + if ( o == parents[0] || o == parents[1] ) return margsparser.impRequirement( o, firsttwo ); else { - const HierarchyImp* h = dynamic_cast( tqparents[0] ); + const HierarchyImp* h = dynamic_cast( parents[0] ); if ( h ) { PointImp* p = new PointImp( Coordinate() ); - Args hargs( tqparents.begin()+ 2, tqparents.end() ); + Args hargs( parents.begin()+ 2, parents.end() ); hargs.push_back( p ); ArgsParser hparser = h->data().argParser(); const ObjectImpType* ret = hparser.impRequirement( o, hargs ); diff --git a/kig/objects/other_type.h b/kig/objects/other_type.h index f8f24209..6bbcead1 100644 --- a/kig/objects/other_type.h +++ b/kig/objects/other_type.h @@ -32,7 +32,7 @@ public: ObjectImp* calc( const Args& args, const KigDocument& ) const; - const ObjectImpType* impRequirement( const ObjectImp* o, const Args& tqparents ) const; + const ObjectImpType* impRequirement( const ObjectImp* o, const Args& parents ) const; bool inherits( int type ) const; const ObjectImpType* resultId() const; @@ -50,9 +50,9 @@ protected: public: static CopyObjectType* instance(); bool inherits( int type ) const; - ObjectImp* calc( const Args& tqparents, const KigDocument& d ) const; - const ObjectImpType* impRequirement( const ObjectImp* o, const Args& tqparents ) const; - bool isDefinedOnOrThrough( const ObjectImp* o, const Args& tqparents ) const; + ObjectImp* calc( const Args& parents, const KigDocument& d ) const; + const ObjectImpType* impRequirement( const ObjectImp* o, const Args& parents ) const; + bool isDefinedOnOrThrough( const ObjectImp* o, const Args& parents ) const; const ObjectImpType* resultId() const; std::vector sortArgs( const std::vector& os ) const; Args sortArgs( const Args& args ) const; diff --git a/kig/objects/point_type.cc b/kig/objects/point_type.cc index 74fc9d37..f1c59ac4 100644 --- a/kig/objects/point_type.cc +++ b/kig/objects/point_type.cc @@ -52,12 +52,12 @@ FixedPointType::~FixedPointType() { } -ObjectImp* FixedPointType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* FixedPointType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents ) ) return new InvalidImp; + if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; - double a = static_cast( tqparents[0] )->data(); - double b = static_cast( tqparents[1] )->data(); + double a = static_cast( parents[0] )->data(); + double b = static_cast( parents[1] )->data(); return new PointImp( Coordinate( a, b ) ); } @@ -80,14 +80,14 @@ RelativePointType::~RelativePointType() { } -ObjectImp* RelativePointType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* RelativePointType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents ) ) return new InvalidImp; - if ( ! tqparents[2]->attachPoint().valid() ) return new InvalidImp; + if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; + if ( ! parents[2]->attachPoint().valid() ) return new InvalidImp; - Coordinate reference = static_cast( tqparents[2] )->attachPoint(); - double a = static_cast( tqparents[0] )->data(); - double b = static_cast( tqparents[1] )->data(); + Coordinate reference = static_cast( parents[2] )->attachPoint(); + double a = static_cast( parents[0] )->data(); + double b = static_cast( parents[1] )->data(); return new PointImp( reference + Coordinate( a, b ) ); } @@ -109,12 +109,12 @@ const CursorPointType* CursorPointType::instance() return &t; } -ObjectImp* CursorPointType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* CursorPointType::calc( const Args& parents, const KigDocument& ) const { - assert ( tqparents[0]->inherits( DoubleImp::stype() ) ); - assert ( tqparents[1]->inherits( DoubleImp::stype() ) ); - double a = static_cast( tqparents[0] )->data(); - double b = static_cast( tqparents[1] )->data(); + assert ( parents[0]->inherits( DoubleImp::stype() ) ); + assert ( parents[1]->inherits( DoubleImp::stype() ) ); + double a = static_cast( parents[0] )->data(); + double b = static_cast( parents[1] )->data(); return new BogusPointImp( Coordinate( a, b ) ); } @@ -124,12 +124,12 @@ const ObjectImpType* CursorPointType::resultId() const return BogusPointImp::stype(); } -ObjectImp* ConstrainedPointType::calc( const Args& tqparents, const KigDocument& doc ) const +ObjectImp* ConstrainedPointType::calc( const Args& parents, const KigDocument& doc ) const { - if ( ! margsparser.checkArgs( tqparents ) ) return new InvalidImp; + if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; - double param = static_cast( tqparents[0] )->data(); - const Coordinate nc = static_cast( tqparents[1] )->getPoint( param, doc ); + double param = static_cast( parents[0] )->data(); + const Coordinate nc = static_cast( parents[1] )->getPoint( param, doc ); if ( nc.valid() ) return new PointImp( nc ); else return new InvalidImp; } @@ -155,7 +155,7 @@ void FixedPointType::move( ObjectTypeCalcer& ourobj, const Coordinate& to, const KigDocument& ) const { // fetch the old coord..; - std::vector pa = ourobj.tqparents(); + std::vector pa = ourobj.parents(); assert( margsparser.checkArgs( pa ) ); assert( dynamic_cast( pa.front() ) ); assert( dynamic_cast( pa.back() ) ); @@ -173,7 +173,7 @@ void RelativePointType::move( ObjectTypeCalcer& ourobj, const Coordinate& to, // fetch the attach point..; // this routine is tightly paired with what moveReferencePoint returns! // right now moveReferencePoint always returns the origin - std::vector pa = ourobj.tqparents(); + std::vector pa = ourobj.parents(); assert( margsparser.checkArgs( pa ) ); assert( dynamic_cast( pa[0] ) ); assert( dynamic_cast( pa[1] ) ); @@ -192,7 +192,7 @@ void CursorPointType::move( ObjectTypeCalcer& ourobj, const Coordinate& to, { // fetch the old coord..; - std::vector pa = ourobj.tqparents(); + std::vector pa = ourobj.parents(); assert( pa.size() == 2 ); assert( dynamic_cast( pa.front() ) ); assert( dynamic_cast( pa.back() ) ); @@ -208,12 +208,12 @@ void ConstrainedPointType::move( ObjectTypeCalcer& ourobj, const Coordinate& to, const KigDocument& d ) const { // fetch the CurveImp.. - std::vector tqparents = ourobj.tqparents(); - assert( margsparser.checkArgs( tqparents ) ); + std::vector parents = ourobj.parents(); + assert( margsparser.checkArgs( parents ) ); - assert( dynamic_cast( tqparents[0] ) ); - ObjectConstCalcer* paramo = static_cast( tqparents[0] ); - const CurveImp* ci = static_cast( tqparents[1]->imp() ); + assert( dynamic_cast( parents[0] ) ); + ObjectConstCalcer* paramo = static_cast( parents[0] ); + const CurveImp* ci = static_cast( parents[1]->imp() ); // fetch the new param.. const double np = ci->getParam( to, d ); @@ -427,11 +427,11 @@ void ConstrainedPointType::executeAction( break; case 0: { - std::vector tqparents = o.tqparents(); - assert( dynamic_cast( tqparents[0] ) && - tqparents[0]->imp()->inherits( DoubleImp::stype() ) ); + std::vector parents = o.parents(); + assert( dynamic_cast( parents[0] ) && + parents[0]->imp()->inherits( DoubleImp::stype() ) ); - ObjectConstCalcer* po = static_cast( tqparents[0] ); + ObjectConstCalcer* po = static_cast( parents[0] ); double oldp = static_cast( po->imp() )->data(); bool ok = true; @@ -440,7 +440,7 @@ void ConstrainedPointType::executeAction( oldp, &w, &ok, 0, 1, 4 ); if ( ! ok ) return; - MonitorDataObjects mon( tqparents ); + MonitorDataObjects mon( parents ); po->setImp( new DoubleImp( newp ) ); KigCommand* kc = new KigCommand( d, i18n( "Change Parameter of Constrained Point" ) ); mon.finish( kc ); @@ -473,46 +473,46 @@ const Coordinate ConstrainedPointType::moveReferencePoint( const ObjectTypeCalce std::vector FixedPointType::movableParents( const ObjectTypeCalcer& ourobj ) const { - return ourobj.tqparents(); + return ourobj.parents(); } std::vector RelativePointType::movableParents( const ObjectTypeCalcer& ourobj ) const { std::vector ret; - ret.push_back( ourobj.tqparents()[0] ); - ret.push_back( ourobj.tqparents()[1] ); + ret.push_back( ourobj.parents()[0] ); + ret.push_back( ourobj.parents()[1] ); return ret; } std::vector ConstrainedPointType::movableParents( const ObjectTypeCalcer& ourobj ) const { std::vector ret; - ret.push_back( ourobj.tqparents()[0] ); + ret.push_back( ourobj.parents()[0] ); return ret; } /* ----------------- Transport of measure ------------------------------ */ -ObjectImp* MeasureTransportType::calc( const Args& tqparents, const KigDocument& doc ) const +ObjectImp* MeasureTransportType::calc( const Args& parents, const KigDocument& doc ) const { double measure; - if ( tqparents.size() != 3 ) return new InvalidImp; + if ( parents.size() != 3 ) return new InvalidImp; - if ( tqparents[0]->inherits (SegmentImp::stype()) ) + if ( parents[0]->inherits (SegmentImp::stype()) ) { - const SegmentImp* s = static_cast( tqparents[0] ); + const SegmentImp* s = static_cast( parents[0] ); measure = s->length(); - } else if ( tqparents[0]->inherits (ArcImp::stype()) ) + } else if ( parents[0]->inherits (ArcImp::stype()) ) { - const ArcImp* s = static_cast( tqparents[0] ); + const ArcImp* s = static_cast( parents[0] ); measure = s->radius()*s->angle(); } else return new InvalidImp; - const Coordinate& p = static_cast( tqparents[2] )->coordinate(); - if ( tqparents[1]->inherits (LineImp::stype()) ) + const Coordinate& p = static_cast( parents[2] )->coordinate(); + if ( parents[1]->inherits (LineImp::stype()) ) { - const LineImp* c = static_cast( tqparents[1] ); + const LineImp* c = static_cast( parents[1] ); if ( !c->containsPoint( p, doc ) ) return new InvalidImp; @@ -523,9 +523,9 @@ ObjectImp* MeasureTransportType::calc( const Args& tqparents, const KigDocument& if ( nc.valid() ) return new PointImp( nc ); else return new InvalidImp; - } else if ( tqparents[1]->inherits (CircleImp::stype()) ) + } else if ( parents[1]->inherits (CircleImp::stype()) ) { - const CircleImp* c = static_cast( tqparents[1] ); + const CircleImp* c = static_cast( parents[1] ); if ( !c->containsPoint( p, doc ) ) return new InvalidImp; @@ -607,17 +607,17 @@ Args MeasureTransportType::sortArgs( const Args& args ) const /* - transport of measure (old, for compatibility with prev. kig files) - */ -ObjectImp* MeasureTransportTypeOld::calc( const Args& tqparents, const KigDocument& doc ) const +ObjectImp* MeasureTransportTypeOld::calc( const Args& parents, const KigDocument& doc ) const { - if ( ! margsparser.checkArgs( tqparents ) ) return new InvalidImp; + if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; - const CircleImp* c = static_cast( tqparents[0] ); - const Coordinate& p = static_cast( tqparents[1] )->coordinate(); + const CircleImp* c = static_cast( parents[0] ); + const Coordinate& p = static_cast( parents[1] )->coordinate(); if ( !c->containsPoint( p, doc ) ) return new InvalidImp; - const SegmentImp* s = static_cast( tqparents[2] ); + const SegmentImp* s = static_cast( parents[2] ); double param = c->getParam( p, doc ); double measure = s->length(); measure /= 2*c->radius()*M_PI; diff --git a/kig/objects/point_type.h b/kig/objects/point_type.h index d1fb7674..69a7e2e8 100644 --- a/kig/objects/point_type.h +++ b/kig/objects/point_type.h @@ -34,7 +34,7 @@ public: bool inherits( int type ) const; - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; bool canMove( const ObjectTypeCalcer& ourobj ) const; bool isFreelyTranslatable( const ObjectTypeCalcer& ourobj ) const; std::vector movableParents( const ObjectTypeCalcer& ourobj ) const; @@ -58,7 +58,7 @@ class RelativePointType public: static const RelativePointType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; bool canMove( const ObjectTypeCalcer& ourobj ) const; bool isFreelyTranslatable( const ObjectTypeCalcer& ourobj ) const; std::vector movableParents( const ObjectTypeCalcer& ourobj ) const; @@ -80,10 +80,10 @@ class CursorPointType public: static const CursorPointType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; - const ObjectImpType* impRequirement( const ObjectImp* o, const Args& tqparents ) const; - bool isDefinedOnOrThrough( const ObjectImp* o, const Args& tqparents ) const; + const ObjectImpType* impRequirement( const ObjectImp* o, const Args& parents ) const; + bool isDefinedOnOrThrough( const ObjectImp* o, const Args& parents ) const; std::vector sortArgs( const std::vector& args ) const; Args sortArgs( const Args& args ) const; bool canMove( const ObjectTypeCalcer& ourobj ) const; @@ -102,7 +102,7 @@ public: bool inherits( int type ) const; - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; bool canMove( const ObjectTypeCalcer& ourobj ) const; bool isFreelyTranslatable( const ObjectTypeCalcer& ourobj ) const; @@ -136,10 +136,10 @@ class MeasureTransportType public: static const MeasureTransportType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; - const ObjectImpType* impRequirement( const ObjectImp* o, const Args& tqparents ) const; - bool isDefinedOnOrThrough( const ObjectImp* o, const Args& tqparents ) const; + const ObjectImpType* impRequirement( const ObjectImp* o, const Args& parents ) const; + bool isDefinedOnOrThrough( const ObjectImp* o, const Args& parents ) const; std::vector sortArgs( const std::vector& args )const; Args sortArgs( const Args& args ) const; }; @@ -152,7 +152,7 @@ class MeasureTransportTypeOld public: static const MeasureTransportTypeOld* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; }; diff --git a/kig/objects/polygon_type.cc b/kig/objects/polygon_type.cc index 55aa4cd8..bca867da 100644 --- a/kig/objects/polygon_type.cc +++ b/kig/objects/polygon_type.cc @@ -60,13 +60,13 @@ const TriangleB3PType* TriangleB3PType::instance() return &s; } -ObjectImp* TriangleB3PType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* TriangleB3PType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents, 1 ) ) return new InvalidImp; + if ( ! margsparser.checkArgs( parents, 1 ) ) return new InvalidImp; std::vector points; Coordinate centerofmass3 = Coordinate( 0, 0 ); - for ( Args::const_iterator i = tqparents.begin(); i != tqparents.end(); ++i ) + for ( Args::const_iterator i = parents.begin(); i != parents.end(); ++i ) { Coordinate point = static_cast( *i )->coordinate(); centerofmass3 += point; @@ -87,46 +87,46 @@ bool TriangleB3PType::canMove( const ObjectTypeCalcer& o ) const bool TriangleB3PType::isFreelyTranslatable( const ObjectTypeCalcer& o ) const { - std::vector tqparents = o.tqparents(); - return tqparents[0]->isFreelyTranslatable() && - tqparents[1]->isFreelyTranslatable() && - tqparents[2]->isFreelyTranslatable(); + std::vector parents = o.parents(); + return parents[0]->isFreelyTranslatable() && + parents[1]->isFreelyTranslatable() && + parents[2]->isFreelyTranslatable(); } void TriangleB3PType::move( ObjectTypeCalcer& o, const Coordinate& to, const KigDocument& d ) const { - std::vector tqparents = o.tqparents(); - assert( margsparser.checkArgs( tqparents ) ); - const Coordinate a = static_cast( tqparents[0]->imp() )->coordinate(); - const Coordinate b = static_cast( tqparents[1]->imp() )->coordinate(); - const Coordinate c = static_cast( tqparents[2]->imp() )->coordinate(); - if ( tqparents[0]->canMove() ) - tqparents[0]->move( to, d ); - if ( tqparents[1]->canMove() ) - tqparents[1]->move( to + b - a, d ); - if ( tqparents[2]->canMove() ) - tqparents[2]->move( to + c - a, d ); + std::vector parents = o.parents(); + assert( margsparser.checkArgs( parents ) ); + const Coordinate a = static_cast( parents[0]->imp() )->coordinate(); + const Coordinate b = static_cast( parents[1]->imp() )->coordinate(); + const Coordinate c = static_cast( parents[2]->imp() )->coordinate(); + if ( parents[0]->canMove() ) + parents[0]->move( to, d ); + if ( parents[1]->canMove() ) + parents[1]->move( to + b - a, d ); + if ( parents[2]->canMove() ) + parents[2]->move( to + c - a, d ); } const Coordinate TriangleB3PType::moveReferencePoint( const ObjectTypeCalcer& o ) const { - std::vector tqparents = o.tqparents(); - assert( margsparser.checkArgs( tqparents ) ); - return static_cast( tqparents[0]->imp() )->coordinate(); + std::vector parents = o.parents(); + assert( margsparser.checkArgs( parents ) ); + return static_cast( parents[0]->imp() )->coordinate(); } std::vector TriangleB3PType::movableParents( const ObjectTypeCalcer& ourobj ) const { - std::vector tqparents = ourobj.tqparents(); + std::vector parents = ourobj.parents(); std::set ret; - std::vector tmp = tqparents[0]->movableParents(); + std::vector tmp = parents[0]->movableParents(); ret.insert( tmp.begin(), tmp.end() ); - tmp = tqparents[1]->movableParents(); + tmp = parents[1]->movableParents(); ret.insert( tmp.begin(), tmp.end() ); - tmp = tqparents[2]->movableParents(); + tmp = parents[2]->movableParents(); ret.insert( tmp.begin(), tmp.end() ); - ret.insert( tqparents.begin(), tqparents.end() ); + ret.insert( parents.begin(), parents.end() ); return std::vector( ret.begin(), ret.end() ); } @@ -151,11 +151,11 @@ const PolygonBNPType* PolygonBNPType::instance() return &s; } -ObjectImp* PolygonBNPType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* PolygonBNPType::calc( const Args& parents, const KigDocument& ) const { - uint count = tqparents.size(); + uint count = parents.size(); assert (count >= 3); /* non sono ammessi poligoni con meno di tre lati */ -// if ( tqparents[0] != tqparents[count] ) return new InvalidImp; +// if ( parents[0] != parents[count] ) return new InvalidImp; std::vector points; uint npoints = 0; @@ -164,8 +164,8 @@ ObjectImp* PolygonBNPType::calc( const Args& tqparents, const KigDocument& ) con for ( uint i = 0; i < count; ++i ) { npoints++; - if ( ! tqparents[i]->inherits( PointImp::stype() ) ) return new InvalidImp; - Coordinate point = static_cast( tqparents[i] )->coordinate(); + if ( ! parents[i]->inherits( PointImp::stype() ) ) return new InvalidImp; + Coordinate point = static_cast( parents[i] )->coordinate(); centerofmassn += point; points.push_back( point ); } @@ -204,10 +204,10 @@ bool PolygonBNPType::canMove( const ObjectTypeCalcer& o ) const bool PolygonBNPType::isFreelyTranslatable( const ObjectTypeCalcer& o ) const { - std::vector tqparents = o.tqparents(); - for ( uint i = 0; i < tqparents.size(); ++i ) + std::vector parents = o.parents(); + for ( uint i = 0; i < parents.size(); ++i ) { - if ( !tqparents[i]->isFreelyTranslatable() ) return false; + if ( !parents[i]->isFreelyTranslatable() ) return false; } return true; } @@ -215,32 +215,32 @@ bool PolygonBNPType::isFreelyTranslatable( const ObjectTypeCalcer& o ) const void PolygonBNPType::move( ObjectTypeCalcer& o, const Coordinate& to, const KigDocument& d ) const { - std::vector tqparents = o.tqparents(); - const Coordinate ref = static_cast( tqparents[0]->imp() )->coordinate(); - for ( uint i = 0; i < tqparents.size(); ++i ) + std::vector parents = o.parents(); + const Coordinate ref = static_cast( parents[0]->imp() )->coordinate(); + for ( uint i = 0; i < parents.size(); ++i ) { - const Coordinate a = static_cast( tqparents[i]->imp() )->coordinate(); - tqparents[i]->move( to + a - ref, d ); + const Coordinate a = static_cast( parents[i]->imp() )->coordinate(); + parents[i]->move( to + a - ref, d ); } } const Coordinate PolygonBNPType::moveReferencePoint( const ObjectTypeCalcer& o ) const { - std::vector tqparents = o.tqparents(); - return static_cast( tqparents[0]->imp() )->coordinate(); + std::vector parents = o.parents(); + return static_cast( parents[0]->imp() )->coordinate(); } std::vector PolygonBNPType::movableParents( const ObjectTypeCalcer& ourobj ) const { - std::vector tqparents = ourobj.tqparents(); + std::vector parents = ourobj.parents(); std::set ret; - for ( uint i = 0; i < tqparents.size(); ++i ) + for ( uint i = 0; i < parents.size(); ++i ) { - std::vector tmp = tqparents[i]->movableParents(); + std::vector tmp = parents[i]->movableParents(); ret.insert( tmp.begin(), tmp.end() ); } - ret.insert( tqparents.begin(), tqparents.end() ); + ret.insert( parents.begin(), parents.end() ); return std::vector( ret.begin(), ret.end() ); } @@ -281,26 +281,26 @@ const PolygonBCVType* PolygonBCVType::instance() return &s; } -ObjectImp* PolygonBCVType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* PolygonBCVType::calc( const Args& parents, const KigDocument& ) const { - if ( tqparents.size() < 3 || tqparents.size() > 4 ) return new InvalidImp; + if ( parents.size() < 3 || parents.size() > 4 ) return new InvalidImp; - if ( ( ! tqparents[0]->inherits( PointImp::stype() ) ) || - ( ! tqparents[1]->inherits( PointImp::stype() ) ) || - ( ! tqparents[2]->inherits( IntImp::stype() ) ) ) + if ( ( ! parents[0]->inherits( PointImp::stype() ) ) || + ( ! parents[1]->inherits( PointImp::stype() ) ) || + ( ! parents[2]->inherits( IntImp::stype() ) ) ) return new InvalidImp; const Coordinate center = - static_cast( tqparents[0] )->coordinate(); + static_cast( parents[0] )->coordinate(); const Coordinate vertex = - static_cast( tqparents[1] )->coordinate(); + static_cast( parents[1] )->coordinate(); const int sides = - static_cast( tqparents[2] )->data(); + static_cast( parents[2] )->data(); int twist = 1; - if ( tqparents.size() == 4 ) + if ( parents.size() == 4 ) { - if ( ! tqparents[3]->inherits( IntImp::stype() ) ) return new InvalidImp; - twist = static_cast( tqparents[3] )->data(); + if ( ! parents[3]->inherits( IntImp::stype() ) ) return new InvalidImp; + twist = static_cast( parents[3] )->data(); } std::vector vertexes; @@ -359,43 +359,43 @@ bool PolygonBCVType::canMove( const ObjectTypeCalcer& o ) const bool PolygonBCVType::isFreelyTranslatable( const ObjectTypeCalcer& o ) const { - std::vector tqparents = o.tqparents(); - return tqparents[0]->isFreelyTranslatable() && - tqparents[1]->isFreelyTranslatable(); + std::vector parents = o.parents(); + return parents[0]->isFreelyTranslatable() && + parents[1]->isFreelyTranslatable(); } void PolygonBCVType::move( ObjectTypeCalcer& o, const Coordinate& to, const KigDocument& d ) const { - std::vector tqparents = o.tqparents(); - // assert( margsparser.checkArgs( tqparents ) ); - if ( ! tqparents[0]->imp()->inherits( PointImp::stype() ) || - ! tqparents[1]->imp()->inherits( PointImp::stype() ) ) return; + std::vector parents = o.parents(); + // assert( margsparser.checkArgs( parents ) ); + if ( ! parents[0]->imp()->inherits( PointImp::stype() ) || + ! parents[1]->imp()->inherits( PointImp::stype() ) ) return; - const Coordinate a = static_cast( tqparents[0]->imp() )->coordinate(); - const Coordinate b = static_cast( tqparents[1]->imp() )->coordinate(); - tqparents[0]->move( to, d ); - tqparents[1]->move( to + b - a, d ); + const Coordinate a = static_cast( parents[0]->imp() )->coordinate(); + const Coordinate b = static_cast( parents[1]->imp() )->coordinate(); + parents[0]->move( to, d ); + parents[1]->move( to + b - a, d ); } const Coordinate PolygonBCVType::moveReferencePoint( const ObjectTypeCalcer& o) const { - std::vector tqparents = o.tqparents(); - // assert( margsparser.checkArgs( tqparents ) ); - if ( ! tqparents[0]->imp()->inherits( PointImp::stype() ) ) return Coordinate::invalidCoord(); + std::vector parents = o.parents(); + // assert( margsparser.checkArgs( parents ) ); + if ( ! parents[0]->imp()->inherits( PointImp::stype() ) ) return Coordinate::invalidCoord(); - return static_cast( tqparents[0]->imp() )->coordinate(); + return static_cast( parents[0]->imp() )->coordinate(); } std::vector PolygonBCVType::movableParents( const ObjectTypeCalcer& ourobj ) const { - std::vector tqparents = ourobj.tqparents(); + std::vector parents = ourobj.parents(); std::set ret; - std::vector tmp = tqparents[0]->movableParents(); + std::vector tmp = parents[0]->movableParents(); ret.insert( tmp.begin(), tmp.end() ); - tmp = tqparents[1]->movableParents(); + tmp = parents[1]->movableParents(); ret.insert( tmp.begin(), tmp.end() ); - ret.insert( &tqparents[0], &tqparents[1] ); + ret.insert( &parents[0], &parents[1] ); return std::vector( ret.begin(), ret.end() ); } @@ -443,23 +443,23 @@ const PolygonLineIntersectionType* PolygonLineIntersectionType::instance() * vertex of the polygon. */ -ObjectImp* PolygonLineIntersectionType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* PolygonLineIntersectionType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents ) ) return new InvalidImp; + if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; - const PolygonImp* polygon = static_cast( tqparents[0] ); + const PolygonImp* polygon = static_cast( parents[0] ); const std::vector ppoints = polygon->points(); - const LineData line = static_cast( tqparents[1] )->data(); + const LineData line = static_cast( parents[1] )->data(); Coordinate intersections[2]; uint whichintersection = 0; bool boundleft = false; bool boundright = false; - if ( tqparents[1]->inherits( SegmentImp::stype() ) ) + if ( parents[1]->inherits( SegmentImp::stype() ) ) { boundleft = boundright = true; } - if ( tqparents[1]->inherits( RayImp::stype() ) ) + if ( parents[1]->inherits( RayImp::stype() ) ) { boundleft = true; } @@ -562,12 +562,12 @@ const PolygonVertexType* PolygonVertexType::instance() return &t; } -ObjectImp* PolygonVertexType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* PolygonVertexType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents ) ) return new InvalidImp; + if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; - const std::vector ppoints = static_cast( tqparents[0] )->points(); - const uint i = static_cast( tqparents[1] )->data(); + const std::vector ppoints = static_cast( parents[0] )->points(); + const uint i = static_cast( parents[1] )->data(); if ( i >= ppoints.size() ) return new InvalidImp; @@ -605,12 +605,12 @@ const PolygonSideType* PolygonSideType::instance() return &t; } -ObjectImp* PolygonSideType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* PolygonSideType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents ) ) return new InvalidImp; + if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; - const std::vector ppoints = static_cast( tqparents[0] )->points(); - const uint i = static_cast( tqparents[1] )->data(); + const std::vector ppoints = static_cast( parents[0] )->points(); + const uint i = static_cast( parents[1] )->data(); if ( i >= ppoints.size() ) return new InvalidImp; @@ -650,11 +650,11 @@ const ConvexHullType* ConvexHullType::instance() return &t; } -ObjectImp* ConvexHullType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* ConvexHullType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents ) ) return new InvalidImp; + if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; - const std::vector ppoints = static_cast( tqparents[0] )->points(); + const std::vector ppoints = static_cast( parents[0] )->points(); if ( ppoints.size() < 3 ) return new InvalidImp; diff --git a/kig/objects/polygon_type.h b/kig/objects/polygon_type.h index 09a77da8..a49100bd 100644 --- a/kig/objects/polygon_type.h +++ b/kig/objects/polygon_type.h @@ -31,7 +31,7 @@ class TriangleB3PType public: static const TriangleB3PType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; bool canMove( const ObjectTypeCalcer& o ) const; bool isFreelyTranslatable( const ObjectTypeCalcer& o ) const; @@ -52,10 +52,10 @@ class PolygonBNPType public: static const PolygonBNPType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; - const ObjectImpType* impRequirement( const ObjectImp* o, const Args& tqparents ) const; - bool isDefinedOnOrThrough( const ObjectImp* o, const Args& tqparents ) const; + const ObjectImpType* impRequirement( const ObjectImp* o, const Args& parents ) const; + bool isDefinedOnOrThrough( const ObjectImp* o, const Args& parents ) const; std::vector sortArgs( const std::vector& args ) const; Args sortArgs( const Args& args ) const; @@ -78,11 +78,11 @@ class PolygonBCVType public: static const PolygonBCVType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; - const ObjectImpType* impRequirement( const ObjectImp* o, const Args& tqparents ) const; - bool isDefinedOnOrThrough( const ObjectImp* o, const Args& tqparents ) const; + const ObjectImpType* impRequirement( const ObjectImp* o, const Args& parents ) const; + bool isDefinedOnOrThrough( const ObjectImp* o, const Args& parents ) const; std::vector sortArgs( const std::vector& args ) const; Args sortArgs( const Args& args ) const; bool canMove( const ObjectTypeCalcer& o ) const; @@ -100,7 +100,7 @@ class PolygonLineIntersectionType ~PolygonLineIntersectionType(); public: static const PolygonLineIntersectionType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; }; @@ -111,7 +111,7 @@ class PolygonVertexType ~PolygonVertexType(); public: static const PolygonVertexType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; }; @@ -122,7 +122,7 @@ class PolygonSideType ~PolygonSideType(); public: static const PolygonSideType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; }; @@ -133,7 +133,7 @@ class ConvexHullType ~ConvexHullType(); public: static const ConvexHullType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; }; #endif diff --git a/kig/objects/special_calcers.cc b/kig/objects/special_calcers.cc index 281017b5..e70bd4e9 100644 --- a/kig/objects/special_calcers.cc +++ b/kig/objects/special_calcers.cc @@ -26,7 +26,7 @@ static const ArgsParser::spec argsspecMeasureTransport[] = static ArgsParser measuretransportargsparser( argsspecMeasureTransport, 3 ); -std::vector MeasureTransportCalcer::tqparents() const +std::vector MeasureTransportCalcer::parents() const { std::vector ret; ret.push_back( mcircle ); @@ -46,7 +46,7 @@ MeasureTransportCalcer::~MeasureTransportCalcer() void MeasureTransportCalcer::calc( const KigDocument& ) { - if ( ! measuretransportargsparser.checkArgs( tqparents() ) ) + if ( ! measuretransportargsparser.checkArgs( parents() ) ) return new InvalidImp(); if ( ! isPointOnCurve( mpoint, mcircle ) ) diff --git a/kig/objects/special_calcers.h b/kig/objects/special_calcers.h index 812d7ee5..640587cc 100644 --- a/kig/objects/special_calcers.h +++ b/kig/objects/special_calcers.h @@ -29,7 +29,7 @@ public: MeasureTransportCalcer(ObjectCalcer* circle, ObjectCalcer* point, ObjectCalcer* segment ); ~MeasureTransportCalcer(); - std::vector tqparents() const; + std::vector parents() const; void calc( const KigDocument& ); const ObjectImpType* impRequirement( ObjectCalcer* o, const std::vector& os ) const; diff --git a/kig/objects/tests_type.cc b/kig/objects/tests_type.cc index a0a072bf..e85c111e 100644 --- a/kig/objects/tests_type.cc +++ b/kig/objects/tests_type.cc @@ -51,11 +51,11 @@ const AreParallelType* AreParallelType::instance() return &t; } -ObjectImp* AreParallelType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* AreParallelType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents ) ) return new InvalidImp; - const LineData& l1 = static_cast( tqparents[0] )->data(); - const LineData& l2 = static_cast( tqparents[1] )->data(); + if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; + const LineData& l1 = static_cast( parents[0] )->data(); + const LineData& l2 = static_cast( parents[1] )->data(); if ( l1.isParallelTo( l2 ) ) return new TestResultImp( i18n( "These lines are parallel." ) ); @@ -95,11 +95,11 @@ const AreOrthogonalType* AreOrthogonalType::instance() return &t; } -ObjectImp* AreOrthogonalType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* AreOrthogonalType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents ) ) return new InvalidImp; - const LineData& l1 = static_cast( tqparents[0] )->data(); - const LineData& l2 = static_cast( tqparents[1] )->data(); + if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; + const LineData& l1 = static_cast( parents[0] )->data(); + const LineData& l2 = static_cast( parents[1] )->data(); if ( l1.isOrthogonalTo( l2 ) ) return new TestResultImp( i18n( "These lines are orthogonal." ) ); @@ -141,12 +141,12 @@ const AreCollinearType* AreCollinearType::instance() return &t; } -ObjectImp* AreCollinearType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* AreCollinearType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents ) ) return new InvalidImp; - const Coordinate& p1 = static_cast( tqparents[0] )->coordinate(); - const Coordinate& p2 = static_cast( tqparents[1] )->coordinate(); - const Coordinate& p3 = static_cast( tqparents[2] )->coordinate(); + if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; + const Coordinate& p1 = static_cast( parents[0] )->coordinate(); + const Coordinate& p2 = static_cast( parents[1] )->coordinate(); + const Coordinate& p3 = static_cast( parents[2] )->coordinate(); if ( areCollinear( p1, p2, p3 ) ) return new TestResultImp( i18n( "These points are collinear." ) ); @@ -184,11 +184,11 @@ const ContainsTestType* ContainsTestType::instance() return &t; } -ObjectImp* ContainsTestType::calc( const Args& tqparents, const KigDocument& doc ) const +ObjectImp* ContainsTestType::calc( const Args& parents, const KigDocument& doc ) const { - if ( ! margsparser.checkArgs( tqparents ) ) return new InvalidImp; - const Coordinate& p = static_cast( tqparents[0] )->coordinate(); - const CurveImp* c = static_cast( tqparents[1] ); + if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; + const Coordinate& p = static_cast( parents[0] )->coordinate(); + const CurveImp* c = static_cast( parents[1] ); if ( c->containsPoint( p, doc ) ) return new TestResultImp( i18n( "This curve contains the point." ) ); @@ -230,11 +230,11 @@ const InPolygonTestType* InPolygonTestType::instance() return &t; } -ObjectImp* InPolygonTestType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* InPolygonTestType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents ) ) return new InvalidImp; - const Coordinate& p = static_cast( tqparents[0] )->coordinate(); - const PolygonImp* pol = static_cast( tqparents[1] ); + if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; + const Coordinate& p = static_cast( parents[0] )->coordinate(); + const PolygonImp* pol = static_cast( parents[1] ); if ( pol->isInPolygon( p ) ) return new TestResultImp( i18n( "This polygon contains the point." ) ); @@ -274,10 +274,10 @@ const ConvexPolygonTestType* ConvexPolygonTestType::instance() return &t; } -ObjectImp* ConvexPolygonTestType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* ConvexPolygonTestType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents ) ) return new InvalidImp; - const PolygonImp* pol = static_cast( tqparents[0] ); + if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; + const PolygonImp* pol = static_cast( parents[0] ); if ( pol->isConvex() ) return new TestResultImp( i18n( "This polygon is convex." ) ); @@ -321,12 +321,12 @@ const SameDistanceType* SameDistanceType::instance() return &t; } -ObjectImp* SameDistanceType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* SameDistanceType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents ) ) return new InvalidImp; - const Coordinate& p1 = static_cast( tqparents[0] )->coordinate(); - const Coordinate& p2 = static_cast( tqparents[1] )->coordinate(); - const Coordinate& p3 = static_cast( tqparents[2] )->coordinate(); + if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; + const Coordinate& p1 = static_cast( parents[0] )->coordinate(); + const Coordinate& p2 = static_cast( parents[1] )->coordinate(); + const Coordinate& p3 = static_cast( parents[2] )->coordinate(); if ( fabs( ( p1 - p2 ).length() - ( p1 - p3 ).length() ) < 10e-5 ) return new TestResultImp( i18n( "The two distances are the same." ) ); @@ -364,11 +364,11 @@ const VectorEqualityTestType* VectorEqualityTestType::instance() return &t; } -ObjectImp* VectorEqualityTestType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* VectorEqualityTestType::calc( const Args& parents, const KigDocument& ) const { - if ( ! margsparser.checkArgs( tqparents ) ) return new InvalidImp; - const Coordinate& v1 = static_cast( tqparents[0] )->dir(); - const Coordinate& v2 = static_cast( tqparents[1] )->dir(); + if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp; + const Coordinate& v1 = static_cast( parents[0] )->dir(); + const Coordinate& v2 = static_cast( parents[1] )->dir(); if ( ( v1 - v2 ).length() < 10e-5 ) return new TestResultImp( i18n( "The two vectors are the same." ) ); diff --git a/kig/objects/tests_type.h b/kig/objects/tests_type.h index 4bc96f8c..7498fc4f 100644 --- a/kig/objects/tests_type.h +++ b/kig/objects/tests_type.h @@ -27,7 +27,7 @@ class AreParallelType ~AreParallelType(); public: static const AreParallelType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; }; @@ -38,7 +38,7 @@ class AreOrthogonalType ~AreOrthogonalType(); public: static const AreOrthogonalType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; }; @@ -49,7 +49,7 @@ class AreCollinearType ~AreCollinearType(); public: static const AreCollinearType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; }; @@ -60,7 +60,7 @@ class ContainsTestType ~ContainsTestType(); public: static const ContainsTestType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; }; @@ -71,7 +71,7 @@ class InPolygonTestType ~InPolygonTestType(); public: static const InPolygonTestType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; }; @@ -82,7 +82,7 @@ class ConvexPolygonTestType ~ConvexPolygonTestType(); public: static const ConvexPolygonTestType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; }; @@ -93,7 +93,7 @@ class SameDistanceType ~SameDistanceType(); public: static const SameDistanceType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; }; @@ -104,7 +104,7 @@ class VectorEqualityTestType ~VectorEqualityTestType(); public: static const VectorEqualityTestType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& ) const; + ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; }; diff --git a/kig/objects/text_type.cc b/kig/objects/text_type.cc index 5fc637bd..09e84c30 100644 --- a/kig/objects/text_type.cc +++ b/kig/objects/text_type.cc @@ -76,11 +76,11 @@ const ObjectImpType* TextType::impRequirement( const ObjectImp* o, const Args& a return ObjectImp::stype(); } -ObjectImp* TextType::calc( const Args& tqparents, const KigDocument& doc ) const +ObjectImp* TextType::calc( const Args& parents, const KigDocument& doc ) const { - if( tqparents.size() < 3 ) return new InvalidImp; - Args firstthree( tqparents.begin(), tqparents.begin() + 3 ); - Args varargs( tqparents.begin() + 3, tqparents.end() ); + if( parents.size() < 3 ) return new InvalidImp; + Args firstthree( parents.begin(), parents.begin() + 3 ); + Args varargs( parents.begin() + 3, parents.end() ); if ( ! mparser.checkArgs( firstthree ) ) return new InvalidImp; @@ -108,9 +108,9 @@ bool TextType::isFreelyTranslatable( const ObjectTypeCalcer& ) const void TextType::move( ObjectTypeCalcer& ourobj, const Coordinate& to, const KigDocument& d ) const { - const std::vector tqparents = ourobj.tqparents(); - assert( tqparents.size() >= 3 ); - const std::vector firstthree( tqparents.begin(), tqparents.begin() + 3 ); + const std::vector parents = ourobj.parents(); + assert( parents.size() >= 3 ); + const std::vector firstthree( parents.begin(), parents.begin() + 3 ); if( dynamic_cast( firstthree[1] ) ) { ObjectConstCalcer* c = static_cast( firstthree[1] ); @@ -133,10 +133,10 @@ void TextType::executeAction( int i, ObjectHolder& o, ObjectTypeCalcer& c, KigPart& doc, KigWidget&, NormalMode& ) const { - std::vector tqparents = c.tqparents(); - assert( tqparents.size() >= 3 ); + std::vector parents = c.parents(); + assert( parents.size() >= 3 ); - std::vector firstthree( tqparents.begin(), tqparents.begin() + 3 ); + std::vector firstthree( parents.begin(), parents.begin() + 3 ); assert( mparser.checkArgs( firstthree ) ); assert( dynamic_cast( firstthree[0] ) ); @@ -201,10 +201,10 @@ Args TextType::sortArgs( const Args& args ) const std::vector TextType::movableParents( const ObjectTypeCalcer& ourobj ) const { - const std::vector tqparents = ourobj.tqparents(); - assert( tqparents.size() >= 3 ); - std::vector ret = tqparents[1]->movableParents(); - ret.push_back( tqparents[1] ); + const std::vector parents = ourobj.parents(); + assert( parents.size() >= 3 ); + std::vector ret = parents[1]->movableParents(); + ret.push_back( parents[1] ); return ret; } diff --git a/kig/objects/text_type.h b/kig/objects/text_type.h index 5968e040..8f97d4ea 100644 --- a/kig/objects/text_type.h +++ b/kig/objects/text_type.h @@ -29,11 +29,11 @@ class TextType public: static const TextType* instance(); - const ObjectImpType* impRequirement( const ObjectImp* o, const Args& tqparents ) const; - bool isDefinedOnOrThrough( const ObjectImp* o, const Args& tqparents ) const; + const ObjectImpType* impRequirement( const ObjectImp* o, const Args& parents ) const; + bool isDefinedOnOrThrough( const ObjectImp* o, const Args& parents ) const; const ObjectImpType* resultId() const; - ObjectImp* calc( const Args& tqparents, const KigDocument& d ) const; + ObjectImp* calc( const Args& parents, const KigDocument& d ) const; std::vector sortArgs( const std::vector& os ) const; Args sortArgs( const Args& args ) const; diff --git a/kig/scripting/newscriptwizardbase.ui b/kig/scripting/newscriptwizardbase.ui index c3020c00..8c58bd2e 100644 --- a/kig/scripting/newscriptwizardbase.ui +++ b/kig/scripting/newscriptwizardbase.ui @@ -74,7 +74,7 @@ in the Kig window and press "Next". - + ktextedit.h diff --git a/kig/scripting/python_type.cc b/kig/scripting/python_type.cc index 0b73cda4..cc5a00ea 100644 --- a/kig/scripting/python_type.cc +++ b/kig/scripting/python_type.cc @@ -108,12 +108,12 @@ const ObjectImpType* PythonCompileType::resultId() const return PythonCompiledScriptImp::stype(); } -ObjectImp* PythonCompileType::calc( const Args& tqparents, const KigDocument& ) const +ObjectImp* PythonCompileType::calc( const Args& parents, const KigDocument& ) const { - assert( tqparents.size() == 1 ); - if ( !tqparents[0]->inherits( StringImp::stype() ) ) return new InvalidImp; + assert( parents.size() == 1 ); + if ( !parents[0]->inherits( StringImp::stype() ) ) return new InvalidImp; - const StringImp* si = static_cast( tqparents[0] ); + const StringImp* si = static_cast( parents[0] ); TQString s = si->data(); CompiledPythonScript cs = PythonScripter::instance()->compile( s.latin1() ); @@ -141,20 +141,20 @@ const PythonExecuteType* PythonExecuteType::instance() return &t; } -ObjectImp* PythonExecuteType::calc( const Args& tqparents, const KigDocument& d ) const +ObjectImp* PythonExecuteType::calc( const Args& parents, const KigDocument& d ) const { - assert( tqparents.size() >= 1 ); - if( !tqparents[0]->inherits( PythonCompiledScriptImp::stype() ) ) return new InvalidImp; + assert( parents.size() >= 1 ); + if( !parents[0]->inherits( PythonCompiledScriptImp::stype() ) ) return new InvalidImp; - CompiledPythonScript& script = static_cast( tqparents[0] )->data(); + CompiledPythonScript& script = static_cast( parents[0] )->data(); - Args args( tqparents.begin() + 1, tqparents.end() ); + Args args( parents.begin() + 1, parents.end() ); return script.calc( args, d ); } -const ObjectImpType* PythonExecuteType::impRequirement( const ObjectImp* o, const Args& tqparents ) const +const ObjectImpType* PythonExecuteType::impRequirement( const ObjectImp* o, const Args& parents ) const { - if ( o == tqparents[0] ) return PythonCompiledScriptImp::stype(); + if ( o == parents[0] ) return PythonCompiledScriptImp::stype(); else return ObjectImp::stype(); } diff --git a/kig/scripting/python_type.h b/kig/scripting/python_type.h index 871cfc17..db623ab6 100644 --- a/kig/scripting/python_type.h +++ b/kig/scripting/python_type.h @@ -28,10 +28,10 @@ class PythonCompileType public: static const PythonCompileType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& d ) const; + ObjectImp* calc( const Args& parents, const KigDocument& d ) const; - const ObjectImpType* impRequirement( const ObjectImp* o, const Args& tqparents ) const; - bool isDefinedOnOrThrough( const ObjectImp* o, const Args& tqparents ) const; + const ObjectImpType* impRequirement( const ObjectImp* o, const Args& parents ) const; + bool isDefinedOnOrThrough( const ObjectImp* o, const Args& parents ) const; const ObjectImpType* resultId() const; std::vector sortArgs( const std::vector& args ) const; @@ -46,10 +46,10 @@ class PythonExecuteType public: static const PythonExecuteType* instance(); - ObjectImp* calc( const Args& tqparents, const KigDocument& d ) const; + ObjectImp* calc( const Args& parents, const KigDocument& d ) const; - const ObjectImpType* impRequirement( const ObjectImp* o, const Args& tqparents ) const; - bool isDefinedOnOrThrough( const ObjectImp* o, const Args& tqparents ) const; + const ObjectImpType* impRequirement( const ObjectImp* o, const Args& parents ) const; + bool isDefinedOnOrThrough( const ObjectImp* o, const Args& parents ) const; const ObjectImpType* resultId() const; std::vector sortArgs( const std::vector& args ) const; diff --git a/kig/scripting/script_mode.cc b/kig/scripting/script_mode.cc index 2c6f4d80..945ad62f 100644 --- a/kig/scripting/script_mode.cc +++ b/kig/scripting/script_mode.cc @@ -275,10 +275,10 @@ ScriptEditMode::ScriptEditMode( ObjectTypeCalcer* exec_calc, KigPart& doc ) { mwawd = EnteringCode; - mexecargs = mexecuted->tqparents(); + mexecargs = mexecuted->parents(); assert( mexecargs.size() >= 1 ); - mcompiledargs = mexecargs[0]->tqparents(); + mcompiledargs = mexecargs[0]->parents(); assert( mcompiledargs.size() == 1 ); const ObjectImp* imp = static_cast( mcompiledargs[0] )->imp(); -- cgit v1.2.1