7fd59977 |
1 | //-------------------------------------------------------------------- |
2 | // |
3 | // File Name : IGESSolid_SelectedComponent.cxx |
4 | // Date : |
5 | // Author : CKY / Contract Toubro-Larsen |
6 | // Copyright : MATRA-DATAVISION 1993 |
7 | // |
8 | //-------------------------------------------------------------------- |
9 | |
10 | #include <IGESSolid_ToolSelectedComponent.ixx> |
11 | #include <IGESData_ParamCursor.hxx> |
12 | #include <IGESSolid_BooleanTree.hxx> |
13 | #include <gp_XYZ.hxx> |
14 | #include <gp_Pnt.hxx> |
15 | #include <IGESData_Dump.hxx> |
16 | #include <Interface_Macros.hxx> |
17 | |
18 | |
19 | IGESSolid_ToolSelectedComponent::IGESSolid_ToolSelectedComponent () { } |
20 | |
21 | |
22 | void IGESSolid_ToolSelectedComponent::ReadOwnParams |
23 | (const Handle(IGESSolid_SelectedComponent)& ent, |
24 | const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const |
25 | { |
26 | Handle(IGESSolid_BooleanTree) tempEntity; |
27 | gp_XYZ tempSelectPoint; |
28 | //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed |
29 | |
30 | PR.ReadEntity(IR, PR.Current(), "Boolean Tree Entity", |
31 | STANDARD_TYPE(IGESSolid_BooleanTree), tempEntity); //szv#4:S4163:12Mar99 `st=` not needed |
32 | |
33 | PR.ReadXYZ(PR.CurrentList(1, 3), "Select Point", tempSelectPoint); //szv#4:S4163:12Mar99 `st=` not needed |
34 | |
35 | DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); |
36 | ent->Init(tempEntity, tempSelectPoint); |
37 | } |
38 | |
39 | void IGESSolid_ToolSelectedComponent::WriteOwnParams |
40 | (const Handle(IGESSolid_SelectedComponent)& ent, IGESData_IGESWriter& IW) const |
41 | { |
42 | IW.Send(ent->Component()); |
43 | IW.Send(ent->SelectPoint().X()); |
44 | IW.Send(ent->SelectPoint().Y()); |
45 | IW.Send(ent->SelectPoint().Z()); |
46 | } |
47 | |
48 | void IGESSolid_ToolSelectedComponent::OwnShared |
49 | (const Handle(IGESSolid_SelectedComponent)& ent, Interface_EntityIterator& iter) const |
50 | { |
51 | iter.GetOneItem(ent->Component()); |
52 | } |
53 | |
54 | void IGESSolid_ToolSelectedComponent::OwnCopy |
55 | (const Handle(IGESSolid_SelectedComponent)& another, |
56 | const Handle(IGESSolid_SelectedComponent)& ent, Interface_CopyTool& TC) const |
57 | { |
58 | DeclareAndCast(IGESSolid_BooleanTree, tempEntity, |
59 | TC.Transferred(another->Component())); |
60 | gp_XYZ tempSelectPoint = another->SelectPoint().XYZ(); |
61 | ent->Init (tempEntity, tempSelectPoint); |
62 | } |
63 | |
64 | IGESData_DirChecker IGESSolid_ToolSelectedComponent::DirChecker |
65 | (const Handle(IGESSolid_SelectedComponent)& /* ent */ ) const |
66 | { |
67 | IGESData_DirChecker DC(182, 0); |
68 | |
69 | DC.Structure (IGESData_DefVoid); |
70 | DC.LineFont (IGESData_DefVoid); |
71 | DC.LineWeight (IGESData_DefVoid); |
72 | DC.Color (IGESData_DefAny); |
73 | |
74 | DC.BlankStatusIgnored (); |
75 | DC.UseFlagRequired (3); |
76 | DC.HierarchyStatusIgnored (); |
77 | return DC; |
78 | } |
79 | |
80 | void IGESSolid_ToolSelectedComponent::OwnCheck |
81 | (const Handle(IGESSolid_SelectedComponent)& /* ent */, |
82 | const Interface_ShareTool& , Handle(Interface_Check)& /* ach */) const |
83 | { |
84 | } |
85 | |
86 | void IGESSolid_ToolSelectedComponent::OwnDump |
87 | (const Handle(IGESSolid_SelectedComponent)& ent, const IGESData_IGESDumper& dumper, |
88 | const Handle(Message_Messenger)& S, const Standard_Integer level) const |
89 | { |
90 | S << "IGESSolid_SelectedComponent" << endl; |
91 | |
92 | // the heading for boolean tree is in BooleanTree OwnDump |
93 | S << "Boolean Tree Entity : " << endl; |
94 | dumper.Dump(ent->Component(),S, (level <= 4) ? 0 : 1); |
95 | S << "Seleted Point : "; |
96 | IGESData_DumpXYZL(S,level, ent->SelectPoint(), ent->Location()); |
97 | S << endl; |
98 | } |