1 // Copyright (c) 1999-2012 OPEN CASCADE SAS
3 // The content of this file is subject to the Open CASCADE Technology Public
4 // License Version 6.5 (the "License"). You may not use the content of this file
5 // except in compliance with the License. Please obtain a copy of the License
6 // at http://www.opencascade.org and read it completely before using this file.
8 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
9 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
11 // The Original Code and all software distributed under the License is
12 // distributed on an "AS IS" basis, without warranty of any kind, and the
13 // Initial Developer hereby disclaims all such warranties, including without
14 // limitation, any warranties of merchantability, fitness for a particular
15 // purpose or non-infringement. Please see the License for the specific terms
16 // and conditions governing the rights and limitations under the License.
18 #include <IFSelect_DispPerSignature.ixx>
19 #include <IFSelect_Selection.hxx>
20 #include <TColStd_HSequenceOfHAsciiString.hxx>
21 #include <TCollection_HAsciiString.hxx>
22 #include <TColStd_HSequenceOfTransient.hxx>
23 #include <Interface_EntityIterator.hxx>
27 IFSelect_DispPerSignature::IFSelect_DispPerSignature () { }
29 Handle(IFSelect_SignCounter) IFSelect_DispPerSignature::SignCounter () const
32 void IFSelect_DispPerSignature::SetSignCounter
33 (const Handle(IFSelect_SignCounter)& sign)
34 { thesign = sign; thesign->SetList (Standard_True); }
36 Standard_CString IFSelect_DispPerSignature::SignName () const
37 { return (Standard_CString ) (thesign.IsNull() ? "???" : thesign->Name()); }
39 TCollection_AsciiString IFSelect_DispPerSignature::Label () const
42 sprintf (lab,"One File per Signature %s",SignName());
43 return TCollection_AsciiString(lab);
46 Standard_Boolean IFSelect_DispPerSignature::LimitedMax
47 (const Standard_Integer nbent, Standard_Integer& max) const
53 void IFSelect_DispPerSignature::Packets
54 (const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const
56 if (thesign.IsNull()) {
58 packs.GetFromIter (FinalSelection()->RootResult(G));
63 thesign->AddList (FinalSelection()->RootResult(G).Content(),G.Model());
64 Handle(TColStd_HSequenceOfHAsciiString) list = thesign->List();
65 Standard_Integer i,nb,is,nbs = list->Length();
66 Handle(TCollection_HAsciiString) asign;
67 Handle(TColStd_HSequenceOfTransient) ents;
68 for (is = 1; is <= nbs; is ++) {
69 asign = list->Value(is);
70 ents = thesign->Entities (asign->ToCString());
71 if (ents.IsNull()) continue;
74 for (i = 1; i <= nb; i ++)
75 packs.GetFromEntity (ents->Value(i),Standard_False);