0028714: Dimension of TDataStd_Real is not serialized to document
[occt.git] / src / DDataStd / DDataStd.cxx
CommitLineData
b311480e 1// Created on: 1997-03-27
2// Created by: Denis PASCAL
3// Copyright (c) 1997-1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
d5f74e42 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
973c2be1 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.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
7fd59977 16
42cf5bc1 17
18#include <DDataStd.hxx>
7fd59977 19#include <TCollection_AsciiString.hxx>
7fd59977 20#include <TDataStd.hxx>
7fd59977 21#include <TDataStd_Real.hxx>
42cf5bc1 22#include <TDataStd_RealEnum.hxx>
23#include <TDataXtd.hxx>
24#include <TDataXtd_Constraint.hxx>
25#include <TDF_Label.hxx>
26#include <TDF_Tool.hxx>
7fd59977 27#include <TNaming_NamedShape.hxx>
28
29//=======================================================================
30//function : AllCommands
31//purpose :
32//=======================================================================
7fd59977 33void 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
51void 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 << ") ";
58e5d30e 71 Standard_DISABLE_DEPRECATION_WARNINGS
72 TDataStd_RealEnum t = CTR->GetValue()->GetDimension();
7fd59977 73 TDataStd::Print(t,anOS);
74 Standard_Real val = CTR->GetValue()->Get();
c6541a0c 75 if (t == TDataStd_ANGULAR) val = (180.*val)/M_PI;
58e5d30e 76 Standard_ENABLE_DEPRECATION_WARNINGS
7fd59977 77 anOS << " ";
78 anOS << val;
79 }
80 if (!CTR->Verified()) anOS << " NotVerifed";
81}