1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0026689: Necessary to improve STEPCAFControl_Reader to read GD&T data from STEP model(AP242).

This commit is contained in:
ink
2015-10-21 15:51:36 +03:00
committed by aba
parent 416d61f0f1
commit c5e030c909
42 changed files with 4205 additions and 454 deletions

View File

@@ -385,6 +385,7 @@
#include <RWStepRepr_RWReprItemAndLengthMeasureWithUnit.hxx>
#include <RWStepRepr_RWShapeAspect.hxx>
#include <RWStepRepr_RWShapeAspectRelationship.hxx>
#include <RWStepRepr_RWFeatureForDatumTargetRelationship.hxx>
#include <RWStepRepr_RWShapeAspectTransition.hxx>
#include <RWStepRepr_RWShapeRepresentationRelationshipWithTransformation.hxx>
#include <RWStepRepr_RWSpecifiedHigherUsageOccurrence.hxx>
@@ -923,6 +924,7 @@
#include <StepRepr_ShapeAspect.hxx>
#include <StepRepr_ShapeAspectDerivingRelationship.hxx>
#include <StepRepr_ShapeAspectRelationship.hxx>
#include <StepRepr_FeatureForDatumTargetRelationship.hxx>
#include <StepRepr_ShapeAspectTransition.hxx>
#include <StepRepr_ShapeRepresentationRelationship.hxx>
#include <StepRepr_ShapeRepresentationRelationshipWithTransformation.hxx>
@@ -4970,6 +4972,12 @@ void RWStepAP214_GeneralModule::FillSharedCase(const Standard_Integer CN,
tool.Share(anent,iter);
}
break;
case 702:
{
DeclareAndCast(StepRepr_FeatureForDatumTargetRelationship,anent,ent);
RWStepRepr_RWFeatureForDatumTargetRelationship tool;
tool.Share(anent,iter);
}
default : break;
}
@@ -6917,6 +6925,9 @@ Standard_Boolean RWStepAP214_GeneralModule::NewVoid
case 701:
ent = new StepRepr_ValueRepresentationItem;
break;
case 702:
ent = new StepRepr_FeatureForDatumTargetRelationship;
break;
default:
return Standard_False;

View File

@@ -295,6 +295,7 @@ Handle(atype) result = Handle(atype)::DownCast (start)
#include <StepBasic_SecurityClassificationLevel.hxx>
#include <StepRepr_ShapeAspect.hxx>
#include <StepRepr_ShapeAspectRelationship.hxx>
#include <StepRepr_FeatureForDatumTargetRelationship.hxx>
#include <StepRepr_ShapeAspectTransition.hxx>
#include <StepShape_ShapeDefinitionRepresentation.hxx>
#include <StepShape_ShapeRepresentation.hxx>
@@ -686,6 +687,7 @@ Handle(atype) result = Handle(atype)::DownCast (start)
#include <RWStepBasic_RWSecurityClassificationLevel.hxx>
#include <RWStepRepr_RWShapeAspect.hxx>
#include <RWStepRepr_RWShapeAspectRelationship.hxx>
#include <RWStepRepr_RWFeatureForDatumTargetRelationship.hxx>
#include <RWStepRepr_RWShapeAspectTransition.hxx>
#include <RWStepShape_RWShapeDefinitionRepresentation.hxx>
#include <RWStepShape_RWShapeRepresentation.hxx>
@@ -8867,6 +8869,13 @@ void RWStepAP214_ReadWriteModule::ReadStep(const Standard_Integer CN,
tool.ReadStep (data,num,ach,anent);
}
break;
case 702:
{
DeclareAndCast(StepRepr_FeatureForDatumTargetRelationship,anent,ent);
RWStepRepr_RWFeatureForDatumTargetRelationship tool;
tool.ReadStep (data,num,ach,anent);
}
break;
default:
ach->AddFail("Type Mismatch when reading - Entity");
@@ -13568,6 +13577,13 @@ void RWStepAP214_ReadWriteModule::WriteStep(const Standard_Integer CN,
tool.WriteStep (SW,anent);
}
break;
case 702:
{
DeclareAndCast(StepRepr_FeatureForDatumTargetRelationship,anent,ent);
RWStepRepr_RWFeatureForDatumTargetRelationship tool;
tool.WriteStep (SW,anent);
}
break;
default:
return;

View File

@@ -38,6 +38,8 @@ RWStepRepr_RWDescriptiveRepresentationItem.cxx
RWStepRepr_RWDescriptiveRepresentationItem.hxx
RWStepRepr_RWExtension.cxx
RWStepRepr_RWExtension.hxx
RWStepRepr_RWFeatureForDatumTargetRelationship.cxx
RWStepRepr_RWFeatureForDatumTargetRelationship.hxx
RWStepRepr_RWFunctionallyDefinedTransformation.cxx
RWStepRepr_RWFunctionallyDefinedTransformation.hxx
RWStepRepr_RWGeometricAlignment.cxx

View File

@@ -0,0 +1,112 @@
// Created on: 2000-04-18
// Created by: Andrey BETENEV
// Copyright (c) 2000-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
// Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.0
#include <Interface_Check.hxx>
#include <Interface_EntityIterator.hxx>
#include <RWStepRepr_RWFeatureForDatumTargetRelationship.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
#include <StepRepr_ShapeAspect.hxx>
#include <StepRepr_FeatureForDatumTargetRelationship.hxx>
//=======================================================================
//function : RWStepRepr_RWFeatureForDatumTargetRelationship
//purpose :
//=======================================================================
RWStepRepr_RWFeatureForDatumTargetRelationship::RWStepRepr_RWFeatureForDatumTargetRelationship ()
{
}
//=======================================================================
//function : ReadStep
//purpose :
//=======================================================================
void RWStepRepr_RWFeatureForDatumTargetRelationship::ReadStep (const Handle(StepData_StepReaderData)& data,
const Standard_Integer num,
Handle(Interface_Check)& ach,
const Handle(StepRepr_FeatureForDatumTargetRelationship) &ent) const
{
// Check number of parameters
if ( ! data->CheckNbParams(num,4,ach,"feature_for_datum_target-relationship") ) return;
// Own fields of ShapeAspectRelationship
Handle(TCollection_HAsciiString) aName;
data->ReadString (num, 1, "name", ach, aName);
Handle(TCollection_HAsciiString) aDescription;
Standard_Boolean hasDescription = Standard_True;
if ( data->IsParamDefined (num,2) ) {
data->ReadString (num, 2, "description", ach, aDescription);
}
else {
hasDescription = Standard_False;
}
Handle(StepRepr_ShapeAspect) aRelatingShapeAspect;
data->ReadEntity (num, 3, "relating_shape_aspect", ach, STANDARD_TYPE(StepRepr_ShapeAspect), aRelatingShapeAspect);
Handle(StepRepr_ShapeAspect) aRelatedShapeAspect;
data->ReadEntity (num, 4, "related_shape_aspect", ach, STANDARD_TYPE(StepRepr_ShapeAspect), aRelatedShapeAspect);
// Initialize entity
ent->Init(aName,
hasDescription,
aDescription,
aRelatingShapeAspect,
aRelatedShapeAspect);
}
//=======================================================================
//function : WriteStep
//purpose :
//=======================================================================
void RWStepRepr_RWFeatureForDatumTargetRelationship::WriteStep (StepData_StepWriter& SW,
const Handle(StepRepr_FeatureForDatumTargetRelationship) &ent) const
{
// Own fields of ShapeAspectRelationship
SW.Send (ent->Name());
if ( ent->HasDescription() ) {
SW.Send (ent->Description());
}
else SW.SendUndef();
SW.Send (ent->RelatingShapeAspect());
SW.Send (ent->RelatedShapeAspect());
}
//=======================================================================
//function : Share
//purpose :
//=======================================================================
void RWStepRepr_RWFeatureForDatumTargetRelationship::Share (const Handle(StepRepr_FeatureForDatumTargetRelationship) &ent,
Interface_EntityIterator& iter) const
{
// Own fields of ShapeAspectRelationship
iter.AddItem (ent->RelatingShapeAspect());
iter.AddItem (ent->RelatedShapeAspect());
}

View File

@@ -0,0 +1,74 @@
// Created on: 2000-04-18
// Created by: Andrey BETENEV
// Copyright (c) 2000-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _RWStepRepr_RWFeatureForDatumTargetRelationship_HeaderFile
#define _RWStepRepr_RWFeatureForDatumTargetRelationship_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Integer.hxx>
class StepData_StepReaderData;
class Interface_Check;
class StepRepr_FeatureForDatumTargetRelationship;
class StepData_StepWriter;
class Interface_EntityIterator;
//! Read & Write tool for FeatureForDatumTargetRelationship
class RWStepRepr_RWFeatureForDatumTargetRelationship
{
public:
DEFINE_STANDARD_ALLOC
//! Empty constructor
Standard_EXPORT RWStepRepr_RWFeatureForDatumTargetRelationship();
//! Reads ShapeAspectRelationship
Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& data, const Standard_Integer num, Handle(Interface_Check)& ach, const Handle(StepRepr_FeatureForDatumTargetRelationship)& ent) const;
//! Writes ShapeAspectRelationship
Standard_EXPORT void WriteStep (StepData_StepWriter& SW, const Handle(StepRepr_FeatureForDatumTargetRelationship)& ent) const;
//! Fills data for graph (shared items)
Standard_EXPORT void Share (const Handle(StepRepr_FeatureForDatumTargetRelationship)& ent, Interface_EntityIterator& iter) const;
protected:
private:
};
#endif // _RWStepRepr_RWFeatureForDatumTargetRelationship_HeaderFile

File diff suppressed because it is too large Load Diff

View File

@@ -2079,7 +2079,8 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTs (const Handle(XSControl_WorkSe
for(i=1; i<=DGTLabels.Length(); i++) {
TDF_Label DatumL = DGTLabels.Value(i);
TDF_LabelSequence ShapeL;
if(!DGTTool->GetRefShapeLabel(DatumL,ShapeL)) continue;
TDF_LabelSequence aNullSeq;
if(!DGTTool->GetRefShapeLabel(DatumL,ShapeL,aNullSeq)) continue;
// find target shape
TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(ShapeL.Value(1));
TopLoc_Location Loc;
@@ -2160,7 +2161,8 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTs (const Handle(XSControl_WorkSe
for(i=1; i<=DGTLabels.Length(); i++) {
TDF_Label DimTolL = DGTLabels.Value(i);
TDF_LabelSequence ShapeL;
if(!DGTTool->GetRefShapeLabel(DimTolL,ShapeL)) continue;
TDF_LabelSequence aNullSeq;
if(!DGTTool->GetRefShapeLabel(DimTolL,ShapeL,aNullSeq)) continue;
// find target shape
TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(ShapeL.Value(1));
TopLoc_Location Loc;

View File

@@ -12,6 +12,8 @@ STEPConstruct_DataMapOfAsciiStringTransient.hxx
STEPConstruct_DataMapOfPointTransient.hxx
STEPConstruct_ExternRefs.cxx
STEPConstruct_ExternRefs.hxx
STEPConstruct_GDTProperty.cxx
STEPConstruct_GDTProperty.hxx
STEPConstruct_Part.cxx
STEPConstruct_Part.hxx
STEPConstruct_PointHasher.cxx

View File

@@ -0,0 +1,600 @@
// Created on: 1999-09-09
// Created by: Andrey BETENEV
// Copyright (c) 1999-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <STEPConstruct_GDTProperty.hxx>
#include <StepRepr_DescriptiveRepresentationItem.hxx>
//=======================================================================
//function : STEPConstruct_GDTProperty
//purpose :
//=======================================================================
STEPConstruct_GDTProperty::STEPConstruct_GDTProperty ()
{
}
//=======================================================================
//function : getDimModifiers
//purpose :
//=======================================================================
void STEPConstruct_GDTProperty::GetDimModifiers(const Handle(StepRepr_CompoundRepresentationItem)& theCRI,
XCAFDimTolObjects_DimensionModifiersSequence& theModifiers)
{
for (Standard_Integer l = 1; l <= theCRI->ItemElement()->Length(); l++)
{
Handle(StepRepr_DescriptiveRepresentationItem) aDRI =
Handle(StepRepr_DescriptiveRepresentationItem)::DownCast(theCRI->ItemElement()->Value(l));
if(aDRI.IsNull()) continue;
XCAFDimTolObjects_DimensionModif aModifier = XCAFDimTolObjects_DimensionModif_ControlledRadius;
const TCollection_AsciiString aModifStr = aDRI->Description()->String();
Standard_Boolean aFound = Standard_False;
if(aModifStr.IsEqual("controlled radius"))
{
aFound = Standard_True;
aModifier = XCAFDimTolObjects_DimensionModif_ControlledRadius;
}
else if(aModifStr.IsEqual("square"))
{
aFound = Standard_True;
aModifier = XCAFDimTolObjects_DimensionModif_Square;
}
else if(aModifStr.IsEqual("statistical"))
{
aFound = Standard_True;
aModifier = XCAFDimTolObjects_DimensionModif_StatisticalTolerance;
}
else if(aModifStr.IsEqual("continuous feature"))
{
aFound = Standard_True;
aModifier = XCAFDimTolObjects_DimensionModif_ContinuousFeature;
}
else if(aModifStr.IsEqual("two point size"))
{
aFound = Standard_True;
aModifier = XCAFDimTolObjects_DimensionModif_TwoPointSize;
}
else if(aModifStr.IsEqual("local size defined by a sphere"))
{
aFound = Standard_True;
aModifier = XCAFDimTolObjects_DimensionModif_LocalSizeDefinedBySphere;
}
else if(aModifStr.IsEqual("least squares association criteria"))
{
aFound = Standard_True;
aModifier = XCAFDimTolObjects_DimensionModif_LeastSquaresAssociationCriterion;
}
else if(aModifStr.IsEqual("maximum inscribed association criteria"))
{
aFound = Standard_True;
aModifier = XCAFDimTolObjects_DimensionModif_MaximumInscribedAssociation;
}
else if(aModifStr.IsEqual("minimum circumscribed association criteria"))
{
aFound = Standard_True;
aModifier = XCAFDimTolObjects_DimensionModif_MinimumCircumscribedAssociation;
}
else if(aModifStr.IsEqual("circumference diameter calculated size"))
{
aFound = Standard_True;
aModifier = XCAFDimTolObjects_DimensionModif_CircumferenceDiameter;
}
else if(aModifStr.IsEqual("area diameter calculated size"))
{
aFound = Standard_True;
aModifier = XCAFDimTolObjects_DimensionModif_AreaDiameter;
}
else if(aModifStr.IsEqual("volume diameter calculated size"))
{
aFound = Standard_True;
aModifier = XCAFDimTolObjects_DimensionModif_VolumeDiameter;
}
else if(aModifStr.IsEqual("maximum rank order size"))
{
aFound = Standard_True;
aModifier = XCAFDimTolObjects_DimensionModif_MaximumSize;
}
else if(aModifStr.IsEqual("minimum rank order size"))
{
aFound = Standard_True;
aModifier = XCAFDimTolObjects_DimensionModif_MinimumSize;
}
else if(aModifStr.IsEqual("average rank order size"))
{
aFound = Standard_True;
aModifier = XCAFDimTolObjects_DimensionModif_AverageSize;
}
else if(aModifStr.IsEqual("median rank order size"))
{
aFound = Standard_True;
aModifier = XCAFDimTolObjects_DimensionModif_MedianSize;
}
else if(aModifStr.IsEqual("mid range rank order size"))
{
aFound = Standard_True;
aModifier = XCAFDimTolObjects_DimensionModif_MidRangeSize;
}
else if(aModifStr.IsEqual("range rank order size"))
{
aFound = Standard_True;
aModifier = XCAFDimTolObjects_DimensionModif_RangeOfSizes;
}
else if(aModifStr.IsEqual("any part of the feature"))
{
aFound = Standard_True;
aModifier = XCAFDimTolObjects_DimensionModif_AnyRestrictedPortionOfFeature;
}
else if(aModifStr.IsEqual("any cross section"))
{
aFound = Standard_True;
aModifier = XCAFDimTolObjects_DimensionModif_AnyCrossSection;
}
else if(aModifStr.IsEqual("specific fixed cross section"))
{
aFound = Standard_True;
aModifier = XCAFDimTolObjects_DimensionModif_SpecificFixedCrossSection;
}
else if(aModifStr.IsEqual("common tolerance"))
{
aFound = Standard_True;
aModifier = XCAFDimTolObjects_DimensionModif_CommonTolerance;
}
else if(aModifStr.IsEqual("free state condition"))
{
aFound = Standard_True;
aModifier = XCAFDimTolObjects_DimensionModif_FreeStateCondition;
}
if (aFound)
theModifiers.Append(aModifier);
}
}
//=======================================================================
//function : getClassOfTolerance
//purpose :
//=======================================================================
void STEPConstruct_GDTProperty::GetDimClassOfTolerance(const Handle(StepShape_LimitsAndFits)& theLAF,
Standard_Boolean theHolle,
XCAFDimTolObjects_DimensionFormVariance theFV,
XCAFDimTolObjects_DimensionGrade theG)
{
Handle(TCollection_HAsciiString) aFormV = theLAF->FormVariance();
Handle(TCollection_HAsciiString) aGrade = theLAF->Grade();
theFV = XCAFDimTolObjects_DimensionFormVariance_None;
Standard_Boolean aFound;
theHolle = Standard_False;
//it is not verified information
for(Standard_Integer c = 0; c <= 1; c++)
{
aFound = Standard_False;
Standard_Boolean aCaseSens = Standard_False;
if (c == 1)
aCaseSens = Standard_True;
Handle(TCollection_HAsciiString) aStr = new TCollection_HAsciiString("a");
if(aFormV->IsSameString(aStr, aCaseSens))
{
aFound = Standard_True;
theFV = XCAFDimTolObjects_DimensionFormVariance_A;
continue;
}
aStr = new TCollection_HAsciiString("b");
if(aFormV->IsSameString(aStr, aCaseSens))
{
aFound = Standard_True;
theFV = XCAFDimTolObjects_DimensionFormVariance_B;
continue;
}
aStr = new TCollection_HAsciiString("c");
if(aFormV->IsSameString(aStr, aCaseSens))
{
aFound = Standard_True;
theFV = XCAFDimTolObjects_DimensionFormVariance_C;
continue;
}
aStr = new TCollection_HAsciiString("cd");
if(aFormV->IsSameString(aStr, aCaseSens))
{
aFound = Standard_True;
theFV = XCAFDimTolObjects_DimensionFormVariance_CD;
continue;
}
aStr = new TCollection_HAsciiString("d");
if(aFormV->IsSameString(aStr, aCaseSens))
{
aFound = Standard_True;
theFV = XCAFDimTolObjects_DimensionFormVariance_D;
continue;
}
aStr = new TCollection_HAsciiString("e");
if(aFormV->IsSameString(aStr, aCaseSens))
{
aFound = Standard_True;
theFV = XCAFDimTolObjects_DimensionFormVariance_E;
continue;
}
aStr = new TCollection_HAsciiString("ef");
if(aFormV->IsSameString(aStr, aCaseSens))
{
aFound = Standard_True;
theFV = XCAFDimTolObjects_DimensionFormVariance_EF;
continue;
}
aStr = new TCollection_HAsciiString("f");
if(aFormV->IsSameString(aStr, aCaseSens))
{
aFound = Standard_True;
theFV = XCAFDimTolObjects_DimensionFormVariance_F;
continue;
}
aStr = new TCollection_HAsciiString("fg");
if(aFormV->IsSameString(aStr, aCaseSens))
{
aFound = Standard_True;
theFV = XCAFDimTolObjects_DimensionFormVariance_FG;
continue;
}
aStr = new TCollection_HAsciiString("g");
if(aFormV->IsSameString(aStr, aCaseSens))
{
aFound = Standard_True;
theFV = XCAFDimTolObjects_DimensionFormVariance_G;
continue;
}
aStr = new TCollection_HAsciiString("h");
if(aFormV->IsSameString(aStr, aCaseSens))
{
aFound = Standard_True;
theFV = XCAFDimTolObjects_DimensionFormVariance_H;
continue;
}
aStr = new TCollection_HAsciiString("js");
if(aFormV->IsSameString(aStr, aCaseSens))
{
aFound = Standard_True;
theFV = XCAFDimTolObjects_DimensionFormVariance_JS;
continue;
}
aStr = new TCollection_HAsciiString("k");
if(aFormV->IsSameString(aStr, aCaseSens))
{
aFound = Standard_True;
theFV = XCAFDimTolObjects_DimensionFormVariance_K;
continue;
}
aStr = new TCollection_HAsciiString("m");
if(aFormV->IsSameString(aStr, aCaseSens))
{
aFound = Standard_True;
theFV = XCAFDimTolObjects_DimensionFormVariance_M;
continue;
}
aStr = new TCollection_HAsciiString("n");
if(aFormV->IsSameString(aStr, aCaseSens))
{
aFound = Standard_True;
theFV = XCAFDimTolObjects_DimensionFormVariance_N;
continue;
}
aStr = new TCollection_HAsciiString("p");
if(aFormV->IsSameString(aStr, aCaseSens))
{
aFound = Standard_True;
theFV = XCAFDimTolObjects_DimensionFormVariance_P;
continue;
}
aStr = new TCollection_HAsciiString("r");
if(aFormV->IsSameString(aStr, aCaseSens))
{
aFound = Standard_True;
theFV = XCAFDimTolObjects_DimensionFormVariance_R;
continue;
}
aStr = new TCollection_HAsciiString("s");
if(aFormV->IsSameString(aStr, aCaseSens))
{
aFound = Standard_True;
theFV = XCAFDimTolObjects_DimensionFormVariance_S;
continue;
}
aStr = new TCollection_HAsciiString("t");
if(aFormV->IsSameString(aStr, aCaseSens))
{
aFound = Standard_True;
theFV = XCAFDimTolObjects_DimensionFormVariance_T;
continue;
}
aStr = new TCollection_HAsciiString("u");
if(aFormV->IsSameString(aStr, aCaseSens))
{
aFound = Standard_True;
theFV = XCAFDimTolObjects_DimensionFormVariance_U;
continue;
}
aStr = new TCollection_HAsciiString("v");
if(aFormV->IsSameString(aStr, aCaseSens))
{
aFound = Standard_True;
theFV = XCAFDimTolObjects_DimensionFormVariance_V;
continue;
}
aStr = new TCollection_HAsciiString("x");
if(aFormV->IsSameString(aStr, aCaseSens))
{
aFound = Standard_True;
theFV = XCAFDimTolObjects_DimensionFormVariance_X;
continue;
}
aStr = new TCollection_HAsciiString("y");
if(aFormV->IsSameString(aStr, aCaseSens))
{
aFound = Standard_True;
theFV = XCAFDimTolObjects_DimensionFormVariance_Y;
continue;
}
aStr = new TCollection_HAsciiString("b");
if(aFormV->IsSameString(aStr, aCaseSens))
{
aFound = Standard_True;
theFV = XCAFDimTolObjects_DimensionFormVariance_B;
continue;
}
aStr = new TCollection_HAsciiString("z");
if(aFormV->IsSameString(aStr, aCaseSens))
{
aFound = Standard_True;
theFV = XCAFDimTolObjects_DimensionFormVariance_Z;
continue;
}
aStr = new TCollection_HAsciiString("za");
if(aFormV->IsSameString(aStr, aCaseSens))
{
aFound = Standard_True;
theFV = XCAFDimTolObjects_DimensionFormVariance_ZA;
continue;
}
aStr = new TCollection_HAsciiString("zb");
if(aFormV->IsSameString(aStr, aCaseSens))
{
aFound = Standard_True;
theFV = XCAFDimTolObjects_DimensionFormVariance_ZB;
continue;
}
aStr = new TCollection_HAsciiString("zc");
if(aFormV->IsSameString(aStr, aCaseSens))
{
aFound = Standard_True;
theFV = XCAFDimTolObjects_DimensionFormVariance_ZC;
continue;
}
if (c == 1 && !aFound)
theHolle = Standard_True;
}
Handle(TCollection_HAsciiString) aStr = new TCollection_HAsciiString("01");
if(aGrade->IsSameString(aStr))
{
theG = XCAFDimTolObjects_DimensionGrade_IT01;
}
else
{
theG = (XCAFDimTolObjects_DimensionGrade)(aGrade->IntegerValue()+1);
}
}
//=======================================================================
//function : getDimType
//purpose :
//=======================================================================
Standard_Boolean STEPConstruct_GDTProperty::GetDimType(const Handle(TCollection_HAsciiString)& theName,
XCAFDimTolObjects_DimensionType& theType)
{
TCollection_AsciiString aName = theName->String();
aName.LowerCase();
theType = XCAFDimTolObjects_DimensionType_Location_None;
if(aName.IsEqual("curve length"))
{
theType = XCAFDimTolObjects_DimensionType_Size_CurveLength;
}
else if(aName.IsEqual("diameter"))
{
theType = XCAFDimTolObjects_DimensionType_Size_Diameter;
}
else if(aName.IsEqual("spherical diameter"))
{
theType = XCAFDimTolObjects_DimensionType_Size_SphericalDiameter;
}
else if(aName.IsEqual("radius"))
{
theType = XCAFDimTolObjects_DimensionType_Size_Radius;
}
else if(aName.IsEqual("spherical radius"))
{
theType = XCAFDimTolObjects_DimensionType_Size_SphericalRadius;
}
else if(aName.IsEqual("toroidal minor diameter"))
{
theType = XCAFDimTolObjects_DimensionType_Size_ToroidalMinorDiameter;
}
else if(aName.IsEqual("toroidal major diameter"))
{
theType = XCAFDimTolObjects_DimensionType_Size_ToroidalMajorDiameter;
}
else if(aName.IsEqual("toroidal minor radius"))
{
theType = XCAFDimTolObjects_DimensionType_Size_ToroidalMinorRadius;
}
else if(aName.IsEqual("toroidal major radius"))
{
theType = XCAFDimTolObjects_DimensionType_Size_ToroidalMajorRadius;
}
else if(aName.IsEqual("toroidal high major diameter"))
{
theType = XCAFDimTolObjects_DimensionType_Size_ToroidalHighMajorDiameter;
}
else if(aName.IsEqual("toroidal low major diameter"))
{
theType = XCAFDimTolObjects_DimensionType_Size_ToroidalLowMajorDiameter;
}
else if(aName.IsEqual("toroidal high major radius"))
{
theType = XCAFDimTolObjects_DimensionType_Size_ToroidalHighMajorRadius;
}
else if(aName.IsEqual("toroidal low major radius"))
{
theType = XCAFDimTolObjects_DimensionType_Size_ToroidalLowMajorRadius;
}
else if(aName.IsEqual("thickness"))
{
theType = XCAFDimTolObjects_DimensionType_Size_Thickness;
}
else if(aName.IsEqual("curved distance"))
{
theType = XCAFDimTolObjects_DimensionType_Location_CurvedDistance;
}
else if(aName.IsEqual("linear distance"))
{
theType = XCAFDimTolObjects_DimensionType_Location_LinearDistance;
}
else if(aName.IsEqual("linear distance centre outer"))
{
theType = XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromCenterToOuter;
}
else if(aName.IsEqual("linear distance centre inner"))
{
theType = XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromCenterToInner;
}
else if(aName.IsEqual("linear distance outer centre"))
{
theType = XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromOuterToCenter;
}
else if(aName.IsEqual("linear distance outer outer"))
{
theType = XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromOuterToOuter;
}
else if(aName.IsEqual("linear distance outer inner"))
{
theType = XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromOuterToInner;
}
else if(aName.IsEqual("linear distance inner centre"))
{
theType = XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromInnerToCenter;
}
else if(aName.IsEqual("linear distance inner outer"))
{
theType = XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromInnerToOuter;
}
else if(aName.IsEqual("linear distance inner inner"))
{
theType = XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromInnerToInner;
}
if(theType != XCAFDimTolObjects_DimensionType_Location_None)
{
return Standard_True;
}
return Standard_False;
}
//=======================================================================
//function : DatumTargetType
//purpose :
//=======================================================================
Standard_Boolean STEPConstruct_GDTProperty::GetDatumTargetType(const Handle(TCollection_HAsciiString)& theDescription,
XCAFDimTolObjects_DatumTargetType& theType)
{
TCollection_AsciiString aName = theDescription->String();
aName.LowerCase();
if(aName.IsEqual("area"))
{
theType = XCAFDimTolObjects_DatumTargetType_Area;
return Standard_True;
}
else if(aName.IsEqual("line"))
{
theType = XCAFDimTolObjects_DatumTargetType_Line;
return Standard_True;
}
else if(aName.IsEqual("circle"))
{
theType = XCAFDimTolObjects_DatumTargetType_Circle;
return Standard_True;
}
else if(aName.IsEqual("rectangle"))
{
theType = XCAFDimTolObjects_DatumTargetType_Rectangle;
return Standard_True;
}
else if(aName.IsEqual("point"))
{
theType = XCAFDimTolObjects_DatumTargetType_Point;
return Standard_True;
}
return Standard_False;
}
//=======================================================================
//function : GetDimQualifierType
//purpose :
//=======================================================================
Standard_Boolean STEPConstruct_GDTProperty::GetDimQualifierType(const Handle(TCollection_HAsciiString)& theDescription,
XCAFDimTolObjects_DimensionQualifier& theType)
{
TCollection_AsciiString aName = theDescription->String();
aName.LowerCase();
theType = XCAFDimTolObjects_DimensionQualifier_None;
if(aName.IsEqual("maximum"))
{
theType = XCAFDimTolObjects_DimensionQualifier_Max;
}
else if(aName.IsEqual("minimum"))
{
theType = XCAFDimTolObjects_DimensionQualifier_Min;
}
else if(aName.IsEqual("average"))
{
theType = XCAFDimTolObjects_DimensionQualifier_Avg;
}
if(theType != XCAFDimTolObjects_DimensionQualifier_None)
{
return Standard_True;
}
return Standard_False;
}
//=======================================================================
//function : GetTolValueType
//purpose :
//=======================================================================
Standard_Boolean STEPConstruct_GDTProperty::GetTolValueType(const Handle(TCollection_HAsciiString)& theDescription,
XCAFDimTolObjects_GeomToleranceTypeValue& theType)
{
TCollection_AsciiString aName = theDescription->String();
aName.LowerCase();
theType = XCAFDimTolObjects_GeomToleranceTypeValue_None;
if(aName.IsEqual("cylindrical or circular"))
{
theType = XCAFDimTolObjects_GeomToleranceTypeValue_Diameter;
}
else if(aName.IsEqual("spherical"))
{
theType = XCAFDimTolObjects_GeomToleranceTypeValue_SphericalDiameter;
}
if(theType != XCAFDimTolObjects_GeomToleranceTypeValue_None)
{
return Standard_True;
}
return Standard_False;
}

View File

@@ -0,0 +1,68 @@
// Created on: 1999-09-08
// Created by: Andrey BETENEV
// Copyright (c) 1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _STEPConstruct_GDTProperty_HeaderFile
#define _STEPConstruct_GDTProperty_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <STEPConstruct_Tool.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_CString.hxx>
#include <StepRepr_CompoundRepresentationItem.hxx>
#include <XCAFDimTolObjects_DimensionModifiersSequence.hxx>
#include <StepShape_LimitsAndFits.hxx>
#include <XCAFDimTolObjects_DimensionFormVariance.hxx>
#include <XCAFDimTolObjects_DimensionGrade.hxx>
#include <XCAFDimTolObjects_DimensionType.hxx>
#include <XCAFDimTolObjects_DatumTargetType.hxx>
#include <XCAFDimTolObjects_DimensionQualifier.hxx>
#include <XCAFDimTolObjects_GeomToleranceTypeValue.hxx>
//! This class provides tools for access (read)
//! the GDT properties.
class STEPConstruct_GDTProperty
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT STEPConstruct_GDTProperty();
Standard_EXPORT static void GetDimModifiers(const Handle(StepRepr_CompoundRepresentationItem)& theCRI,
XCAFDimTolObjects_DimensionModifiersSequence& theModifiers);
Standard_EXPORT static void GetDimClassOfTolerance(const Handle(StepShape_LimitsAndFits)& theLAF,
Standard_Boolean theHolle,
XCAFDimTolObjects_DimensionFormVariance theFV,
XCAFDimTolObjects_DimensionGrade theG);
Standard_EXPORT static Standard_Boolean GetDimType(const Handle(TCollection_HAsciiString)& theName,
XCAFDimTolObjects_DimensionType& theType);
Standard_EXPORT static Standard_Boolean GetDatumTargetType(const Handle(TCollection_HAsciiString)& theDescription,
XCAFDimTolObjects_DatumTargetType& theType);
Standard_EXPORT static Standard_Boolean GetDimQualifierType(const Handle(TCollection_HAsciiString)& theDescription,
XCAFDimTolObjects_DimensionQualifier& theType);
Standard_EXPORT static Standard_Boolean GetTolValueType(const Handle(TCollection_HAsciiString)& theDescription,
XCAFDimTolObjects_GeomToleranceTypeValue& theType);
};
#endif // _STEPConstruct_GDTProperty_HeaderFile

View File

@@ -288,6 +288,7 @@ static Standard_CString schemaAP203 = "CONFIG_CONTROL_DESIGN";
#include <StepBasic_SecurityClassificationLevel.hxx>
#include <StepRepr_ShapeAspect.hxx>
#include <StepRepr_ShapeAspectRelationship.hxx>
#include <StepRepr_FeatureForDatumTargetRelationship.hxx>
#include <StepRepr_ShapeAspectTransition.hxx>
#include <StepShape_ShapeDefinitionRepresentation.hxx>
#include <StepShape_ShapeRepresentation.hxx>
@@ -1411,6 +1412,7 @@ StepAP214_Protocol::StepAP214_Protocol ()
types.Bind (STANDARD_TYPE(StepRepr_CompShAspAndDatumFeatAndShAsp), 699);
types.Bind (STANDARD_TYPE(StepRepr_IntegerRepresentationItem), 700);
types.Bind (STANDARD_TYPE(StepRepr_ValueRepresentationItem), 701);
types.Bind (STANDARD_TYPE(StepRepr_FeatureForDatumTargetRelationship), 702);
}
//=======================================================================

View File

@@ -48,6 +48,8 @@ StepRepr_Extension.cxx
StepRepr_Extension.hxx
StepRepr_ExternallyDefinedRepresentation.cxx
StepRepr_ExternallyDefinedRepresentation.hxx
StepRepr_FeatureForDatumTargetRelationship.cxx
StepRepr_FeatureForDatumTargetRelationship.hxx
StepRepr_FunctionallyDefinedTransformation.cxx
StepRepr_FunctionallyDefinedTransformation.hxx
StepRepr_GeometricAlignment.cxx

View File

@@ -0,0 +1,29 @@
// Created on: 2000-04-18
// Created by: Andrey BETENEV
// Copyright (c) 2000-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
// Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.0
#include <Standard_Type.hxx>
#include <StepRepr_ShapeAspect.hxx>
#include <StepRepr_FeatureForDatumTargetRelationship.hxx>
//=======================================================================
//function : StepRepr_FeatureForDatumtargetRelationship
//purpose :
//=======================================================================
StepRepr_FeatureForDatumTargetRelationship::StepRepr_FeatureForDatumTargetRelationship ()
{
}

View File

@@ -0,0 +1,59 @@
// Created on: 2000-04-18
// Created by: Andrey BETENEV
// Copyright (c) 2000-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _StepRepr_FeatureForDatumtargetRelationship_HeaderFile
#define _StepRepr_FeatureForDatumtargetRelationship_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <StepRepr_ShapeAspectRelationship.hxx>
class StepRepr_FeatureForDatumTargetRelationship;
DEFINE_STANDARD_HANDLE(StepRepr_FeatureForDatumTargetRelationship, StepRepr_ShapeAspectRelationship)
//! Representation of STEP entity DimensionalLocation
class StepRepr_FeatureForDatumTargetRelationship : public StepRepr_ShapeAspectRelationship
{
public:
//! Empty constructor
Standard_EXPORT StepRepr_FeatureForDatumTargetRelationship();
DEFINE_STANDARD_RTTI(StepRepr_FeatureForDatumTargetRelationship,StepRepr_ShapeAspectRelationship)
protected:
private:
};
#endif // _StepRepr_FeatureForDatumtargetRelationship_HeaderFile

View File

@@ -15,6 +15,7 @@
#include <Standard_Transient.hxx>
#include <StepShape_PrecisionQualifier.hxx>
#include <StepShape_TypeQualifier.hxx>
#include <StepShape_ValueFormatTypeQualifier.hxx>
#include <StepShape_ValueQualifier.hxx>
StepShape_ValueQualifier::StepShape_ValueQualifier () { }
@@ -33,3 +34,6 @@ Handle(StepShape_PrecisionQualifier) StepShape_ValueQualifier::PrecisionQualifi
Handle(StepShape_TypeQualifier) StepShape_ValueQualifier::TypeQualifier () const
{ return Handle(StepShape_TypeQualifier)::DownCast(Value()); }
Handle(StepShape_ValueFormatTypeQualifier) StepShape_ValueQualifier::ValueFormatTypeQualifier () const
{ return Handle(StepShape_ValueFormatTypeQualifier)::DownCast(Value()); }

View File

@@ -25,6 +25,7 @@
class Standard_Transient;
class StepShape_PrecisionQualifier;
class StepShape_TypeQualifier;
class StepShape_ValueFormatTypeQualifier;
//! Added for Dimensional Tolerances
@@ -49,6 +50,9 @@ public:
//! Returns Value as TypeQualifier
Standard_EXPORT Handle(StepShape_TypeQualifier) TypeQualifier() const;
//! Returns Value as ValueFormatTypeQualifier
Standard_EXPORT Handle(StepShape_ValueFormatTypeQualifier) ValueFormatTypeQualifier() const;

View File

@@ -9,6 +9,7 @@ XCAFDimTolObjects_Tool.cxx
XCAFDimTolObjects_Tool.hxx
XCAFDimTolObjects_DatumModifWithValue.hxx
XCAFDimTolObjects_DatumSingleModif.hxx
XCAFDimTolObjects_DatumTargetType.hxx
XCAFDimTolObjects_DimensionModif.hxx
XCAFDimTolObjects_DimensionFormVariance.hxx
XCAFDimTolObjects_DimensionGrade.hxx

View File

@@ -21,6 +21,7 @@
XCAFDimTolObjects_DatumObject::XCAFDimTolObjects_DatumObject()
{
myIsDTarget = Standard_False;
}
//=======================================================================
@@ -35,6 +36,9 @@ XCAFDimTolObjects_DatumObject::XCAFDimTolObjects_DatumObject(const Handle(XCAFDi
myModifierWithValue = theObj->myModifierWithValue;
myValueOfModifier = theObj->myValueOfModifier;
myDatumTarget = theObj->myDatumTarget;
myIsDTarget = theObj->myIsDTarget;
myAxis = theObj->myAxis;
myDTargetType = theObj->myDTargetType;
}
//=======================================================================
@@ -131,12 +135,123 @@ void XCAFDimTolObjects_DatumObject::SetDatumTarget (const TopoDS_Shape& theShape
myDatumTarget = theShape;
}
//=======================================================================
//function : GetPosition
//purpose :
//=======================================================================
Standard_Integer XCAFDimTolObjects_DatumObject::GetPosition() const
{
return myPosition;
}
//=======================================================================
//function : SetName
//purpose :
//=======================================================================
void XCAFDimTolObjects_DatumObject::SetPosition(const Standard_Integer thePosition)
{
myPosition = thePosition;
}
//=======================================================================
//function : IsDatumTarget
//purpose :
//=======================================================================
Standard_Boolean XCAFDimTolObjects_DatumObject::IsDatumTarget() const
Standard_Boolean XCAFDimTolObjects_DatumObject::IsDatumTarget() const
{
return !myDatumTarget.IsNull();
return myIsDTarget;
}
//=======================================================================
//function : IsDatumTarget
//purpose :
//=======================================================================
void XCAFDimTolObjects_DatumObject::IsDatumTarget(const Standard_Boolean theIsDT)
{
myIsDTarget = theIsDT;
}
//=======================================================================
//function : GetDatumTargetType
//purpose :
//=======================================================================
XCAFDimTolObjects_DatumTargetType XCAFDimTolObjects_DatumObject::GetDatumTargetType() const
{
return myDTargetType;
}
//=======================================================================
//function : SetDatumTargetType
//purpose :
//=======================================================================
void XCAFDimTolObjects_DatumObject::SetDatumTargetType(const XCAFDimTolObjects_DatumTargetType theType)
{
myDTargetType = theType;
}
//=======================================================================
//function : GetDatumTargetAxis
//purpose :
//=======================================================================
gp_Ax2 XCAFDimTolObjects_DatumObject::GetDatumTargetAxis() const
{
return myAxis;
}
//=======================================================================
//function : SetDatumTargetAxis
//purpose :
//=======================================================================
void XCAFDimTolObjects_DatumObject::SetDatumTargetAxis(const gp_Ax2& theAxis)
{
myAxis = theAxis;
}
//=======================================================================
//function : GetDatumTargetLength
//purpose :
//=======================================================================
Standard_Real XCAFDimTolObjects_DatumObject::GetDatumTargetLength() const
{
return myLength;
}
//=======================================================================
//function : SetDatumTargetLength
//purpose :
//=======================================================================
void XCAFDimTolObjects_DatumObject::SetDatumTargetLength(const Standard_Real theLength)
{
myLength = theLength;
}
//=======================================================================
//function : GetDatumTargetWidth
//purpose :
//=======================================================================
Standard_Real XCAFDimTolObjects_DatumObject::GetDatumTargetWidth() const
{
return myWidth;
}
//=======================================================================
//function : SetDatumTargetWidth
//purpose :
//=======================================================================
void XCAFDimTolObjects_DatumObject::SetDatumTargetWidth(const Standard_Real theWidth)
{
myWidth = theWidth;
}

View File

@@ -21,6 +21,7 @@
#include <Standard_Type.hxx>
#include <XCAFDimTolObjects_DatumObjectSequence.hxx>
#include <XCAFDimTolObjects_DatumTargetType.hxx>
#include <TCollection_HAsciiString.hxx>
#include <XCAFDimTolObjects_DatumModifiersSequence.hxx>
#include <XCAFDimTolObjects_DatumModifWithValue.hxx>
@@ -29,6 +30,7 @@
#include <Standard_Transient.hxx>
#include <XCAFDimTolObjects_DatumSingleModif.hxx>
#include <Standard_Boolean.hxx>
#include <gp_Ax2.hxx>
class XCAFDimTolObjects_DatumObject;
DEFINE_STANDARD_HANDLE(XCAFDimTolObjects_DatumObject, Standard_Transient)
@@ -60,9 +62,31 @@ public:
Standard_EXPORT TopoDS_Shape GetDatumTarget() const;
Standard_EXPORT void SetDatumTarget (const TopoDS_Shape& theShape);
Standard_EXPORT Standard_Integer GetPosition () const;
Standard_EXPORT void SetPosition (const Standard_Integer thePosition);
Standard_EXPORT Standard_Boolean IsDatumTarget() const;
Standard_EXPORT void IsDatumTarget(const Standard_Boolean theIsDT);
Standard_EXPORT XCAFDimTolObjects_DatumTargetType GetDatumTargetType() const;
Standard_EXPORT void SetDatumTargetType (const XCAFDimTolObjects_DatumTargetType theType);
Standard_EXPORT gp_Ax2 GetDatumTargetAxis() const;
Standard_EXPORT void SetDatumTargetAxis (const gp_Ax2& theAxis);
Standard_EXPORT Standard_Real GetDatumTargetLength() const;
Standard_EXPORT void SetDatumTargetLength (const Standard_Real theLength);
Standard_EXPORT Standard_Real GetDatumTargetWidth() const;
Standard_EXPORT void SetDatumTargetWidth (const Standard_Real theWidth);
DEFINE_STANDARD_RTTI(XCAFDimTolObjects_DatumObject,Standard_Transient)
@@ -73,6 +97,13 @@ private:
XCAFDimTolObjects_DatumModifWithValue myModifierWithValue;
Standard_Real myValueOfModifier;
TopoDS_Shape myDatumTarget;
Standard_Integer myPosition;
Standard_Boolean myIsDTarget;
XCAFDimTolObjects_DatumTargetType myDTargetType;
gp_Ax2 myAxis;
Standard_Real myLength;
Standard_Real myWidth;
};

View File

@@ -0,0 +1,30 @@
// Created on: 2015-08-06
// Created by: Ilya Novikov
// Copyright (c) 2004-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _XCAFDimTolObjects_DatumTargetType_HeaderFile
#define _XCAFDimTolObjects_DatumTargetType_HeaderFile
//! Defines types of dimension
enum XCAFDimTolObjects_DatumTargetType
{
XCAFDimTolObjects_DatumTargetType_Point,
XCAFDimTolObjects_DatumTargetType_Line,
XCAFDimTolObjects_DatumTargetType_Rectangle,
XCAFDimTolObjects_DatumTargetType_Circle,
XCAFDimTolObjects_DatumTargetType_Area
};
#endif // _XCAFDimTolObjects_DatumTargetType_HeaderFile

View File

@@ -313,10 +313,10 @@ Standard_Boolean XCAFDimTolObjects_DimensionObject::GetClassOfTolerance (Standar
XCAFDimTolObjects_DimensionFormVariance& theFormVariance,
XCAFDimTolObjects_DimensionGrade& theGrade) const
{
theFormVariance = myFormVariance;
if(myFormVariance != XCAFDimTolObjects_DimensionFormVariance_None)
{
theHole = myIsHole;
theFormVariance = myFormVariance;
theGrade = myGrade;
return Standard_True;
}

View File

@@ -33,7 +33,9 @@ XCAFDimTolObjects_GeomToleranceModif_Pitch_Diameter,
XCAFDimTolObjects_GeomToleranceModif_Reciprocity_Requirement,
XCAFDimTolObjects_GeomToleranceModif_Separate_Requirement,
XCAFDimTolObjects_GeomToleranceModif_Statistical_Tolerance,
XCAFDimTolObjects_GeomToleranceModif_Tangent_Plane
XCAFDimTolObjects_GeomToleranceModif_Tangent_Plane,
XCAFDimTolObjects_GeomToleranceModif_All_Around,
XCAFDimTolObjects_GeomToleranceModif_All_Over,
};
#endif // _XCAFDimTolObjects_GeomToleranceModif_HeaderFile

View File

@@ -20,6 +20,7 @@
XCAFDimTolObjects_GeomToleranceObject::XCAFDimTolObjects_GeomToleranceObject()
{
myHasAxis = Standard_False;
}
//=======================================================================
@@ -37,6 +38,8 @@ XCAFDimTolObjects_GeomToleranceObject::XCAFDimTolObjects_GeomToleranceObject(con
myValueOfZoneModif = theObj->myValueOfZoneModif;
myModifiers = theObj->myModifiers;
myMaxValueModif = theObj->myMaxValueModif;
myAxis = theObj->GetAxis();
myHasAxis = Standard_False;
}
//=======================================================================
@@ -208,3 +211,34 @@ Standard_Real XCAFDimTolObjects_GeomToleranceObject::GetMaxValueModifier() cons
{
return myMaxValueModif;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
void XCAFDimTolObjects_GeomToleranceObject::SetAxis (const gp_Ax2 theAxis)
{
myAxis = theAxis;
myHasAxis = Standard_True;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
gp_Ax2 XCAFDimTolObjects_GeomToleranceObject::GetAxis() const
{
return myAxis;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean XCAFDimTolObjects_GeomToleranceObject::HasAxis () const
{
return myHasAxis;
}

View File

@@ -29,6 +29,7 @@
#include <XCAFDimTolObjects_GeomToleranceModifiersSequence.hxx>
#include <Standard_Transient.hxx>
#include <XCAFDimTolObjects_GeomToleranceModif.hxx>
#include <gp_Ax2.hxx>
class XCAFDimTolObjects_GeomToleranceObject;
DEFINE_STANDARD_HANDLE(XCAFDimTolObjects_GeomToleranceObject, Standard_Transient)
@@ -77,6 +78,12 @@ public:
Standard_EXPORT Standard_Real GetMaxValueModifier() const;
Standard_EXPORT void SetAxis (const gp_Ax2 theAxis);
Standard_EXPORT gp_Ax2 GetAxis() const;
Standard_EXPORT Standard_Boolean HasAxis () const;
DEFINE_STANDARD_RTTI(XCAFDimTolObjects_GeomToleranceObject,Standard_Transient)
private:
@@ -89,8 +96,8 @@ private:
Standard_Real myValueOfZoneModif;
XCAFDimTolObjects_GeomToleranceModifiersSequence myModifiers;
Standard_Real myMaxValueModif;
gp_Ax2 myAxis;
Standard_Boolean myHasAxis;
};

View File

@@ -173,11 +173,11 @@ Standard_Boolean XCAFDimTolObjects_Tool::GetRefDatum(const TopoDS_Shape& theShap
myDimTolTool->ShapeTool()->Search(theShape, aShapeL);
if(!aShapeL.IsNull())
{
TDF_Label aDatumL;
TDF_LabelSequence aDatumL;
if(myDimTolTool->GetRefDatumLabel(aShapeL, aDatumL))
{
Handle(XCAFDoc_Datum) aDatum;
if( aDatumL.FindAttribute(XCAFDoc_Datum::GetID(),aDatum)){
if( aDatumL.First().FindAttribute(XCAFDoc_Datum::GetID(),aDatum)){
theDatumObject = aDatum->GetObject();
return Standard_True;
}

View File

@@ -94,12 +94,23 @@ Standard_GUID XCAFDoc::DimTolRefGUID()
//purpose :
//=======================================================================
Standard_GUID XCAFDoc::DimensionRefGUID()
Standard_GUID XCAFDoc::DimensionRefFirstGUID()
{
static Standard_GUID ID("efd212e3-6dfd-11d4-b9c8-0060b0ee281b");
return ID;
}
//=======================================================================
//function : DimensionRefGUID
//purpose :
//=======================================================================
Standard_GUID XCAFDoc::DimensionRefSecondGUID()
{
static Standard_GUID ID("efd212e0-6dfd-11d4-b9c8-0060b0ee281b");
return ID;
}
//=======================================================================
//function : GeomToleranceRefGUID
//purpose :

View File

@@ -77,7 +77,10 @@ public:
Standard_EXPORT static Standard_GUID DimTolRefGUID();
//! Return GUIDs for TreeNode representing specified types of Dimension
Standard_EXPORT static Standard_GUID DimensionRefGUID() ;
Standard_EXPORT static Standard_GUID DimensionRefFirstGUID() ;
//! Return GUIDs for TreeNode representing specified types of Dimension
Standard_EXPORT static Standard_GUID DimensionRefSecondGUID() ;
//! Return GUIDs for TreeNode representing specified types of GeomTolerance
Standard_EXPORT static Standard_GUID GeomToleranceRefGUID() ;

View File

@@ -17,10 +17,12 @@
#include <TCollection_HAsciiString.hxx>
#include <TDF_Attribute.hxx>
#include <TDF_Label.hxx>
#include <TDF_ChildIterator.hxx>
#include <TDF_RelocationTable.hxx>
#include <XCAFDoc_Datum.hxx>
#include <TDataStd_AsciiString.hxx>
#include <TDataStd_IntegerArray.hxx>
#include <TDataStd_RealArray.hxx>
#include <TDataStd_Integer.hxx>
#include <TDataStd_Real.hxx>
#include <TNaming_NamedShape.hxx>
@@ -34,7 +36,14 @@ enum ChildLab
ChildLab_Name = 1,
ChildLab_Modifiers,
ChildLab_ModifierWithValue,
ChildLab_DatumTarget
ChildLab_IsDTarget,
ChildLab_DTargetType,
ChildLab_AxisLoc,
ChildLab_AxisN,
ChildLab_AxisRef,
ChildLab_DTargetLength,
ChildLab_DTargetWidth,
ChildLab_DatumTarget,
};
//=======================================================================
@@ -152,7 +161,12 @@ Handle(TCollection_HAsciiString) XCAFDoc_Datum::GetIdentification() const
void XCAFDoc_Datum::SetObject(const Handle(XCAFDimTolObjects_DatumObject)& theObject)
{
Backup();
if (!theObject->GetName().IsNull())
TDF_ChildIterator anIter(Label());
for(;anIter.More(); anIter.Next())
{
anIter.Value().ForgetAllAttributes();
}
if (!theObject->GetName().IsNull() && !theObject->GetName()->IsEmpty())
{
Handle(TDataStd_AsciiString) anAttName;
if(!Label().FindChild(ChildLab_Name).FindAttribute(TDataStd_AsciiString::GetID(), anAttName))
@@ -162,16 +176,8 @@ void XCAFDoc_Datum::SetObject(const Handle(XCAFDimTolObjects_DatumObject)& theOb
}
anAttName->Set(theObject->GetName()->String());
}
else
{
Label().FindChild(ChildLab_Name).ForgetAllAttributes();
}
if(theObject->GetModifiers().Length() == 0)
{
Label().FindChild(ChildLab_Modifiers).ForgetAllAttributes();
}
else
if(theObject->GetModifiers().Length() > 0)
{
Handle(TDataStd_IntegerArray) aModifiers;
if(!Label().FindChild(ChildLab_Modifiers).FindAttribute(TDataStd_IntegerArray::GetID(), aModifiers))
@@ -205,19 +211,60 @@ void XCAFDoc_Datum::SetObject(const Handle(XCAFDimTolObjects_DatumObject)& theOb
aModifierWithValueM->Set(aM);
aModifierWithValueV->Set(aV);
}
else
{
Label().FindChild(ChildLab_ModifierWithValue).ForgetAllAttributes();
}
if(!theObject->GetDatumTarget().IsNull())
Handle(TDataStd_Integer) aIsTarget = new TDataStd_Integer();
aIsTarget->Set(theObject->IsDatumTarget());
Label().FindChild(ChildLab_IsDTarget).AddAttribute(aIsTarget);
if(theObject->IsDatumTarget())
{
TNaming_Builder tnBuild(Label().FindChild(ChildLab_DatumTarget));
tnBuild.Generated(theObject->GetDatumTarget());
}
else
{
Label().FindChild(ChildLab_DatumTarget).ForgetAllAttributes();
Handle(TDataStd_Integer) aType = new TDataStd_Integer();
aType->Set(theObject->GetDatumTargetType());
Label().FindChild(ChildLab_DTargetType).AddAttribute(aType);
if(theObject->GetDatumTargetType() == XCAFDimTolObjects_DatumTargetType_Area)
{
if(!theObject->GetDatumTarget().IsNull())
{
TNaming_Builder tnBuild(Label().FindChild(ChildLab_DatumTarget));
tnBuild.Generated(theObject->GetDatumTarget());
}
}
else
{
Handle(TDataStd_RealArray) aLoc = new TDataStd_RealArray();
Handle(TDataStd_RealArray) aN = new TDataStd_RealArray();
Handle(TDataStd_RealArray) aR = new TDataStd_RealArray();
gp_Ax2 anAx = theObject->GetDatumTargetAxis();
aLoc->SetValue(aLoc->Upper(),anAx.Location().X());
aLoc->SetValue(aLoc->Upper()+1,anAx.Location().Y());
aLoc->SetValue(aLoc->Upper()+2,anAx.Location().Z());
aN->SetValue(aN->Upper(),anAx.Axis().Direction().X());
aN->SetValue(aN->Upper(),anAx.Axis().Direction().X());
aN->SetValue(aN->Upper(),anAx.Axis().Direction().X());
aR->SetValue(aR->Upper(),anAx.Direction().X());
aR->SetValue(aR->Upper(),anAx.Direction().X());
aR->SetValue(aR->Upper(),anAx.Direction().X());
Label().FindChild(ChildLab_AxisLoc).AddAttribute(aLoc);
Label().FindChild(ChildLab_AxisN).AddAttribute(aN);
Label().FindChild(ChildLab_AxisRef).AddAttribute(aR);
if(theObject->GetDatumTargetType() != XCAFDimTolObjects_DatumTargetType_Point)
{
Handle(TDataStd_Real) aLen = new TDataStd_Real();
aLen->Set(theObject->GetDatumTargetLength());
Label().FindChild(ChildLab_DTargetLength).AddAttribute(aLen);
if(theObject->GetDatumTargetType() == XCAFDimTolObjects_DatumTargetType_Rectangle)
{
Handle(TDataStd_Real) aWidth = new TDataStd_Real();
aWidth->Set(theObject->GetDatumTargetWidth());
Label().FindChild(ChildLab_DTargetWidth).AddAttribute(aWidth);
}
}
}
}
}
@@ -257,10 +304,60 @@ Handle(XCAFDimTolObjects_DatumObject) XCAFDoc_Datum::GetObject() const
}
}
Handle(TNaming_NamedShape) aDatumTarget;
if(Label().FindChild(ChildLab_DatumTarget).FindAttribute(TNaming_NamedShape::GetID(), aDatumTarget))
Handle(TDataStd_Integer) aIsDTarget;
if(Label().FindChild(ChildLab_IsDTarget).FindAttribute(TDataStd_Integer::GetID(), aIsDTarget))
{
anObj->SetDatumTarget(aDatumTarget->Get());
anObj->IsDatumTarget((aIsDTarget->Get() != 0));
}
if (aIsDTarget != 0)
{
Handle(TDataStd_Integer) aDTargetType;
if(Label().FindChild(ChildLab_DTargetType).FindAttribute(TDataStd_Integer::GetID(), aDTargetType))
{
anObj->SetDatumTargetType((XCAFDimTolObjects_DatumTargetType)aDTargetType->Get());
if(anObj->GetDatumTargetType() == XCAFDimTolObjects_DatumTargetType_Area)
{
Handle(TNaming_NamedShape) aDatumTarget;
if(Label().FindChild(ChildLab_DatumTarget).FindAttribute(TNaming_NamedShape::GetID(), aDatumTarget))
{
anObj->SetDatumTarget(aDatumTarget->Get());
}
}
else
{
Handle(TDataStd_RealArray) aLoc;
Handle(TDataStd_RealArray) aN;
Handle(TDataStd_RealArray) aR;
if(Label().FindChild(ChildLab_AxisLoc).FindAttribute(TDataStd_RealArray::GetID(), aLoc) && aLoc->Length() == 3 &&
Label().FindChild(ChildLab_AxisN).FindAttribute(TDataStd_RealArray::GetID(), aN) && aN->Length() == 3 &&
Label().FindChild(ChildLab_AxisRef).FindAttribute(TDataStd_RealArray::GetID(), aR) && aR->Length() == 3 )
{
gp_Pnt aL(aLoc->Value(aLoc->Upper()), aLoc->Value(aLoc->Upper()+1), aLoc->Value(aLoc->Upper()+2));
gp_Dir aD(aN->Value(aN->Upper()), aN->Value(aN->Upper()+1), aN->Value(aN->Upper()+2));
gp_Dir aDR(aR->Value(aR->Upper()), aR->Value(aR->Upper()+1), aR->Value(aR->Upper()+2));
gp_Ax2 anAx(aL, aD, aDR);
anObj->SetDatumTargetAxis(anAx);
}
if(anObj->GetDatumTargetType() != XCAFDimTolObjects_DatumTargetType_Point)
{
Handle(TDataStd_Real) aLen;
if(Label().FindChild(ChildLab_DTargetLength).FindAttribute(TDataStd_Integer::GetID(), aLen))
{
anObj->SetDatumTargetLength(aLen->Get());
}
if(anObj->GetDatumTargetType() == XCAFDimTolObjects_DatumTargetType_Rectangle)
{
Handle(TDataStd_Real) aWidth;
if(Label().FindChild(ChildLab_DTargetWidth).FindAttribute(TDataStd_Integer::GetID(), aWidth))
{
anObj->SetDatumTargetWidth(aWidth->Get());
}
}
}
}
}
}
return anObj;

View File

@@ -314,43 +314,79 @@ void XCAFDoc_DimTolTool::SetDimension(const TDF_Label& theFirstL,
const TDF_Label& theSecondL,
const TDF_Label& theDimTolL) const
{
Handle(XCAFDoc_GraphNode) aChGNode;
Handle(XCAFDoc_GraphNode) aFGNode;
Handle(XCAFDoc_GraphNode) aSecondFGNode;
TDF_LabelSequence aFirstLS, aSecondLS;
if(!theFirstL.IsNull())
aFirstLS.Append(theFirstL);
if(!theSecondL.IsNull())
aSecondLS.Append(theSecondL);
SetDimension(aFirstLS, aSecondLS, theDimTolL);
}
//Handle(XCAFDoc_GraphNode) ChGNode, FGNode;
if ( theDimTolL.FindAttribute (XCAFDoc::DimensionRefGUID(), aChGNode) ) {
while (aChGNode->NbFathers() > 0) {
aFGNode = aChGNode->GetFather(1);
aFGNode->UnSetChild(aChGNode);
}
theDimTolL.ForgetAttribute ( XCAFDoc::DimTolRefGUID() );
}
//=======================================================================
//function : SetDimension
//purpose :
//=======================================================================
if(!IsDimension(theDimTolL))
void XCAFDoc_DimTolTool::SetDimension(const TDF_LabelSequence& theFirstL,
const TDF_LabelSequence& theSecondL,
const TDF_Label& theDimTolL) const
{
if(!IsDimension(theDimTolL) || theFirstL.Length() == 0)
{
return;
}
if (!theDimTolL.FindAttribute(XCAFDoc::DimensionRefGUID(), aChGNode) ) {
Handle(XCAFDoc_GraphNode) aChGNode;
Handle(XCAFDoc_GraphNode) aFGNode;
Handle(XCAFDoc_GraphNode) aSecondFGNode;
if ( theDimTolL.FindAttribute (XCAFDoc::DimensionRefFirstGUID(), aChGNode) ) {
while (aChGNode->NbFathers() > 0) {
aFGNode = aChGNode->GetFather(1);
aFGNode->UnSetChild(aChGNode);
if(aFGNode->NbChildren() == 0)
aFGNode->ForgetAttribute( XCAFDoc::DimensionRefFirstGUID() );
}
theDimTolL.ForgetAttribute ( XCAFDoc::DimensionRefFirstGUID() );
}
if ( theDimTolL.FindAttribute (XCAFDoc::DimensionRefSecondGUID(), aChGNode) ) {
while (aChGNode->NbFathers() > 0) {
aFGNode = aChGNode->GetFather(1);
aFGNode->UnSetChild(aChGNode);
if(aFGNode->NbChildren() == 0)
aFGNode->ForgetAttribute( XCAFDoc::DimensionRefSecondGUID() );
}
theDimTolL.ForgetAttribute ( XCAFDoc::DimensionRefSecondGUID() );
}
if (!theDimTolL.FindAttribute(XCAFDoc::DimensionRefFirstGUID(), aChGNode)) {
aChGNode = new XCAFDoc_GraphNode;
aChGNode = XCAFDoc_GraphNode::Set(theDimTolL);
aChGNode->SetGraphID(XCAFDoc::DimensionRefFirstGUID());
}
if (!theFirstL.FindAttribute(XCAFDoc::DimensionRefGUID(), aFGNode) ) {
aFGNode = new XCAFDoc_GraphNode;
aFGNode = XCAFDoc_GraphNode::Set(theFirstL);
}
aFGNode->SetGraphID(XCAFDoc::DimensionRefGUID());
aChGNode->SetGraphID(XCAFDoc::DimensionRefGUID());
aFGNode->SetChild(aChGNode);
aChGNode->SetFather(aFGNode);
if (!theSecondL.IsNull()){
if(!theSecondL.FindAttribute(XCAFDoc::DimensionRefGUID(), aSecondFGNode) ) {
aSecondFGNode = new XCAFDoc_GraphNode;
aSecondFGNode = XCAFDoc_GraphNode::Set(theSecondL);
for(Standard_Integer i = theFirstL.Lower(); i <= theFirstL.Upper(); i++)
{
if (!theFirstL.Value(i).FindAttribute(XCAFDoc::DimensionRefFirstGUID(), aFGNode) ) {
aFGNode = new XCAFDoc_GraphNode;
aFGNode = XCAFDoc_GraphNode::Set(theFirstL.Value(i));
}
aSecondFGNode->SetGraphID(XCAFDoc::DimensionRefGUID());
aFGNode->SetGraphID(XCAFDoc::DimensionRefFirstGUID());
aFGNode->SetChild(aChGNode);
aChGNode->SetFather(aFGNode);
}
if (!theDimTolL.FindAttribute(XCAFDoc::DimensionRefSecondGUID(), aChGNode) && theSecondL.Length() > 0) {
aChGNode = new XCAFDoc_GraphNode;
aChGNode = XCAFDoc_GraphNode::Set(theDimTolL);
aChGNode->SetGraphID(XCAFDoc::DimensionRefSecondGUID());
}
for(Standard_Integer i = theSecondL.Lower(); i <= theSecondL.Upper(); i++)
{
if(!theSecondL.Value(i).FindAttribute(XCAFDoc::DimensionRefSecondGUID(), aSecondFGNode) ) {
aSecondFGNode = new XCAFDoc_GraphNode;
aSecondFGNode = XCAFDoc_GraphNode::Set(theSecondL.Value(i));
}
aSecondFGNode->SetGraphID(XCAFDoc::DimensionRefSecondGUID());
aSecondFGNode->SetChild(aChGNode);
aChGNode->SetFather(aSecondFGNode);
}
@@ -364,12 +400,60 @@ void XCAFDoc_DimTolTool::SetDimension(const TDF_Label& theFirstL,
void XCAFDoc_DimTolTool::SetGeomTolerance(const TDF_Label& theL,
const TDF_Label& theDimTolL) const
{
// set reference
Handle(TDataStd_TreeNode) refNode, mainNode;
refNode = TDataStd_TreeNode::Set ( theDimTolL, XCAFDoc::GeomToleranceRefGUID() );
mainNode = TDataStd_TreeNode::Set ( theL, XCAFDoc::GeomToleranceRefGUID() );
refNode->Remove(); // abv: fix against bug in TreeNode::Append()
mainNode->Append(refNode);
TDF_LabelSequence aSeq;
aSeq.Append(theL);
SetGeomTolerance(aSeq, theDimTolL);
}
//=======================================================================
//function : SetGeomTolerance
//purpose :
//=======================================================================
void XCAFDoc_DimTolTool::SetGeomTolerance(const TDF_LabelSequence& theL,
const TDF_Label& theDimTolL) const
{
// // set reference
// Handle(TDataStd_TreeNode) refNode, mainNode;
// refNode = TDataStd_TreeNode::Set ( theDimTolL, XCAFDoc::GeomToleranceRefGUID() );
// mainNode = TDataStd_TreeNode::Set ( theL, XCAFDoc::GeomToleranceRefGUID() );
// refNode->Remove(); // abv: fix against bug in TreeNode::Append()
// mainNode->Append(refNode);
if(!IsGeomTolerance(theDimTolL) || theL.Length() == 0)
{
return;
}
Handle(XCAFDoc_GraphNode) aChGNode;
Handle(XCAFDoc_GraphNode) aFGNode;
//Handle(XCAFDoc_GraphNode) ChGNode, FGNode;
if ( theDimTolL.FindAttribute (XCAFDoc::GeomToleranceRefGUID(), aChGNode) ) {
while (aChGNode->NbFathers() > 0) {
aFGNode = aChGNode->GetFather(1);
aFGNode->UnSetChild(aChGNode);
if(aFGNode->NbChildren() == 0)
aFGNode->ForgetAttribute( XCAFDoc::GeomToleranceRefGUID() );
}
theDimTolL.ForgetAttribute ( XCAFDoc::GeomToleranceRefGUID() );
}
if (!theDimTolL.FindAttribute(XCAFDoc::GeomToleranceRefGUID(), aChGNode)) {
aChGNode = new XCAFDoc_GraphNode;
aChGNode = XCAFDoc_GraphNode::Set(theDimTolL);
aChGNode->SetGraphID(XCAFDoc::GeomToleranceRefGUID());
}
for(Standard_Integer i = theL.Lower(); i <= theL.Upper(); i++)
{
if (!theL.Value(i).FindAttribute(XCAFDoc::GeomToleranceRefGUID(), aFGNode) ) {
aFGNode = new XCAFDoc_GraphNode;
aFGNode = XCAFDoc_GraphNode::Set(theL.Value(i));
}
aFGNode->SetGraphID(XCAFDoc::GeomToleranceRefGUID());
aFGNode->SetChild(aChGNode);
aChGNode->SetFather(aFGNode);
}
}
//=======================================================================
@@ -412,26 +496,43 @@ TDF_Label XCAFDoc_DimTolTool::SetDimTol(const TDF_Label& L,
//=======================================================================
Standard_Boolean XCAFDoc_DimTolTool::GetRefShapeLabel(const TDF_Label& theL,
TDF_LabelSequence& theShapeL) const
TDF_LabelSequence& theShapeLFirst,
TDF_LabelSequence& theShapeLSecond) const
{
theShapeL.Clear();
theShapeLFirst.Clear();
theShapeLSecond.Clear();
Handle(TDataStd_TreeNode) aNode;
if( !theL.FindAttribute(XCAFDoc::DimTolRefGUID(),aNode) || !aNode->HasFather() ) {
if( !theL.FindAttribute(XCAFDoc::DatumRefGUID(),aNode) || !aNode->HasFather() ) {
if( !theL.FindAttribute(XCAFDoc::GeomToleranceRefGUID(),aNode) || !aNode->HasFather() ) {
Handle(XCAFDoc_GraphNode) aGNode;
if( theL.FindAttribute(XCAFDoc::DimensionRefGUID(),aGNode) && aGNode->NbFathers() > 0 ) {
Handle(XCAFDoc_GraphNode) aGNode;
if( theL.FindAttribute(XCAFDoc::GeomToleranceRefGUID(),aGNode) && aGNode->NbFathers() > 0 ) {
for(Standard_Integer i = 1; i <= aGNode->NbFathers(); i++)
{
theShapeLFirst.Append(aGNode->GetFather(i)->Label());
}
return Standard_True;
}
else if( theL.FindAttribute(XCAFDoc::DimensionRefFirstGUID(),aGNode) && aGNode->NbFathers() > 0 ) {
for(Standard_Integer i = 1; i <= aGNode->NbFathers(); i++)
{
theShapeLFirst.Append(aGNode->GetFather(i)->Label());
}
if( theL.FindAttribute(XCAFDoc::DimensionRefSecondGUID(),aGNode) && aGNode->NbFathers() > 0 ) {
for(Standard_Integer i = 1; i <= aGNode->NbFathers(); i++)
{
theShapeL.Append(aGNode->GetFather(i)->Label());
theShapeLSecond.Append(aGNode->GetFather(i)->Label());
}
return Standard_True;
}
return Standard_True;
}
else
{
return Standard_False;
}
}
}
theShapeL.Append(aNode->Father()->Label());
theShapeLFirst.Append(aNode->Father()->Label());
return Standard_True;
}
@@ -444,14 +545,22 @@ Standard_Boolean XCAFDoc_DimTolTool::GetRefDimensionLabels(const TDF_Label& theS
TDF_LabelSequence& theDimTols) const
{
Handle(XCAFDoc_GraphNode) aGNode;
if( theShapeL.FindAttribute(XCAFDoc::DimensionRefGUID(),aGNode) && aGNode->NbChildren() > 0 ) {
Standard_Boolean aResult = Standard_False;
if( theShapeL.FindAttribute(XCAFDoc::DimensionRefFirstGUID(),aGNode) && aGNode->NbChildren() > 0 ) {
for(Standard_Integer i = 1; i <= aGNode->NbChildren(); i++)
{
theDimTols.Append(aGNode->GetChild(i)->Label());
}
return Standard_True;
aResult = Standard_True;
}
return Standard_False;
if( theShapeL.FindAttribute(XCAFDoc::DimensionRefSecondGUID(),aGNode) && aGNode->NbChildren() > 0 ) {
for(Standard_Integer i = 1; i <= aGNode->NbChildren(); i++)
{
theDimTols.Append(aGNode->GetChild(i)->Label());
}
aResult = Standard_True;
}
return aResult;
}
//=======================================================================
@@ -462,16 +571,14 @@ Standard_Boolean XCAFDoc_DimTolTool::GetRefDimensionLabels(const TDF_Label& theS
Standard_Boolean XCAFDoc_DimTolTool::GetRefGeomToleranceLabels(const TDF_Label& theShapeL,
TDF_LabelSequence& theDimTols) const
{
Handle(TDataStd_TreeNode) aNode;
if( !theShapeL.FindAttribute(XCAFDoc::GeomToleranceRefGUID(),aNode) ||
!aNode->HasFirst() ) {
Handle(XCAFDoc_GraphNode) aGNode;
if( !theShapeL.FindAttribute(XCAFDoc::GeomToleranceRefGUID(),aGNode) ||
aGNode->NbChildren() == 0 ) {
return Standard_False;
}
Handle(TDataStd_TreeNode) aLast = aNode->First();
theDimTols.Append(aLast->Label());
while(aLast->HasNext()) {
aLast = aLast->Next();
theDimTols.Append(aLast->Label());
for(Standard_Integer i = 1; i <= aGNode->NbChildren(); i++)
{
theDimTols.Append(aGNode->GetChild(i)->Label());
}
return Standard_True;
}
@@ -482,15 +589,20 @@ Standard_Boolean XCAFDoc_DimTolTool::GetRefGeomToleranceLabels(const TDF_Label&
//=======================================================================
Standard_Boolean XCAFDoc_DimTolTool::GetRefDatumLabel(const TDF_Label& theShapeL,
TDF_Label& theDatum) const
TDF_LabelSequence& theDatum) const
{
Handle(TDataStd_TreeNode) aNode;
if( !theShapeL.FindAttribute(XCAFDoc::DatumRefGUID(),aNode) ||
!aNode->HasFirst() ) {
return Standard_False;
}
Handle(TDataStd_TreeNode) aLast = aNode->First();
theDatum = aLast->Label();
Handle(TDataStd_TreeNode) aFirst = aNode->First();
theDatum.Append(aFirst->Label());
for(Standard_Integer i = 1; i < aNode->NbChildren(); i++)
{
aFirst = aFirst->Next();
theDatum.Append(aFirst->Label());
}
return Standard_True;
}

View File

@@ -68,6 +68,9 @@ public:
//! in the DGTtable
Standard_EXPORT void GetDimensionLabels (TDF_LabelSequence& theLabels) const;
//! Sets a link with GUID
Standard_EXPORT void SetDimension (const TDF_LabelSequence& theFirstLS, const TDF_LabelSequence& theSecondLS, const TDF_Label& theDimTolL) const;
//! Sets a link with GUID
Standard_EXPORT void SetDimension (const TDF_Label& theFirstL, const TDF_Label& theSecondL, const TDF_Label& theDimTolL) const;
@@ -90,6 +93,9 @@ public:
//! Sets a link with GUID
Standard_EXPORT void SetGeomTolerance (const TDF_Label& theL, const TDF_Label& theDimTolL) const;
//! Sets a link with GUID
Standard_EXPORT void SetGeomTolerance (const TDF_LabelSequence& theL, const TDF_Label& theDimTolL) const;
//! Returns all GeomTolerance labels defined for label ShapeL
Standard_EXPORT Standard_Boolean GetRefGeomToleranceLabels (const TDF_Label& theShapeL, TDF_LabelSequence& theDimTols) const;
@@ -126,7 +132,7 @@ public:
//! Returns ShapeL defined for label DimTolL
//! Returns False if the DimTolL is not in DGTtable
Standard_EXPORT Standard_Boolean GetRefShapeLabel (const TDF_Label& DimTolL, TDF_LabelSequence& ShapeL) const;
Standard_EXPORT Standard_Boolean GetRefShapeLabel (const TDF_Label& DimTolL, TDF_LabelSequence& ShapeLFirst, TDF_LabelSequence& ShapeLSecond) const;
//! Returns all DimTol labels defined for label ShapeL
Standard_EXPORT Standard_Boolean GetRefDGTLabels (const TDF_Label& ShapeL, TDF_LabelSequence& DimTols) const;
@@ -175,7 +181,7 @@ public:
Standard_EXPORT Standard_Boolean GetTolerOfDatumLabels (const TDF_Label& theDatumL, TDF_LabelSequence& theTols) const;
//! Returns Datum label defined for label ShapeL
Standard_EXPORT Standard_Boolean GetRefDatumLabel (const TDF_Label& theShapeL, TDF_Label& theDatum) const;
Standard_EXPORT Standard_Boolean GetRefDatumLabel (const TDF_Label& theShapeL, TDF_LabelSequence& theDatum) const;
Standard_EXPORT const Standard_GUID& ID() const;

View File

@@ -14,6 +14,7 @@
#include <XCAFDoc_Dimension.hxx>
#include <TDF_RelocationTable.hxx>
#include <TDF_ChildIterator.hxx>
#include <XCAFDoc.hxx>
#include <TDataStd_TreeNode.hxx>
#include <Precision.hxx>
@@ -86,78 +87,59 @@ void XCAFDoc_Dimension::SetObject (const Handle(XCAFDimTolObjects_DimensionObjec
{
Backup();
Handle(TDataStd_Integer) aType;
if(!Label().FindChild(ChildLab_Type).FindAttribute(TDataStd_Integer::GetID(), aType))
//Label().ForForgetAllAttributes();
TDF_ChildIterator anIter(Label());
for(;anIter.More(); anIter.Next())
{
aType = new TDataStd_Integer();
Label().FindChild(ChildLab_Type).AddAttribute(aType);
anIter.Value().ForgetAllAttributes();
}
Handle(TDataStd_Integer) aType = new TDataStd_Integer();
Label().FindChild(ChildLab_Type).AddAttribute(aType);
aType->Set(theObject->GetType());
if(theObject->GetValues().IsNull())
if(!theObject->GetValues().IsNull())
{
Label().FindChild(ChildLab_Value).ForgetAllAttributes();
}
else
{
Handle(TDataStd_RealArray) aVal;
if(!Label().FindChild(ChildLab_Value).FindAttribute(TDataStd_RealArray::GetID(), aVal))
{
aVal = new TDataStd_RealArray();
Label().FindChild(ChildLab_Value).AddAttribute(aVal);
}
Handle(TDataStd_RealArray) aVal = new TDataStd_RealArray();
Label().FindChild(ChildLab_Value).AddAttribute(aVal);
aVal->ChangeArray(theObject->GetValues());
}
Handle(TDataStd_Integer) aQualifier;
if(!Label().FindChild(ChildLab_Qualifier).FindAttribute(TDataStd_Integer::GetID(), aQualifier))
{
aQualifier = new TDataStd_Integer();
Label().FindChild(ChildLab_Qualifier).AddAttribute(aQualifier);
}
Handle(TDataStd_Integer) aQualifier = new TDataStd_Integer();
Label().FindChild(ChildLab_Qualifier).AddAttribute(aQualifier);
aQualifier->Set(theObject->GetQualifier());
Standard_Boolean aH;
XCAFDimTolObjects_DimensionFormVariance aF;
XCAFDimTolObjects_DimensionGrade aG;
theObject->GetClassOfTolerance(aH,aF,aG);
Handle(TDataStd_IntegerArray) aClass;
if(!Label().FindChild(ChildLab_Class).FindAttribute(TDataStd_IntegerArray::GetID(), aClass))
Handle(TColStd_HArray1OfInteger) anArrI;
if(aF != XCAFDimTolObjects_DimensionFormVariance_None)
{
aClass = new TDataStd_IntegerArray();
Handle(TDataStd_IntegerArray) aClass = new TDataStd_IntegerArray();
Label().FindChild(ChildLab_Class).AddAttribute(aClass);
anArrI = new TColStd_HArray1OfInteger(1,3);
anArrI->SetValue(1,aH);
anArrI->SetValue(2,aF);
anArrI->SetValue(3,aG);
aClass->ChangeArray(anArrI);
}
Handle(TColStd_HArray1OfInteger) anArrI = new TColStd_HArray1OfInteger(1,3);
anArrI->SetValue(1,aH);
anArrI->SetValue(2,aF);
anArrI->SetValue(3,aG);
aClass->ChangeArray(anArrI);
Standard_Integer aL, aR;
theObject->GetNbOfDecimalPlaces(aL, aR);
Handle(TDataStd_IntegerArray) aDec;
if(!Label().FindChild(ChildLab_Dec).FindAttribute(TDataStd_IntegerArray::GetID(), aDec))
if (aL > 0 && aR > 0)
{
aDec = new TDataStd_IntegerArray();
Handle(TDataStd_IntegerArray) aDec = new TDataStd_IntegerArray();
Label().FindChild(ChildLab_Dec).AddAttribute(aDec);
anArrI = new TColStd_HArray1OfInteger(1,2);
anArrI->SetValue(1,aL);
anArrI->SetValue(2,aR);
aDec->ChangeArray(anArrI);
}
anArrI = new TColStd_HArray1OfInteger(1,2);
anArrI->SetValue(1,aL);
anArrI->SetValue(2,aR);
aDec->ChangeArray(anArrI);
if(theObject->GetModifiers().Length() == 0)
if(theObject->GetModifiers().Length() > 0)
{
Label().FindChild(ChildLab_Modifiers).ForgetAllAttributes();
}
else
{
Handle(TDataStd_IntegerArray) aModifiers;
if(!Label().FindChild(ChildLab_Modifiers).FindAttribute(TDataStd_IntegerArray::GetID(), aModifiers))
{
aModifiers = new TDataStd_IntegerArray();
Label().FindChild(ChildLab_Modifiers).AddAttribute(aModifiers);
}
Handle(TDataStd_IntegerArray) aModifiers = new TDataStd_IntegerArray();
Label().FindChild(ChildLab_Modifiers).AddAttribute(aModifiers);
anArrI = new TColStd_HArray1OfInteger(1,theObject->GetModifiers().Length());
for(Standard_Integer i = 1; i <= theObject->GetModifiers().Length(); i++)
anArrI->SetValue(i,theObject->GetModifiers().Value(i));
@@ -166,44 +148,37 @@ void XCAFDoc_Dimension::SetObject (const Handle(XCAFDimTolObjects_DimensionObjec
if(!theObject->GetPath().IsNull())
{
TNaming_Builder tnBuild(Label().FindChild(ChildLab_Path));
tnBuild.Generated(theObject->GetPath());
}
else
{
Label().FindChild(ChildLab_Path).ForgetAllAttributes();
TNaming_Builder tnBuild(Label().FindChild(ChildLab_Path));
tnBuild.Generated(theObject->GetPath());
}
Handle(TDataStd_RealArray) aDir;
if(!Label().FindChild(ChildLab_Dir).FindAttribute(TDataStd_RealArray::GetID(), aDir))
Handle(TColStd_HArray1OfReal) anArrR;
if(theObject->GetType() == XCAFDimTolObjects_DimensionType_Location_Oriented)
{
aDir = new TDataStd_RealArray();
gp_Dir aD;
theObject->GetDirection(aD);
Handle(TDataStd_RealArray) aDir = new TDataStd_RealArray();
Label().FindChild(ChildLab_Dir).AddAttribute(aDir);
anArrR = new TColStd_HArray1OfReal(1,3);
anArrR->SetValue(1,aD.X());
anArrR->SetValue(2,aD.Y());
anArrR->SetValue(3,aD.Z());
aDir->ChangeArray(anArrR);
}
gp_Dir aD;
theObject->GetDirection(aD);
Handle(TColStd_HArray1OfReal) anArrR = new TColStd_HArray1OfReal(1,3);
anArrR->SetValue(1,aD.X());
anArrR->SetValue(2,aD.Y());
anArrR->SetValue(3,aD.Z());
aDir->ChangeArray(anArrR);
Handle(TDataStd_RealArray) aPnts;
if(!Label().FindChild(ChildLab_Pnts).FindAttribute(TDataStd_RealArray::GetID(), aPnts))
{
aPnts = new TDataStd_RealArray();
Label().FindChild(ChildLab_Pnts).AddAttribute(aPnts);
}
Handle(TColgp_HArray1OfPnt) aP = theObject->GetPoints();
if(!aP.IsNull() && aP->Length() > 0)
{
anArrR = new TColStd_HArray1OfReal(1,6);
Handle(TDataStd_RealArray) aPnts;
anArrR->SetValue(1,aP->Value(1).X());
anArrR->SetValue(2,aP->Value(1).Y());
anArrR->SetValue(3,aP->Value(1).Z());
anArrR->SetValue(4,aP->Value(2).X());
anArrR->SetValue(5,aP->Value(2).Y());
anArrR->SetValue(6,aP->Value(2).Z());
aPnts = new TDataStd_RealArray();
Label().FindChild(ChildLab_Pnts).AddAttribute(aPnts);
aPnts->ChangeArray(anArrR);
}
}

View File

@@ -14,10 +14,12 @@
#include <XCAFDoc_GeomTolerance.hxx>
#include <TDF_RelocationTable.hxx>
#include <TDF_ChildIterator.hxx>
#include <XCAFDoc.hxx>
#include <TDataStd_TreeNode.hxx>
#include <TDataStd_Integer.hxx>
#include <TDataStd_IntegerArray.hxx>
#include <TDataStd_RealArray.hxx>
#include <TDataStd_Real.hxx>
#include <XCAFDimTolObjects_GeomToleranceObject.hxx>
@@ -30,7 +32,10 @@ enum ChildLab
ChildLab_ZoneModif,
ChildLab_ValueOfZoneModif,
ChildLab_Modifiers,
ChildLab_aMaxValueModif
ChildLab_aMaxValueModif,
ChildLab_AxisLoc,
ChildLab_AxisN,
ChildLab_AxisRef
};
//=======================================================================
@@ -80,80 +85,90 @@ void XCAFDoc_GeomTolerance::SetObject (const Handle(XCAFDimTolObjects_GeomTolera
{
Backup();
Handle(TDataStd_Integer) aType;
if(!Label().FindChild(ChildLab_Type).FindAttribute(TDataStd_Integer::GetID(), aType))
//Label().ForForgetAllAttributes();
TDF_ChildIterator anIter(Label());
for(;anIter.More(); anIter.Next())
{
aType = new TDataStd_Integer();
Label().FindChild(ChildLab_Type).AddAttribute(aType);
anIter.Value().ForgetAllAttributes();
}
aType->Set(theObject->GetType());
Handle(TDataStd_Integer) aTypeOfValue;
if(!Label().FindChild(ChildLab_TypeOfValue).FindAttribute(TDataStd_Integer::GetID(), aTypeOfValue))
Handle(TDataStd_Integer) aType = new TDataStd_Integer();
aType->Set(theObject->GetType());
Label().FindChild(ChildLab_Type).AddAttribute(aType);
if(theObject->GetTypeOfValue() != XCAFDimTolObjects_GeomToleranceTypeValue_None)
{
aTypeOfValue = new TDataStd_Integer();
Handle(TDataStd_Integer) aTypeOfValue = new TDataStd_Integer();
aTypeOfValue->Set(theObject->GetTypeOfValue());
Label().FindChild(ChildLab_TypeOfValue).AddAttribute(aTypeOfValue);
}
aTypeOfValue->Set(theObject->GetTypeOfValue());
Handle(TDataStd_Real) aValue;
if(!Label().FindChild(ChildLab_Value).FindAttribute(TDataStd_Real::GetID(), aValue))
{
aValue = new TDataStd_Real();
Label().FindChild(ChildLab_Value).AddAttribute(aValue);
}
Handle(TDataStd_Real) aValue = new TDataStd_Real();
aValue->Set(theObject->GetValue());
Label().FindChild(ChildLab_Value).AddAttribute(aValue);
Handle(TDataStd_Integer) aMatReqModif;
if(!Label().FindChild(ChildLab_MatReqModif).FindAttribute(TDataStd_Integer::GetID(), aMatReqModif))
if(theObject->GetMaterialRequirementModifier() != XCAFDimTolObjects_GeomToleranceMatReqModif_None)
{
Label().FindChild(ChildLab_MatReqModif).FindAttribute(TDataStd_Integer::GetID(), aMatReqModif);
aMatReqModif = new TDataStd_Integer();
Label().FindChild(ChildLab_MatReqModif).AddAttribute(aMatReqModif);
aMatReqModif->Set(theObject->GetMaterialRequirementModifier());
}
aMatReqModif->Set(theObject->GetMaterialRequirementModifier());
Handle(TDataStd_Integer) aZoneModif;
if(!Label().FindChild(ChildLab_ZoneModif).FindAttribute(TDataStd_Integer::GetID(), aZoneModif))
if(theObject->GetZoneModifier() != XCAFDimTolObjects_GeomToleranceZoneModif_None)
{
aZoneModif = new TDataStd_Integer();
Handle(TDataStd_Integer) aZoneModif = new TDataStd_Integer();
aZoneModif->Set(theObject->GetZoneModifier());
Label().FindChild(ChildLab_ZoneModif).AddAttribute(aZoneModif);
}
aZoneModif->Set(theObject->GetZoneModifier());
Handle(TDataStd_Real) aValueOfZoneModif;
if(!Label().FindChild(ChildLab_ValueOfZoneModif).FindAttribute(TDataStd_Real::GetID(), aValueOfZoneModif))
if(theObject->GetValueOfZoneModifier() > 0)
{
aValueOfZoneModif = new TDataStd_Real();
Handle(TDataStd_Real) aValueOfZoneModif = new TDataStd_Real();
aValueOfZoneModif->Set(theObject->GetValueOfZoneModifier());
Label().FindChild(ChildLab_ValueOfZoneModif).AddAttribute(aValueOfZoneModif);
}
aValueOfZoneModif->Set(theObject->GetValueOfZoneModifier());
if(theObject->GetModifiers().Length() == 0)
if(theObject->GetModifiers().Length() > 0)
{
Label().FindChild(ChildLab_Modifiers).ForgetAllAttributes();
}
else
{
Handle(TDataStd_IntegerArray) aModifiers;
if(!Label().FindChild(ChildLab_Modifiers).FindAttribute(TDataStd_IntegerArray::GetID(), aModifiers)
|| theObject->GetModifiers().Length() == 0)
{
aModifiers = new TDataStd_IntegerArray();
Label().FindChild(ChildLab_Modifiers).AddAttribute(aModifiers);
}
Handle(TDataStd_IntegerArray) aModifiers = new TDataStd_IntegerArray();
Handle(TColStd_HArray1OfInteger) anArr = new TColStd_HArray1OfInteger(1,theObject->GetModifiers().Length());
for(Standard_Integer i = 1; i <= theObject->GetModifiers().Length(); i++)
anArr->SetValue(i,theObject->GetModifiers().Value(i));
aModifiers->ChangeArray(anArr);
Label().FindChild(ChildLab_Modifiers).AddAttribute(aModifiers);
}
Handle(TDataStd_Real) aMaxValueModif;
if(!Label().FindChild(ChildLab_aMaxValueModif).FindAttribute(TDataStd_Real::GetID(), aMaxValueModif))
if(theObject->GetMaxValueModifier() > 0)
{
aMaxValueModif = new TDataStd_Real();
Handle(TDataStd_Real) aMaxValueModif = new TDataStd_Real();
aMaxValueModif->Set(theObject->GetMaxValueModifier());
Label().FindChild(ChildLab_aMaxValueModif).AddAttribute(aMaxValueModif);
}
aMaxValueModif->Set(theObject->GetMaxValueModifier());
if(theObject->HasAxis())
{
Handle(TDataStd_RealArray) aLoc = new TDataStd_RealArray();
Handle(TDataStd_RealArray) aN = new TDataStd_RealArray();
Handle(TDataStd_RealArray) aR = new TDataStd_RealArray();
gp_Ax2 anAx = theObject->GetAxis();
aLoc->SetValue(aLoc->Upper(),anAx.Location().X());
aLoc->SetValue(aLoc->Upper()+1,anAx.Location().Y());
aLoc->SetValue(aLoc->Upper()+2,anAx.Location().Z());
aN->SetValue(aN->Upper(),anAx.Axis().Direction().X());
aN->SetValue(aN->Upper(),anAx.Axis().Direction().X());
aN->SetValue(aN->Upper(),anAx.Axis().Direction().X());
aR->SetValue(aR->Upper(),anAx.Direction().X());
aR->SetValue(aR->Upper(),anAx.Direction().X());
aR->SetValue(aR->Upper(),anAx.Direction().X());
Label().FindChild(ChildLab_AxisLoc).AddAttribute(aLoc);
Label().FindChild(ChildLab_AxisN).AddAttribute(aN);
Label().FindChild(ChildLab_AxisRef).AddAttribute(aR);
}
}
//=======================================================================
@@ -216,7 +231,20 @@ Handle(XCAFDimTolObjects_GeomToleranceObject) XCAFDoc_GeomTolerance::GetObject()
{
anObj->SetMaxValueModifier(aMaxValueModif->Get());
}
Handle(TDataStd_RealArray) aLoc;
Handle(TDataStd_RealArray) aN;
Handle(TDataStd_RealArray) aR;
if(Label().FindChild(ChildLab_AxisLoc).FindAttribute(TDataStd_RealArray::GetID(), aLoc) && aLoc->Length() == 3 &&
Label().FindChild(ChildLab_AxisN).FindAttribute(TDataStd_RealArray::GetID(), aN) && aN->Length() == 3 &&
Label().FindChild(ChildLab_AxisRef).FindAttribute(TDataStd_RealArray::GetID(), aR) && aR->Length() == 3 )
{
gp_Pnt aL(aLoc->Value(aLoc->Upper()), aLoc->Value(aLoc->Upper()+1), aLoc->Value(aLoc->Upper()+2));
gp_Dir aD(aN->Value(aN->Upper()), aN->Value(aN->Upper()+1), aN->Value(aN->Upper()+2));
gp_Dir aDR(aR->Value(aR->Upper()), aR->Value(aR->Upper()+1), aR->Value(aR->Upper()+2));
gp_Ax2 anAx(aL, aD, aDR);
anObj->SetAxis(anAx);
}
return anObj;
}

View File

@@ -595,7 +595,6 @@ static Standard_Integer XAttributeValue (Draw_Interpretor& di, Standard_Integer
else if ( att->ID() == XCAFDoc::ColorRefGUID(XCAFDoc_ColorSurf) ) type = "Surface Color Link";
else if ( att->ID() == XCAFDoc::ColorRefGUID(XCAFDoc_ColorCurv) ) type = "Curve Color Link";
else if ( att->ID() == XCAFDoc::DimTolRefGUID() ) type = "DGT Link";
else if ( att->ID() == XCAFDoc::GeomToleranceRefGUID() ) type = "GeomTolerance Link";
else if ( att->ID() == XCAFDoc::DatumRefGUID() ) type = "Datum Link";
else if ( att->ID() == XCAFDoc::MaterialRefGUID() ) type = "Material Link";
Handle(TDataStd_TreeNode) TN = Handle(TDataStd_TreeNode)::DownCast(att);
@@ -763,8 +762,14 @@ static Standard_Integer XAttributeValue (Draw_Interpretor& di, Standard_Integer
else if ( att->ID() == XCAFDoc::DatumTolRefGUID() ) {
type = "DatumToler Link";
}
else if ( att->ID() == XCAFDoc::DimensionRefGUID() ) {
type = "Dimension Link";
else if ( att->ID() == XCAFDoc::DimensionRefFirstGUID() ) {
type = "Dimension Link First";
}
else if ( att->ID() == XCAFDoc::DimensionRefSecondGUID() ) {
type = "Dimension Link Second";
}
else if ( att->ID() == XCAFDoc::GeomToleranceRefGUID() ){
type = "GeomTolerance Link";
}
else return 0;

View File

@@ -123,7 +123,7 @@ static Standard_Integer DumpDGTs (Draw_Interpretor& di, Standard_Integer argc, c
{
TCollection_AsciiString Entry;
TDF_Tool::Entry(aLabels.Value(i), Entry);
di << "\n " << Entry;
di << "\n " << Entry << " Shape" << "."<< i;
flag = Standard_False;
}
TCollection_AsciiString Entry;
@@ -131,7 +131,54 @@ static Standard_Integer DumpDGTs (Draw_Interpretor& di, Standard_Integer argc, c
di << "\n \t " << Entry;
flag = Standard_False;
di << " Dimension";
di << " Dimension" << "."<< i << "."<< j;
if (argc > 3)
{
di <<" (";
di << " T " << aDimTolObj->GetType();
if(aDimTolObj->IsDimWithRange())
{
di << ", LB " << aDimTolObj->GetLowerBound();
di << ", UB " << aDimTolObj->GetUpperBound();
}
else
{
di << ", V " << aDimTolObj->GetValue();
if (aDimTolObj->IsDimWithPlusMinusTolerance())
{
di << ", VL " << aDimTolObj->GetLowerTolValue();
di << ", VU " << aDimTolObj->GetUpperTolValue();
}
else if (aDimTolObj->IsDimWithClassOfTolerance())
{
Standard_Boolean isH;
XCAFDimTolObjects_DimensionFormVariance aFV;
XCAFDimTolObjects_DimensionGrade aG;
aDimTolObj->GetClassOfTolerance(isH, aFV, aG);
di << ", H " << (Standard_Integer)isH<< " F " << aFV << " G " << aG;
}
}
if (aDimTolObj->HasQualifier())
di << ", Q " << aDimTolObj->GetQualifier();
if (aDimTolObj->GetType() == XCAFDimTolObjects_DimensionType_Location_Oriented)
{
gp_Dir aD;
aDimTolObj->GetDirection(aD);
di << ", D (" << aD.X() << ", " << aD.Y() << ", " << aD.Z() << ")";
}
XCAFDimTolObjects_DimensionModifiersSequence aModif =
aDimTolObj->GetModifiers();
if (!aModif.IsEmpty())
{
di << ",";
for (Standard_Integer k = aModif.Lower(); k <= aModif.Upper(); k++)
{
di << " M " << aModif.Value(k);
}
}
di << ", P " << (Standard_Integer)!aDimTolObj->GetPath().IsNull();
di << " )";
}
}
}
aGDTs.Clear();
@@ -146,7 +193,7 @@ static Standard_Integer DumpDGTs (Draw_Interpretor& di, Standard_Integer argc, c
{
TCollection_AsciiString Entry;
TDF_Tool::Entry(aLabels.Value(i), Entry);
di << "\n " << Entry;
di << "\n " << Entry << " Shape" << "."<< i;
flag = Standard_False;
}
TCollection_AsciiString Entry;
@@ -154,7 +201,50 @@ static Standard_Integer DumpDGTs (Draw_Interpretor& di, Standard_Integer argc, c
di << "\n \t " << Entry;
flag = Standard_False;
di << " GeomTolerance";
di << " GeomTolerance" << "."<< i << "."<< j;
if (argc > 3)
{
di <<" (";
di << " T " << aDimTolObj->GetType();
di << " TV " << aDimTolObj->GetTypeOfValue();
di << ", V " << aDimTolObj->GetValue();
if (aDimTolObj->HasAxis())
{
gp_Ax2 anAx = aDimTolObj->GetAxis();
di << ", A ( L (" << anAx.Location().X() << anAx.Location().Y() << anAx.Location().Z()
<< "), XD (" << anAx.XDirection().X() << anAx.XDirection().Y() << anAx.XDirection().Z()
<< "), RD (" << anAx.YDirection().X() << anAx.YDirection().Y() << anAx.YDirection().Z() << "))";
}
XCAFDimTolObjects_GeomToleranceModifiersSequence aModif =
aDimTolObj->GetModifiers();
if (!aModif.IsEmpty())
{
di << ",";
for (Standard_Integer k = aModif.Lower(); k <= aModif.Upper(); k++)
{
di << " M " << aModif.Value(k);
}
}
if (aDimTolObj->GetMaterialRequirementModifier() != XCAFDimTolObjects_GeomToleranceMatReqModif_None)
{
di << ", MR " << aDimTolObj->GetMaterialRequirementModifier();
}
if (aDimTolObj->GetMaxValueModifier() > 0)
{
di << "MaxV " << aDimTolObj->GetMaxValueModifier();
}
if ( aDimTolObj->GetZoneModifier() != XCAFDimTolObjects_GeomToleranceZoneModif_None)
{
di << ", ZM " << aDimTolObj->GetZoneModifier();
if (aDimTolObj->GetValueOfZoneModifier() > 0)
{
di << " ZMV " <<aDimTolObj->GetValueOfZoneModifier();
}
}
di << " )";
}
Handle(XCAFDoc_GraphNode) aNode;
if(aGDTs.Value(j).FindAttribute(XCAFDoc::DatumTolRefGUID(), aNode) && aNode->NbChildren() > 0)
{
@@ -163,40 +253,153 @@ static Standard_Integer DumpDGTs (Draw_Interpretor& di, Standard_Integer argc, c
Handle(XCAFDoc_Datum) aDatum;
if(aNode->GetChild(k)->Label().FindAttribute(XCAFDoc_Datum::GetID(), aDatum))
{
Handle(XCAFDimTolObjects_DatumObject) aDatumObj = aDatum->GetObject();
TCollection_AsciiString anEntry;
TDF_Tool::Entry(aNode->GetChild(k)->Label(), anEntry);
di << "\n \t \t " << anEntry;
di << " Datum";
di << " Datum" << "."<< i << "."<< j << "."<< k;
if (argc > 3)
{
di <<" (";
XCAFDimTolObjects_DatumModifiersSequence aModif =
aDatumObj->GetModifiers();
if (!aModif.IsEmpty())
{
di << ",";
for (Standard_Integer k = aModif.Lower(); k <= aModif.Upper(); k++)
{
di << " M " << aModif.Value(k);
}
}
XCAFDimTolObjects_DatumModifWithValue aM;
Standard_Real aV;
aDatumObj->GetModifierWithValue(aM, aV);
if (aM != XCAFDimTolObjects_DatumModifWithValue_None)
{
di << ", MV" << aM << " " << aV;
}
di << " )";
}
}
}
}
}
}
TDF_Label aDatumL;
TDF_LabelSequence aDatumL;
if (aDimTolTool->GetRefDatumLabel(aLabels.Value(i), aDatumL))
{
Handle(XCAFDoc_Datum) aDatum;
if(aDatumL.FindAttribute(XCAFDoc_Datum::GetID(), aDatum))
for(Standard_Integer j = aDatumL.Lower(); j <= aDatumL.Upper(); j++)
{
if(flag)
Handle(XCAFDoc_Datum) aDatum;
if(aDatumL.Value(j).FindAttribute(XCAFDoc_Datum::GetID(), aDatum) &&
aDatum->GetObject()->IsDatumTarget())
{
Handle(XCAFDimTolObjects_DatumObject) aDatumObj = aDatum->GetObject();
if(flag)
{
TCollection_AsciiString Entry;
TDF_Tool::Entry(aLabels.Value(i), Entry);
di << "\n " << Entry << " Shape" << "."<< i;
flag = Standard_False;
}
TCollection_AsciiString Entry;
TDF_Tool::Entry(aLabels.Value(i), Entry);
di << "\n " << Entry;
TDF_Tool::Entry(aDatumL.First(), Entry);
di << "\n \t " << Entry;
flag = Standard_False;
}
TCollection_AsciiString Entry;
TDF_Tool::Entry(aDatumL, Entry);
di << "\n \t " << Entry;
flag = Standard_False;
di << " Datum";
di << " Datum target" << "."<< i << "."<< j;
if (argc > 3)
{
di <<" (";
di << " T " << aDatumObj->GetDatumTargetType();
if (aDatumObj->GetDatumTargetType() != XCAFDimTolObjects_DatumTargetType_Area)
{
gp_Ax2 anAx = aDatumObj->GetDatumTargetAxis();
di << ", A ( L (" << anAx.Location().X() << anAx.Location().Y() << anAx.Location().Z()
<< "), XD (" << anAx.XDirection().X() << anAx.XDirection().Y() << anAx.XDirection().Z()
<< "), RD (" << anAx.YDirection().X() << anAx.YDirection().Y() << anAx.YDirection().Z() << "))";
if (aDatumObj->GetDatumTargetType() != XCAFDimTolObjects_DatumTargetType_Point)
{
di << ", L " << aDatumObj->GetDatumTargetLength() ;
if (aDatumObj->GetDatumTargetType() == XCAFDimTolObjects_DatumTargetType_Rectangle)
{
di << ", W " << aDatumObj->GetDatumTargetWidth() ;
}
}
}
di << " )";
}
}
}
}
}
return 0;
}
static Standard_Integer DumpNbDGTs (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
{
if (argc < 2) {
di<<"Use: "<<"XDumpNbDGTs Doc";
return 1;
}
Handle(TDocStd_Document) Doc;
DDocStd::GetDocument(argv[1], Doc);
if ( Doc.IsNull() ) { di << argv[1] << " is not a document" << "\n"; return 1; }
Handle(XCAFDoc_DimTolTool) aDimTolTool= XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
TDF_LabelSequence aLabels;
aShapeTool->GetShapes(aLabels);
for ( Standard_Integer i=1; i <= aLabels.Length(); i++ )
{
aShapeTool->GetSubShapes(aLabels.Value(i), aLabels);
}
TDF_LabelSequence aGDTs;
aDimTolTool->GetDimensionLabels(aGDTs);
di << "\n NbOfDimensions : " << aGDTs.Length();
aGDTs.Clear();
aDimTolTool->GetGeomToleranceLabels(aGDTs);
di << "\n NbOfTolerances : " << aGDTs.Length();
Standard_Integer aCounter = 0;
Standard_Integer aCounter1 = 0;
Standard_Integer aCounter2 = 0;
for ( Standard_Integer i=1; i <= aLabels.Length(); i++ )
{
Standard_Boolean isDatum = Standard_False;
TDF_LabelSequence aDatL;
if(aDimTolTool->GetRefDatumLabel(aLabels.Value(i), aDatL))
{
for(Standard_Integer j = aDatL.Lower(); j <= aDatL.Upper(); j++)
{
Handle(XCAFDoc_Datum) aDat;
if(aDatL.Value(j).FindAttribute(XCAFDoc_Datum::GetID(), aDat))
{
if(aDat->GetObject()->IsDatumTarget())
{
aCounter1++;
}
else
{
aCounter2++;
isDatum = Standard_True;
}
}
}
if(isDatum)
aCounter++;
}
}
di << "\n NbOfDatumFeature : " << aCounter;
di << "\n NbOfAttachedDatum : " << aCounter2;
di << "\n NbOfDatumTarget : " << aCounter1;
return 0;
}
static Standard_Integer addDim (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
{
if (argc < 3) {
@@ -378,25 +581,16 @@ static Standard_Integer getDatum (Draw_Interpretor& di, Standard_Integer argc, c
return 1;
}
TDF_Label aD;
TDF_LabelSequence aD;
if(!aDimTolTool->GetRefDatumLabel(aLabel, aD))
{
TDF_LabelSequence aDS;
if(aDimTolTool->GetDatumOfTolerLabels(aLabel, aDS))
{
for(Standard_Integer i = 1; i<=aDS.Length();i++)
{
if(i>1) di<<", ";
TCollection_AsciiString Entry;
TDF_Tool::Entry(aDS.Value(i), Entry);
di<<Entry;
}
}
aDimTolTool->GetDatumOfTolerLabels(aLabel, aD);
}
else
for(Standard_Integer i = aD.Lower(); i <= aD.Upper(); i++)
{
if(i>1) di<<", ";
TCollection_AsciiString Entry;
TDF_Tool::Entry(aD, Entry);
TDF_Tool::Entry(aD.Value(i), Entry);
di<<Entry;
}
return 0;
@@ -1890,6 +2084,9 @@ void XDEDRAW_GDTs::InitCommands(Draw_Interpretor& di)
di.Add ("XDumpDGTs","XDumpDGTs Doc shape/label/all ",
__FILE__, DumpDGTs, g);
di.Add ("XDumpNbDGTs","XDumpDGTs Doc",
__FILE__, DumpNbDGTs, g);
di.Add ("XAddDimension","XAddDimension Doc shape/label [shape/label]",
__FILE__, addDim, g);

View File

@@ -1,2 +1,3 @@
001 dimensions
002 tolerances
002 tolerances
003 import

97
tests/gdt/import/A1 Normal file
View File

@@ -0,0 +1,97 @@
# !!!! This file is generated automatically, do not edit manually! See end script
set filename nist_ctc_01_asme1_ap242.stp
set ref_data {
NbOfDimensions : 8
NbOfTolerances : 6
NbOfDatumFeature : 3
NbOfAttachedDatum : 11
NbOfDatumTarget : 0
0:1:1:1:1 Shape.2
0:1:4:1 GeomTolerance.2.1 ( T 7 TV 0, V 0.20000000000000001 )
0:1:1:1:2 Shape.3
0:1:4:2 GeomTolerance.3.1 ( T 9 TV 0, V 1.5 )
0:1:4:3 Datum.3.1.1 ( )
0:1:1:1:3 Shape.4
0:1:4:4 GeomTolerance.4.1 ( T 12 TV 0, V 0.5, M 15 )
0:1:4:5 Datum.4.1.1 ( )
0:1:1:1:4 Shape.5
0:1:4:4 GeomTolerance.5.1 ( T 12 TV 0, V 0.5, M 15 )
0:1:4:5 Datum.5.1.1 ( )
0:1:1:1:5 Shape.6
0:1:4:4 GeomTolerance.6.1 ( T 12 TV 0, V 0.5, M 15 )
0:1:4:5 Datum.6.1.1 ( )
0:1:1:1:6 Shape.7
0:1:4:4 GeomTolerance.7.1 ( T 12 TV 0, V 0.5, M 15 )
0:1:4:5 Datum.7.1.1 ( )
0:1:1:1:7 Shape.8
0:1:4:4 GeomTolerance.8.1 ( T 12 TV 0, V 0.5, M 15 )
0:1:4:5 Datum.8.1.1 ( )
0:1:1:1:8 Shape.9
0:1:4:4 GeomTolerance.9.1 ( T 12 TV 0, V 0.5, M 15 )
0:1:4:5 Datum.9.1.1 ( )
0:1:1:1:9 Shape.10
0:1:4:6 GeomTolerance.10.1 ( T 9 TV 0, V 0.75 )
0:1:4:7 Datum.10.1.1 ( )
0:1:4:8 Datum.10.1.2 ( )
0:1:4:9 Datum.10.1.3 ( )
0:1:1:1:10 Shape.11
0:1:4:6 GeomTolerance.11.1 ( T 9 TV 0, V 0.75 )
0:1:4:7 Datum.11.1.1 ( )
0:1:4:8 Datum.11.1.2 ( )
0:1:4:9 Datum.11.1.3 ( )
0:1:1:1:11 Shape.12
0:1:4:18 Dimension.12.1 ( T 15, V 35, VL 0.20000000000000001, VU 0, P 0 )
0:1:1:1:12 Shape.13
0:1:4:19 Dimension.13.1 ( T 15, V 35, VL 0, VU 0.20000000000000001, P 0 )
0:1:1:1:13 Shape.14
0:1:4:10 GeomTolerance.14.1 ( T 9 TV 0, V 0.75 )
0:1:4:11 Datum.14.1.1 ( )
0:1:4:12 Datum.14.1.2 ( )
0:1:4:13 Datum.14.1.3 ( )
0:1:1:1:14 Shape.15
0:1:4:10 GeomTolerance.15.1 ( T 9 TV 0, V 0.75 )
0:1:4:11 Datum.15.1.1 ( )
0:1:4:12 Datum.15.1.2 ( )
0:1:4:13 Datum.15.1.3 ( )
0:1:1:1:15 Shape.16
0:1:4:14 GeomTolerance.16.1 ( T 12 TV 0, V 1.25 )
0:1:4:15 Datum.16.1.1 ( )
0:1:4:16 Datum.16.1.2 ( )
0:1:4:17 Datum.16.1.3 ( )
0:1:1:1:16 Shape.17
0:1:4:14 GeomTolerance.17.1 ( T 12 TV 0, V 1.25 )
0:1:4:15 Datum.17.1.1 ( )
0:1:4:16 Datum.17.1.2 ( )
0:1:4:17 Datum.17.1.3 ( )
0:1:1:1:17 Shape.18
0:1:4:18 Dimension.18.1 ( T 15, V 35, VL 0.20000000000000001, VU 0, P 0 )
0:1:1:1:18 Shape.19
0:1:4:19 Dimension.19.1 ( T 15, V 35, VL 0, VU 0.20000000000000001, P 0 )
0:1:1:1:19 Shape.20
0:1:4:20 Dimension.20.1 ( T 15, V 20, VL 0.10000000000000001, VU 0.050000000000000003, P 0 )
0:1:1:1:20 Shape.21
0:1:4:20 Dimension.21.1 ( T 15, V 20, VL 0.10000000000000001, VU 0.050000000000000003, P 0 )
0:1:1:1:21 Shape.22
0:1:4:21 Dimension.22.1 ( T 15, V 20, VL 0.050000000000000003, VU 0.10000000000000001, P 0 )
0:1:1:1:22 Shape.23
0:1:4:21 Dimension.23.1 ( T 15, V 20, VL 0.050000000000000003, VU 0.10000000000000001, P 0 )
0:1:1:1:23 Shape.24
0:1:4:22 Dimension.24.1 ( T 11, V 59.999999999851163, VL 0.5, VU 0.5, Q 3, P 0 )
0:1:1:1:24 Shape.25
0:1:4:22 Dimension.25.1 ( T 11, V 59.999999999851163, VL 0.5, VU 0.5, Q 3, P 0 )
0:1:1:1:25 Shape.26
0:1:4:23 Dimension.26.1 ( T 15, LB 34.799999999999997, UB 35.200000000000003, P 0 )
0:1:1:1:26 Shape.27
0:1:4:23 Dimension.27.1 ( T 15, LB 34.799999999999997, UB 35.200000000000003, P 0 )
0:1:1:1:27 Shape.28
0:1:4:24 Dimension.28.1 ( T 15, LB 34.799999999999997, UB 35.200000000000003, P 0 )
0:1:1:1:28 Shape.29
0:1:4:24 Dimension.29.1 ( T 15, LB 34.799999999999997, UB 35.200000000000003, P 0 )
0:1:1:1:29 Shape.30
0:1:4:25 Dimension.30.1 ( T 15, V 25, VL 0.14999999999999999, VU 0.14999999999999999, P 0 )
0:1:1:1:30 Shape.31
0:1:4:25 Dimension.31.1 ( T 15, V 25, VL 0.14999999999999999, VU 0.14999999999999999, P 0 )
}

185
tests/gdt/import/A2 Normal file
View File

@@ -0,0 +1,185 @@
# !!!! This file is generated automatically, do not edit manually! See end script
set filename nist_ctc_02_asme1_ap242-2.stp
set ref_data {
NbOfDimensions : 7
NbOfTolerances : 22
NbOfDatumFeature : 5
NbOfAttachedDatum : 24
NbOfDatumTarget : 9
0:1:1:2:1 Shape.4
0:1:4:1 GeomTolerance.4.1 ( T 6 TV 0, V 0.25 )
0:1:4:9 Datum target.4.1 ( T 3, A ( L (000), XD (100), RD (010)), L 0 )
0:1:1:2:4 Shape.7
0:1:4:21 GeomTolerance.7.1 ( T 7 TV 0, V 0.050000000000000003 )
0:1:1:2:44 Shape.47
0:1:4:2 Datum target.47.1 ( T 3, A ( L (000), XD (100), RD (010)), L 0 )
0:1:4:2 Datum target.47.2 ( T 3, A ( L (000), XD (100), RD (010)), L 0 )
0:1:4:2 Datum target.47.3 ( T 3, A ( L (000), XD (100), RD (010)), L 0 )
0:1:1:2:45 Shape.48
0:1:4:6 Datum target.48.1 ( T 3, A ( L (000), XD (100), RD (010)), L 0 )
0:1:1:2:53 Shape.56
0:1:4:5 Datum target.56.1 ( T 3, A ( L (000), XD (100), RD (010)), L 0 )
0:1:1:2:60 Shape.63
0:1:4:16 GeomTolerance.63.1 ( T 12 TV 0, V 2.5 )
0:1:1:2:62 Shape.65
0:1:4:8 Datum target.65.1 ( T 3, A ( L (000), XD (100), RD (010)), L 0 )
0:1:1:2:71 Shape.74
0:1:4:7 Datum target.74.1 ( T 3, A ( L (000), XD (100), RD (010)), L 0 )
0:1:1:2:75 Shape.78
0:1:4:57 GeomTolerance.78.1 ( T 12 TV 0, V 0.80000000000000004 )
0:1:4:58 Datum.78.1.1 (, M 12 )
0:1:4:59 Datum.78.1.2 ( )
0:1:1:2:94 Shape.97
0:1:4:29 Dimension.97.1 ( T 15, V 12, VL 0.050000000000000003, VU 0.050000000000000003, P 0 )
0:1:4:30 GeomTolerance.97.1 ( T 9 TV 1, V 0.050000000000000003 )
0:1:4:31 Datum.97.1.1 ( )
0:1:4:32 Datum.97.1.2 ( )
0:1:1:2:95 Shape.98
0:1:4:29 Dimension.98.1 ( T 15, V 12, VL 0.050000000000000003, VU 0.050000000000000003, P 0 )
0:1:4:30 GeomTolerance.98.1 ( T 9 TV 1, V 0.050000000000000003 )
0:1:4:31 Datum.98.1.1 ( )
0:1:4:32 Datum.98.1.2 ( )
0:1:1:2:96 Shape.99
0:1:4:26 Dimension.99.1 ( T 15, V 12, VL 0.050000000000000003, VU 0.050000000000000003, P 0 )
0:1:4:27 GeomTolerance.99.1 ( T 8 TV 1, V 0.050000000000000003 )
0:1:4:28 Datum.99.1.1 ( )
0:1:1:2:97 Shape.100
0:1:4:26 Dimension.100.1 ( T 15, V 12, VL 0.050000000000000003, VU 0.050000000000000003, P 0 )
0:1:4:27 GeomTolerance.100.1 ( T 8 TV 1, V 0.050000000000000003 )
0:1:4:28 Datum.100.1.1 ( )
0:1:1:2:184 Shape.187
0:1:4:22 GeomTolerance.187.1 ( T 12 TV 0, V 0.10000000000000001 )
0:1:1:2:185 Shape.188
0:1:4:45 GeomTolerance.188.1 ( T 12 TV 0, V 0.5 )
0:1:4:46 Datum.188.1.1 ( )
0:1:4:47 Datum.188.1.2 (, M 15 )
0:1:4:48 Datum.188.1.3 ( )
0:1:1:2:192 Shape.195
0:1:4:41 GeomTolerance.195.1 ( T 12 TV 0, V 0.5 )
0:1:4:42 Datum.195.1.1 ( )
0:1:4:43 Datum.195.1.2 ( )
0:1:4:44 Datum.195.1.3 ( )
0:1:1:2:195 Shape.198
0:1:4:22 GeomTolerance.198.1 ( T 12 TV 0, V 0.10000000000000001 )
0:1:1:2:205 Shape.208
0:1:4:53 GeomTolerance.208.1 ( T 12 TV 0, V 0.5 )
0:1:4:54 Datum.208.1.1 ( )
0:1:4:55 Datum.208.1.2 ( )
0:1:4:56 Datum.208.1.3 (, M 15 )
0:1:1:2:208 Shape.211
0:1:4:22 GeomTolerance.211.1 ( T 12 TV 0, V 0.10000000000000001 )
0:1:1:2:219 Shape.222
0:1:4:22 GeomTolerance.222.1 ( T 12 TV 0, V 0.10000000000000001 )
0:1:1:2:220 Shape.223
0:1:4:49 GeomTolerance.223.1 ( T 12 TV 0, V 0.5 )
0:1:4:50 Datum.223.1.1 ( )
0:1:4:51 Datum.223.1.2 (, M 15 )
0:1:4:52 Datum.223.1.3 (, M 15 )
0:1:1:2:311 Shape.314
0:1:4:23 GeomTolerance.314.1 ( T 12 TV 0, V 0.80000000000000004 )
0:1:4:24 Datum.314.1.1 (, M 12 )
0:1:4:25 Datum.314.1.2 (, M 12 )
0:1:1:2:331 Shape.334
0:1:4:33 Dimension.334.1 ( T 15, V 22, VL 0.10000000000000001, VU 0.10000000000000001, P 0 )
0:1:4:34 GeomTolerance.334.1 ( T 0 TV 1, V 0.10000000000000001, MR 2 )
0:1:1:2:332 Shape.335
0:1:4:33 Dimension.335.1 ( T 15, V 22, VL 0.10000000000000001, VU 0.10000000000000001, P 0 )
0:1:4:34 GeomTolerance.335.1 ( T 0 TV 1, V 0.10000000000000001, MR 2 )
0:1:1:2:357 Shape.360
0:1:4:35 GeomTolerance.360.1 ( T 12 TV 0, V 0.80000000000000004 )
0:1:4:36 Datum.360.1.1 ( )
0:1:4:37 Datum.360.1.2 ( )
0:1:1:2:363 Shape.366
0:1:4:60 Dimension.366.1 ( T 15, V 22, VL 0.10000000000000001, VU 0.10000000000000001, P 0 )
0:1:4:61 GeomTolerance.366.1 ( T 0 TV 1, V 0.14999999999999999, MR 2 )
0:1:4:62 Datum.366.1.1 ( )
0:1:1:2:364 Shape.367
0:1:4:60 Dimension.367.1 ( T 15, V 22, VL 0.10000000000000001, VU 0.10000000000000001, P 0 )
0:1:4:61 GeomTolerance.367.1 ( T 0 TV 1, V 0.14999999999999999, MR 2 )
0:1:4:62 Datum.367.1.1 ( )
0:1:1:2:375 Shape.378
0:1:4:14 GeomTolerance.378.1 ( T 12 TV 0, V 2.5 )
0:1:1:2:396 Shape.399
0:1:4:15 GeomTolerance.399.1 ( T 12 TV 0, V 0.75 )
0:1:1:2:431 Shape.434
0:1:4:10 Dimension.434.1 ( T 15, V 52, VL 0.14999999999999999, VU 0.14999999999999999, P 0 )
0:1:4:11 GeomTolerance.434.1 ( T 0 TV 1, V 1, MR 2 )
0:1:1:2:432 Shape.435
0:1:4:10 Dimension.435.1 ( T 15, V 52, VL 0.14999999999999999, VU 0.14999999999999999, P 0 )
0:1:4:11 GeomTolerance.435.1 ( T 0 TV 1, V 1, MR 2 )
0:1:1:2:435 Shape.438
0:1:4:10 Dimension.438.1 ( T 15, V 52, VL 0.14999999999999999, VU 0.14999999999999999, P 0 )
0:1:4:11 GeomTolerance.438.1 ( T 0 TV 1, V 1, MR 2 )
0:1:1:2:436 Shape.439
0:1:4:10 Dimension.439.1 ( T 15, V 52, VL 0.14999999999999999, VU 0.14999999999999999, P 0 )
0:1:4:11 GeomTolerance.439.1 ( T 0 TV 1, V 1, MR 2 )
0:1:1:2:437 Shape.440
0:1:4:38 GeomTolerance.440.1 ( T 12 TV 0, V 0.80000000000000004 )
0:1:4:39 Datum.440.1.1 ( )
0:1:4:40 Datum.440.1.2 (, M 12 )
0:1:1:2:494 Shape.497
0:1:4:12 Dimension.497.1 ( T 15, V 100, VL 0.14999999999999999, VU 0.14999999999999999, P 0 )
0:1:4:13 GeomTolerance.497.1 ( T 0 TV 1, V 1.5, MR 1 )
0:1:1:2:495 Shape.498
0:1:4:12 Dimension.498.1 ( T 15, V 100, VL 0.14999999999999999, VU 0.14999999999999999, P 0 )
0:1:4:13 GeomTolerance.498.1 ( T 0 TV 1, V 1.5, MR 1 )
0:1:1:2:518 Shape.521
0:1:4:12 Dimension.521.1 ( T 15, V 100, VL 0.14999999999999999, VU 0.14999999999999999, P 0 )
0:1:4:13 GeomTolerance.521.1 ( T 0 TV 1, V 1.5, MR 1 )
0:1:1:2:519 Shape.522
0:1:4:12 Dimension.522.1 ( T 15, V 100, VL 0.14999999999999999, VU 0.14999999999999999, P 0 )
0:1:4:13 GeomTolerance.522.1 ( T 0 TV 1, V 1.5, MR 1 )
0:1:1:2:540 Shape.543
0:1:4:17 GeomTolerance.543.1 ( T 12 TV 0, V 2.5 )
0:1:1:2:612 Shape.615
0:1:4:20 Datum target.615.1 ( T 3, A ( L (000), XD (100), RD (010)), L 0 )
0:1:1:2:645 Shape.648
0:1:4:18 Dimension.648.1 ( T 15, V 40, VL 0.14999999999999999, VU 0.14999999999999999, P 0 )
0:1:4:19 GeomTolerance.648.1 ( T 8 TV 1, V 0.25 )
0:1:1:2:646 Shape.649
0:1:4:18 Dimension.649.1 ( T 15, V 40, VL 0.14999999999999999, VU 0.14999999999999999, P 0 )
0:1:4:19 GeomTolerance.649.1 ( T 8 TV 1, V 0.25 )
0:1:1:2:672 Shape.675
0:1:4:10 Dimension.675.1 ( T 15, V 52, VL 0.14999999999999999, VU 0.14999999999999999, P 0 )
0:1:4:11 GeomTolerance.675.1 ( T 0 TV 1, V 1, MR 2 )
0:1:1:2:673 Shape.676
0:1:4:10 Dimension.676.1 ( T 15, V 52, VL 0.14999999999999999, VU 0.14999999999999999, P 0 )
0:1:4:11 GeomTolerance.676.1 ( T 0 TV 1, V 1, MR 2 )
0:1:1:2:674 Shape.677
0:1:4:10 Dimension.677.1 ( T 15, V 52, VL 0.14999999999999999, VU 0.14999999999999999, P 0 )
0:1:4:11 GeomTolerance.677.1 ( T 0 TV 1, V 1, MR 2 )
0:1:1:2:675 Shape.678
0:1:4:10 Dimension.678.1 ( T 15, V 52, VL 0.14999999999999999, VU 0.14999999999999999, P 0 )
0:1:4:11 GeomTolerance.678.1 ( T 0 TV 1, V 1, MR 2 )
0:1:1:2:676 Shape.679
0:1:4:12 Dimension.679.1 ( T 15, V 100, VL 0.14999999999999999, VU 0.14999999999999999, P 0 )
0:1:4:13 GeomTolerance.679.1 ( T 0 TV 1, V 1.5, MR 1 )
0:1:1:2:677 Shape.680
0:1:4:12 Dimension.680.1 ( T 15, V 100, VL 0.14999999999999999, VU 0.14999999999999999, P 0 )
0:1:4:13 GeomTolerance.680.1 ( T 0 TV 1, V 1.5, MR 1 )
0:1:1:2:678 Shape.681
0:1:4:33 Dimension.681.1 ( T 15, V 22, VL 0.10000000000000001, VU 0.10000000000000001, P 0 )
0:1:4:34 GeomTolerance.681.1 ( T 0 TV 1, V 0.10000000000000001, MR 2 )
0:1:1:2:679 Shape.682
0:1:4:27 GeomTolerance.682.1 ( T 8 TV 1, V 0.050000000000000003 )
0:1:4:28 Datum.682.1.1 ( )
0:1:1:2:680 Shape.683
0:1:4:27 GeomTolerance.683.1 ( T 8 TV 1, V 0.050000000000000003 )
0:1:4:28 Datum.683.1.1 ( )
0:1:1:2:681 Shape.684
0:1:4:30 GeomTolerance.684.1 ( T 9 TV 1, V 0.050000000000000003 )
0:1:4:31 Datum.684.1.1 ( )
0:1:4:32 Datum.684.1.2 ( )
0:1:1:2:682 Shape.685
0:1:4:30 GeomTolerance.685.1 ( T 9 TV 1, V 0.050000000000000003 )
0:1:4:31 Datum.685.1.1 ( )
0:1:4:32 Datum.685.1.2 ( )
0:1:1:2:683 Shape.686
0:1:4:33 Dimension.686.1 ( T 15, V 22, VL 0.10000000000000001, VU 0.10000000000000001, P 0 )
0:1:4:34 GeomTolerance.686.1 ( T 0 TV 1, V 0.10000000000000001, MR 2 )
0:1:1:3:1 Shape.687
0:1:4:1 GeomTolerance.687.1 ( T 6 TV 0, V 0.25 )
}

169
tests/gdt/import/A3 Normal file
View File

@@ -0,0 +1,169 @@
# !!!! This file is generated automatically, do not edit manually! See end script
set filename nist_ctc_03_asme1_ap242.stp
set ref_data {
NbOfDimensions : 10
NbOfTolerances : 13
NbOfDatumFeature : 5
NbOfAttachedDatum : 26
NbOfDatumTarget : 0
0:1:1:2:2 Shape.5
0:1:4:1 GeomTolerance.5.1 ( T 12 TV 0, V 0.254 )
0:1:1:2:7 Shape.10
0:1:4:6 Dimension.10.1 ( T 2, V 20.827999999999996, VL 64.515999999999991, VU 64.515999999999991, P 0 )
0:1:1:2:19 Shape.22
0:1:4:39 Dimension.22.1 ( T 15, V 11.1252, VL 64.515999999999991, VU 64.515999999999991, P 0 )
0:1:4:35 GeomTolerance.22.1 ( T 0 TV 1, V 1.27, MR 1 )
0:1:4:36 Datum.22.1.1 ( )
0:1:4:37 Datum.22.1.2 (, M 15 )
0:1:4:38 Datum.22.1.3 (, M 15 )
0:1:1:2:20 Shape.23
0:1:4:39 Dimension.23.1 ( T 15, V 11.1252, VL 64.515999999999991, VU 64.515999999999991, P 0 )
0:1:4:35 GeomTolerance.23.1 ( T 0 TV 1, V 1.27, MR 1 )
0:1:4:36 Datum.23.1.1 ( )
0:1:4:37 Datum.23.1.2 (, M 15 )
0:1:4:38 Datum.23.1.3 (, M 15 )
0:1:1:2:21 Shape.24
0:1:4:39 Dimension.24.1 ( T 15, V 11.1252, VL 64.515999999999991, VU 64.515999999999991, P 0 )
0:1:4:35 GeomTolerance.24.1 ( T 0 TV 1, V 1.27, MR 1 )
0:1:4:36 Datum.24.1.1 ( )
0:1:4:37 Datum.24.1.2 (, M 15 )
0:1:4:38 Datum.24.1.3 (, M 15 )
0:1:1:2:22 Shape.25
0:1:4:39 Dimension.25.1 ( T 15, V 11.1252, VL 64.515999999999991, VU 64.515999999999991, P 0 )
0:1:4:35 GeomTolerance.25.1 ( T 0 TV 1, V 1.27, MR 1 )
0:1:4:36 Datum.25.1.1 ( )
0:1:4:37 Datum.25.1.2 (, M 15 )
0:1:4:38 Datum.25.1.3 (, M 15 )
0:1:1:2:28 Shape.31
0:1:4:6 Dimension.31.1 ( T 2, V 20.827999999999996, VL 64.515999999999991, VU 64.515999999999991, P 0 )
0:1:4:2 GeomTolerance.31.1 ( T 12 TV 0, V 0.76200000000000001 )
0:1:4:3 Datum.31.1.1 ( )
0:1:4:4 Datum.31.1.2 ( )
0:1:4:5 Datum.31.1.3 ( )
0:1:1:2:39 Shape.42
0:1:4:14 Dimension.42.1 ( T 15, V 50.799999999999997, VL 64.515999999999991, VU 64.515999999999991, P 0 )
0:1:4:15 GeomTolerance.42.1 ( T 9 TV 1, V 1.524 )
0:1:4:16 Datum.42.1.1 ( )
0:1:4:17 Datum.42.1.2 ( )
0:1:4:18 Datum.42.1.3 ( )
0:1:1:2:40 Shape.43
0:1:4:14 Dimension.43.1 ( T 15, V 50.799999999999997, VL 64.515999999999991, VU 64.515999999999991, P 0 )
0:1:4:15 GeomTolerance.43.1 ( T 9 TV 1, V 1.524 )
0:1:4:16 Datum.43.1.1 ( )
0:1:4:17 Datum.43.1.2 ( )
0:1:4:18 Datum.43.1.3 ( )
0:1:1:2:48 Shape.51
0:1:4:30 Dimension.51.1 ( T 2, V 19.049999999999997, P 0 )
0:1:1:2:49 Shape.52
0:1:4:19 Dimension.52.1 ( T 15, V 38.099999999999994, VL 64.515999999999991, VU 64.515999999999991, P 0 )
0:1:4:20 GeomTolerance.52.1 ( T 9 TV 1, V 2.032 )
0:1:4:21 Datum.52.1.1 ( )
0:1:4:22 Datum.52.1.2 ( )
0:1:4:23 Datum.52.1.3 ( )
0:1:4:25 GeomTolerance.52.2 ( T 9 TV 0, V 0.76200000000000001 )
0:1:4:26 Datum.52.2.1 ( )
0:1:4:27 Datum.52.2.2 ( )
0:1:4:28 Datum.52.2.3 ( )
0:1:1:2:50 Shape.53
0:1:4:19 Dimension.53.1 ( T 15, V 38.099999999999994, VL 64.515999999999991, VU 64.515999999999991, P 0 )
0:1:4:24 Dimension.53.2 ( T 2, V 38.099999999999994, P 0 )
0:1:4:20 GeomTolerance.53.1 ( T 9 TV 1, V 2.032 )
0:1:4:21 Datum.53.1.1 ( )
0:1:4:22 Datum.53.1.2 ( )
0:1:4:23 Datum.53.1.3 ( )
0:1:4:25 GeomTolerance.53.2 ( T 9 TV 0, V 0.76200000000000001 )
0:1:4:26 Datum.53.2.1 ( )
0:1:4:27 Datum.53.2.2 ( )
0:1:4:28 Datum.53.2.3 ( )
0:1:1:2:51 Shape.54
0:1:4:29 Dimension.54.1 ( T 15, V 15.875, VL 64.515999999999991, VU 64.515999999999991, P 0 )
0:1:4:31 GeomTolerance.54.1 ( T 0 TV 1, V 1.27, MR 1 )
0:1:4:32 Datum.54.1.1 ( )
0:1:4:33 Datum.54.1.2 ( )
0:1:4:34 Datum.54.1.3 ( )
0:1:1:2:52 Shape.55
0:1:4:29 Dimension.55.1 ( T 15, V 15.875, VL 64.515999999999991, VU 64.515999999999991, P 0 )
0:1:4:31 GeomTolerance.55.1 ( T 0 TV 1, V 1.27, MR 1 )
0:1:4:32 Datum.55.1.1 ( )
0:1:4:33 Datum.55.1.2 ( )
0:1:4:34 Datum.55.1.3 ( )
0:1:1:2:53 Shape.56
0:1:4:29 Dimension.56.1 ( T 15, V 15.875, VL 64.515999999999991, VU 64.515999999999991, P 0 )
0:1:4:31 GeomTolerance.56.1 ( T 0 TV 1, V 1.27, MR 1 )
0:1:4:32 Datum.56.1.1 ( )
0:1:4:33 Datum.56.1.2 ( )
0:1:4:34 Datum.56.1.3 ( )
0:1:1:2:54 Shape.57
0:1:4:29 Dimension.57.1 ( T 15, V 15.875, VL 64.515999999999991, VU 64.515999999999991, P 0 )
0:1:4:31 GeomTolerance.57.1 ( T 0 TV 1, V 1.27, MR 1 )
0:1:4:32 Datum.57.1.1 ( )
0:1:4:33 Datum.57.1.2 ( )
0:1:4:34 Datum.57.1.3 ( )
0:1:1:2:55 Shape.58
0:1:4:29 Dimension.58.1 ( T 15, V 15.875, VL 64.515999999999991, VU 64.515999999999991, P 0 )
0:1:4:31 GeomTolerance.58.1 ( T 0 TV 1, V 1.27, MR 1 )
0:1:4:32 Datum.58.1.1 ( )
0:1:4:33 Datum.58.1.2 ( )
0:1:4:34 Datum.58.1.3 ( )
0:1:1:2:56 Shape.59
0:1:4:29 Dimension.59.1 ( T 15, V 15.875, VL 64.515999999999991, VU 64.515999999999991, P 0 )
0:1:4:31 GeomTolerance.59.1 ( T 0 TV 1, V 1.27, MR 1 )
0:1:4:32 Datum.59.1.1 ( )
0:1:4:33 Datum.59.1.2 ( )
0:1:4:34 Datum.59.1.3 ( )
0:1:1:2:57 Shape.60
0:1:4:29 Dimension.60.1 ( T 15, V 15.875, VL 64.515999999999991, VU 64.515999999999991, P 0 )
0:1:4:31 GeomTolerance.60.1 ( T 0 TV 1, V 1.27, MR 1 )
0:1:4:32 Datum.60.1.1 ( )
0:1:4:33 Datum.60.1.2 ( )
0:1:4:34 Datum.60.1.3 ( )
0:1:1:2:58 Shape.61
0:1:4:29 Dimension.61.1 ( T 15, V 15.875, VL 64.515999999999991, VU 64.515999999999991, P 0 )
0:1:4:31 GeomTolerance.61.1 ( T 0 TV 1, V 1.27, MR 1 )
0:1:4:32 Datum.61.1.1 ( )
0:1:4:33 Datum.61.1.2 ( )
0:1:4:34 Datum.61.1.3 ( )
0:1:1:2:123 Shape.126
0:1:4:43 GeomTolerance.126.1 ( T 12 TV 0, V 1.524 )
0:1:4:44 Datum.126.1.1 ( )
0:1:4:45 Datum.126.1.2 ( )
0:1:4:46 Datum.126.1.3 ( )
0:1:4:47 GeomTolerance.126.2 ( T 7 TV 0, V 0.127 )
0:1:4:48 GeomTolerance.126.3 ( T 1 TV 0, V 1.016 )
0:1:4:49 Datum.126.3.1 ( )
0:1:1:2:129 Shape.132
0:1:4:1 GeomTolerance.132.1 ( T 12 TV 0, V 0.254 )
0:1:1:2:134 Shape.137
0:1:4:40 Dimension.137.1 ( T 15, V 27.050999999999998, VL 64.515999999999991, VU 64.515999999999991, P 0 )
0:1:4:41 GeomTolerance.137.1 ( T 8 TV 1, V 0.254 )
0:1:4:42 Datum.137.1.1 ( )
0:1:1:2:135 Shape.138
0:1:4:40 Dimension.138.1 ( T 15, V 27.050999999999998, VL 64.515999999999991, VU 64.515999999999991, P 0 )
0:1:4:41 GeomTolerance.138.1 ( T 8 TV 1, V 0.254 )
0:1:4:42 Datum.138.1.1 ( )
0:1:1:2:153 Shape.156
0:1:4:7 Dimension.156.1 ( T 15, V 11.1252, VL 64.515999999999991, VU 64.515999999999991, P 0 )
0:1:4:9 GeomTolerance.156.1 ( T 8 TV 1, V 0.254 )
0:1:4:10 Datum.156.1.1 ( )
0:1:1:2:154 Shape.157
0:1:4:7 Dimension.157.1 ( T 15, V 11.1252, VL 64.515999999999991, VU 64.515999999999991, P 0 )
0:1:4:9 GeomTolerance.157.1 ( T 8 TV 1, V 0.254 )
0:1:4:10 Datum.157.1.1 ( )
0:1:1:2:155 Shape.158
0:1:4:8 Dimension.158.1 ( T 15, V 11.1252, VL 64.515999999999991, VU 64.515999999999991, P 0 )
0:1:4:11 GeomTolerance.158.1 ( T 9 TV 1, V 0.50800000000000001 )
0:1:4:12 Datum.158.1.1 ( )
0:1:4:13 Datum.158.1.2 ( )
0:1:1:2:156 Shape.159
0:1:4:8 Dimension.159.1 ( T 15, V 11.1252, VL 64.515999999999991, VU 64.515999999999991, P 0 )
0:1:4:11 GeomTolerance.159.1 ( T 9 TV 1, V 0.50800000000000001 )
0:1:4:12 Datum.159.1.1 ( )
0:1:4:13 Datum.159.1.2 ( )
0:1:1:2:157 Shape.160
0:1:4:24 Dimension.160.1 ( T 2, V 38.099999999999994, P 0 )
0:1:1:2:158 Shape.161
0:1:4:30 Dimension.161.1 ( T 2, V 19.049999999999997, P 0 )
}

179
tests/gdt/import/A4 Normal file
View File

@@ -0,0 +1,179 @@
# !!!! This file is generated automatically, do not edit manually! See end script
set filename nist_ctc_04_asme1_ap242.stp
set ref_data {
NbOfDimensions : 5
NbOfTolerances : 4
NbOfDatumFeature : 6
NbOfAttachedDatum : 10
NbOfDatumTarget : 0
0:1:1:2:1 Shape.4
0:1:4:1 GeomTolerance.4.1 ( T 9 TV 1, V 0.34999999999999998 )
0:1:4:2 Datum.4.1.1 ( )
0:1:4:3 Datum.4.1.2 ( )
0:1:4:4 Datum.4.1.3 ( )
0:1:1:2:2 Shape.5
0:1:4:1 GeomTolerance.5.1 ( T 9 TV 1, V 0.34999999999999998 )
0:1:4:2 Datum.5.1.1 ( )
0:1:4:3 Datum.5.1.2 ( )
0:1:4:4 Datum.5.1.3 ( )
0:1:1:2:6 Shape.9
0:1:4:5 GeomTolerance.9.1 ( T 12 TV 0, V 2 )
0:1:4:6 Datum.9.1.1 ( )
0:1:4:7 Datum.9.1.2 ( )
0:1:4:8 Datum.9.1.3 ( )
0:1:4:9 GeomTolerance.9.2 ( T 12 TV 0, V 0.20000000000000001 )
0:1:4:10 Datum.9.2.1 ( )
0:1:1:2:7 Shape.10
0:1:4:5 GeomTolerance.10.1 ( T 12 TV 0, V 2 )
0:1:4:6 Datum.10.1.1 ( )
0:1:4:7 Datum.10.1.2 ( )
0:1:4:8 Datum.10.1.3 ( )
0:1:4:9 GeomTolerance.10.2 ( T 12 TV 0, V 0.20000000000000001 )
0:1:4:10 Datum.10.2.1 ( )
0:1:1:2:11 Shape.14
0:1:4:11 GeomTolerance.14.1 ( T 12 TV 0, V 0.5 )
0:1:4:12 Datum.14.1.1 ( )
0:1:4:13 Datum.14.1.2 ( )
0:1:4:14 Datum.14.1.3 ( )
0:1:1:2:12 Shape.15
0:1:4:15 Dimension.15.1 ( T 15, V 10, P 0 )
0:1:1:2:13 Shape.16
0:1:4:15 Dimension.16.1 ( T 15, V 10, P 0 )
0:1:1:2:14 Shape.17
0:1:4:16 Dimension.17.1 ( T 2, V 20, VL 0.20000000000000001, VU 0.20000000000000001, P 0 )
0:1:1:2:15 Shape.18
0:1:4:17 Dimension.18.1 ( T 14, V 25, VL 0.25, VU 0.25, P 0 )
0:1:4:16 Dimension.18.2 ( T 2, V 20, VL 0.20000000000000001, VU 0.20000000000000001, P 0 )
0:1:1:2:16 Shape.19
0:1:4:18 Dimension.19.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:17 Shape.20
0:1:4:18 Dimension.20.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:18 Shape.21
0:1:4:18 Dimension.21.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:19 Shape.22
0:1:4:18 Dimension.22.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:20 Shape.23
0:1:4:18 Dimension.23.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:21 Shape.24
0:1:4:18 Dimension.24.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:22 Shape.25
0:1:4:18 Dimension.25.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:23 Shape.26
0:1:4:18 Dimension.26.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:24 Shape.27
0:1:4:18 Dimension.27.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:25 Shape.28
0:1:4:18 Dimension.28.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:26 Shape.29
0:1:4:18 Dimension.29.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:27 Shape.30
0:1:4:18 Dimension.30.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:28 Shape.31
0:1:4:18 Dimension.31.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:29 Shape.32
0:1:4:18 Dimension.32.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:30 Shape.33
0:1:4:18 Dimension.33.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:31 Shape.34
0:1:4:18 Dimension.34.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:32 Shape.35
0:1:4:18 Dimension.35.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:33 Shape.36
0:1:4:18 Dimension.36.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:34 Shape.37
0:1:4:18 Dimension.37.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:35 Shape.38
0:1:4:18 Dimension.38.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:36 Shape.39
0:1:4:18 Dimension.39.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:37 Shape.40
0:1:4:18 Dimension.40.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:38 Shape.41
0:1:4:18 Dimension.41.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:39 Shape.42
0:1:4:18 Dimension.42.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:40 Shape.43
0:1:4:18 Dimension.43.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:41 Shape.44
0:1:4:18 Dimension.44.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:42 Shape.45
0:1:4:18 Dimension.45.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:43 Shape.46
0:1:4:18 Dimension.46.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:44 Shape.47
0:1:4:18 Dimension.47.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:45 Shape.48
0:1:4:18 Dimension.48.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:46 Shape.49
0:1:4:18 Dimension.49.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:47 Shape.50
0:1:4:18 Dimension.50.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:48 Shape.51
0:1:4:18 Dimension.51.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:49 Shape.52
0:1:4:18 Dimension.52.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:50 Shape.53
0:1:4:18 Dimension.53.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:51 Shape.54
0:1:4:18 Dimension.54.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:52 Shape.55
0:1:4:18 Dimension.55.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:53 Shape.56
0:1:4:18 Dimension.56.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:54 Shape.57
0:1:4:18 Dimension.57.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:55 Shape.58
0:1:4:18 Dimension.58.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:56 Shape.59
0:1:4:18 Dimension.59.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:57 Shape.60
0:1:4:18 Dimension.60.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:58 Shape.61
0:1:4:18 Dimension.61.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:59 Shape.62
0:1:4:18 Dimension.62.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:60 Shape.63
0:1:4:18 Dimension.63.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:61 Shape.64
0:1:4:18 Dimension.64.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:62 Shape.65
0:1:4:18 Dimension.65.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:63 Shape.66
0:1:4:18 Dimension.66.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:64 Shape.67
0:1:4:18 Dimension.67.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:65 Shape.68
0:1:4:18 Dimension.68.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:66 Shape.69
0:1:4:18 Dimension.69.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:67 Shape.70
0:1:4:18 Dimension.70.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:68 Shape.71
0:1:4:18 Dimension.71.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:69 Shape.72
0:1:4:18 Dimension.72.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:70 Shape.73
0:1:4:18 Dimension.73.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:71 Shape.74
0:1:4:18 Dimension.74.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:72 Shape.75
0:1:4:18 Dimension.75.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:73 Shape.76
0:1:4:18 Dimension.76.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:74 Shape.77
0:1:4:18 Dimension.77.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:75 Shape.78
0:1:4:18 Dimension.78.1 ( T 15, V 20, VL 0.29999999999999999, VU 0.29999999999999999, P 0 )
0:1:1:2:76 Shape.79
0:1:4:19 Dimension.79.1 ( T 11, V 89.999999999776747, VL 1, VU 1, Q 3, P 0 )
0:1:1:2:77 Shape.80
0:1:4:19 Dimension.80.1 ( T 11, V 89.999999999776747, VL 1, VU 1, Q 3, P 0 )
0:1:1:3:1 Shape.81
0:1:4:11 GeomTolerance.81.1 ( T 12 TV 0, V 0.5 )
0:1:4:12 Datum.81.1.1 ( )
0:1:4:13 Datum.81.1.2 ( )
0:1:4:14 Datum.81.1.3 ( )
}

63
tests/gdt/import/A5 Normal file
View File

@@ -0,0 +1,63 @@
# !!!! This file is generated automatically, do not edit manually! See end script
set filename nist_ctc_05_asme1_ap242-1.stp
set ref_data {
NbOfDimensions : 2
NbOfTolerances : 10
NbOfDatumFeature : 2
NbOfAttachedDatum : 9
NbOfDatumTarget : 2
0:1:1:2:2 Shape.5
0:1:4:10 Dimension.5.1 ( T 2, V 127, VL 64.515999999999991, VU 64.515999999999991, P 0 )
0:1:1:2:8 Shape.11
0:1:4:10 Dimension.11.1 ( T 2, V 127, VL 64.515999999999991, VU 64.515999999999991, P 0 )
0:1:1:2:9 Shape.12
0:1:4:1 GeomTolerance.12.1 ( T 13 TV 0, V 0.127 )
0:1:1:2:66 Shape.69
0:1:4:11 GeomTolerance.69.1 ( T 3 TV 0, V 0.050799999999999998 )
0:1:1:2:67 Shape.70
0:1:4:11 GeomTolerance.70.1 ( T 3 TV 0, V 0.050799999999999998 )
0:1:1:2:68 Shape.71
0:1:4:2 GeomTolerance.71.1 ( T 2 TV 0, V 0.88900000000000001 )
0:1:4:3 Datum.71.1.1 ( )
0:1:4:4 Datum.71.1.2 ( )
0:1:1:2:88 Shape.91
0:1:4:12 GeomTolerance.91.1 ( T 2 TV 1, V 0.76200000000000001 )
0:1:4:13 Datum.91.1.1 ( )
0:1:1:2:89 Shape.92
0:1:4:12 GeomTolerance.92.1 ( T 2 TV 1, V 0.76200000000000001 )
0:1:4:13 Datum.92.1.1 ( )
0:1:1:2:118 Shape.121
0:1:4:23 Datum target.121.1 ( T 3, A ( L (000), XD (100), RD (010)), L 0 )
0:1:1:2:123 Shape.126
0:1:4:21 Datum target.126.1 ( T 3, A ( L (000), XD (100), RD (010)), L 0 )
0:1:1:2:125 Shape.128
0:1:4:14 GeomTolerance.128.1 ( T 2 TV 0, V 0.63500000000000001 )
0:1:4:15 Datum.128.1.1 ( )
0:1:4:16 Datum.128.1.2 ( )
0:1:1:2:141 Shape.144
0:1:4:17 GeomTolerance.144.1 ( T 2 TV 0, V 0.63500000000000001 )
0:1:4:18 Datum.144.1.1 ( )
0:1:4:19 Datum.144.1.2 ( )
0:1:1:2:152 Shape.155
0:1:4:22 GeomTolerance.155.1 ( T 9 TV 0, V 0.254 )
0:1:1:2:153 Shape.156
0:1:4:7 GeomTolerance.156.1 ( T 2 TV 0, V 0.38100000000000001 )
0:1:4:8 Datum.156.1.1 ( )
0:1:1:2:154 Shape.157
0:1:4:20 GeomTolerance.157.1 ( T 9 TV 0, V 0.254 )
0:1:1:2:199 Shape.202
0:1:4:5 GeomTolerance.202.1 ( T 2 TV 0, V 0.050799999999999998 )
0:1:4:6 Datum.202.1.1 ( )
0:1:1:2:200 Shape.203
0:1:4:5 GeomTolerance.203.1 ( T 2 TV 0, V 0.050799999999999998 )
0:1:4:6 Datum.203.1.1 ( )
0:1:1:2:206 Shape.209
0:1:4:9 Dimension.209.1 ( T 2, V 254, VL 64.515999999999991, VU 64.515999999999991, P 0 )
0:1:1:2:207 Shape.210
0:1:4:9 Dimension.210.1 ( T 2, V 254, VL 64.515999999999991, VU 64.515999999999991, P 0 )
0:1:1:3:1 Shape.211
0:1:4:1 GeomTolerance.211.1 ( T 13 TV 0, V 0.127 )
}

1
tests/gdt/import/begin Normal file
View File

@@ -0,0 +1 @@
NewDocument D

124
tests/gdt/import/end Normal file
View File

@@ -0,0 +1,124 @@
# Set flag dump_file to 1 in order to regenerate script files with actual data
# used as reference. In this mode all tests intentionaly report failure.
set dump_file 0
########################################################################
set mist 0;
set nbTol 0;
set nbDim 0;
set nbDat 0;
set nbDatT 0;
set nbAttDat 0;
###################################################################
set ref_Compare 0
set todo_msg ""
set todo_mask "puts \"TODO CR23096 ALL: "
set Mandriva_todo_mask "puts \"TODO CR23096 ALL:"
set end_line "\" \n"
##################################################################
# Read original file
if { [string length $filename] > 1} {
set path_file [locate_data_file $filename]
if { [catch { ReadStep D_First $path_file } catch_result] } {
set err_msg "Error: First - file was not read - exception "
puts $err_msg
append todo_msg $todo_mask $err_msg $end_line
set mist 1
}
} else {
set mist 1
}
# Get information about translation
if { $mist < 1} {
puts ""
set xst [ XDumpNbDGTs D_First ]
if { [llength $xst] > 0 } {
regexp {NbOfDimensions +: +([-0-9.+eE]+)} $xst full nbDim
regexp {NbOfTolerances +: +([-0-9.+eE]+)} $xst full nbTol
regexp {NbOfDatumFeature +: +([-0-9.+eE]+)} $xst full nbDat
regexp {NbOfAttachedDatum +: +([-0-9.+eE]+)} $xst full nbAttDat
regexp {NbOfDatumTarget +: +([-0-9.+eE]+)} $xst full nbDatT
} else {
puts " GDT information was NOT provided"
}
set xstruct [ XDumpDGTs D_First all 1]
}
if { $mist != 1 } {
puts ""
set result ""
append result [format $xst]
append result [format "\n"]
append result [format $xstruct]
}
set err_compare_ref ""
if { [catch { Close D_First } catch_result] } {
set err_msg "Error : cannot close a document D_First - exception"
puts $err_msg
}
# Put reference data to the test script file if option "dump" is set
if { $dump_file == 1 } {
set fd_stream [open $dirname/$groupname/$gridname/$casename w]
puts $fd_stream "# !!!! This file is generated automatically, do not edit manually! See end script"
puts $fd_stream "set filename $filename"
if { $mist != 1 } {
puts $fd_stream ""
puts $fd_stream "set ref_data \{"
puts $fd_stream $result
puts $fd_stream "\}"
}
close $fd_stream
} elseif { $mist != 1 } {
puts "========================== Comparision with reference data ========"
puts ""
# Comparision of reference data with obtained result
set ref_list [split $ref_data \n]
set cur_list [split $result \n]
set nb_ref [llength $ref_list]
set nb_cur [llength $cur_list]
for { set i 0 } { $i < $nb_cur } { incr i } {
set j [expr $i +1]
set refstr [lindex $ref_list $j]
set curstr [lindex $cur_list $i]
set isOK 1;
if {[string equal $refstr $curstr] == 0} {
set isOK 0
}
if { $isOK == 0} {
incr ref_Compare
append err_compare_ref " Reference data - $refstr\n"
append err_compare_ref " Current data - $curstr\n"
append err_compare_ref "--------------------------------------------------------------------\n"
}
}
}
if { $dump_file != 0 } {
puts "Error : Running in regeneration mode, comparision was not performed!"
if { $mist != 1 } {
puts "Generation of test file $groupname/$gridname/$casename successful"
} else {
puts "Generation of reference data failed"
}
} else {
if { $ref_Compare > 0} {
puts "Error : $ref_Compare differences with reference data found :\n$err_compare_ref"
} else {
puts "Comparision of current result with reference data - OK\n"
}
}
puts "--------------------------------------------------------------------"
puts ""
puts "TEST COMPLETED"