summaryrefslogtreecommitdiff
path: root/src/IGESGraph/IGESGraph_ToolDefinitionLevel.cxx
blob: bb6af2ad4a295ca50bbfd3508fe8a0f2965019a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
//--------------------------------------------------------------------
//
//  File Name : IGESGraph_DefinitionLevel.cxx
//  Date      :
//  Author    : CKY / Contract Toubro-Larsen
//  Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------

#include <Interface_Macros.hxx>
#include <IGESGraph_ToolDefinitionLevel.ixx>
#include <IGESData_ParamCursor.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <IGESData_Dump.hxx>


IGESGraph_ToolDefinitionLevel::IGESGraph_ToolDefinitionLevel ()    {  }


void IGESGraph_ToolDefinitionLevel::ReadOwnParams
  (const Handle(IGESGraph_DefinitionLevel)& ent,
   const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const
{ 
  //Standard_Boolean st; //szv#4:S4163:12Mar99 moved down
  Standard_Integer nbval;

  Handle(TColStd_HArray1OfInteger) levelNumbers;

  // Reading nbval(No. of Property Values)
  Standard_Boolean st = PR.ReadInteger(PR.Current(), "No. of Property Values", nbval);
  if (st && nbval > 0)
    {
      // Reading levelNumbers(HArray1OfInteger)
//      levelNumbers = new TColStd_HArray1OfInteger(1, nbval);   done by :
      PR.ReadInts(PR.CurrentList(nbval), "array levelNumbers", levelNumbers, 1); //szv#4:S4163:12Mar99 `st=` not needed
    }
  else  PR.AddFail("No. of Property Values : Not Positive");

  DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
  ent->Init(levelNumbers);
}

void IGESGraph_ToolDefinitionLevel::WriteOwnParams
  (const Handle(IGESGraph_DefinitionLevel)& ent, IGESData_IGESWriter& IW)  const
{ 
  Standard_Integer Up  = ent->NbPropertyValues();
  IW.Send( Up );
  for ( Standard_Integer i = 1; i <= Up; i++)
    IW.Send( ent->LevelNumber(i) );
}

void  IGESGraph_ToolDefinitionLevel::OwnShared
  (const Handle(IGESGraph_DefinitionLevel)& /*ent*/, Interface_EntityIterator& /*iter*/) const
{
}

void IGESGraph_ToolDefinitionLevel::OwnCopy
  (const Handle(IGESGraph_DefinitionLevel)& another,
   const Handle(IGESGraph_DefinitionLevel)& ent, Interface_CopyTool& /*TC*/) const
{ 
  Standard_Integer nbval;
  Handle(TColStd_HArray1OfInteger) levelNumbers; 
 
  nbval = another->NbPropertyValues();
 
  levelNumbers = new TColStd_HArray1OfInteger(1, nbval);
  for (Standard_Integer i = 1; i <= nbval; i++)
    levelNumbers->SetValue( i, another->LevelNumber(i) );

  ent->Init(levelNumbers);
}

IGESData_DirChecker IGESGraph_ToolDefinitionLevel::DirChecker
  (const Handle(IGESGraph_DefinitionLevel)& /*ent*/)  const
{ 
  IGESData_DirChecker DC (406, 1);
  DC.Structure(IGESData_DefVoid);
  DC.LineFont(IGESData_DefVoid);
  DC.LineWeight(IGESData_DefVoid);
  DC.Color(IGESData_DefVoid);
  DC.BlankStatusIgnored();
  DC.UseFlagIgnored();
  DC.HierarchyStatusIgnored();
  return DC;
}

void IGESGraph_ToolDefinitionLevel::OwnCheck
  (const Handle(IGESGraph_DefinitionLevel)& /*ent*/,
   const Interface_ShareTool& , Handle(Interface_Check)& /*ach*/)  const
{
}

void IGESGraph_ToolDefinitionLevel::OwnDump
  (const Handle(IGESGraph_DefinitionLevel)& ent, const IGESData_IGESDumper& /*dumper*/,
   const Handle(Message_Messenger)& S, const Standard_Integer level)  const
{
  S << "IGESGraph_DefinitionLevel" << endl;

  S << "Level Numbers : ";
  IGESData_DumpVals(S ,level,1, ent->NbPropertyValues(),ent->LevelNumber);
  S << endl;
}