Salome HOME
Separate action "Find bottom" for context menu.
[modules/hydro.git] / src / HYDROData / HYDROData_Entity.cxx
1 // Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 #include "HYDROData_Entity.h"
24
25 #include "HYDROData_Iterator.h"
26 #include "HYDROData_Tool.h"
27
28 #include <TDataStd_Name.hxx>
29 #include <TDataStd_ByteArray.hxx>
30 #include <TDataStd_UAttribute.hxx>
31 #include <TDataStd_IntegerArray.hxx>
32 #include <TDataStd_BooleanArray.hxx>
33 #include <TDataStd_Integer.hxx>
34 #include <TDataStd_RealArray.hxx>
35 #include <TDataStd_ReferenceList.hxx>
36
37 #include <TDF_CopyLabel.hxx>
38 #include <TDF_ListIteratorOfLabelList.hxx>
39
40 #include <QColor>
41 #include <QString>
42 #include <QStringList>
43 #include <QVariant>
44
45 static const Standard_GUID GUID_MUST_BE_UPDATED("80f2bb81-3873-4631-8ddd-940d2119f000");
46
47 IMPLEMENT_STANDARD_HANDLE(HYDROData_Entity,MMgt_TShared)
48 IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Entity,MMgt_TShared)
49
50 // is equal function for unique object mapping
51 bool IsEqual(const Handle_HYDROData_Entity& theObj1, const Handle_HYDROData_Entity& theObj2)
52 {
53   if ( !theObj1.IsNull() && !theObj2.IsNull() )
54     return theObj1->Label() == theObj2->Label();
55   return false;
56 }
57
58 QString HYDROData_Entity::GetName() const
59 {
60   Handle(TDataStd_Name) aName;
61   if (myLab.FindAttribute(TDataStd_Name::GetID(), aName)) {
62     TCollection_AsciiString aStr(aName->Get());
63     return QString(aStr.ToCString());
64   }
65   return QString();
66 }
67
68 QString HYDROData_Entity::GetObjPyName() const
69 {
70   QString aName = GetName();
71   aName.replace(QRegExp("[\\W]"), "_");
72
73   return aName;
74 }
75
76 void HYDROData_Entity::SetName(const QString& theName)
77 {
78   TDataStd_Name::Set(myLab, TCollection_ExtendedString(theName.toLatin1().constData()));
79 }
80
81 QStringList HYDROData_Entity::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
82 {
83   QStringList anEmptyList;
84   return anEmptyList;
85 }
86
87 void HYDROData_Entity::Update()
88 {
89   SetToUpdate( false );
90 }
91
92 void HYDROData_Entity::UpdateLocalCS( double theDx, double theDy )
93 {
94   //On the base level no actions are necessary
95 }
96
97 bool HYDROData_Entity::IsHas2dPrs() const
98 {
99   return false;
100 }
101
102 void HYDROData_Entity::Show()
103 {
104   if ( !IsHas2dPrs() )
105     return;
106
107   Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
108   if ( aDocument.IsNull() )
109     return;
110
111   aDocument->Show( this );
112 }
113
114 QVariant HYDROData_Entity::GetDataVariant()
115 {
116   return QVariant();
117 }
118
119 void HYDROData_Entity::SetToUpdate( bool theFlag )
120 {
121   if ( IsMustBeUpdated() == theFlag )
122     return;
123
124   if ( theFlag )
125   {
126     TDataStd_UAttribute::Set( myLab, GUID_MUST_BE_UPDATED );
127
128     Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
129     if ( !aDocument.IsNull() )
130     {
131       // Change the states of this and all depended objects
132       HYDROData_Tool::SetMustBeUpdatedObjects( aDocument );
133     }
134   }
135   else
136   {
137     myLab.ForgetAttribute( GUID_MUST_BE_UPDATED );
138   }
139 }
140
141 bool HYDROData_Entity::IsMustBeUpdated() const
142 {
143   return myLab.IsAttribute( GUID_MUST_BE_UPDATED );
144 }
145
146 bool HYDROData_Entity::CanBeUpdated() const
147 {
148   return true;
149 }
150
151 bool HYDROData_Entity::IsRemoved() const
152 {
153   return !myLab.HasAttribute();
154 }
155
156 void HYDROData_Entity::Remove()
157 {
158   return myLab.ForgetAllAttributes( true );
159 }
160
161 bool HYDROData_Entity::CanRemove()
162 {
163   return true;
164 }
165
166 HYDROData_Entity::HYDROData_Entity()
167 {
168 }
169
170 HYDROData_Entity::~HYDROData_Entity()
171 {
172 }
173
174 void HYDROData_Entity::CopyTo( const Handle(HYDROData_Entity)& theDestination ) const
175 {
176   TDF_CopyLabel aCopy(myLab, theDestination->Label());
177   aCopy.Perform();
178 }
179
180 Handle(HYDROData_Entity) HYDROData_Entity::GetFatherObject() const
181 {
182   Handle(HYDROData_Entity) aFather;
183
184   if ( !myLab.IsNull() )
185   {
186     TDF_Label aFatherLabel = myLab.Father();
187
188     while ( aFather.IsNull() && !aFatherLabel.IsNull() && !aFatherLabel.IsRoot() )
189     {
190       aFather = HYDROData_Iterator::Object( aFatherLabel );
191       aFatherLabel = aFatherLabel.Father();
192     }
193   }
194
195   return aFather;
196 }
197
198 HYDROData_SequenceOfObjects HYDROData_Entity::GetAllReferenceObjects() const
199 {
200   return HYDROData_SequenceOfObjects();
201 }
202
203 Standard_Boolean HYDROData_Entity::GetZLevel( Standard_Integer& theLevel ) const
204 {
205   theLevel = -1;
206
207   TDF_Label aLabel = myLab.FindChild( DataTag_ZLevel, false );
208   if ( !aLabel.IsNull() )
209   {
210     Handle(TDataStd_Integer) anIntVal;
211     if ( aLabel.FindAttribute( TDataStd_Integer::GetID(), anIntVal ) )
212     {
213       theLevel = anIntVal->Get();
214       return Standard_True;
215     }
216   }
217
218   return Standard_False;
219 }
220
221 void HYDROData_Entity::SetZLevel( const Standard_Integer& theLevel )
222 {
223   TDataStd_Integer::Set( myLab.FindChild( DataTag_ZLevel ), theLevel );
224 }
225
226 void HYDROData_Entity::RemoveZLevel()
227 {
228   TDF_Label aLabel = myLab.FindChild( DataTag_ZLevel, false );
229   if ( !aLabel.IsNull() )
230     aLabel.ForgetAllAttributes();
231 }
232
233 void HYDROData_Entity::SetLabel( const TDF_Label& theLabel )
234 {
235   myLab = theLabel;
236 }
237
238 void HYDROData_Entity::SaveByteArray( const int   theTag, 
239                                       const char* theData,
240                                       const int   theLen )
241 {
242   TDF_Label aLab = theTag == 0 ? myLab : myLab.FindChild(theTag);
243   // array is empty, remove the attribute
244   if (theLen <= 0) {
245     aLab.ForgetAttribute(TDataStd_ByteArray::GetID());
246     return;
247   }
248   // store data of image in byte array
249   Handle(TDataStd_ByteArray) aData;
250   if (!aLab.FindAttribute(TDataStd_ByteArray::GetID(), aData)) {
251     aData = TDataStd_ByteArray::Set(aLab, 1, theLen);
252   }
253   // copy bytes one by one
254   if (aData->Length() != theLen) {
255     Handle(TColStd_HArray1OfByte) aNewData = new TColStd_HArray1OfByte(1, theLen);
256     for(int a = 0; a < theLen; a++)
257       aNewData->SetValue(a + 1, theData[a]);
258     aData->ChangeArray(aNewData);
259   } else {
260     for(int a = 0; a < theLen; a++)
261       aData->SetValue(a + 1, theData[a]);
262   }
263 }
264
265 const char* HYDROData_Entity::ByteArray(const int theTag, int& theLen) const
266 {
267   TDF_Label aLab = theTag == 0 ? myLab : myLab.FindChild(theTag);
268   Handle(TDataStd_ByteArray) aData;
269   if (!aLab.FindAttribute(TDataStd_ByteArray::GetID(), aData))
270     return NULL; // return empty image if there is no array
271   theLen = aData->Length();
272   if (theLen)
273     return (const char*)(&(aData->InternalArray()->ChangeArray1().ChangeValue(1)));
274   return NULL;
275 }
276
277 int HYDROData_Entity::NbReferenceObjects( const int theTag ) const
278 {
279   Handle(TDataStd_ReferenceList) aRefs = getReferenceList( theTag, false );
280   return aRefs.IsNull() ? 0 : aRefs->Extent();
281 }
282
283 bool HYDROData_Entity::HasReference( const Handle_HYDROData_Entity& theObj,
284                                      const int                      theTag ) const
285 {
286   if ( theObj.IsNull() )
287     return false;
288
289   Handle(TDataStd_ReferenceList) aRefs = getReferenceList( theTag, false );
290   if ( aRefs.IsNull() || aRefs->IsEmpty() )
291     return false;
292
293   TDF_ListIteratorOfLabelList aListIt( aRefs->List() );
294   for ( ; aListIt.More(); aListIt.Next() )
295   {
296     const TDF_Label& aRefLabel = aListIt.Value();
297     if  ( theObj->Label() == aRefLabel )
298       return true;
299   }
300
301   return false;
302 }
303
304 void HYDROData_Entity::AddReferenceObject( const Handle_HYDROData_Entity& theObj,
305                                            const int                      theTag )
306 {
307   if ( theObj.IsNull() )
308     return;
309
310   Handle(TDataStd_ReferenceList) aRefs = getReferenceList( theTag, true );
311   aRefs->Append( theObj->Label() );
312 }
313
314 void HYDROData_Entity::SetReferenceObject( const Handle_HYDROData_Entity& theObj,
315                                            const int                      theTag,
316                                            const int                      theIndex )
317 {
318   if ( theObj.IsNull() )
319   {
320     RemoveReferenceObject( theTag, theIndex );
321     return;
322   }
323
324   Handle(TDataStd_ReferenceList) aRefs = getReferenceList( theTag, true );
325
326   if ( theIndex >= aRefs->Extent() )
327   {
328     aRefs->Append( theObj->Label() );
329   }
330   else if ( theIndex < 0 )
331   {
332     aRefs->Prepend( theObj->Label() );
333   }
334   else
335   {
336     RemoveReferenceObject( theTag, theIndex );
337
338     Handle(HYDROData_Entity) aBeforeObj = GetReferenceObject( theTag, theIndex );
339
340     aRefs = getReferenceList( theTag, true ); // because reference list can be removed
341     if ( !aBeforeObj.IsNull() )
342       aRefs->InsertBefore( theObj->Label(), aBeforeObj->Label() );
343     else 
344       aRefs->Append( theObj->Label() );
345   }
346 }
347
348 void HYDROData_Entity::InsertReferenceObject( const Handle_HYDROData_Entity& theObj,
349                                               const int                      theTag,
350                                               const int                      theBeforeIndex )
351 {
352   if ( theObj.IsNull() )
353     return;
354
355   Handle(TDataStd_ReferenceList) aRefs = getReferenceList( theTag, true );
356
357   if ( theBeforeIndex >= aRefs->Extent() )
358   {
359     aRefs->Append( theObj->Label() );
360   }
361   else if ( theBeforeIndex < 0 )
362   {
363     aRefs->Prepend( theObj->Label() );
364   }
365   else
366   {
367     Handle(HYDROData_Entity) aBeforeObj = GetReferenceObject( theTag, theBeforeIndex );
368     if ( !aBeforeObj.IsNull() )
369       aRefs->InsertBefore( theObj->Label(), aBeforeObj->Label() );
370     else 
371       aRefs->Append( theObj->Label() );
372   }
373 }
374
375 void HYDROData_Entity::SetReferenceObjects( const HYDROData_SequenceOfObjects& theObjects,
376                                             const int                          theTag )
377 {
378   ClearReferenceObjects( theTag );
379   if ( theObjects.IsEmpty() )
380     return;
381
382   HYDROData_SequenceOfObjects::Iterator anIter( theObjects );
383   for ( ; anIter.More(); anIter.Next() )
384     AddReferenceObject( anIter.Value(), theTag );
385 }
386
387 Handle(HYDROData_Entity) HYDROData_Entity::GetReferenceObject( const int theTag,
388                                                                const int theIndex ) const
389 {
390   Handle(HYDROData_Entity) aRes;
391
392   Handle(TDataStd_ReferenceList) aRefs = getReferenceList( theTag, false );
393   if ( aRefs.IsNull() || theIndex < 0 || theIndex >= aRefs->Extent() )
394     return aRes;
395
396   TDF_ListIteratorOfLabelList anIter( aRefs->List() );
397   for ( int anIndex = 0; anIndex != theIndex && anIter.More(); anIter.Next(), ++anIndex );
398
399   const TDF_Label& aRefLabel = anIter.Value();
400   aRes = HYDROData_Iterator::Object( aRefLabel );
401
402   return aRes;
403 }
404
405 HYDROData_SequenceOfObjects HYDROData_Entity::GetReferenceObjects( const int theTag ) const
406 {
407   HYDROData_SequenceOfObjects aRes;
408
409   Handle(TDataStd_ReferenceList) aRefs = getReferenceList( theTag, false );
410   if ( aRefs.IsNull() )
411     return aRes;
412
413   TDF_ListIteratorOfLabelList anIter( aRefs->List() );
414   for ( ; anIter.More(); anIter.Next() )
415   {
416     const TDF_Label& aRefLabel = anIter.Value();
417
418     Handle(HYDROData_Entity) aRefObject = HYDROData_Iterator::Object( aRefLabel );
419     if ( aRefObject.IsNull() )
420       continue;
421
422     aRes.Append( aRefObject );
423   }
424
425   return aRes;
426 }
427
428 void HYDROData_Entity::RemoveReferenceObject( const TDF_Label& theRefLabel,
429                                               const int        theTag )
430 {
431   Handle(TDataStd_ReferenceList) aRefs = getReferenceList( theTag, false );
432   if ( aRefs.IsNull() )
433     return;
434
435   if ( aRefs->Extent() == 1 )
436   { 
437     // remove all if only one
438     ClearReferenceObjects( theTag );
439     return;
440   }
441
442   aRefs->Remove( theRefLabel );
443 }
444
445 void HYDROData_Entity::RemoveReferenceObject( const int theTag,
446                                               const int theIndex )
447 {
448   Handle(TDataStd_ReferenceList) aRefs = getReferenceList( theTag, false );
449   if ( aRefs.IsNull() )
450     return;
451
452   if ( aRefs->Extent() == 1 && theIndex == 0 )
453   { 
454     // remove all if only one
455     ClearReferenceObjects( theTag );
456     return;
457   }
458
459   int anIndex = 0;
460   TDF_ListIteratorOfLabelList anIter( aRefs->List() );
461   for ( ; anIndex != theIndex && anIter.More(); anIter.Next(), ++anIndex );
462
463   if ( anIndex != theIndex || !anIter.More() )
464     return;
465
466   const TDF_Label& aRefLabel = anIter.Value();
467   aRefs->Remove( aRefLabel );
468 }
469
470 void HYDROData_Entity::ClearReferenceObjects( const int theTag )
471 {
472   TDF_Label aSetLabel = theTag == 0 ? myLab : myLab.FindChild( theTag );
473   aSetLabel.ForgetAttribute( TDataStd_ReferenceList::GetID() );
474 }
475
476 Handle(TDataStd_ReferenceList) HYDROData_Entity::getReferenceList( const int theTag,
477                                                                    const bool theIsCreate ) const
478 {
479   TDF_Label aLabel = theTag == 0 ? myLab : myLab.FindChild( theTag );
480
481   Handle(TDataStd_ReferenceList) aRefs;
482   if ( !aLabel.FindAttribute( TDataStd_ReferenceList::GetID(), aRefs ) && theIsCreate )
483     aRefs = TDataStd_ReferenceList::Set( aLabel );
484
485   return aRefs;
486 }
487
488 void HYDROData_Entity::SetColor( const QColor& theColor,
489                                  const int     theTag )
490 {
491   TDF_Label aLabel = theTag == 0 ? myLab : myLab.FindChild( theTag );
492
493   Handle(TDataStd_IntegerArray) aColorArray;
494   if ( !aLabel.FindAttribute( TDataStd_IntegerArray::GetID(), aColorArray ) )
495     aColorArray = TDataStd_IntegerArray::Set( aLabel, 1, 4 );
496
497   aColorArray->SetValue( 1, theColor.red()   );
498   aColorArray->SetValue( 2, theColor.green() );
499   aColorArray->SetValue( 3, theColor.blue()  );
500   aColorArray->SetValue( 4, theColor.alpha() );
501 }
502
503 QColor HYDROData_Entity::GetColor( const QColor& theDefColor,
504                                    const int     theTag ) const
505 {
506   QColor aResColor = theDefColor;
507
508   TDF_Label aLabel = theTag == 0 ? myLab : myLab.FindChild( theTag );
509
510   Handle(TDataStd_IntegerArray) aColorArray;
511   if ( aLabel.FindAttribute( TDataStd_IntegerArray::GetID(), aColorArray ) )
512   {
513     aResColor.setRed(   aColorArray->Value( 1 ) );
514     aResColor.setGreen( aColorArray->Value( 2 ) );
515     aResColor.setBlue(  aColorArray->Value( 3 ) );
516     aResColor.setAlpha( aColorArray->Value( 4 ) );
517   }
518
519   return aResColor;
520 }
521
522 QStringList HYDROData_Entity::dumpObjectCreation( MapOfTreatedObjects& theTreatedObjects ) const
523 {
524   QStringList aResList;
525
526   Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
527   if ( aDocument.IsNull() )
528     return aResList;
529
530   QString aDocName = aDocument->GetDocPyName();
531   QString aName = GetObjPyName();
532
533   aResList << QString( "%1 = %2.CreateObject( %3 );" )
534               .arg( aName ).arg( aDocName ).arg( getPyTypeID() );
535   aResList << QString( "%1.SetName( \"%2\" );" )
536               .arg( aName ).arg( GetName() );
537   aResList << QString( "" );
538
539   if ( IsHas2dPrs() )
540   {
541     // Dump object z-level in viewer
542     Standard_Integer anObjZLevel = -1;
543     if ( GetZLevel( anObjZLevel ) )
544     {
545       aResList << QString( "%1.SetZLevel( %2 );" )
546                   .arg( aName ).arg( anObjZLevel );
547       aResList << QString( "" );
548     }
549   }
550
551   return aResList;
552 }
553
554 QString HYDROData_Entity::getPyTypeID() const
555 {
556   switch( GetKind() )
557   {
558     case KIND_IMAGE:             return "KIND_IMAGE";
559     case KIND_POLYLINE:          return "KIND_POLYLINE";
560     case KIND_BATHYMETRY:        return "KIND_BATHYMETRY";
561     case KIND_ALTITUDE:          return "KIND_ALTITUDE";
562     case KIND_IMMERSIBLE_ZONE:   return "KIND_IMMERSIBLE_ZONE";
563     case KIND_RIVER:             return "KIND_RIVER";
564     case KIND_STREAM:            return "KIND_STREAM";
565     case KIND_CONFLUENCE:        return "KIND_CONFLUENCE";
566     case KIND_CHANNEL:           return "KIND_CHANNEL";
567     case KIND_OBSTACLE:          return "KIND_OBSTACLE";
568     case KIND_DIGUE:             return "KIND_DIGUE";
569     case KIND_PROFILE:           return "KIND_PROFILE";
570     case KIND_PROFILEUZ:         return "KIND_PROFILEUZ";
571     case KIND_POLYLINEXY:        return "KIND_POLYLINEXY";
572     case KIND_CALCULATION:       return "KIND_CALCULATION";
573     case KIND_ZONE:              return "KIND_ZONE";
574     case KIND_REGION:            return "KIND_REGION";
575     case KIND_VISUAL_STATE:      return "KIND_VISUAL_STATE";
576     case KIND_ARTIFICIAL_OBJECT: return "KIND_ARTIFICIAL_OBJECT";
577     case KIND_NATURAL_OBJECT:    return "KIND_NATURAL_OBJECT";
578     case KIND_DUMMY_3D:          return "KIND_DUMMY_3D";
579     case KIND_SHAPES_GROUP:      return "KIND_SHAPES_GROUP";
580     case KIND_SPLITTED_GROUP:    return "KIND_SPLITTED_GROUP";
581     case KIND_STREAM_ALTITUDE:   return "KIND_STREAM_ALTITUDE";
582     case KIND_OBSTACLE_ALTITUDE: return "KIND_OBSTACLE_ALTITUDE";
583     default:                     return "KIND_UNKNOWN"; ///! Unrecognized object
584   }
585 }
586
587 void HYDROData_Entity::setPythonReferenceObject( MapOfTreatedObjects&            theTreatedObjects,
588                                                  QStringList&                    theScript,
589                                                  const Handle(HYDROData_Entity)& theRefObject,
590                                                  const QString&                  theMethod ) const
591 {
592   if ( !checkObjectPythonDefinition( theTreatedObjects, theScript, theRefObject ) )
593     return;
594
595   QString aRefObjName = theRefObject->GetObjPyName();
596
597   QString anObjName = GetObjPyName();
598   theScript << QString( "%1.%2( %3 );" )
599                .arg( anObjName ).arg( theMethod ).arg( aRefObjName );
600 }
601
602 bool HYDROData_Entity::checkObjectPythonDefinition( MapOfTreatedObjects&            theTreatedObjects,
603                                                     QStringList&                    theScript,
604                                                     const Handle(HYDROData_Entity)& theRefObject ) const
605 {
606   if ( theRefObject.IsNull() )
607     return false;
608
609   QString aRefObjName = theRefObject->GetName();
610   if ( aRefObjName.isEmpty() )
611     return false;
612
613   if ( theTreatedObjects.contains( aRefObjName ) )
614     return true;
615
616   // The definition of reference object must be dumped before this
617   QStringList aRefObjDump = theRefObject->DumpToPython( theTreatedObjects );
618   if ( aRefObjDump.isEmpty() )
619     return false;
620
621   QStringList aTmpList = theScript;
622   theScript = aRefObjDump;
623
624   theScript << QString( "" );
625   theScript << aTmpList;
626
627   theTreatedObjects.insert( aRefObjName, theRefObject );
628
629   return true;
630 }
631
632 void HYDROData_Entity::setPythonObjectColor( QStringList&         theScript,
633                                              const QColor&        theColor,
634                                              const QColor&        theDefaultColor,
635                                              const QString&       theMethod ) const
636 {
637   if ( theColor == theDefaultColor )
638     return; //Do not set the color for object if it like default
639
640   QString anObjName = GetObjPyName();
641   theScript << QString( "%1.%2( QColor( %3, %4, %5, %6 ) );" )
642               .arg( anObjName ).arg( theMethod )
643               .arg( theColor.red()  ).arg( theColor.green() )
644               .arg( theColor.blue() ).arg( theColor.alpha() );
645 }
646
647 void HYDROData_Entity::findPythonReferenceObject( MapOfTreatedObjects& theTreatedObjects,
648                                                   QStringList& theScript ) const
649 {
650   Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
651   if ( aDocument.IsNull() )
652     return;
653     
654   theScript << QString( "%1 = %2.FindObjectByName( \"%3\" );" ).arg( GetObjPyName() )
655                                                                .arg( aDocument->GetDocPyName() )
656                                                                .arg( GetName() );
657 }