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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
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>
29 //=======================================================================
30 //function : AllCommands
32 //=======================================================================
33 void DDataStd::AllCommands (Draw_Interpretor& theCommands)
35 NamedShapeCommands (theCommands);
36 BasicCommands (theCommands);
37 DatumCommands (theCommands);
38 ConstraintCommands (theCommands);
39 ObjectCommands (theCommands);
40 DrawDisplayCommands (theCommands);
41 NameCommands(theCommands);
42 TreeCommands(theCommands);
46 //=======================================================================
47 //function : DumpConstraint
49 //=======================================================================
51 void DDataStd::DumpConstraint (const Handle(TDataXtd_Constraint)& CTR, Standard_OStream& anOS)
53 TCollection_AsciiString S;
54 TDF_Tool::Entry(CTR->Label(),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);
62 if (CTR->IsPlanar()) {
64 TDF_Tool::Entry(CTR->GetPlane()->Label(),S);
67 if (CTR->IsDimension()) {
69 TDF_Tool::Entry(CTR->GetValue()->Label(),S);
71 TDataStd_RealEnum t = CTR->GetValue()->GetDimension();
72 TDataStd::Print(t,anOS);
73 Standard_Real val = CTR->GetValue()->Get();
74 if (t == TDataStd_ANGULAR) val = (180.*val)/M_PI;
78 if (!CTR->Verified()) anOS << " NotVerifed";