7fd59977 |
1 | // File: DDataStd.cxx |
2 | // Created: Thu Mar 27 09:24:53 1997 |
3 | // Author: Denis PASCAL |
4 | // <dp@dingox.paris1.matra-dtv.fr> |
5 | |
6 | |
7 | #include <DDataStd.ixx> |
8 | #include <TCollection_AsciiString.hxx> |
9 | #include <TDF_Label.hxx> |
10 | #include <TDF_Tool.hxx> |
11 | #include <TDataStd.hxx> |
12 | #include <TDataXtd.hxx> |
13 | #include <TDataStd_RealEnum.hxx> |
14 | #include <TDataStd_Real.hxx> |
15 | #include <TNaming_NamedShape.hxx> |
16 | |
17 | //======================================================================= |
18 | //function : AllCommands |
19 | //purpose : |
20 | //======================================================================= |
21 | |
22 | void DDataStd::AllCommands (Draw_Interpretor& theCommands) |
23 | { |
24 | NamedShapeCommands (theCommands); |
25 | BasicCommands (theCommands); |
26 | DatumCommands (theCommands); |
27 | ConstraintCommands (theCommands); |
28 | ObjectCommands (theCommands); |
29 | DrawDisplayCommands (theCommands); |
30 | NameCommands(theCommands); |
31 | TreeCommands(theCommands); |
32 | } |
33 | |
34 | |
35 | //======================================================================= |
36 | //function : DumpConstraint |
37 | //purpose : |
38 | //======================================================================= |
39 | |
40 | void DDataStd::DumpConstraint (const Handle(TDataXtd_Constraint)& CTR, Standard_OStream& anOS) |
41 | { |
42 | TCollection_AsciiString S; |
43 | TDF_Tool::Entry(CTR->Label(),S); |
44 | anOS << S << " "; |
45 | TDataXtd::Print(CTR->GetType(),anOS); |
46 | for (Standard_Integer i = 1; i <= CTR->NbGeometries(); i++) { |
47 | anOS << " G_" << i << " ("; |
48 | TDF_Tool::Entry(CTR->GetGeometry(i)->Label(),S); |
49 | anOS << S << ") "; |
50 | } |
51 | if (CTR->IsPlanar()) { |
52 | anOS << " P ("; |
53 | TDF_Tool::Entry(CTR->GetPlane()->Label(),S); |
54 | anOS << S << ") "; |
55 | } |
56 | if (CTR->IsDimension()) { |
57 | anOS << " V ("; |
58 | TDF_Tool::Entry(CTR->GetValue()->Label(),S); |
59 | anOS << S << ") "; |
60 | TDataStd_RealEnum t = CTR->GetValue()->GetDimension(); |
61 | TDataStd::Print(t,anOS); |
62 | Standard_Real val = CTR->GetValue()->Get(); |
63 | if (t == TDataStd_ANGULAR) val = (180.*val)/PI; |
64 | anOS << " "; |
65 | anOS << val; |
66 | } |
67 | if (!CTR->Verified()) anOS << " NotVerifed"; |
68 | } |