1 // Created by: CKY / Contract Toubro-Larsen
2 // Copyright (c) 1993-1999 Matra Datavision
3 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 //--------------------------------------------------------------------
17 //--------------------------------------------------------------------
19 #include <IGESGraph_ToolIntercharacterSpacing.ixx>
20 #include <IGESData_ParamCursor.hxx>
23 IGESGraph_ToolIntercharacterSpacing::IGESGraph_ToolIntercharacterSpacing ()
27 void IGESGraph_ToolIntercharacterSpacing::ReadOwnParams
28 (const Handle(IGESGraph_IntercharacterSpacing)& ent,
29 const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const
31 //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
33 Standard_Integer nbPropertyValues;
36 // Reading nbPropertyValues(Integer)
37 PR.ReadInteger(PR.Current(), "No. of property values", nbPropertyValues); //szv#4:S4163:12Mar99 `st=` not needed
38 if (nbPropertyValues != 1)
39 PR.AddFail("No. of Property values : Value is not 1");
41 // Reading iSpace(Real)
42 PR.ReadReal(PR.Current(), "Intercharacter space in % of text height", iSpace); //szv#4:S4163:12Mar99 `st=` not needed
44 DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
45 ent->Init(nbPropertyValues, iSpace);
48 void IGESGraph_ToolIntercharacterSpacing::WriteOwnParams
49 (const Handle(IGESGraph_IntercharacterSpacing)& ent, IGESData_IGESWriter& IW) const
51 IW.Send( ent->NbPropertyValues() );
52 IW.Send( ent->ISpace() );
55 void IGESGraph_ToolIntercharacterSpacing::OwnShared
56 (const Handle(IGESGraph_IntercharacterSpacing)& /*ent*/, Interface_EntityIterator& /*iter*/) const
60 void IGESGraph_ToolIntercharacterSpacing::OwnCopy
61 (const Handle(IGESGraph_IntercharacterSpacing)& another,
62 const Handle(IGESGraph_IntercharacterSpacing)& ent, Interface_CopyTool& /*TC*/) const
64 ent->Init(1,another->ISpace());
67 Standard_Boolean IGESGraph_ToolIntercharacterSpacing::OwnCorrect
68 (const Handle(IGESGraph_IntercharacterSpacing)& ent) const
70 Standard_Boolean res = (ent->NbPropertyValues() != 1);
71 if (res) ent->Init(1,ent->ISpace()); // nbpropertyvalues=1
75 IGESData_DirChecker IGESGraph_ToolIntercharacterSpacing::DirChecker
76 (const Handle(IGESGraph_IntercharacterSpacing)& /*ent*/) const
78 IGESData_DirChecker DC (406, 18);
79 DC.Structure(IGESData_DefVoid);
80 DC.LineFont(IGESData_DefVoid);
81 DC.LineWeight(IGESData_DefVoid);
82 DC.Color(IGESData_DefVoid);
83 DC.BlankStatusIgnored();
85 DC.HierarchyStatusIgnored();
89 void IGESGraph_ToolIntercharacterSpacing::OwnCheck
90 (const Handle(IGESGraph_IntercharacterSpacing)& ent,
91 const Interface_ShareTool& , Handle(Interface_Check)& ach) const
93 if ((ent->ISpace() < 0.0) || (ent->ISpace() > 100.0))
94 ach->AddFail("Intercharacter Space : Value not in the range [0-100]");
95 if (ent->NbPropertyValues() != 1)
96 ach->AddFail("No. of Property values : Value != 1");
99 void IGESGraph_ToolIntercharacterSpacing::OwnDump
100 (const Handle(IGESGraph_IntercharacterSpacing)& ent, const IGESData_IGESDumper& /*dumper*/,
101 const Handle(Message_Messenger)& S, const Standard_Integer /*level*/) const
103 S << "IGESGraph_IntercharacterSpacing" << endl;
105 S << "No. of property values : " << ent->NbPropertyValues() << endl;
106 S << "Intercharacter space in % of text height : " << ent->ISpace() << endl;