0031687: Draw Harness, ViewerTest - extend command vrenderparams with option updating...
[occt.git] / src / IGESGraph / IGESGraph_ToolLineFontPredefined.cxx
CommitLineData
b311480e 1// Created by: CKY / Contract Toubro-Larsen
2// Copyright (c) 1993-1999 Matra Datavision
973c2be1 3// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 4//
973c2be1 5// This file is part of Open CASCADE Technology software library.
7fd59977 6//
d5f74e42 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
973c2be1 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.
7fd59977 12//
973c2be1 13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
b311480e 15
16//--------------------------------------------------------------------
7fd59977 17//--------------------------------------------------------------------
18
42cf5bc1 19#include <IGESData_DirChecker.hxx>
20#include <IGESData_IGESDumper.hxx>
21#include <IGESData_IGESReaderData.hxx>
22#include <IGESData_IGESWriter.hxx>
7fd59977 23#include <IGESData_ParamCursor.hxx>
42cf5bc1 24#include <IGESData_ParamReader.hxx>
25#include <IGESGraph_LineFontPredefined.hxx>
26#include <IGESGraph_ToolLineFontPredefined.hxx>
27#include <Interface_Check.hxx>
28#include <Interface_CopyTool.hxx>
29#include <Interface_EntityIterator.hxx>
30#include <Interface_ShareTool.hxx>
31#include <Message_Messenger.hxx>
32#include <Standard_DomainError.hxx>
7fd59977 33
34IGESGraph_ToolLineFontPredefined::IGESGraph_ToolLineFontPredefined () { }
35
36
37void IGESGraph_ToolLineFontPredefined::ReadOwnParams
38 (const Handle(IGESGraph_LineFontPredefined)& ent,
39 const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const
40{
41 //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
42
43 Standard_Integer nbPropertyValues;
44 Standard_Integer lineFontPatternCode;
45
46 // Reading nbPropertyValues(Integer)
47 PR.ReadInteger(PR.Current(), "No. of property values", nbPropertyValues); //szv#4:S4163:12Mar99 `st=` not needed
48 if (nbPropertyValues != 1)
49 PR.AddFail("No. of Property values : Value is not 1");
50
51 // Reading lineFontPatternCode(Integer)
52 PR.ReadInteger(PR.Current(), "Line Font Pattern Code", lineFontPatternCode); //szv#4:S4163:12Mar99 `st=` not needed
53
54 DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
55 ent->Init(nbPropertyValues, lineFontPatternCode);
56}
57
58void IGESGraph_ToolLineFontPredefined::WriteOwnParams
59 (const Handle(IGESGraph_LineFontPredefined)& ent, IGESData_IGESWriter& IW) const
60{
61 IW.Send( ent->NbPropertyValues() );
62 IW.Send( ent->LineFontPatternCode() );
63}
64
65void IGESGraph_ToolLineFontPredefined::OwnShared
66 (const Handle(IGESGraph_LineFontPredefined)& /*ent*/, Interface_EntityIterator& /*iter*/) const
67{
68}
69
70void IGESGraph_ToolLineFontPredefined::OwnCopy
71 (const Handle(IGESGraph_LineFontPredefined)& another,
72 const Handle(IGESGraph_LineFontPredefined)& ent, Interface_CopyTool& /*TC*/) const
73{
74 ent->Init(1,another->LineFontPatternCode());
75}
76
77Standard_Boolean IGESGraph_ToolLineFontPredefined::OwnCorrect
78 (const Handle(IGESGraph_LineFontPredefined)& ent) const
79{
80 Standard_Boolean res = (ent->NbPropertyValues() != 1);
81 if (res) ent->Init(1,ent->LineFontPatternCode()); // nbpropertyvalues=1
82 return res;
83}
84
85IGESData_DirChecker IGESGraph_ToolLineFontPredefined::DirChecker
86 (const Handle(IGESGraph_LineFontPredefined)& /*ent*/) const
87{
88 IGESData_DirChecker DC (406, 19);
89 DC.Structure(IGESData_DefVoid);
90 DC.LineFont(IGESData_DefVoid);
91 DC.LineWeight(IGESData_DefVoid);
92 DC.Color(IGESData_DefVoid);
93 DC.BlankStatusIgnored();
94 DC.UseFlagIgnored();
95 DC.HierarchyStatusIgnored();
96 return DC;
97}
98
99void IGESGraph_ToolLineFontPredefined::OwnCheck
100 (const Handle(IGESGraph_LineFontPredefined)& ent,
101 const Interface_ShareTool& , Handle(Interface_Check)& ach) const
102{
103 if (ent->NbPropertyValues() != 1)
104 ach->AddFail("No. of Property values : Value != 1");
105}
106
107void IGESGraph_ToolLineFontPredefined::OwnDump
108 (const Handle(IGESGraph_LineFontPredefined)& ent, const IGESData_IGESDumper& /*dumper*/,
0ebe5b0a 109 Standard_OStream& S, const Standard_Integer /*level*/) const
7fd59977 110{
0ebe5b0a 111 S << "IGESGraph_LineFontPredefined\n"
112 << "No. of property values : " << ent->NbPropertyValues() << "\n"
113 << "Line font pattern code : " << ent->LineFontPatternCode() << "\n"
114 << std::endl;
7fd59977 115}