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 //--------------------------------------------------------------------
21 #include <IGESBasic_SubfigureDef.hxx>
22 #include <IGESData_DirChecker.hxx>
23 #include <IGESData_Dump.hxx>
24 #include <IGESData_IGESDumper.hxx>
25 #include <IGESData_IGESReaderData.hxx>
26 #include <IGESData_IGESWriter.hxx>
27 #include <IGESData_ParamCursor.hxx>
28 #include <IGESData_ParamReader.hxx>
29 #include <IGESData_Status.hxx>
30 #include <IGESGeom_Point.hxx>
31 #include <IGESGeom_ToolPoint.hxx>
32 #include <Interface_Check.hxx>
33 #include <Interface_CopyTool.hxx>
34 #include <Interface_EntityIterator.hxx>
35 #include <Interface_Macros.hxx>
36 #include <Interface_ShareTool.hxx>
37 #include <Message_Messenger.hxx>
38 #include <Message_Msg.hxx>
39 #include <Standard_DomainError.hxx>
42 IGESGeom_ToolPoint::IGESGeom_ToolPoint () { }
45 void IGESGeom_ToolPoint::ReadOwnParams
46 (const Handle(IGESGeom_Point)& ent,
47 const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
50 // Building of messages
51 //==================================
52 Message_Msg Msg73("XSTEP_73");
53 //==================================
56 Handle(IGESBasic_SubfigureDef) aSymbol;
57 IGESData_Status aStatus;
58 //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
60 PR.ReadXYZ(PR.CurrentList(1, 3), Msg73, aPoint); //szv#4:S4163:12Mar99 `st=` not needed
61 //st = PR.ReadXYZ(PR.CurrentList(1, 3), "Point", aPoint);
63 if (PR.DefinedElseSkip()){
64 if (!PR.ReadEntity(IR, PR.Current(), aStatus,
65 STANDARD_TYPE(IGESBasic_SubfigureDef), aSymbol, Standard_True)){
66 Message_Msg Msg74("XSTEP_74");
68 case IGESData_ReferenceError: {
69 Message_Msg Msg216 ("IGES_216");
70 Msg74.Arg(Msg216.Value());
73 case IGESData_EntityError: {
74 Message_Msg Msg217 ("IGES_217");
75 Msg74.Arg(Msg217.Value());
78 case IGESData_TypeError: {
79 Message_Msg Msg218 ("IGES_218");
80 Msg74.Arg(Msg218.Value());
87 //szv#4:S4163:12Mar99 `st=` not needed
89 // st = PR.ReadEntity(IR, PR.Current(), "Display Symbol",
90 // STANDARD_TYPE(IGESBasic_SubfigureDef), aSymbol, Standard_True);
92 DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
93 ent->Init(aPoint, aSymbol);
96 void IGESGeom_ToolPoint::WriteOwnParams
97 (const Handle(IGESGeom_Point)& ent, IGESData_IGESWriter& IW) const
99 IW.Send(ent->Value().X());
100 IW.Send(ent->Value().Y());
101 IW.Send(ent->Value().Z());
102 IW.Send(ent->DisplaySymbol());
105 void IGESGeom_ToolPoint::OwnShared
106 (const Handle(IGESGeom_Point)& ent, Interface_EntityIterator& iter) const
108 iter.GetOneItem(ent->DisplaySymbol());
111 void IGESGeom_ToolPoint::OwnCopy
112 (const Handle(IGESGeom_Point)& another,
113 const Handle(IGESGeom_Point)& ent, Interface_CopyTool& TC) const
115 gp_XYZ aPoint = (another->Value()).XYZ();
117 DeclareAndCast(IGESBasic_SubfigureDef, aSymbol,
118 TC.Transferred(another->DisplaySymbol()));
119 ent->Init(aPoint, aSymbol);
123 IGESData_DirChecker IGESGeom_ToolPoint::DirChecker
124 (const Handle(IGESGeom_Point)& ent ) const
126 IGESData_DirChecker DC(116,0);
127 DC.Structure(IGESData_DefVoid);
128 if (ent->HasDisplaySymbol())
130 DC.LineFont(IGESData_DefAny);
131 DC.LineWeight(IGESData_DefValue);
133 DC.Color(IGESData_DefAny);
137 void IGESGeom_ToolPoint::OwnCheck
138 (const Handle(IGESGeom_Point)& /* ent */,
139 const Interface_ShareTool& , Handle(Interface_Check)& /* ach */) const
143 void IGESGeom_ToolPoint::OwnDump
144 (const Handle(IGESGeom_Point)& ent, const IGESData_IGESDumper& dumper,
145 const Handle(Message_Messenger)& S, const Standard_Integer level) const
147 S << "IGESGeom_Point" << endl;
150 IGESData_DumpXYZL(S,level, ent->Value(), ent->Location());
152 S << " Display Symbol : ";
153 dumper.Dump(ent->DisplaySymbol(),S, (level <= 4) ? 0 : 1);