Integration of OCCT 6.5.0 from SVN
[occt.git] / src / IGESAppli / IGESAppli_ToolNode.cxx
CommitLineData
7fd59977 1//--------------------------------------------------------------------
2//
3// File Name : IGESAppli_Node.cxx
4// Date :
5// Author : CKY / Contract Toubro-Larsen
6// Copyright : MATRA-DATAVISION 1993
7//
8//--------------------------------------------------------------------
9
10#include <IGESAppli_ToolNode.ixx>
11#include <IGESData_ParamCursor.hxx>
12#include <IGESGeom_TransformationMatrix.hxx>
13#include <gp_XYZ.hxx>
14#include <gp_Pnt.hxx>
15#include <Interface_Macros.hxx>
16#include <Message_Messenger.hxx>
17
18IGESAppli_ToolNode::IGESAppli_ToolNode () { }
19
20
21void IGESAppli_ToolNode::ReadOwnParams
22 (const Handle(IGESAppli_Node)& ent,
23 const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
24{
25 gp_XYZ tempCoordinates;
26 Handle(IGESGeom_TransformationMatrix) tempSystem;
27 //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
28
29 //szv#4:S4163:12Mar99 `st=` not needed
30 PR.ReadXYZ(PR.CurrentList(1, 3),"Coordinates of Node (XYZ)",tempCoordinates);
31
32 if (PR.DefinedElseSkip())
33 PR.ReadEntity(IR,PR.Current(),"Transformation Matrix",
34 STANDARD_TYPE(IGESGeom_TransformationMatrix), tempSystem,Standard_True);
35
36 DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
37 ent->Init(tempCoordinates,tempSystem);
38}
39
40void IGESAppli_ToolNode::WriteOwnParams
41 (const Handle(IGESAppli_Node)& ent, IGESData_IGESWriter& IW) const
42{
43 IW.Send(ent->Coord().X());
44 IW.Send(ent->Coord().Y());
45 IW.Send(ent->Coord().Z());
46 IW.Send(ent->System());
47}
48
49void IGESAppli_ToolNode::OwnShared
50 (const Handle(IGESAppli_Node)& ent, Interface_EntityIterator& iter) const
51{
52 iter.GetOneItem(ent->System());
53}
54
55void IGESAppli_ToolNode::OwnCopy
56 (const Handle(IGESAppli_Node)& another,
57 const Handle(IGESAppli_Node)& ent, Interface_CopyTool& TC) const
58{
59 gp_XYZ aCoord = (another->Coord()).XYZ();
60 DeclareAndCast(IGESGeom_TransformationMatrix,aSystem,
61 TC.Transferred(another->System()));
62
63 ent->Init(aCoord,aSystem);
64}
65
66IGESData_DirChecker IGESAppli_ToolNode::DirChecker
67 (const Handle(IGESAppli_Node)& /*ent*/ ) const
68{
69 IGESData_DirChecker DC(134,0); //Form no = 0 & Type = 134
70 DC.Structure(IGESData_DefVoid);
71 DC.LineFont(IGESData_DefVoid);
72 DC.LineWeight(IGESData_DefVoid);
73 DC.Color(IGESData_DefAny);
74 DC.UseFlagRequired(04);
75 return DC;
76}
77
78void IGESAppli_ToolNode::OwnCheck
79 (const Handle(IGESAppli_Node)& ent,
80 const Interface_ShareTool& , Handle(Interface_Check)& ach) const
81{
82 if (!ent->HasSubScriptNumber())
83 ach->AddFail("SubScript Number expected (for Node Number) not present");
84 if (!ent->HasTransf())
85 ach->AddFail("Transformation Matrix expected, not present");
86 if (!ent->System().IsNull())
87 if (ent->System()->FormNumber() < 10)
88 ach->AddFail("System : Incorrect FormNumber (not 10-11-12)");
89}
90
91void IGESAppli_ToolNode::OwnDump
92 (const Handle(IGESAppli_Node)& ent, const IGESData_IGESDumper& dumper,
93 const Handle(Message_Messenger)& S, const Standard_Integer level) const
94{
95 S << "IGESAppli_Node" << endl;
96 S << " Nodal Coords : 1st " << ent->Coord().X()
97 << " 2nd : " << ent->Coord().Y() << " 3rd : " << ent->Coord().Z() <<endl;
98 S << "Nodal Displacement Coordinate System : ";
99 if (!ent->System().IsNull())
100 dumper.Dump(ent->System(),S, level);
101 else
102 S << "Global Cartesian Coordinate System (default)";
103 S << endl;
104}