0024428: Implementation of LGPL license
[occt.git] / src / IGESGraph / IGESGraph_ToolHighLight.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//
973c2be1 7// This library is free software; you can redistribute it and / or modify it
8// under the terms of the GNU Lesser General Public 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.
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
19#include <IGESGraph_ToolHighLight.ixx>
20#include <IGESData_ParamCursor.hxx>
21
22
23IGESGraph_ToolHighLight::IGESGraph_ToolHighLight () { }
24
25
26void IGESGraph_ToolHighLight::ReadOwnParams
27 (const Handle(IGESGraph_HighLight)& ent,
28 const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const
29{
30 Standard_Integer nbPropertyValues;
31 Standard_Integer highLightStatus;
32
33 // Reading nbPropertyValues(Integer)
34 PR.ReadInteger(PR.Current(), "No. of property values", nbPropertyValues);
35 if (nbPropertyValues != 1)
36 PR.AddFail("No. of Property values : Value is not 1");
37
38 if (PR.DefinedElseSkip())
39 // Reading highLightStatus(Integer)
40 PR.ReadInteger (PR.Current(), "Highlight flag", highLightStatus);
41 else
42 highLightStatus = 0; // Default Value
43
44 DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
45 ent->Init(nbPropertyValues, highLightStatus);
46}
47
48void IGESGraph_ToolHighLight::WriteOwnParams
49 (const Handle(IGESGraph_HighLight)& ent, IGESData_IGESWriter& IW) const
50{
51 IW.Send( ent->NbPropertyValues() );
52 IW.Send( ent->HighLightStatus() );
53}
54
55void IGESGraph_ToolHighLight::OwnShared
56 (const Handle(IGESGraph_HighLight)& /*ent*/, Interface_EntityIterator& /*iter*/) const
57{
58}
59
60void IGESGraph_ToolHighLight::OwnCopy
61 (const Handle(IGESGraph_HighLight)& another,
62 const Handle(IGESGraph_HighLight)& ent, Interface_CopyTool& /*TC*/) const
63{
64 ent->Init(1,another->HighLightStatus());
65}
66
67Standard_Boolean IGESGraph_ToolHighLight::OwnCorrect
68 (const Handle(IGESGraph_HighLight)& ent) const
69{
70 Standard_Boolean res = (ent->NbPropertyValues() != 1);
71 if (res) ent->Init(1,ent->HighLightStatus()); // nbpropertyvalues=1
72 return res;
73}
74
75IGESData_DirChecker IGESGraph_ToolHighLight::DirChecker
76 (const Handle(IGESGraph_HighLight)& /*ent*/) const
77{
78 IGESData_DirChecker DC (406, 20);
79 DC.Structure(IGESData_DefVoid);
80 DC.LineFont(IGESData_DefVoid);
81 DC.LineWeight(IGESData_DefVoid);
82 DC.Color(IGESData_DefVoid);
83 DC.BlankStatusIgnored();
84 DC.UseFlagIgnored();
85 DC.HierarchyStatusIgnored();
86 return DC;
87}
88
89void IGESGraph_ToolHighLight::OwnCheck
90 (const Handle(IGESGraph_HighLight)& ent,
91 const Interface_ShareTool& , Handle(Interface_Check)& ach) const
92{
93 if (ent->NbPropertyValues() != 1)
94 ach->AddFail("No. of Property values : Value != 1");
95}
96
97void IGESGraph_ToolHighLight::OwnDump
98 (const Handle(IGESGraph_HighLight)& ent, const IGESData_IGESDumper& /*dumper*/,
99 const Handle(Message_Messenger)& S, const Standard_Integer /*level*/) const
100{
101 S << "IGESGraph_HighLight" << endl;
102
103 S << "No. of property values : " << ent->NbPropertyValues() << endl;
104 S << "Highlight Status : " << ent->HighLightStatus() << endl;
105 S << endl;
106}