1 // Created on: 2015-06-18
2 // Created by: Ilya Novikov
3 // Copyright (c) 2000-2015 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #include <XDEDRAW_GDTs.hxx>
20 #include <DDocStd.hxx>
21 #include <DrawTrSurf.hxx>
22 #include <Geom_Plane.hxx>
24 #include <STEPCAFControl_GDTProperty.hxx>
26 #include <TDF_Tool.hxx>
27 #include <TDF_Label.hxx>
28 #include <TDF_LabelSequence.hxx>
29 #include <TDocStd_Document.hxx>
30 #include <XCAFDoc_GraphNode.hxx>
32 #include <XCAFDoc.hxx>
33 #include <XCAFDoc_DocumentTool.hxx>
34 #include <XCAFDoc_ShapeTool.hxx>
35 #include <XCAFDoc_DimTol.hxx>
36 #include <XCAFDoc_Dimension.hxx>
37 #include <XCAFDimTolObjects_DimensionObject.hxx>
38 #include <XCAFDoc_Datum.hxx>
39 #include <XCAFDimTolObjects_DatumObject.hxx>
40 #include <XCAFDoc_GeomTolerance.hxx>
41 #include <XCAFDimTolObjects_GeomToleranceObject.hxx>
42 #include <XCAFDoc_DimTolTool.hxx>
43 #include <XCAFDimTolObjects_DimensionObjectSequence.hxx>
44 #include <XCAFDimTolObjects_DatumObjectSequence.hxx>
45 #include <XCAFDimTolObjects_GeomToleranceObjectSequence.hxx>
46 #include <XCAFDimTolObjects_DatumSingleModif.hxx>
47 #include <XCAFDimTolObjects_DimensionModif.hxx>
48 #include <XCAFDimTolObjects_GeomToleranceModif.hxx>
49 #include <XCAFDimTolObjects_DatumModifiersSequence.hxx>
50 #include <XCAFDimTolObjects_DatumObject.hxx>
51 #include <XCAFDimTolObjects_Tool.hxx>
53 #include <TCollection_AsciiString.hxx>
54 #include <TCollection_HAsciiString.hxx>
55 #include <TColStd_HArray1OfReal.hxx>
56 #include <TColgp_HArray1OfPnt.hxx>
59 #include <TopoDS_Shape.hxx>
60 #include <TopoDS_Edge.hxx>
61 #include <TopoDS_Vertex.hxx>
62 #include <BRep_Tool.hxx>
66 static Standard_Integer DumpDGTs (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
69 di<<"Use: XDumpDGTs Doc shape/label/all\n";
72 Handle(TDocStd_Document) Doc;
73 DDocStd::GetDocument(argv[1], Doc);
74 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
75 Handle(XCAFDoc_DimTolTool) aDimTolTool= XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
76 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
78 TCollection_AsciiString name = argv[2];
79 TDF_LabelSequence aLabels;
80 if(name.IsEqual("all"))
82 aShapeTool->GetShapes(aLabels);
83 for ( Standard_Integer i=1; i <= aLabels.Length(); i++ )
85 aShapeTool->GetSubShapes(aLabels.Value(i), aLabels);
91 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
92 if ( !aLabel.IsNull() ) {
93 aLabels.Append(aLabel);
94 aShapeTool->GetSubShapes(aLabel, aLabels);
98 TopoDS_Shape aShape= DBRep::Get(argv[2]);
99 if ( !aShape.IsNull() )
101 aShapeTool->Search(aShape, aLabel);
102 if ( !aLabel.IsNull() ) {
103 aLabels.Append(aLabel);
104 aShapeTool->GetSubShapes(aLabel, aLabels);
108 di<<"Shape "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
115 for ( Standard_Integer i=1; i <= aLabels.Length(); i++ )
117 Standard_Boolean flag = Standard_True;
118 TDF_LabelSequence aGDTs;
119 aDimTolTool->GetRefDimensionLabels(aLabels.Value(i), aGDTs);
120 for ( Standard_Integer j=1; j <= aGDTs.Length(); j++ )
122 Handle(XCAFDoc_Dimension) aDimTol;
123 if(aGDTs.Value(j).FindAttribute(XCAFDoc_Dimension::GetID(), aDimTol))
125 Handle(XCAFDimTolObjects_DimensionObject) aDimTolObj = aDimTol->GetObject();
128 TCollection_AsciiString Entry;
129 TDF_Tool::Entry(aLabels.Value(i), Entry);
130 di << "\n " << Entry << " Shape."<< i;
131 flag = Standard_False;
133 TCollection_AsciiString Entry;
134 TDF_Tool::Entry(aGDTs.Value(j), Entry);
135 di << "\n \t " << Entry;
136 flag = Standard_False;
138 di << " Dimension."<< i << "."<< j;
142 di << " T " << aDimTolObj->GetType();
143 if(aDimTolObj->IsDimWithRange())
145 di << ", LB " << aDimTolObj->GetLowerBound();
146 di << ", UB " << aDimTolObj->GetUpperBound();
150 di << ", V " << aDimTolObj->GetValue();
151 if (aDimTolObj->IsDimWithPlusMinusTolerance())
153 di << ", VL " << aDimTolObj->GetLowerTolValue();
154 di << ", VU " << aDimTolObj->GetUpperTolValue();
156 else if (aDimTolObj->IsDimWithClassOfTolerance())
158 Standard_Boolean isH;
159 XCAFDimTolObjects_DimensionFormVariance aFV;
160 XCAFDimTolObjects_DimensionGrade aG;
161 aDimTolObj->GetClassOfTolerance(isH, aFV, aG);
162 di << ", H " << (Standard_Integer)isH<< " F " << aFV << " G " << aG;
165 if (aDimTolObj->HasQualifier())
166 di << ", Q " << aDimTolObj->GetQualifier();
167 if (aDimTolObj->GetType() == XCAFDimTolObjects_DimensionType_Location_Oriented)
170 aDimTolObj->GetDirection(aD);
171 di << ", D (" << aD.X() << ", " << aD.Y() << ", " << aD.Z() << ")";
173 XCAFDimTolObjects_DimensionModifiersSequence aModif =
174 aDimTolObj->GetModifiers();
175 if (!aModif.IsEmpty())
178 for (Standard_Integer k = aModif.Lower(); k <= aModif.Upper(); k++)
180 di << " M " << aModif.Value(k);
183 di << ", P " << (Standard_Integer)!aDimTolObj->GetPath().IsNull();
189 aDimTolTool->GetRefGeomToleranceLabels(aLabels.Value(i), aGDTs);
190 for ( Standard_Integer j=1; j <= aGDTs.Length(); j++ )
192 Handle(XCAFDoc_GeomTolerance) aDimTol;
193 if(aGDTs.Value(j).FindAttribute(XCAFDoc_GeomTolerance::GetID(), aDimTol))
195 Handle(XCAFDimTolObjects_GeomToleranceObject) aDimTolObj = aDimTol->GetObject();
198 TCollection_AsciiString Entry;
199 TDF_Tool::Entry(aLabels.Value(i), Entry);
200 di << "\n " << Entry << " Shape."<< i;
201 flag = Standard_False;
203 TCollection_AsciiString Entry;
204 TDF_Tool::Entry(aGDTs.Value(j), Entry);
205 di << "\n \t " << Entry;
206 flag = Standard_False;
208 di << " GeomTolerance."<< i << "."<< j;
212 di << " T " << aDimTolObj->GetType();
213 di << " TV " << aDimTolObj->GetTypeOfValue();
214 di << ", V " << aDimTolObj->GetValue();
216 if (aDimTolObj->HasAxis())
218 gp_Ax2 anAx = aDimTolObj->GetAxis();
219 di << ", A ( L (" << anAx.Location().X() << anAx.Location().Y() << anAx.Location().Z()
220 << "), XD (" << anAx.XDirection().X() << anAx.XDirection().Y() << anAx.XDirection().Z()
221 << "), RD (" << anAx.YDirection().X() << anAx.YDirection().Y() << anAx.YDirection().Z() << "))";
223 XCAFDimTolObjects_GeomToleranceModifiersSequence aModif =
224 aDimTolObj->GetModifiers();
225 if (!aModif.IsEmpty())
228 for (Standard_Integer k = aModif.Lower(); k <= aModif.Upper(); k++)
230 di << " M " << aModif.Value(k);
233 if (aDimTolObj->GetMaterialRequirementModifier() != XCAFDimTolObjects_GeomToleranceMatReqModif_None)
235 di << ", MR " << aDimTolObj->GetMaterialRequirementModifier();
237 if (aDimTolObj->GetMaxValueModifier() > 0)
239 di << "MaxV " << aDimTolObj->GetMaxValueModifier();
241 if ( aDimTolObj->GetZoneModifier() != XCAFDimTolObjects_GeomToleranceZoneModif_None)
243 di << ", ZM " << aDimTolObj->GetZoneModifier();
244 if (aDimTolObj->GetValueOfZoneModifier() > 0)
246 di << " ZMV " <<aDimTolObj->GetValueOfZoneModifier();
252 Handle(XCAFDoc_GraphNode) aNode;
253 if(aGDTs.Value(j).FindAttribute(XCAFDoc::DatumTolRefGUID(), aNode) && aNode->NbChildren() > 0)
255 for(Standard_Integer k = 1; k<=aNode->NbChildren(); k++)
257 Handle(XCAFDoc_Datum) aDatum;
258 if(aNode->GetChild(k)->Label().FindAttribute(XCAFDoc_Datum::GetID(), aDatum))
260 Handle(XCAFDimTolObjects_DatumObject) aDatumObj = aDatum->GetObject();
261 TCollection_AsciiString anEntry;
262 TDF_Tool::Entry(aNode->GetChild(k)->Label(), anEntry);
263 di << "\n \t \t " << anEntry;
264 di << " Datum."<< i << "."<< j << "."<< k;
268 XCAFDimTolObjects_DatumModifiersSequence aModif =
269 aDatumObj->GetModifiers();
270 if (!aModif.IsEmpty())
273 for (Standard_Integer iModif = aModif.Lower(); iModif <= aModif.Upper(); iModif++)
275 di << " M " << aModif.Value(iModif);
278 XCAFDimTolObjects_DatumModifWithValue aM;
280 aDatumObj->GetModifierWithValue(aM, aV);
281 if (aM != XCAFDimTolObjects_DatumModifWithValue_None)
283 di << ", MV" << aM << " " << aV;
292 TDF_LabelSequence aDatumL;
293 if (aDimTolTool->GetRefDatumLabel(aLabels.Value(i), aDatumL))
295 for(Standard_Integer j = aDatumL.Lower(); j <= aDatumL.Upper(); j++)
297 Handle(XCAFDoc_Datum) aDatum;
298 if(aDatumL.Value(j).FindAttribute(XCAFDoc_Datum::GetID(), aDatum) &&
299 aDatum->GetObject()->IsDatumTarget())
301 Handle(XCAFDimTolObjects_DatumObject) aDatumObj = aDatum->GetObject();
304 TCollection_AsciiString Entry;
305 TDF_Tool::Entry(aLabels.Value(i), Entry);
306 di << "\n " << Entry << " Shape."<< i;
307 flag = Standard_False;
309 TCollection_AsciiString Entry;
310 TDF_Tool::Entry(aDatumL.First(), Entry);
311 di << "\n \t " << Entry;
312 flag = Standard_False;
314 di << " Datum target."<< i << "."<< j;
318 di << " T " << aDatumObj->GetDatumTargetType();
319 if (aDatumObj->GetDatumTargetType() != XCAFDimTolObjects_DatumTargetType_Area)
321 gp_Ax2 anAx = aDatumObj->GetDatumTargetAxis();
322 di << ", A ( L (" << anAx.Location().X() << anAx.Location().Y() << anAx.Location().Z()
323 << "), XD (" << anAx.XDirection().X() << anAx.XDirection().Y() << anAx.XDirection().Z()
324 << "), RD (" << anAx.YDirection().X() << anAx.YDirection().Y() << anAx.YDirection().Z() << "))";
325 if (aDatumObj->GetDatumTargetType() != XCAFDimTolObjects_DatumTargetType_Point)
327 di << ", L " << aDatumObj->GetDatumTargetLength() ;
328 if (aDatumObj->GetDatumTargetType() == XCAFDimTolObjects_DatumTargetType_Rectangle)
330 di << ", W " << aDatumObj->GetDatumTargetWidth() ;
343 static Standard_Integer DumpNbDGTs (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
346 di<<"Use: XDumpNbDGTs Doc";
350 Standard_Boolean isFull = Standard_False;
352 char aChar = argv[2][0];
354 isFull = Standard_True;
356 Handle(TDocStd_Document) Doc;
357 DDocStd::GetDocument(argv[1], Doc);
358 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
359 Handle(XCAFDoc_DimTolTool) aDimTolTool= XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
360 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
362 TDF_LabelSequence aLabels;
363 aShapeTool->GetShapes(aLabels);
364 for ( Standard_Integer i=1; i <= aLabels.Length(); i++ )
366 aShapeTool->GetSubShapes(aLabels.Value(i), aLabels);
369 TDF_LabelSequence aGDTs;
370 aDimTolTool->GetDimensionLabels(aGDTs);
371 di << "\n NbOfDimensions : " << aGDTs.Length();
373 Standard_Integer nbSize = 0,
378 for (Standard_Integer i = 1; i <= aGDTs.Length(); i++) {
379 Handle(XCAFDoc_Dimension) aDimAttr;
380 if (!aGDTs.Value(i).FindAttribute(XCAFDoc_Dimension::GetID(),aDimAttr))
382 Handle(XCAFDimTolObjects_DimensionObject) anObject = aDimAttr->GetObject();
383 if (anObject.IsNull())
385 XCAFDimTolObjects_DimensionType aDimType = anObject->GetType();
386 if (aDimType == XCAFDimTolObjects_DimensionType_CommonLabel) {
389 else if (STEPCAFControl_GDTProperty::IsDimensionalLocation(aDimType)) {
392 else if (aDimType == XCAFDimTolObjects_DimensionType_Location_Angular) {
396 else if (aDimType == XCAFDimTolObjects_DimensionType_Location_WithPath) {
400 else if (STEPCAFControl_GDTProperty::IsDimensionalSize(aDimType)) {
403 else if (aDimType == XCAFDimTolObjects_DimensionType_Size_Angular) {
407 else if (aDimType == XCAFDimTolObjects_DimensionType_Size_WithPath) {
412 di << "\n NbOfDimensionalSize : " << nbSize;
413 di << "\n NbOfDimensionalLocation: " << nbLocation;
414 di << "\n NbOfAngular : " << nbAngular;
415 di << "\n NbOfWithPath : " << nbWithPath;
416 di << "\n NbOfCommonLabels : " << nbCommon;
420 aDimTolTool->GetGeomToleranceLabels(aGDTs);
421 di << "\n NbOfTolerances : " << aGDTs.Length();
423 Standard_Integer nbWithModif = 0,
426 for (Standard_Integer i = 1; i <= aGDTs.Length(); i++) {
427 Handle(XCAFDoc_GeomTolerance) aGTAttr;
428 if (!aGDTs.Value(i).FindAttribute(XCAFDoc_GeomTolerance::GetID(),aGTAttr))
430 Handle(XCAFDimTolObjects_GeomToleranceObject) anObject = aGTAttr->GetObject();
431 if (anObject.IsNull())
433 if (anObject->GetMaterialRequirementModifier() != XCAFDimTolObjects_GeomToleranceMatReqModif_None) {
436 else if (anObject->GetModifiers().Length() > 0) {
437 Standard_Boolean isHasModif = Standard_False;
438 for (Standard_Integer j = 1; j <= anObject->GetModifiers().Length(); j++)
439 if (anObject->GetModifiers().Value(j) != XCAFDimTolObjects_GeomToleranceModif_All_Around &&
440 anObject->GetModifiers().Value(j) != XCAFDimTolObjects_GeomToleranceModif_All_Over) {
441 isHasModif = Standard_True;
447 if (anObject->GetMaxValueModifier() != 0) {
450 TDF_LabelSequence aDatumSeq;
451 aDimTolTool->GetDatumWithObjectOfTolerLabels(aGDTs.Value(i), aDatumSeq);
452 if (aDatumSeq.Length() > 0) {
456 di << "\n NbOfGTWithModifiers : " << nbWithModif;
457 di << "\n NbOfGTWithMaxTolerance : " << nbWithMaxTol;
458 di << "\n NbOfGTWithDatums : " << nbWithDatumRef;
461 Standard_Integer aCounter = 0;
462 Standard_Integer aCounter1 = 0;
463 Standard_Integer aCounter2 = 0;
465 for ( Standard_Integer i=1; i <= aLabels.Length(); i++ )
467 Standard_Boolean isDatum = Standard_False;
468 TDF_LabelSequence aDatL;
469 if(aDimTolTool->GetRefDatumLabel(aLabels.Value(i), aDatL))
471 for(Standard_Integer j = aDatL.Lower(); j <= aDatL.Upper(); j++)
473 Handle(XCAFDoc_Datum) aDat;
474 if(aDatL.Value(j).FindAttribute(XCAFDoc_Datum::GetID(), aDat))
476 if(aDat->GetObject()->IsDatumTarget())
483 isDatum = Standard_True;
491 di << "\n NbOfDatumFeature : " << aCounter;
492 di << "\n NbOfAttachedDatum : " << aCounter2;
493 di << "\n NbOfDatumTarget : " << aCounter1;
498 static Standard_Integer addDim (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
501 di<<"Use: XAddDimension Doc shape/label [shape/label]\n";
504 Handle(TDocStd_Document) Doc;
505 DDocStd::GetDocument(argv[1], Doc);
506 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
507 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
508 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
511 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
512 if ( aLabel.IsNull() )
514 TopoDS_Shape aShape= DBRep::Get(argv[2]);
515 if ( !aShape.IsNull() )
517 aShapeTool->Search(aShape, aLabel);
518 if ( aLabel.IsNull() )
520 di<<"Shape "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
528 TDF_Tool::Label(Doc->GetData(), argv[3], aLabel1);
529 if ( aLabel1.IsNull() )
531 TopoDS_Shape aShape= DBRep::Get(argv[3]);
532 if ( !aShape.IsNull() )
534 aShapeTool->Search(aShape, aLabel1);
535 if ( aLabel1.IsNull() )
537 di<<"Shape "<<argv[3]<<" is absent in "<<argv[1]<<"\n";
544 TDF_Label aDimL = aDimTolTool->AddDimension();
546 aDimTolTool->SetDimension(aLabel, aDimL);
548 aDimTolTool->SetDimension(aLabel, aLabel1, aDimL);
549 TCollection_AsciiString Entry;
550 TDF_Tool::Entry(aDimL, Entry);
555 static Standard_Integer addGTol (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
558 di<<"Use: XAddGeomTolerance Doc shape/label\n";
561 Handle(TDocStd_Document) Doc;
562 DDocStd::GetDocument(argv[1], Doc);
563 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
564 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
565 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
568 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
569 if ( aLabel.IsNull() )
571 TopoDS_Shape aShape= DBRep::Get(argv[2]);
572 if ( !aShape.IsNull() )
574 aShapeTool->Search(aShape, aLabel);
575 if ( aLabel.IsNull() )
577 di<<"Shape "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
583 TDF_Label aTolL = aDimTolTool->AddGeomTolerance();
584 aDimTolTool->SetGeomTolerance(aLabel, aTolL);
585 TCollection_AsciiString Entry;
586 TDF_Tool::Entry(aTolL, Entry);
591 static Standard_Integer addDatum (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
594 di<<"Use: XAddDatum Doc shape1/label1 ... shapeN/labelN\n";
597 Handle(TDocStd_Document) Doc;
598 DDocStd::GetDocument(argv[1], Doc);
599 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
600 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
601 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
603 TDF_LabelSequence aLabelSeq;
604 for (Standard_Integer i = 2; i < argc; i++) {
606 TDF_Tool::Label(Doc->GetData(), argv[i], aLabel);
607 if (aLabel.IsNull()) {
608 TopoDS_Shape aShape = DBRep::Get(argv[i]);
609 if (!aShape.IsNull())
610 aShapeTool->Search(aShape, aLabel);
614 aLabelSeq.Append(aLabel);
617 TDF_Label aDatumL = aDimTolTool->AddDatum();
618 aDimTolTool->SetDatum(aLabelSeq, aDatumL);
619 TCollection_AsciiString Entry;
620 TDF_Tool::Entry(aDatumL, Entry);
625 static Standard_Integer setDatum (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
628 di<<"Use: XSetDatum Doc Datum_Label GeomTol_Label\n";
631 Handle(TDocStd_Document) Doc;
632 DDocStd::GetDocument(argv[1], Doc);
633 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
634 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
635 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
638 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
639 if ( aLabel.IsNull() )
641 di<<"Datum "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
646 TDF_Tool::Label(Doc->GetData(), argv[3], aTol);
649 di<<"GeomTolerance "<<argv[3]<<" is absent in "<<argv[1]<<"\n";
653 // check datum position number
654 Handle(XCAFDoc_Datum) aDatumAttr;
655 if (!aLabel.FindAttribute(XCAFDoc_Datum::GetID(), aDatumAttr))
657 di<<"Invalid datum object\n";
660 Handle(XCAFDimTolObjects_DatumObject) aDatumObj = aDatumAttr->GetObject();
661 if (aDatumObj.IsNull())
663 di<<"Invalid datum object\n";
667 if (aDatumObj->GetPosition() < 1 || aDatumObj->GetPosition() > 3)
669 di<<"Invalid datum position number: use XSetDatumPosition\n";
673 aDimTolTool->SetDatumToGeomTol(aLabel, aTol);
677 static Standard_Integer setDatumPosition (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
680 di<<"Use: XSetDatumPosition Doc Datum_Label position[1-3]\n";
684 if (Draw::Atoi(argv[3]) < 1 || Draw::Atoi(argv[3]) > 3) {
685 di<<"Datum position should be 1, 2 or 3\n";
689 Handle(TDocStd_Document) Doc;
690 DDocStd::GetDocument(argv[1], Doc);
691 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
692 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
693 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
696 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
697 if ( aLabel.IsNull() )
699 di<<"Datum "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
702 Handle(XCAFDoc_Datum) aDatum;
703 if(aLabel.FindAttribute(XCAFDoc_Datum::GetID(), aDatum))
705 Handle(XCAFDimTolObjects_DatumObject) anObj = aDatum->GetObject();
706 anObj->SetPosition(Draw::Atoi(argv[3]));
707 aDatum->SetObject(anObj);
712 static Standard_Integer getDatumPosition (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
715 di<<"Use: XGetDatumPosition Doc Datum_Label\n";
718 Handle(TDocStd_Document) Doc;
719 DDocStd::GetDocument(argv[1], Doc);
720 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
721 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
722 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
725 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
726 if ( aLabel.IsNull() )
728 di<<"Datum "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
731 Handle(XCAFDoc_Datum) aDatum;
732 if(aLabel.FindAttribute(XCAFDoc_Datum::GetID(), aDatum))
734 di << aDatum->GetObject()->GetPosition();
740 static Standard_Integer getDatum (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
743 di<<"Use: XGetDatum Doc GeomTol_Label/Shape_Label\n";
746 Handle(TDocStd_Document) Doc;
747 DDocStd::GetDocument(argv[1], Doc);
748 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
749 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
750 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
753 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
754 if ( aLabel.IsNull() )
756 di<<"Label "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
760 TDF_LabelSequence aD;
761 if(!aDimTolTool->GetRefDatumLabel(aLabel, aD))
763 aDimTolTool->GetDatumOfTolerLabels(aLabel, aD);
765 for(Standard_Integer i = aD.Lower(); i <= aD.Upper(); i++)
768 TCollection_AsciiString Entry;
769 TDF_Tool::Entry(aD.Value(i), Entry);
775 static Standard_Integer addDatumModif (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
778 di<<"Use: XAddDatumModifier Doc Datum_Label mod1 mod2 ...\n";
781 Handle(TDocStd_Document) Doc;
782 DDocStd::GetDocument(argv[1], Doc);
783 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
784 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
785 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
788 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
789 if ( aLabel.IsNull() )
791 di<<"Datum "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
794 Handle(XCAFDoc_Datum) aDatum;
795 if(aLabel.FindAttribute(XCAFDoc_Datum::GetID(), aDatum))
797 for(Standard_Integer i = 3; i < argc; i++)
799 if(Draw::Atoi(argv[i]) < 22 && Draw::Atoi(argv[i]) > -1)
801 Handle(XCAFDimTolObjects_DatumObject) anObj = aDatum->GetObject();
802 anObj->AddModifier((XCAFDimTolObjects_DatumSingleModif)Draw::Atoi(argv[i]));
803 aDatum->SetObject(anObj);
810 static Standard_Integer getDatumModif (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
813 di<<"Use: XGetDatumModifiers Doc Datum_Label\n";
816 Handle(TDocStd_Document) Doc;
817 DDocStd::GetDocument(argv[1], Doc);
818 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
819 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
820 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
823 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
824 if ( aLabel.IsNull() )
826 di<<"Datum "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
829 Handle(XCAFDoc_Datum) aDatum;
830 if(aLabel.FindAttribute(XCAFDoc_Datum::GetID(), aDatum))
832 XCAFDimTolObjects_DatumModifiersSequence aS = aDatum->GetObject()->GetModifiers();
833 for(Standard_Integer i = 1; i<=aS.Length();i++)
837 case 0 : di<<"AnyCrossSection"; break;
838 case 1 : di<<"AnyLongitudinalSection"; break;
839 case 2 : di<<"Basic"; break;
840 case 3 : di<<"ContactingFeature\n"; break;
841 case 4 : di<<"DegreeOfFreedomConstraintU"; break;
842 case 5 : di<<"DegreeOfFreedomConstraintV"; break;
843 case 6 : di<<"DegreeOfFreedomConstraintW"; break;
844 case 7 : di<<"DegreeOfFreedomConstraintX"; break;
845 case 8 : di<<"DegreeOfFreedomConstraintY"; break;
846 case 9 : di<<"DegreeOfFreedomConstraintZ"; break;
847 case 10 : di<<"DistanceVariable"; break;
848 case 11 : di<<"FreeState"; break;
849 case 12 : di<<"LeastMaterialRequirement"; break;
850 case 13 : di<<"Line"; break;
851 case 14 : di<<"MajorDiameter"; break;
852 case 15 : di<<"MaximumMaterialRequirement"; break;
853 case 16 : di<<"MinorDiameter"; break;
854 case 17 : di<<"Orientation"; break;
855 case 18 : di<<"PitchDiameter"; break;
856 case 19 : di<<"Plane"; break;
857 case 20 : di<<"Point"; break;
858 case 21 : di<<"Translation"; break;
866 static Standard_Integer setDatumName (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
869 di<<"Use: XSetDatumName Doc Datum_Label name\n";
872 Handle(TDocStd_Document) Doc;
873 DDocStd::GetDocument(argv[1], Doc);
874 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
875 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
876 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
879 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
880 if ( aLabel.IsNull() )
882 di<<"Datum "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
885 Handle(XCAFDoc_Datum) aDatum;
886 if(aLabel.FindAttribute(XCAFDoc_Datum::GetID(), aDatum))
888 Handle(XCAFDimTolObjects_DatumObject) anObj = aDatum->GetObject();
889 anObj->SetName(new TCollection_HAsciiString(argv[3]));
890 aDatum->SetObject(anObj);
895 static Standard_Integer getDatumName (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
898 di<<"Use: XGetDatumName Doc Datum_Label\n";
901 Handle(TDocStd_Document) Doc;
902 DDocStd::GetDocument(argv[1], Doc);
903 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
904 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
905 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
908 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
909 if ( aLabel.IsNull() )
911 di<<"Datum "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
914 Handle(XCAFDoc_Datum) aDatum;
915 if(aLabel.FindAttribute(XCAFDoc_Datum::GetID(), aDatum))
917 di<<aDatum->GetObject()->GetName()->ToCString();
922 static Standard_Integer setTypeOfTol (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
925 di<<"Use: XSetTypeOfTolerance Doc GTol_Label type\n";
928 Handle(TDocStd_Document) Doc;
929 DDocStd::GetDocument(argv[1], Doc);
930 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
931 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
932 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
935 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
936 if ( aLabel.IsNull() )
938 di<<"GeomTolerance "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
941 Handle(XCAFDoc_GeomTolerance) aGeomTolerance;
942 if(aLabel.FindAttribute(XCAFDoc_GeomTolerance::GetID(), aGeomTolerance))
944 if(Draw::Atoi(argv[3]) > -1 && Draw::Atoi(argv[3]) < 16)
946 Handle(XCAFDimTolObjects_GeomToleranceObject) anObj = aGeomTolerance->GetObject();
947 anObj->SetType((XCAFDimTolObjects_GeomToleranceType)Draw::Atoi(argv[3]));
948 aGeomTolerance->SetObject(anObj);
954 static Standard_Integer getTypeOfTol (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
957 di<<"Use: XGetTypeOfTolerance Doc GTol_Label\n";
960 Handle(TDocStd_Document) Doc;
961 DDocStd::GetDocument(argv[1], Doc);
962 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
963 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
964 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
967 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
968 if ( aLabel.IsNull() )
970 di<<"GeomTolerance "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
973 Handle(XCAFDoc_GeomTolerance) aGeomTolerance;
974 if(aLabel.FindAttribute(XCAFDoc_GeomTolerance::GetID(), aGeomTolerance))
976 switch(aGeomTolerance->GetObject()->GetType()){
977 case 0 : di<<"type is absent"; break;
978 case 1 : di<<"Angularity"; break;
979 case 2 : di<<"CircularRunout"; break;
980 case 3 : di<<"CircularityOrRoundness"; break;
981 case 4 : di<<"Coaxiality"; break;
982 case 5 : di<<"Concentricity"; break;
983 case 6 : di<<"Cylindricity"; break;
984 case 7 : di<<"Flatness"; break;
985 case 8 : di<<"Parallelism"; break;
986 case 9 : di<<"Perpendicularity"; break;
987 case 10 : di<<"Position"; break;
988 case 11 : di<<"ProfileOfLine"; break;
989 case 12 : di<<"ProfileOfSurface"; break;
990 case 13 : di<<"Straightness"; break;
991 case 14 : di<<"Symmetry"; break;
992 case 15 : di<<"TotalRunout"; break;
999 static Standard_Integer setTypeOfTolVal (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
1002 di<<"Use: XSetTypeOfToleranceValue Doc GTol_Label type\n";
1005 Handle(TDocStd_Document) Doc;
1006 DDocStd::GetDocument(argv[1], Doc);
1007 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
1008 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
1009 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
1012 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
1013 if ( aLabel.IsNull() )
1015 di<<"GeomTolerance "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
1018 Handle(XCAFDoc_GeomTolerance) aGeomTolerance;
1019 if(aLabel.FindAttribute(XCAFDoc_GeomTolerance::GetID(), aGeomTolerance))
1021 if(Draw::Atoi(argv[3]) > -1 && Draw::Atoi(argv[3]) < 3)
1023 Handle(XCAFDimTolObjects_GeomToleranceObject) anObj = aGeomTolerance->GetObject();
1024 anObj->SetTypeOfValue((XCAFDimTolObjects_GeomToleranceTypeValue)Draw::Atoi(argv[3]));
1025 aGeomTolerance->SetObject(anObj);
1031 static Standard_Integer getTypeOfTolVal (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
1034 di<<"Use: XGetTypeOfToleranceValue Doc GTol_Label\n";
1037 Handle(TDocStd_Document) Doc;
1038 DDocStd::GetDocument(argv[1], Doc);
1039 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
1040 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
1041 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
1044 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
1045 if ( aLabel.IsNull() )
1047 di<<"GeomTolerance "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
1050 Handle(XCAFDoc_GeomTolerance) aGeomTolerance;
1051 if(aLabel.FindAttribute(XCAFDoc_GeomTolerance::GetID(), aGeomTolerance))
1053 switch(aGeomTolerance->GetObject()->GetTypeOfValue()){
1054 case 0 : di<<"type is absent"; break;
1055 case 1 : di<<"Diameter"; break;
1056 case 2 : di<<"SphericalDiameter"; break;
1063 static Standard_Integer setTolVal (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
1066 di<<"Use: XSetToleranceValue Doc GTol_Label value\n";
1069 Handle(TDocStd_Document) Doc;
1070 DDocStd::GetDocument(argv[1], Doc);
1071 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
1072 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
1073 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
1076 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
1077 if ( aLabel.IsNull() )
1079 di<<"GeomTolerance "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
1082 Handle(XCAFDoc_GeomTolerance) aGeomTolerance;
1083 if(aLabel.FindAttribute(XCAFDoc_GeomTolerance::GetID(), aGeomTolerance))
1085 Handle(XCAFDimTolObjects_GeomToleranceObject) anObj = aGeomTolerance->GetObject();
1086 anObj->SetValue(Draw::Atof(argv[3]));
1087 aGeomTolerance->SetObject(anObj);
1092 static Standard_Integer getTolVal (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
1095 di<<"Use: XGetToleranceValue Doc GTol_Label\n";
1098 Handle(TDocStd_Document) Doc;
1099 DDocStd::GetDocument(argv[1], Doc);
1100 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
1101 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
1102 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
1105 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
1106 if ( aLabel.IsNull() )
1108 di<<"GeomTolerance "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
1111 Handle(XCAFDoc_GeomTolerance) aGeomTolerance;
1112 if(aLabel.FindAttribute(XCAFDoc_GeomTolerance::GetID(), aGeomTolerance))
1114 di << aGeomTolerance->GetObject()->GetValue();
1119 static Standard_Integer setMatReq (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
1122 di<<"Use: XSetTolMaterialReq Doc GTol_Label mod\n";
1125 Handle(TDocStd_Document) Doc;
1126 DDocStd::GetDocument(argv[1], Doc);
1127 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
1128 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
1129 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
1132 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
1133 if ( aLabel.IsNull() )
1135 di<<"GeomTolerance "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
1138 Handle(XCAFDoc_GeomTolerance) aGeomTolerance;
1139 if(aLabel.FindAttribute(XCAFDoc_GeomTolerance::GetID(), aGeomTolerance))
1141 if(Draw::Atoi(argv[3]) > -1 && Draw::Atoi(argv[3]) < 3)
1143 Handle(XCAFDimTolObjects_GeomToleranceObject) anObj = aGeomTolerance->GetObject();
1144 anObj->SetMaterialRequirementModifier((XCAFDimTolObjects_GeomToleranceMatReqModif)Draw::Atoi(argv[3]));
1145 aGeomTolerance->SetObject(anObj);
1151 static Standard_Integer getMatReq (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
1154 di<<"Use: XGetTolMaterialReq Doc GTol_Label\n";
1157 Handle(TDocStd_Document) Doc;
1158 DDocStd::GetDocument(argv[1], Doc);
1159 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
1160 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
1161 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
1164 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
1165 if ( aLabel.IsNull() )
1167 di<<"GeomTolerance "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
1170 Handle(XCAFDoc_GeomTolerance) aGeomTolerance;
1171 if(aLabel.FindAttribute(XCAFDoc_GeomTolerance::GetID(), aGeomTolerance))
1173 switch(aGeomTolerance->GetObject()->GetMaterialRequirementModifier()){
1174 case 0 : di<<"modifier is absent"; break;
1175 case 1 : di<<"M"; break;
1176 case 2 : di<<"L"; break;
1183 static Standard_Integer setZoneMod (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
1186 di<<"Use: XSetTolZoneMod Doc GTol_Label mod\n";
1189 Handle(TDocStd_Document) Doc;
1190 DDocStd::GetDocument(argv[1], Doc);
1191 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
1192 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
1193 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
1196 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
1197 if ( aLabel.IsNull() )
1199 di<<"GeomTolerance "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
1202 Handle(XCAFDoc_GeomTolerance) aGeomTolerance;
1203 if(aLabel.FindAttribute(XCAFDoc_GeomTolerance::GetID(), aGeomTolerance))
1205 if(Draw::Atoi(argv[3]) > -1 && Draw::Atoi(argv[3]) < 3)
1207 Handle(XCAFDimTolObjects_GeomToleranceObject) anObj = aGeomTolerance->GetObject();
1208 anObj->SetZoneModifier((XCAFDimTolObjects_GeomToleranceZoneModif)Draw::Atoi(argv[3]));
1209 aGeomTolerance->SetObject(anObj);
1215 static Standard_Integer getZoneMod (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
1218 di<<"Use: XGetTolZoneMod Doc GTol_Label\n";
1221 Handle(TDocStd_Document) Doc;
1222 DDocStd::GetDocument(argv[1], Doc);
1223 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
1224 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
1225 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
1228 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
1229 if ( aLabel.IsNull() )
1231 di<<"GeomTolerance "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
1234 Handle(XCAFDoc_GeomTolerance) aGeomTolerance;
1235 if(aLabel.FindAttribute(XCAFDoc_GeomTolerance::GetID(), aGeomTolerance))
1237 switch(aGeomTolerance->GetObject()->GetZoneModifier()){
1238 case 0 : di<<"modifier is absent"; break;
1239 case 1 : di<<"P"; break;
1240 case 2 : di<<"NonUniform"; break;
1247 static Standard_Integer setZoneModVal (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
1250 di<<"Use: XSetTolZoneModValue Doc GTol_Label val\n";
1253 Handle(TDocStd_Document) Doc;
1254 DDocStd::GetDocument(argv[1], Doc);
1255 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
1256 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
1257 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
1260 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
1261 if ( aLabel.IsNull() )
1263 di<<"GeomTolerance "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
1266 Handle(XCAFDoc_GeomTolerance) aGeomTolerance;
1267 if(aLabel.FindAttribute(XCAFDoc_GeomTolerance::GetID(), aGeomTolerance))
1269 Handle(XCAFDimTolObjects_GeomToleranceObject) anObj = aGeomTolerance->GetObject();
1270 anObj->SetValueOfZoneModifier(Draw::Atof(argv[3]));
1271 aGeomTolerance->SetObject(anObj);
1276 static Standard_Integer getZoneModVal (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
1279 di<<"Use: XGetTolZoneModValue Doc GTol_Label\n";
1282 Handle(TDocStd_Document) Doc;
1283 DDocStd::GetDocument(argv[1], Doc);
1284 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
1285 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
1286 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
1289 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
1290 if ( aLabel.IsNull() )
1292 di<<"GeomTolerance "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
1295 Handle(XCAFDoc_GeomTolerance) aGeomTolerance;
1296 if(aLabel.FindAttribute(XCAFDoc_GeomTolerance::GetID(), aGeomTolerance))
1298 di << aGeomTolerance->GetObject()->GetValueOfZoneModifier();
1303 static Standard_Integer addTolModif (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
1306 di<<"Use: XAddTolModifier Doc Tol_Label mod1 mod2 ...\n";
1309 Handle(TDocStd_Document) Doc;
1310 DDocStd::GetDocument(argv[1], Doc);
1311 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
1312 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
1313 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
1316 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
1317 if ( aLabel.IsNull() )
1319 di<<"GeomTolerance "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
1322 Handle(XCAFDoc_GeomTolerance) aGeomTolerance;
1323 if(aLabel.FindAttribute(XCAFDoc_GeomTolerance::GetID(), aGeomTolerance))
1325 for(Standard_Integer i = 3; i < argc; i++)
1327 if(Draw::Atoi(argv[i]) > -1 && Draw::Atoi(argv[i]) < 17)
1329 Handle(XCAFDimTolObjects_GeomToleranceObject) anObj = aGeomTolerance->GetObject();
1330 anObj->AddModifier((XCAFDimTolObjects_GeomToleranceModif)Draw::Atoi(argv[i]));
1331 aGeomTolerance->SetObject(anObj);
1338 static Standard_Integer getTolModif (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
1341 di<<"Use: XGetTolModifiers Doc Tol_Label\n";
1344 Handle(TDocStd_Document) Doc;
1345 DDocStd::GetDocument(argv[1], Doc);
1346 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
1347 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
1348 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
1351 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
1352 if ( aLabel.IsNull() )
1354 di<<"GeomTolerance "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
1357 Handle(XCAFDoc_GeomTolerance) aGeomTolerance;
1358 if(aLabel.FindAttribute(XCAFDoc_GeomTolerance::GetID(), aGeomTolerance))
1360 XCAFDimTolObjects_GeomToleranceModifiersSequence aS = aGeomTolerance->GetObject()->GetModifiers();
1361 for(Standard_Integer i = 1; i <= aS.Length(); i++)
1363 if (i > 1) di<<", ";
1364 switch(aS.Value(i)){
1365 case 0 : di<<"Any_Cross_Section"; break;
1366 case 1 : di<<"Common_Zone"; break;
1367 case 2 : di<<"Each_Radial_Element"; break;
1368 case 3 : di<<"Free_State"; break;
1369 case 4 : di<<"Least_Material_Requirement"; break;
1370 case 5 : di<<"Line_Element"; break;
1371 case 6 : di<<"Major_Diameter"; break;
1372 case 7 : di<<"Maximum_Material_Requirement"; break;
1373 case 8 : di<<"Minor_Diameter"; break;
1374 case 9 : di<<"Not_Convex"; break;
1375 case 10 : di<<"Pitch_Diameter"; break;
1376 case 11 : di<<"Reciprocity_Requirement"; break;
1377 case 12 : di<<"Separate_Requirement"; break;
1378 case 13 : di<<"Statistical_Tolerance"; break;
1379 case 14 : di<<"Tangent_Plane"; break;
1387 static Standard_Integer setTolMaxVal (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
1390 di<<"Use: XSetTolMaxValue Doc Dim_Label val\n";
1393 Handle(TDocStd_Document) Doc;
1394 DDocStd::GetDocument(argv[1], Doc);
1395 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
1396 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
1397 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
1400 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
1401 if ( aLabel.IsNull() )
1403 di<<"GeomTolerance "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
1406 Handle(XCAFDoc_GeomTolerance) aGeomTolerance;
1407 if(aLabel.FindAttribute(XCAFDoc_GeomTolerance::GetID(), aGeomTolerance))
1409 Handle(XCAFDimTolObjects_GeomToleranceObject) anObj = aGeomTolerance->GetObject();
1410 anObj->SetMaxValueModifier(Draw::Atof(argv[3]));
1411 aGeomTolerance->SetObject(anObj);
1416 static Standard_Integer getTolMaxVal (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
1419 di<<"Use: XGetTolMaxValue Doc Dim_Label\n";
1422 Handle(TDocStd_Document) Doc;
1423 DDocStd::GetDocument(argv[1], Doc);
1424 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
1425 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
1426 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
1429 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
1430 if ( aLabel.IsNull() )
1432 di<<"GeomTolerance "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
1435 Handle(XCAFDoc_GeomTolerance) aGeomTolerance;
1436 if(aLabel.FindAttribute(XCAFDoc_GeomTolerance::GetID(), aGeomTolerance))
1438 di << aGeomTolerance->GetObject()->GetMaxValueModifier();
1443 static Standard_Integer setDimType (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
1446 di<<"Use: XSetDimensionType Doc Dim_Label type\n";
1449 Handle(TDocStd_Document) Doc;
1450 DDocStd::GetDocument(argv[1], Doc);
1451 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
1452 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
1453 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
1456 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
1457 if ( aLabel.IsNull() )
1459 di<<"Dimension "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
1462 Handle(XCAFDoc_Dimension) aDimension;
1463 if(aLabel.FindAttribute(XCAFDoc_Dimension::GetID(), aDimension))
1465 if(Draw::Atoi(argv[3]) > -1 && Draw::Atoi(argv[3]) < 30)
1467 Handle(XCAFDimTolObjects_DimensionObject) anObj = aDimension->GetObject();
1468 anObj->SetType((XCAFDimTolObjects_DimensionType)Draw::Atoi(argv[3]));
1469 aDimension->SetObject(anObj);
1475 static Standard_Integer getDimType (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
1478 di<<"Use: XGetDimensionType Doc Dim_Label\n";
1481 Handle(TDocStd_Document) Doc;
1482 DDocStd::GetDocument(argv[1], Doc);
1483 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
1484 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
1485 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
1488 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
1489 if ( aLabel.IsNull() )
1491 di<<"Dimension "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
1494 Handle(XCAFDoc_Dimension) aDimension;
1495 if(aLabel.FindAttribute(XCAFDoc_Dimension::GetID(), aDimension))
1497 switch(aDimension->GetObject()->GetType()){
1498 case 0 : di<<"type is absent"; break;
1499 case 1 : di<<"Location_CurvedDistance"; break;
1500 case 2 : di<<"Location_LinearDistance"; break;
1501 case 3 : di<<"Location_LinearDistance_FromCenterToOuter"; break;
1502 case 4 : di<<"Location_LinearDistance_FromCenterToInner"; break;
1503 case 5 : di<<"Location_LinearDistance_FromOuterToCenter"; break;
1504 case 6 : di<<"Location_LinearDistance_FromOuterToOuter"; break;
1505 case 7 : di<<"Location_LinearDistance_FromOuterToInner"; break;
1506 case 8 : di<<"Location_LinearDistance_FromInnerToCenter"; break;
1507 case 9 : di<<"Location_LinearDistance_FromInnerToOuter"; break;
1508 case 10 : di<<"Location_LinearDistance_FromInnerToInner"; break;
1509 case 11 : di<<"Location_Angular"; break;
1510 case 12 : di<<"Location_Oriented"; break;
1511 case 13 : di<<"Location_WithPath"; break;
1512 case 14 : di<<"Size_CurveLength"; break;
1513 case 15 : di<<"Size_Diameter"; break;
1514 case 16 : di<<"Size_SphericalDiameter"; break;
1515 case 17 : di<<"Size_Radius"; break;
1516 case 18 : di<<"Size_SphericalRadius"; break;
1517 case 19 : di<<"Size_ToroidalMinorDiameter"; break;
1518 case 20 : di<<"Size_ToroidalMajorDiameter"; break;
1519 case 21 : di<<"Size_ToroidalMinorRadius"; break;
1520 case 22 : di<<"Size_ToroidalMajorRadius"; break;
1521 case 23 : di<<"Size_ToroidalHighMajorDiameter"; break;
1522 case 24 : di<<"Size_ToroidalLowMajorDiameter"; break;
1523 case 25 : di<<"Size_ToroidalHighMajorRadius"; break;
1524 case 26 : di<<"Size_ToroidalLowMajorRadius"; break;
1525 case 27 : di<<"Size_Thickness"; break;
1526 case 28 : di<<"Size_Angular"; break;
1527 case 29 : di<<"Size_WithPath"; break;
1534 static Standard_Integer setDimVal (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
1537 di<<"Use: XSetDimensionValue Doc Dim_Label val\n";
1540 Handle(TDocStd_Document) Doc;
1541 DDocStd::GetDocument(argv[1], Doc);
1542 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
1543 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
1544 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
1547 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
1548 if ( aLabel.IsNull() )
1550 di<<"Dimension "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
1553 Handle(XCAFDoc_Dimension) aDimension;
1554 if(aLabel.FindAttribute(XCAFDoc_Dimension::GetID(), aDimension))
1556 Handle(XCAFDimTolObjects_DimensionObject) anObj = aDimension->GetObject();
1557 anObj->SetValue(Draw::Atof(argv[3]));
1558 aDimension->SetObject(anObj);
1563 static Standard_Integer getDimVal (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
1566 di<<"Use: XGetDimensionValue Doc Dim_Label\n";
1569 Handle(TDocStd_Document) Doc;
1570 DDocStd::GetDocument(argv[1], Doc);
1571 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
1572 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
1573 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
1576 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
1577 if ( aLabel.IsNull() )
1579 di<<"Dimension "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
1582 Handle(XCAFDoc_Dimension) aDimension;
1583 if(aLabel.FindAttribute(XCAFDoc_Dimension::GetID(), aDimension))
1585 di << aDimension->GetObject()->GetValue();
1590 static Standard_Integer setDimQalif (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
1593 di<<"Use: XSetDimensionQualifier Doc Dim_Label val\n";
1596 Handle(TDocStd_Document) Doc;
1597 DDocStd::GetDocument(argv[1], Doc);
1598 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
1599 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
1600 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
1603 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
1604 if ( aLabel.IsNull() )
1606 di<<"Dimension "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
1609 Handle(XCAFDoc_Dimension) aDimension;
1610 if(aLabel.FindAttribute(XCAFDoc_Dimension::GetID(), aDimension))
1612 if(Draw::Atoi(argv[3]) > -1 && Draw::Atoi(argv[3]) < 4)
1614 Handle(XCAFDimTolObjects_DimensionObject) anObj = aDimension->GetObject();
1615 anObj->SetQualifier((XCAFDimTolObjects_DimensionQualifier)Draw::Atoi(argv[3]));
1616 aDimension->SetObject(anObj);
1622 static Standard_Integer getDimQalif (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
1625 di<<"Use: XGetDimensionQualifier Doc Dim_Label\n";
1628 Handle(TDocStd_Document) Doc;
1629 DDocStd::GetDocument(argv[1], Doc);
1630 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
1631 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
1632 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
1635 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
1636 if ( aLabel.IsNull() )
1638 di<<"Dimension "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
1641 Handle(XCAFDoc_Dimension) aDimension;
1642 if(aLabel.FindAttribute(XCAFDoc_Dimension::GetID(), aDimension))
1645 switch(aDimension->GetObject()->GetQualifier()){
1646 case 0 : di<<"type is absent"; break;
1647 case 1 : di<<"Min"; break;
1648 case 2 : di<<"Max"; break;
1649 case 3 : di<<"Avg"; break;
1656 static Standard_Integer setDimRange (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
1659 di<<"Use: XSetDimensionRange Doc Dim_Label low_val up_val\n";
1662 Handle(TDocStd_Document) Doc;
1663 DDocStd::GetDocument(argv[1], Doc);
1664 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
1665 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
1666 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
1669 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
1670 if ( aLabel.IsNull() )
1672 di<<"Dimension "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
1675 Handle(XCAFDoc_Dimension) aDimension;
1676 if(aLabel.FindAttribute(XCAFDoc_Dimension::GetID(), aDimension))
1678 if(Draw::Atof(argv[3]) < Draw::Atof(argv[4]))
1680 Handle(XCAFDimTolObjects_DimensionObject) anObj = aDimension->GetObject();
1681 anObj->SetLowerBound(Draw::Atof(argv[3]));
1682 anObj->SetUpperBound(Draw::Atof(argv[4]));
1683 aDimension->SetObject(anObj);
1689 static Standard_Integer getDimRange (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
1692 di<<"Use: XGetDimensionRange Doc Dim_Label\n";
1695 Handle(TDocStd_Document) Doc;
1696 DDocStd::GetDocument(argv[1], Doc);
1697 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
1698 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
1699 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
1702 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
1703 if ( aLabel.IsNull() )
1705 di<<"Dimension "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
1708 Handle(XCAFDoc_Dimension) aDimension;
1709 if(aLabel.FindAttribute(XCAFDoc_Dimension::GetID(), aDimension))
1711 di << "lower " << aDimension->GetObject()->GetLowerBound();
1712 di << " upper " << aDimension->GetObject()->GetUpperBound();
1717 static Standard_Integer setDimPlusMinusTol (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
1720 di<<"Use: XSetDimensionPlusMinusTol Doc Dim_Label low_val up_val\n";
1723 Handle(TDocStd_Document) Doc;
1724 DDocStd::GetDocument(argv[1], Doc);
1725 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
1726 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
1727 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
1730 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
1731 if ( aLabel.IsNull() )
1733 di<<"Dimension "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
1736 Handle(XCAFDoc_Dimension) aDimension;
1737 if(aLabel.FindAttribute(XCAFDoc_Dimension::GetID(), aDimension))
1739 if(Draw::Atof(argv[3]) < Draw::Atof(argv[4]))
1741 Handle(XCAFDimTolObjects_DimensionObject) anObj = aDimension->GetObject();
1742 anObj->SetLowerTolValue(Draw::Atof(argv[3]));
1743 anObj->SetUpperTolValue(Draw::Atof(argv[4]));
1744 aDimension->SetObject(anObj);
1750 static Standard_Integer getDimPlusMinusTol (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
1753 di<<"Use: XGetDimensionPlusMinusTol Doc Dim_Label\n";
1756 Handle(TDocStd_Document) Doc;
1757 DDocStd::GetDocument(argv[1], Doc);
1758 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
1759 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
1760 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
1763 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
1764 if ( aLabel.IsNull() )
1766 di<<"Dimension "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
1769 Handle(XCAFDoc_Dimension) aDimension;
1770 if(aLabel.FindAttribute(XCAFDoc_Dimension::GetID(), aDimension))
1772 di << "lower " << aDimension->GetObject()->GetLowerTolValue();
1773 di << " upper " << aDimension->GetObject()->GetUpperTolValue();
1778 static Standard_Integer setDimClassTol (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
1781 di<<"Use: XSetDimensionClassOfTol Doc Dim_Label ishole[1/0] formVar grade\n";
1784 Handle(TDocStd_Document) Doc;
1785 DDocStd::GetDocument(argv[1], Doc);
1786 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
1787 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
1788 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
1791 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
1792 if ( aLabel.IsNull() )
1794 di<<"Dimension "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
1797 Handle(XCAFDoc_Dimension) aDimension;
1798 if(aLabel.FindAttribute(XCAFDoc_Dimension::GetID(), aDimension))
1800 if(Draw::Atoi(argv[4]) > 0 && Draw::Atoi(argv[4]) < 29 && Draw::Atoi(argv[5]) > -1 && Draw::Atoi(argv[5]) < 20)
1802 Handle(XCAFDimTolObjects_DimensionObject) anObj = aDimension->GetObject();
1803 anObj->SetClassOfTolerance((Draw::Atoi(argv[3]) != 0), (XCAFDimTolObjects_DimensionFormVariance)Draw::Atoi(argv[4]), (XCAFDimTolObjects_DimensionGrade)Draw::Atoi(argv[5]));
1804 aDimension->SetObject(anObj);
1810 static Standard_Integer getDimClassTol (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
1813 di<<"Use: XGetDimensionClassOfTol Doc Dim_Label\n";
1816 Handle(TDocStd_Document) Doc;
1817 DDocStd::GetDocument(argv[1], Doc);
1818 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
1819 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
1820 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
1823 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
1824 if ( aLabel.IsNull() )
1826 di<<"Dimension "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
1829 Handle(XCAFDoc_Dimension) aDimension;
1830 if(aLabel.FindAttribute(XCAFDoc_Dimension::GetID(), aDimension))
1833 XCAFDimTolObjects_DimensionFormVariance f;
1834 XCAFDimTolObjects_DimensionGrade g;
1835 if(aDimension->GetObject()->GetClassOfTolerance(h ,f, g))
1840 case 1 : di<<"a";break;
1841 case 2 : di<<"b";break;
1842 case 3 : di<<"c";break;
1843 case 4 : di<<"cd";break;
1844 case 5 : di<<"d";break;
1845 case 6 : di<<"e";break;
1846 case 7 : di<<"ef";break;
1847 case 8 : di<<"f";break;
1848 case 9 : di<<"fg";break;
1849 case 10 : di<<"g";break;
1850 case 11 : di<<"h";break;
1851 case 12 : di<<"js";break;
1852 case 13 : di<<"j";break;
1853 case 14 : di<<"k";break;
1854 case 15 : di<<"m";break;
1855 case 16 : di<<"n";break;
1856 case 17 : di<<"p";break;
1857 case 18 : di<<"r";break;
1858 case 19 : di<<"s";break;
1859 case 20 : di<<"t";break;
1860 case 21 : di<<"u";break;
1861 case 22 : di<<"v";break;
1862 case 23 : di<<"x";break;
1863 case 24 : di<<"y";break;
1864 case 25 : di<<"z";break;
1865 case 26 : di<<"a";break;
1866 case 27 : di<<"zb";break;
1867 case 28 : di<<"zc";break;
1874 case 1 : di<<"A";break;
1875 case 2 : di<<"B";break;
1876 case 3 : di<<"C";break;
1877 case 4 : di<<"CD";break;
1878 case 5 : di<<"D";break;
1879 case 6 : di<<"E";break;
1880 case 7 : di<<"EF";break;
1881 case 8 : di<<"F";break;
1882 case 9 : di<<"FG";break;
1883 case 10 : di<<"G";break;
1884 case 11 : di<<"H";break;
1885 case 12 : di<<"JS";break;
1886 case 13 : di<<"J";break;
1887 case 14 : di<<"K";break;
1888 case 15 : di<<"M";break;
1889 case 16 : di<<"N";break;
1890 case 17 : di<<"P";break;
1891 case 18 : di<<"R";break;
1892 case 19 : di<<"S";break;
1893 case 20 : di<<"T";break;
1894 case 21 : di<<"U";break;
1895 case 22 : di<<"V";break;
1896 case 23 : di<<"X";break;
1897 case 24 : di<<"Y";break;
1898 case 25 : di<<"Z";break;
1899 case 26 : di<<"ZA";break;
1900 case 27 : di<<"ZB";break;
1901 case 28 : di<<"ZC";break;
1906 case 0 : di<<"01"; break;
1907 case 1 : di<<"0"; break;
1908 case 2 : di<<"1"; break;
1909 case 3 : di<<"2"; break;
1910 case 4 : di<<"3"; break;
1911 case 5 : di<<"4"; break;
1912 case 6 : di<<"5"; break;
1913 case 7 : di<<"6"; break;
1914 case 8 : di<<"7"; break;
1915 case 9 : di<<"8"; break;
1916 case 10 : di<<"9"; break;
1917 case 11 : di<<"10"; break;
1918 case 12 : di<<"11"; break;
1919 case 13 : di<<"12"; break;
1920 case 14 : di<<"13"; break;
1921 case 15 : di<<"14"; break;
1922 case 16 : di<<"15"; break;
1923 case 17 : di<<"16"; break;
1924 case 18 : di<<"17"; break;
1925 case 19 : di<<"18"; break;
1933 static Standard_Integer setDimNbOfDecimalPlaces (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
1936 di<<"Use: XSetDimensionNbOfDecimalPlaces Doc Dim_Label l_val r_val\n";
1939 Handle(TDocStd_Document) Doc;
1940 DDocStd::GetDocument(argv[1], Doc);
1941 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
1942 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
1943 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
1946 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
1947 if ( aLabel.IsNull() )
1949 di<<"Dimension "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
1952 Handle(XCAFDoc_Dimension) aDimension;
1953 if(aLabel.FindAttribute(XCAFDoc_Dimension::GetID(), aDimension))
1955 Handle(XCAFDimTolObjects_DimensionObject) anObj = aDimension->GetObject();
1956 anObj->SetNbOfDecimalPlaces(Draw::Atoi(argv[3]), Draw::Atoi(argv[4]));
1957 aDimension->SetObject(anObj);
1962 static Standard_Integer getDimNbOfDecimalPlaces (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
1965 di<<"Use: XGetDimensionNbOfDecimalPlaces Doc Dim_Label\n";
1968 Handle(TDocStd_Document) Doc;
1969 DDocStd::GetDocument(argv[1], Doc);
1970 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
1971 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
1972 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
1975 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
1976 if ( aLabel.IsNull() )
1978 di<<"Dimension "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
1981 Handle(XCAFDoc_Dimension) aDimension;
1982 if(aLabel.FindAttribute(XCAFDoc_Dimension::GetID(), aDimension))
1984 Standard_Integer l, r;
1985 aDimension->GetObject()->GetNbOfDecimalPlaces(l,r);
1986 di << l << "." << r;
1991 static Standard_Integer addDimModifier (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
1994 di<<"Use: XAddDimensionModifiers Doc Dim_Label mod1 mod2 ...\n";
1997 Handle(TDocStd_Document) Doc;
1998 DDocStd::GetDocument(argv[1], Doc);
1999 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
2000 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
2001 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
2004 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
2005 if ( aLabel.IsNull() )
2007 di<<"Dimension "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
2010 Handle(XCAFDoc_Dimension) aDimension;
2011 if(aLabel.FindAttribute(XCAFDoc_Dimension::GetID(), aDimension))
2013 for(Standard_Integer i = 3; i < argc; i++)
2015 if(Draw::Atoi(argv[i]) > -1 && Draw::Atoi(argv[i]) < 24)
2017 Handle(XCAFDimTolObjects_DimensionObject) anObj = aDimension->GetObject();
2018 anObj->AddModifier((XCAFDimTolObjects_DimensionModif)Draw::Atoi(argv[i]));
2019 aDimension->SetObject(anObj);
2026 static Standard_Integer getDimModifier (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
2029 di<<"Use: XGetDimensionModifiers Doc Dim_Label\n";
2032 Handle(TDocStd_Document) Doc;
2033 DDocStd::GetDocument(argv[1], Doc);
2034 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
2035 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
2036 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
2039 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
2040 if ( aLabel.IsNull() )
2042 di<<"Dimension "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
2045 Handle(XCAFDoc_Dimension) aDimension;
2046 if(aLabel.FindAttribute(XCAFDoc_Dimension::GetID(), aDimension))
2048 XCAFDimTolObjects_DimensionModifiersSequence aS = aDimension->GetObject()->GetModifiers();
2049 for(Standard_Integer i = 1; i <= aS.Length(); i++)
2051 if (i > 1) di<<", ";
2052 switch(aS.Value(i)){
2053 case 0 : di<<"ControlledRadius"; break;
2054 case 1 : di<<"Square"; break;
2055 case 2 : di<<"StatisticalTolerance"; break;
2056 case 3 : di<<"ContinuousFeature"; break;
2057 case 4 : di<<"TwoPointSize"; break;
2058 case 5 : di<<"LocalSizeDefinedBySphere"; break;
2059 case 6 : di<<"LeastSquaresAssociationCriterion"; break;
2060 case 7 : di<<"MaximumInscribedAssociation"; break;
2061 case 8 : di<<"MinimumCircumscribedAssociation"; break;
2062 case 9 : di<<"CircumferenceDiameter"; break;
2063 case 10 : di<<"AreaDiameter"; break;
2064 case 11 : di<<"VolumeDiameter"; break;
2065 case 12 : di<<"MaximumSize"; break;
2066 case 13 : di<<"MinimumSize"; break;
2067 case 14 : di<<"AverageSize"; break;
2068 case 15 : di<<"MedianSize"; break;
2069 case 16 : di<<"MidRangeSize"; break;
2070 case 17 : di<<"RangeOfSizes"; break;
2071 case 18 : di<<"AnyRestrictedPortionOfFeature"; break;
2072 case 19 : di<<"AnyCrossSection"; break;
2073 case 20 : di<<"SpecificFixedCrossSection"; break;
2074 case 21 : di<<"CommonTolerance"; break;
2075 case 22 : di<<"FreeStateCondition"; break;
2076 case 23 : di<<"Between"; break;
2084 static Standard_Integer addDimPath (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
2087 di<<"Use: XSetDimensionPath Doc Dim_Label path(edge)\n";
2090 Handle(TDocStd_Document) Doc;
2091 DDocStd::GetDocument(argv[1], Doc);
2092 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
2093 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
2094 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
2097 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
2098 if ( aLabel.IsNull() )
2100 di<<"Dimension "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
2103 Handle(XCAFDoc_Dimension) aDimension;
2104 if(aLabel.FindAttribute(XCAFDoc_Dimension::GetID(), aDimension))
2106 TopoDS_Edge aE = TopoDS::Edge(DBRep::Get(argv[3],TopAbs_EDGE));
2109 Handle(XCAFDimTolObjects_DimensionObject) anObj = aDimension->GetObject();
2111 aDimension->SetObject(anObj);
2117 static Standard_Integer addDimPoints (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
2120 di<<"Use: XSetDimensionPoints Doc Dim_Label v1 [v2]\n";
2123 Handle(TDocStd_Document) Doc;
2124 DDocStd::GetDocument(argv[1], Doc);
2125 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
2126 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
2127 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
2130 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
2131 if ( aLabel.IsNull() )
2133 di<<"Dimension "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
2136 Handle(XCAFDoc_Dimension) aDimension;
2137 if(aLabel.FindAttribute(XCAFDoc_Dimension::GetID(), aDimension))
2139 Handle(XCAFDimTolObjects_DimensionObject) anObj = aDimension->GetObject();
2141 TopoDS_Vertex aV1 = TopoDS::Vertex(DBRep::Get(argv[3],TopAbs_VERTEX));
2143 anObj->SetPoint(BRep_Tool::Pnt(aV1));
2146 TopoDS_Vertex aV2 = TopoDS::Vertex(DBRep::Get(argv[4],TopAbs_VERTEX));
2148 anObj->SetPoint2(BRep_Tool::Pnt(aV2));
2151 aDimension->SetObject(anObj);
2156 static Standard_Integer getDimPoints (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
2159 di<<"Use: XGetDimensionPoints Doc Dim_Label\n";
2162 Handle(TDocStd_Document) Doc;
2163 DDocStd::GetDocument(argv[1], Doc);
2164 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
2165 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
2166 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
2169 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
2170 if ( aLabel.IsNull() )
2172 di<<"Dimension "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
2175 Handle(XCAFDoc_Dimension) aDimension;
2176 if(aLabel.FindAttribute(XCAFDoc_Dimension::GetID(), aDimension))
2178 Handle(XCAFDimTolObjects_DimensionObject) anObj = aDimension->GetObject();
2179 if(anObj->HasPoint()) {
2180 di << anObj->GetPoint().X() << ";" << anObj->GetPoint().Y() << ";" << anObj->GetPoint().Z() << " ";
2182 if(anObj->HasPoint2()) {
2183 di << anObj->GetPoint2().X() << ";" << anObj->GetPoint2().Y() << ";" << anObj->GetPoint2().Z();
2189 static Standard_Integer addDimDir (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
2192 di<<"Use: XSetDimensionDir Doc Dim_Label x y z\n";
2195 Handle(TDocStd_Document) Doc;
2196 DDocStd::GetDocument(argv[1], Doc);
2197 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
2198 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
2199 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
2202 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
2203 if ( aLabel.IsNull() )
2205 di<<"Dimension "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
2208 Handle(XCAFDoc_Dimension) aDimension;
2209 if(aLabel.FindAttribute(XCAFDoc_Dimension::GetID(), aDimension))
2211 Handle(XCAFDimTolObjects_DimensionObject) anObj = aDimension->GetObject();
2212 anObj->SetDirection(gp_Dir(Draw::Atof(argv[3]),Draw::Atof(argv[4]),Draw::Atof(argv[5])));
2213 aDimension->SetObject(anObj);
2218 static Standard_Integer getDimDir (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
2221 di<<"Use: XGetDimensionDir Doc Dim_Label\n";
2224 Handle(TDocStd_Document) Doc;
2225 DDocStd::GetDocument(argv[1], Doc);
2226 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
2227 Handle(XCAFDoc_DimTolTool) aDimTolTool = XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
2228 Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
2231 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
2232 if ( aLabel.IsNull() )
2234 di<<"Dimension "<<argv[2]<<" is absent in "<<argv[1]<<"\n";
2237 Handle(XCAFDoc_Dimension) aDimension;
2238 if(aLabel.FindAttribute(XCAFDoc_Dimension::GetID(), aDimension))
2241 if(aDimension->GetObject()->GetDirection(dir))
2243 di << dir.X()<< ";"<< dir.Y()<< ";"<<dir.Z();
2249 static Standard_Integer addDimDescr (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
2252 di<<"Use: XAddDimensionDescr Doc Dim_Label Description [DescriptionName]\n";
2255 Handle(TDocStd_Document) Doc;
2256 DDocStd::GetDocument(argv[1], Doc);
2257 if ( Doc.IsNull() ) {
2258 di << argv[1] << " is not a document\n";
2263 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
2264 if ( aLabel.IsNull() )
2266 di << "Dimension "<< argv[2] << " is absent in " << argv[1] << "\n";
2269 Handle(XCAFDoc_Dimension) aDimension;
2270 if(aLabel.FindAttribute(XCAFDoc_Dimension::GetID(), aDimension))
2272 Handle(XCAFDimTolObjects_DimensionObject) anObj = aDimension->GetObject();
2273 Handle(TCollection_HAsciiString) aDescription = new TCollection_HAsciiString(argv[3]);
2274 Handle(TCollection_HAsciiString) aDescrName = (argc == 4) ? new TCollection_HAsciiString()
2275 : new TCollection_HAsciiString(argv[4]);
2276 anObj->AddDescription(aDescription, aDescrName);
2277 aDimension->SetObject(anObj);
2282 static Standard_Integer getDimDescr (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
2285 di << "Use: XGetDimensionDescr Doc Dim_Label\n";
2288 Handle(TDocStd_Document) Doc;
2289 DDocStd::GetDocument(argv[1], Doc);
2290 if ( Doc.IsNull() ) {
2291 di << argv[1] << " is not a document\n";
2296 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
2297 if ( aLabel.IsNull() )
2299 di << "Dimension "<< argv[2] << " is absent in " << argv[1] << "\n";
2302 Handle(XCAFDoc_Dimension) aDimension;
2303 if(aLabel.FindAttribute(XCAFDoc_Dimension::GetID(), aDimension))
2305 Handle(XCAFDimTolObjects_DimensionObject) anObject = aDimension->GetObject();
2306 for (Standard_Integer i = 0; i < anObject->NbDescriptions(); i++) {
2307 Handle(TCollection_HAsciiString) aDescription = anObject->GetDescription(i);
2308 Handle(TCollection_HAsciiString) aDescrName = anObject->GetDescriptionName(i);
2309 di << "name: " << aDescrName->ToCString() << " description: " << aDescription->ToCString() << "\n";
2315 static Standard_Integer addGDTPosition (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
2318 di << "Use: XSetGDTPosition Doc GDT_Label loc_x loc_y loc_z normal_x normal_y normal_z xdir_x xdir_y xdir_z\n";
2321 Handle(TDocStd_Document) Doc;
2322 DDocStd::GetDocument(argv[1], Doc);
2323 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
2326 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
2327 if ( aLabel.IsNull() )
2329 di << "GDT " << argv[2] << " is absent in " << argv[1] << "\n";
2333 gp_Pnt aPoint(Draw::Atof(argv[3]), Draw::Atof(argv[4]), Draw::Atof(argv[5]));
2334 gp_Dir aNormal(Draw::Atof(argv[6]), Draw::Atof(argv[7]), Draw::Atof(argv[8]));
2335 gp_Dir aDir(Draw::Atof(argv[9]), Draw::Atof(argv[10]), Draw::Atof(argv[11]));
2336 gp_Ax2 aPlane(aPoint, aNormal, aDir);
2338 Handle(XCAFDoc_Dimension) aDimension;
2339 if (aLabel.FindAttribute(XCAFDoc_Dimension::GetID(), aDimension))
2341 Handle(XCAFDimTolObjects_DimensionObject) anObj = aDimension->GetObject();
2342 anObj->SetPlane(aPlane);
2343 anObj->SetPointTextAttach(aPoint);
2344 aDimension->SetObject(anObj);
2346 // Geometric Tolerance
2347 Handle(XCAFDoc_GeomTolerance) aGeomTolerance;
2348 if (aLabel.FindAttribute(XCAFDoc_GeomTolerance::GetID(), aGeomTolerance))
2350 Handle(XCAFDimTolObjects_GeomToleranceObject) anObj = aGeomTolerance->GetObject();
2351 anObj->SetPlane(aPlane);
2352 anObj->SetPointTextAttach(aPoint);
2353 aGeomTolerance->SetObject(anObj);
2356 Handle(XCAFDoc_Datum) aDatum;
2357 if (aLabel.FindAttribute(XCAFDoc_Datum::GetID(), aDatum))
2359 Handle(XCAFDimTolObjects_DatumObject) anObj = aDatum->GetObject();
2360 anObj->SetPlane(aPlane);
2361 anObj->SetPointTextAttach(aPoint);
2362 aDatum->SetObject(anObj);
2367 static Standard_Integer getGDTPosition (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
2370 di << "Use: XGetGDTPosition Doc GDT_Label\n";
2373 Handle(TDocStd_Document) Doc;
2374 DDocStd::GetDocument(argv[1], Doc);
2375 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
2378 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
2379 if ( aLabel.IsNull() )
2381 di << "GDT " << argv[2] << " is absent in " << argv[1] << "\n";
2385 gp_Dir aNormal, aDir;
2387 Handle(XCAFDoc_Dimension) aDimension;
2388 if (aLabel.FindAttribute(XCAFDoc_Dimension::GetID(), aDimension))
2390 Handle(XCAFDimTolObjects_DimensionObject) anObj = aDimension->GetObject();
2391 aPoint = anObj->GetPointTextAttach();
2392 aNormal = anObj->GetPlane().Direction();
2393 aDir = anObj->GetPlane().XDirection();
2395 // Geometric Tolerance
2396 Handle(XCAFDoc_GeomTolerance) aGeomTolerance;
2397 if (aLabel.FindAttribute(XCAFDoc_GeomTolerance::GetID(), aGeomTolerance))
2399 Handle(XCAFDimTolObjects_GeomToleranceObject) anObj = aGeomTolerance->GetObject();
2400 aPoint = anObj->GetPointTextAttach();
2401 aNormal = anObj->GetPlane().Direction();
2402 aDir = anObj->GetPlane().XDirection();
2405 Handle(XCAFDoc_Datum) aDatum;
2406 if (aLabel.FindAttribute(XCAFDoc_Datum::GetID(), aDatum))
2408 Handle(XCAFDimTolObjects_DatumObject) anObj = aDatum->GetObject();
2409 aPoint = anObj->GetPointTextAttach();
2410 aNormal = anObj->GetPlane().Direction();
2411 aDir = anObj->GetPlane().XDirection();
2414 di << "position: " << aPoint.X() << " " << aPoint.Y() << " " << aPoint.Z() << "\n";
2415 di << "normal: " << aNormal.X() << " " << aNormal.Y() << " " << aNormal.Z() << "\n";
2416 di << "x_direction: " << aDir.X() << " " << aDir.Y() << " " << aDir.Z() << "\n";
2420 static Standard_Integer addGDTPresentation (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
2423 di << "Use: XSetGDTPresentation Doc GDT_Label Shape Name\n";
2426 Handle(TDocStd_Document) Doc;
2427 DDocStd::GetDocument(argv[1], Doc);
2428 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
2431 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
2432 if ( aLabel.IsNull() )
2434 di << "GDT " << argv[2] << " is absent in " << argv[1] << "\n";
2438 TopoDS_Shape aPresentation= DBRep::Get(argv[3]);
2439 Handle(TCollection_HAsciiString) aName = new TCollection_HAsciiString(argv[4]);
2441 Handle(XCAFDoc_Dimension) aDimension;
2442 if (aLabel.FindAttribute(XCAFDoc_Dimension::GetID(), aDimension))
2444 Handle(XCAFDimTolObjects_DimensionObject) anObj = aDimension->GetObject();
2445 anObj->SetPresentation(aPresentation, aName);
2446 aDimension->SetObject(anObj);
2448 // Geometric Tolerance
2449 Handle(XCAFDoc_GeomTolerance) aGeomTolerance;
2450 if (aLabel.FindAttribute(XCAFDoc_GeomTolerance::GetID(), aGeomTolerance))
2452 Handle(XCAFDimTolObjects_GeomToleranceObject) anObj = aGeomTolerance->GetObject();
2453 anObj->SetPresentation(aPresentation, aName);
2454 aGeomTolerance->SetObject(anObj);
2457 Handle(XCAFDoc_Datum) aDatum;
2458 if (aLabel.FindAttribute(XCAFDoc_Datum::GetID(), aDatum))
2460 Handle(XCAFDimTolObjects_DatumObject) anObj = aDatum->GetObject();
2461 anObj->SetPresentation(aPresentation, aName);
2462 aDatum->SetObject(anObj);
2467 static Standard_Integer getGDTPresentation (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
2470 di << "Use: XGetGDTPresentation Doc GDT_Label Shape\n";
2473 Handle(TDocStd_Document) Doc;
2474 DDocStd::GetDocument(argv[1], Doc);
2475 if ( Doc.IsNull() ) { di << argv[1] << " is not a document\n"; return 1; }
2478 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
2479 if ( aLabel.IsNull() )
2481 di << "GDT " << argv[2] << " is absent in " << argv[1] << "\n";
2484 TopoDS_Shape aPresentation;
2486 Handle(XCAFDoc_Dimension) aDimension;
2487 if (aLabel.FindAttribute(XCAFDoc_Dimension::GetID(), aDimension))
2489 Handle(XCAFDimTolObjects_DimensionObject) anObj = aDimension->GetObject();
2490 aPresentation = anObj->GetPresentation();
2492 // Geometric Tolerance
2493 Handle(XCAFDoc_GeomTolerance) aGeomTolerance;
2494 if (aLabel.FindAttribute(XCAFDoc_GeomTolerance::GetID(), aGeomTolerance))
2496 Handle(XCAFDimTolObjects_GeomToleranceObject) anObj = aGeomTolerance->GetObject();
2497 aPresentation = anObj->GetPresentation();
2500 Handle(XCAFDoc_Datum) aDatum;
2501 if (aLabel.FindAttribute(XCAFDoc_Datum::GetID(), aDatum))
2503 Handle(XCAFDimTolObjects_DatumObject) anObj = aDatum->GetObject();
2504 aPresentation = anObj->GetPresentation();
2507 DBRep::Set (argv[3], aPresentation);
2511 static Standard_Integer addGDTAffectedPlane(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
2514 di << "Use: XSetGDTAffectedPlane Doc GDT_Label plane type[1 - intersection/ 2 - orientation]\n";
2517 Handle(TDocStd_Document) Doc;
2518 DDocStd::GetDocument(argv[1], Doc);
2519 if (Doc.IsNull()) { di << argv[1] << " is not a document\n"; return 1; }
2522 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
2523 if (aLabel.IsNull())
2525 di << "GDT " << argv[2] << " is absent in " << argv[1] << "\n";
2529 Handle(Geom_Surface) aSurf = DrawTrSurf::GetSurface(argv[3]);
2530 Handle(Geom_Plane) aPlane = Handle(Geom_Plane)::DownCast(aSurf);
2531 if (aPlane.IsNull())
2533 di << "Invalid plane\n";
2536 Standard_Integer aType = Draw::Atoi(argv[4]);
2538 // Geometric Tolerance
2539 Handle(XCAFDoc_GeomTolerance) aGeomTolerance;
2540 if (!aLabel.FindAttribute(XCAFDoc_GeomTolerance::GetID(), aGeomTolerance))
2542 di << "Geometric tolerance is abcent on label" << argv[2] << "\n";
2546 Handle(XCAFDimTolObjects_GeomToleranceObject) anObj = aGeomTolerance->GetObject();
2547 anObj->SetAffectedPlane(aPlane->Pln(), (XCAFDimTolObjects_ToleranceZoneAffectedPlane)aType);
2548 aGeomTolerance->SetObject(anObj);
2552 static Standard_Integer getGDTAffectedPlane(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
2555 di << "Use: XGetGDTAffectedPlane Doc GDT_Label Plane\n";
2558 Handle(TDocStd_Document) Doc;
2559 DDocStd::GetDocument(argv[1], Doc);
2560 if (Doc.IsNull()) { di << argv[1] << " is not a document\n"; return 1; }
2563 TDF_Tool::Label(Doc->GetData(), argv[2], aLabel);
2564 if (aLabel.IsNull())
2566 di << "GDT " << argv[2] << " is absent in " << argv[1] << "\n";
2570 // Geometric Tolerance
2571 Handle(XCAFDoc_GeomTolerance) aGeomTolerance;
2572 Handle(Geom_Plane) aPlane;
2573 if (aLabel.FindAttribute(XCAFDoc_GeomTolerance::GetID(), aGeomTolerance))
2575 Handle(XCAFDimTolObjects_GeomToleranceObject) anObj = aGeomTolerance->GetObject();
2576 if (anObj->GetAffectedPlaneType() == XCAFDimTolObjects_ToleranceZoneAffectedPlane_None)
2578 di << "No affected plane\n";
2581 gp_Pln aPln = anObj->GetAffectedPlane();
2582 aPlane = new Geom_Plane(aPln);
2583 if (anObj->GetAffectedPlaneType() == XCAFDimTolObjects_ToleranceZoneAffectedPlane_Intersection)
2584 di << "intersection plane\n";
2585 if (anObj->GetAffectedPlaneType() == XCAFDimTolObjects_ToleranceZoneAffectedPlane_Orientation)
2586 di << "orientation plane\n";
2587 DrawTrSurf::Set(argv[3], aPlane);
2594 //=======================================================================
2595 //function : InitCommands
2597 //=======================================================================
2599 void XDEDRAW_GDTs::InitCommands(Draw_Interpretor& di)
2601 static Standard_Boolean initactor = Standard_False;
2606 initactor = Standard_True;
2608 Standard_CString g = "XDE G&DTs commands";
2610 di.Add ("XDumpDGTs","XDumpDGTs Doc shape/label/all ",
2611 __FILE__, DumpDGTs, g);
2613 di.Add ("XDumpNbDGTs","XDumpNbDGTs Doc [f (full dumping)]",
2614 __FILE__, DumpNbDGTs, g);
2616 di.Add ("XAddDimension","XAddDimension Doc shape/label [shape/label]",
2617 __FILE__, addDim, g);
2619 di.Add ("XAddGeomTolerance","XAddGeomTolerance Doc shape/label",
2620 __FILE__, addGTol, g);
2622 di.Add ("XAddDatum","XAddDatum Doc shape1/label1 ... shapeN/labelN",
2623 __FILE__, addDatum, g);
2625 di.Add ("XSetDatum","XSetDatum Doc Datum_Label GeomTol_Label",
2626 __FILE__, setDatum, g);
2628 di.Add ("XGetDatum","XGetDatum Doc GeomTol_Label/Shape_Label",
2629 __FILE__, getDatum, g);
2631 di.Add ("XAddDatumModifier","XAddDatumModifier Doc Datum_Label mod1 mod2 ...\n"
2633 "\n 0 AnyCrossSection"
2634 "\n 1 Any_LongitudinalSection"
2636 "\n 3 ContactingFeature"
2637 "\n 4 DegreeOfFreedomConstraintU"
2638 "\n 5 DegreeOfFreedomConstraintV"
2639 "\n 6 DegreeOfFreedomConstraintW"
2640 "\n 7 DegreeOfFreedomConstraintX"
2641 "\n 8 DegreeOfFreedomConstraintY"
2642 "\n 9 DegreeOfFreedomConstraintZ"
2643 "\n 10 DistanceVariable"
2645 "\n 12 LeastMaterialRequirement"
2647 "\n 14 MajorDiameter"
2648 "\n 15 MaximumMaterialRequirement"
2649 "\n 16 MinorDiameter"
2651 "\n 18 PitchDiameter"
2654 "\n 21 Translation",
2655 __FILE__, addDatumModif, g);
2657 di.Add ("XGetDatumModifiers","XGetDatumModifiers Doc Datum_Label",
2658 __FILE__, getDatumModif, g);
2660 di.Add ("XSetDatumName","XSetDatumName Doc Datum_Label name",
2661 __FILE__, setDatumName, g);
2663 di.Add ("XGetDatumName","XGetDatumName Doc Datum_Label",
2664 __FILE__, getDatumName, g);
2666 di.Add ("XSetDatumPosition","XSetDatumPosition Doc Datum_Label position[1-3]"
2667 "Set datum position number in geometric tolerance datum system",
2668 __FILE__, setDatumPosition, g);
2670 di.Add ("XGetDatumPosition","XGetDatumPosition Doc Datum_Label",
2671 __FILE__, getDatumPosition, g);
2673 di.Add ("XSetTypeOfTolerance","XSetTypeOfTolerance Doc GTol_Label type"
2675 "\t 0 type is absent\n"
2677 "\t 2 CircularRunout\n"
2678 "\t 3 CircularityOrRoundness\n"
2680 "\t 5 Concentricity\n"
2681 "\t 6 Cylindricity\n"
2683 "\t 8 Parallelism\n"
2684 "\t 9 Perpendicularity\n"
2686 "\t 11 ProfileOfLine\n"
2687 "\t 12 ProfileOfSurface\n"
2688 "\t 13 Straightness\n"
2690 "\t 15 TotalRunout\n",
2691 __FILE__, setTypeOfTol, g);
2693 di.Add ("XGetTypeOfTolerance","XGetTypeOfTolerance Doc GTol_Label",
2694 __FILE__, getTypeOfTol, g);
2696 di.Add ("XSetTypeOfToleranceValue","XSetTypeOfToleranceValue Doc GTol_Label type"
2700 "\n 2 SphericalDiameter",
2701 __FILE__, setTypeOfTolVal, g);
2703 di.Add ("XGetTypeOfToleranceValue","XGetTypeOfToleranceValue Doc GTol_Label",
2704 __FILE__, getTypeOfTolVal, g);
2706 di.Add ("XSetToleranceValue","XSetToleranceValue Doc GTol_Label value",
2707 __FILE__, setTolVal, g);
2709 di.Add ("XGetToleranceValue","XGetToleranceValue Doc GTol_Label",
2710 __FILE__, getTolVal, g);
2712 di.Add ("XSetTolMaterialReq","XSetTolMaterialReq Doc GTol_Label mod"
2717 __FILE__, setMatReq, g);
2719 di.Add ("XGetTolMaterialReq","XGetTolMaterialReq Doc GTol_Label",
2720 __FILE__, getMatReq, g);
2722 di.Add ("XSetTolZoneMod","XSetTolZoneMod Doc GTol_Label mod"
2727 __FILE__, setZoneMod, g);
2729 di.Add ("XGetTolZoneMod","XGetTolZoneMod Doc GTol_Label",
2730 __FILE__, getZoneMod, g);
2732 di.Add ("XSetTolZoneModValue","XSetTolZoneModValue Doc GTol_Label val",
2733 __FILE__, setZoneModVal, g);
2735 di.Add ("XGetTolZoneModValue","XGetTolZoneModValue Doc GTol_Label",
2736 __FILE__, getZoneModVal, g);
2738 di.Add ("XAddTolModifier","XAddTolModifier Doc Tol_Label mod1 mod2 ..."
2740 "\t 0 Any_Cross_Section\n"
2741 "\t 1 Common_Zone\n"
2742 "\t 2 Each_Radial_Element\n"
2744 "\t 4 Least_Material_Requirement\n"
2745 "\t 5 Line_Element\n"
2746 "\t 6 Major_Diameter\n"
2747 "\t 7 Maximum_Material_Requirement\n"
2748 "\t 8 Minor_Diameter\n"
2750 "\t 10 Pitch_Diameter\n"
2751 "\t 11 Reciprocity_Requirement\n"
2752 "\t 12 Separate_Requirement\n"
2753 "\t 13 Statistical_Tolerance\n"
2754 "\t 14 Tangent_Plane\n",
2755 __FILE__, addTolModif, g);
2757 di.Add ("XGetTolModifier","XGetTolModifier Doc Tol_Label",
2758 __FILE__, getTolModif, g);
2760 di.Add ("XSetTolMaxValue","XSetTolMaxValue Doc Dim_Label val",
2761 __FILE__, setTolMaxVal, g);
2763 di.Add ("XGetTolMaxValue","XGetTolMaxValue Doc Dim_Label val",
2764 __FILE__, getTolMaxVal, g);
2766 di.Add ("XSetDimensionType","XSetDimensionType Doc Dim_Label type"
2768 "\t 0 type is absent\n"
2769 "\t 1 Location_CurvedDistance\n"
2770 "\t 2 Location_LinearDistance\n"
2771 "\t 3 Location_LinearDistance_FromCenterToOuter\n"
2772 "\t 4 Location_LinearDistance_FromCenterToInner\n"
2773 "\t 5 Location_LinearDistance_FromOuterToCenter\n"
2774 "\t 6 Location_LinearDistance_FromOuterToOuter\n"
2775 "\t 7 Location_LinearDistance_FromOuterToInner\n"
2776 "\t 8 Location_LinearDistance_FromInnerToCenter\n"
2777 "\t 9 Location_LinearDistance_FromInnerToOuter\n"
2778 "\t 10 Location_LinearDistance_FromInnerToInner\n"
2779 "\t 11 Location_Angular\n"
2780 "\t 12 Location_Oriented\n"
2781 "\t 13 Location_WithPath\n"
2782 "\t 14 Size_CurveLength\n"
2783 "\t 15 Size_Diameter\n"
2784 "\t 16 Size_SphericalDiameter\n"
2785 "\t 17 Size_Radius\n"
2786 "\t 18 Size_SphericalRadius\n"
2787 "\t 19 Size_ToroidalMinorDiameter\n"
2788 "\t 20 Size_ToroidalMajorDiameter\n"
2789 "\t 21 Size_ToroidalMinorRadius\n"
2790 "\t 22 Size_ToroidalMajorRadius\n"
2791 "\t 23 Size_ToroidalHighMajorDiameter\n"
2792 "\t 24 Size_ToroidalLowMajorDiameter\n"
2793 "\t 25 Size_ToroidalHighMajorRadius\n"
2794 "\t 26 Size_ToroidalLowMajorRadius\n"
2795 "\t 27 Size_Thickness\n"
2796 "\t 28 Size_Angular\n"
2797 "\t 29 Size_WithPath\n",
2798 __FILE__, setDimType, g);
2800 di.Add ("XGetDimensionType","XGetDimensionType Doc Dim_Label",
2801 __FILE__, getDimType, g);
2803 di.Add ("XSetDimensionValue","XSetDimensionValue Doc Dim_Label val",
2804 __FILE__, setDimVal, g);
2806 di.Add ("XGetDimensionValue","XGetDimensionValue Doc Dim_Label",
2807 __FILE__, getDimVal, g);
2809 di.Add ("XSetDimensionQualifier","XSetDimensionQualifier Doc Dim_Label val"
2815 __FILE__, setDimQalif, g);
2817 di.Add ("XGetDimensionQualifier","XGetDimensionQualifier Doc Dim_Label",
2818 __FILE__, getDimQalif, g);
2820 di.Add ("XSetDimensionRange","XSetDimensionRange Doc Dim_Label low_val up_val",
2821 __FILE__, setDimRange, g);
2823 di.Add ("XGetDimensionRange","XGetDimensionRange Doc Dim_Label",
2824 __FILE__, getDimRange, g);
2826 di.Add ("XSetDimensionPlusMinusTol","XSetDimensionPlusMinusTol Doc Dim_Label low_val up_val",
2827 __FILE__, setDimPlusMinusTol, g);
2829 di.Add ("XGetDimensionPlusMinusTol","XGetDimensionPlusMinusTol Doc Dim_Label",
2830 __FILE__, getDimPlusMinusTol, g);
2832 di.Add ("XSetDimensionClassOfTol","XSetDimensionClassOfTol Doc Dim_Label ishole[1/0] formVar grade"
2833 "Values of formVar:"
2883 __FILE__, setDimClassTol, g);
2885 di.Add ("XGetDimensionClassOfTol","XGetDimensionClassOfTol Doc Dim_Label",
2886 __FILE__, getDimClassTol, g);
2888 di.Add ("XSetDimensionNbOfDecimalPlaces","XSetDimensionNbOfDecimalPlaces Doc Dim_Label l_val r_val",
2889 __FILE__, setDimNbOfDecimalPlaces, g);
2891 di.Add ("XGetDimensionNbOfDecimalPlaces","XGetDimensionNbOfDecimalPlaces Doc Dim_Label",
2892 __FILE__, getDimNbOfDecimalPlaces, g);
2894 di.Add ("XAddDimensionModifiers","XAddDimensionModifiers Doc Dim_Label mod1 mod2 ..."
2896 "\t 0 ControlledRadius\n"
2898 "\t 2 StatisticalTolerance\n"
2899 "\t 3 ContinuousFeature\n"
2900 "\t 4 TwoPointSize\n"
2901 "\t 5 LocalSizeDefinedBySphere\n"
2902 "\t 6 LeastSquaresAssociationCriterion\n"
2903 "\t 7 MaximumInscribedAssociation\n"
2904 "\t 8 MinimumCircumscribedAssociation\n"
2905 "\t 9 CircumferenceDiameter\n"
2906 "\t10 AreaDiameter\n"
2907 "\t11 VolumeDiameter\n"
2908 "\t12 MaximumSize\n"
2909 "\t13 MinimumSize\n"
2910 "\t14 AverageSize\n"
2912 "\t16 MidRangeSize\n"
2913 "\t17 RangeOfSizes\n"
2914 "\t18 AnyRestrictedPortionOfFeature\n"
2915 "\t19 AnyCrossSection\n"
2916 "\t20 SpecificFixedCrossSection\n"
2917 "\t21 CommonTolerance\n"
2918 "\t22 FreeStateCondition\n"
2920 __FILE__, addDimModifier, g);
2922 di.Add ("XGetDimensionModifiers","XGetDimensionModifiers Doc Dim_Label",
2923 __FILE__, getDimModifier, g);
2925 di.Add ("XSetDimensionPath","XSetDimensionPath Doc Dim_Label path(edge)",
2926 __FILE__, addDimPath, g);
2928 di.Add ("XSetDimensionPoints","XSetDimensionPoints Doc Dim_Label v1 [v2]",
2929 __FILE__, addDimPoints, g);
2931 di.Add ("XGetDimensionPoints","XGetDimensionPoints Doc Dim_Label",
2932 __FILE__, getDimPoints, g);
2934 di.Add ("XSetDimensionDir","XSetDimensionDir Doc Dim_Label x y z",
2935 __FILE__, addDimDir, g);
2937 di.Add ("XGetDimensionDir","XGetDimensionDir Doc Dim_Label",
2938 __FILE__, getDimDir, g);
2940 di.Add ("XAddDimensionDescr","XAddDimensionDescr Doc Dim_Label Description [DescriptionName]\n"
2941 "Add named text description to given Dimension, if DescriptionName is missed"
2942 "name will be an empty string.",
2943 __FILE__, addDimDescr, g);
2945 di.Add ("XGetDimensionDescr","XGetDimensionDescr Doc Dim_Label\n"
2946 "Return all descriptions of given Dimension.",
2947 __FILE__, getDimDescr, g);
2949 di.Add ("XSetGDTPosition","XSetGDTPosition Doc GDT_Label loc_x loc_y loc_z normal_x normal_y normal_z xdir_x xdir_y xdir_z"
2950 "Set plane to display dimension parallel to and point to display text (loc)",
2951 __FILE__, addGDTPosition, g);
2953 di.Add ("XGetGDTPosition","XGetGDTPosition Doc GDT_Label"
2954 "Returns text position and plane, parallel to which dimension is displayed",
2955 __FILE__, getGDTPosition, g);
2957 di.Add ("XSetGDTPresentation","XSetGDTPresentation Doc GDT_Label Shape Name"
2958 "Set presentation with given name for dimension",
2959 __FILE__, addGDTPresentation, g);
2961 di.Add ("XGetGDTPresentation","XGetGDTPresentation Doc GDT_Label Shape"
2962 "Returns Presentation into Shape",
2963 __FILE__, getGDTPresentation, g);
2965 di.Add("XSetGDTAffectedPlane", "XSetGDTAffectedPlane Doc GDT_Label Plane type[1 - intersection/ 2 - orientation]"
2966 "Set affectedP plane for geometric tolerance",
2967 __FILE__, addGDTAffectedPlane, g);
2969 di.Add("XGetGDTAffectedPlane", "XGetGDTAffectedPlane Doc GDT_Label Plane"
2970 "Returns affected plane into Plane",
2971 __FILE__, getGDTAffectedPlane, g);