0028714: Dimension of TDataStd_Real is not serialized to document
[occt.git] / src / DDataStd / DDataStd.cxx
1 // Created on: 1997-03-27
2 // Created by: Denis PASCAL
3 // Copyright (c) 1997-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17
18 #include <DDataStd.hxx>
19 #include <TCollection_AsciiString.hxx>
20 #include <TDataStd.hxx>
21 #include <TDataStd_Real.hxx>
22 #include <TDataStd_RealEnum.hxx>
23 #include <TDataXtd.hxx>
24 #include <TDataXtd_Constraint.hxx>
25 #include <TDF_Label.hxx>
26 #include <TDF_Tool.hxx>
27 #include <TNaming_NamedShape.hxx>
28
29 //=======================================================================
30 //function : AllCommands
31 //purpose  : 
32 //=======================================================================
33 void DDataStd::AllCommands (Draw_Interpretor& theCommands)
34 {   
35   NamedShapeCommands (theCommands);  
36   BasicCommands (theCommands);  
37   DatumCommands (theCommands);   
38   ConstraintCommands (theCommands); 
39   ObjectCommands (theCommands); 
40   DrawDisplayCommands (theCommands);
41   NameCommands(theCommands); 
42   TreeCommands(theCommands);   
43 }
44
45
46 //=======================================================================
47 //function : DumpConstraint
48 //purpose  : 
49 //=======================================================================
50
51 void DDataStd::DumpConstraint (const Handle(TDataXtd_Constraint)& CTR, Standard_OStream& anOS)
52 {
53   TCollection_AsciiString S;
54   TDF_Tool::Entry(CTR->Label(),S); 
55   anOS << S << " ";
56   TDataXtd::Print(CTR->GetType(),anOS); 
57   for (Standard_Integer i = 1; i <= CTR->NbGeometries(); i++) {
58     anOS << " G_" << i << " (";
59     TDF_Tool::Entry(CTR->GetGeometry(i)->Label(),S); 
60     anOS << S << ") ";
61   }     
62   if (CTR->IsPlanar()) {
63     anOS << " P (";
64     TDF_Tool::Entry(CTR->GetPlane()->Label(),S); 
65     anOS << S << ") ";  
66   }
67   if (CTR->IsDimension()) {
68     anOS << " V (";
69     TDF_Tool::Entry(CTR->GetValue()->Label(),S); 
70     anOS << S << ") ";     
71     Standard_DISABLE_DEPRECATION_WARNINGS
72     TDataStd_RealEnum t = CTR->GetValue()->GetDimension();
73     TDataStd::Print(t,anOS); 
74     Standard_Real val = CTR->GetValue()->Get();
75     if (t == TDataStd_ANGULAR) val = (180.*val)/M_PI;
76     Standard_ENABLE_DEPRECATION_WARNINGS
77     anOS << " ";
78     anOS << val;
79   }
80   if (!CTR->Verified()) anOS << " NotVerifed"; 
81 }