
Thu, 05/26/2011 - 19:29
Hello,
I have noticed that copying labels having TNaming_NamedShape attribute with TNaming_REPLACE evolution attached fails.
To fix this bug the processing of TNaming_REPLACE must be added to
- TNaming_NamedShape::Paste and
- LoadNamedShape
The patch below was made for OCC6.3.0. However, the problem exists also in OCC5.2 and 6.5.0 (at least, I haven't checked any others).
Pawel
Index: TNaming_NamedShape.cxx
===================================================================
--- TNaming_NamedShape.cxx
+++ TNaming_NamedShape.cxx
@@ -526,6 +526,13 @@
B.Select(copNS,copOS);
break;
}
+ //Kowalski - 26.05.2011
+ case TNaming_REPLACE :
+ {
+ B.Replace(copOS,copNS);
+ break;
+ }
+ //===
default:
break;
Index: TNaming.cxx
===================================================================
--- TNaming.cxx
+++ TNaming.cxx
@@ -335,7 +335,15 @@
case TNaming_SELECTED :
{
B.Select(NS,OS);
+ break; //Kowalski - 26.05.2011
}
+ //Kowalski - 26.05.2011
+ case TNaming_REPLACE :
+ {
+ B.Replace(OS,NS);
+ break;
+ }
+ //===
default:
break;
}
Fri, 05/27/2011 - 11:43
Hi Pawel,
I would like to inform you that it is rather bug of documentation, because evolution TNaming_REPLACE of NamedShape is not yet implemented in OCAF component of OCCT (it is not cpmpleted). And we don't recommend to use it.
As result your patch has no sense, because it can't be regenerated by Naming algorithm.
At the moment the next evolutions are supported only (see paragraph "5. 2. 1 Registering shapes and their evolution" of Application Framework User's Guide):
- PRIMITIVE
- GENERATED
- MODIFY
- DELETE,
- SELECTED
Regards
Fri, 05/27/2011 - 13:22
Dear Forum supervisor,
thank you for your comment!
Indeed, the documentation does not mention supporting TNaming_REPLACE.
As we have a lot of legacy data having NamedShapes with TNaming_REPLACE evolution, could you please explain what you mean by "the patch can't be regenerated by Naming algorithm" and how it can be observed? Browsing the code of the TNaming package I couldn't find any other places where TNaming_REPLACE is omitted.
Thank you
Pawel
Fri, 05/27/2011 - 14:19
Dear Pawel,
You can find some general information at the paragraph "8. 2 Services provided" of OCAF User's Guide. Several words below to make it more clear.
There is only one client on Naming evolution in OCCT. It is the Naming algorithm covered by 3 top classes: TNaming_Selector, TNaming_Naming and TNaming_Name. It is necessary only if you are designing parametric CAD system. If not, i.e you don't track history of modifications, you may name it as PRIMITIVE.
Regards
Fri, 05/27/2011 - 14:43
Thank you!