0023024: Update headers of OCCT files
[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-2012 OPEN CASCADE SAS
5 //
6 // The content of this file is subject to the Open CASCADE Technology Public
7 // License Version 6.5 (the "License"). You may not use the content of this file
8 // except in compliance with the License. Please obtain a copy of the License
9 // at http://www.opencascade.org and read it completely before using this file.
10 //
11 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 //
14 // The Original Code and all software distributed under the License is
15 // distributed on an "AS IS" basis, without warranty of any kind, and the
16 // Initial Developer hereby disclaims all such warranties, including without
17 // limitation, any warranties of merchantability, fitness for a particular
18 // purpose or non-infringement. Please see the License for the specific terms
19 // and conditions governing the rights and limitations under the License.
20
21
22
23 #include <DDataStd.ixx> 
24 #include <TCollection_AsciiString.hxx>
25 #include <TDF_Label.hxx>
26 #include <TDF_Tool.hxx>
27 #include <TDataStd.hxx>
28 #include <TDataXtd.hxx>
29 #include <TDataStd_RealEnum.hxx>
30 #include <TDataStd_Real.hxx>
31 #include <TNaming_NamedShape.hxx>
32
33 //=======================================================================
34 //function : AllCommands
35 //purpose  : 
36 //=======================================================================
37
38 void DDataStd::AllCommands (Draw_Interpretor& theCommands)
39 {   
40   NamedShapeCommands (theCommands);  
41   BasicCommands (theCommands);  
42   DatumCommands (theCommands);   
43   ConstraintCommands (theCommands); 
44   ObjectCommands (theCommands); 
45   DrawDisplayCommands (theCommands);
46   NameCommands(theCommands); 
47   TreeCommands(theCommands);   
48 }
49
50
51 //=======================================================================
52 //function : DumpConstraint
53 //purpose  : 
54 //=======================================================================
55
56 void DDataStd::DumpConstraint (const Handle(TDataXtd_Constraint)& CTR, Standard_OStream& anOS)
57 {
58   TCollection_AsciiString S;
59   TDF_Tool::Entry(CTR->Label(),S); 
60   anOS << S << " ";
61   TDataXtd::Print(CTR->GetType(),anOS); 
62   for (Standard_Integer i = 1; i <= CTR->NbGeometries(); i++) {
63     anOS << " G_" << i << " (";
64     TDF_Tool::Entry(CTR->GetGeometry(i)->Label(),S); 
65     anOS << S << ") ";
66   }     
67   if (CTR->IsPlanar()) {
68     anOS << " P (";
69     TDF_Tool::Entry(CTR->GetPlane()->Label(),S); 
70     anOS << S << ") ";  
71   }
72   if (CTR->IsDimension()) {
73     anOS << " V (";
74     TDF_Tool::Entry(CTR->GetValue()->Label(),S); 
75     anOS << S << ") ";     
76     TDataStd_RealEnum t = CTR->GetValue()->GetDimension();  
77     TDataStd::Print(t,anOS); 
78     Standard_Real val = CTR->GetValue()->Get();
79     if (t == TDataStd_ANGULAR) val = (180.*val)/M_PI;
80     anOS << " ";
81     anOS << val;
82   }
83   if (!CTR->Verified()) anOS << " NotVerifed"; 
84 }