1 // Created on: 1994-08-26
2 // Created by: Christian CAILLET
3 // Copyright (c) 1994-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
18 #include <IFSelect_ContextWrite.hxx>
19 #include <IGESData_IGESWriter.hxx>
20 #include <IGESSelect_AddFileComment.hxx>
21 #include <Standard_Type.hxx>
22 #include <TCollection_AsciiString.hxx>
23 #include <TCollection_HAsciiString.hxx>
26 IMPLEMENT_STANDARD_RTTIEXT(IGESSelect_AddFileComment,IGESSelect_FileModifier)
28 IGESSelect_AddFileComment::IGESSelect_AddFileComment ()
29 { thelist = new TColStd_HSequenceOfHAsciiString(); }
31 void IGESSelect_AddFileComment::Clear ()
35 void IGESSelect_AddFileComment::AddLine (const Standard_CString line)
36 { thelist->Append (new TCollection_HAsciiString(line)); }
38 void IGESSelect_AddFileComment::AddLines
39 (const Handle(TColStd_HSequenceOfHAsciiString)& lines)
40 { thelist->Append (lines); }
42 Standard_Integer IGESSelect_AddFileComment::NbLines () const
43 { return thelist->Length(); }
45 Standard_CString IGESSelect_AddFileComment::Line
46 (const Standard_Integer num) const
47 { return thelist->Value(num)->ToCString(); }
49 Handle(TColStd_HSequenceOfHAsciiString) IGESSelect_AddFileComment::Lines
53 void IGESSelect_AddFileComment::Perform
54 (IFSelect_ContextWrite& ,
55 IGESData_IGESWriter& writer) const
57 Standard_Integer i, nb = NbLines();
58 for (i = 1; i <= nb; i ++) {
59 writer.SendStartLine (Line(i));
63 TCollection_AsciiString IGESSelect_AddFileComment::Label () const
65 Standard_Integer nb = NbLines();
67 sprintf (labl, "Add %d Comment Lines (Start Section)",nb);
68 return TCollection_AsciiString (labl);