mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0033206: Data Exchange, Step - Supplemental geometry support
Updated import methods to add supplemental geometry as a reference to the PMI Updated export methods to handle supplemental geometry as a special type. Created new GUID for supplemental geometry container - compound contains all sup. geom. shapes. Created new GUID for supplemental geometry label - supplemental geometry shape. Created new GUID for supplemental geometry reference - relation for depends on. Supplemental geometry: surfaces and curves.
This commit is contained in:
parent
3e1adab2d9
commit
706b94cc6d
@ -16,8 +16,11 @@
|
||||
#include <STEPCAFControl_Reader.hxx>
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||
#include <BRepBuilderAPI_MakeFace.hxx>
|
||||
#include <Geom_Axis2Placement.hxx>
|
||||
#include <Geom_CartesianPoint.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Interface_EntityIterator.hxx>
|
||||
#include <Interface_InterfaceModel.hxx>
|
||||
@ -64,6 +67,7 @@
|
||||
#include <STEPControl_Reader.hxx>
|
||||
#include <StepGeom_GeometricRepresentationItem.hxx>
|
||||
#include <StepGeom_Axis2Placement3d.hxx>
|
||||
#include <StepGeom_Curve.hxx>
|
||||
#include <StepGeom_Direction.hxx>
|
||||
#include <StepDimTol_AngularityTolerance.hxx>
|
||||
#include <StepDimTol_CircularRunoutTolerance.hxx>
|
||||
@ -753,7 +757,6 @@ Standard_Boolean STEPCAFControl_Reader::Transfer (STEPControl_Reader &reader,
|
||||
|
||||
// Update assembly compounds
|
||||
STool->UpdateAssemblies();
|
||||
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
@ -2071,6 +2074,46 @@ void readAnnotation(const Handle(XSControl_TransferReader)& theTR,
|
||||
return;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : computePMIReferensePosition
|
||||
//purpose : compute position of shape contains in the shapeAspect
|
||||
//=======================================================================
|
||||
Standard_Boolean computePMIReferensePosition(const Handle(StepRepr_ShapeAspect)& theReference,
|
||||
const Interface_Graph& theGraph,
|
||||
gp_Pnt& thePosition)
|
||||
{
|
||||
if (theReference.IsNull())
|
||||
return Standard_False;
|
||||
Handle(StepAP242_GeometricItemSpecificUsage) aGISU = NULL;
|
||||
for (Interface_EntityIterator anIt = theGraph.Sharings(theReference); aGISU.IsNull() && anIt.More(); anIt.Next())
|
||||
{
|
||||
aGISU = Handle(StepAP242_GeometricItemSpecificUsage)::DownCast(anIt.Value());
|
||||
}
|
||||
if (aGISU.IsNull() || aGISU->NbIdentifiedItem() == 0)
|
||||
return Standard_False;
|
||||
const Handle(StepRepr_RepresentationItem)& anItem = aGISU->IdentifiedItem()->Value(1);
|
||||
if (anItem->IsKind(STANDARD_TYPE(StepGeom_CartesianPoint)))
|
||||
{
|
||||
Handle(StepGeom_CartesianPoint) aPoint = Handle(StepGeom_CartesianPoint)::DownCast(anItem);
|
||||
thePosition.SetX(aPoint->CoordinatesValue(1));
|
||||
thePosition.SetY(aPoint->CoordinatesValue(2));
|
||||
thePosition.SetZ(aPoint->CoordinatesValue(3));
|
||||
return Standard_True;
|
||||
}
|
||||
else if (anItem->IsKind(STANDARD_TYPE(StepGeom_Axis2Placement3d)))
|
||||
{
|
||||
Handle(StepGeom_Axis2Placement3d) anA2P3D = Handle(StepGeom_Axis2Placement3d)::DownCast(anItem);
|
||||
if (!anA2P3D->Location().IsNull())
|
||||
{
|
||||
thePosition.SetX(anA2P3D->Location()->CoordinatesValue(1));
|
||||
thePosition.SetY(anA2P3D->Location()->CoordinatesValue(2));
|
||||
thePosition.SetZ(anA2P3D->Location()->CoordinatesValue(3));
|
||||
return Standard_True;
|
||||
}
|
||||
}
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : readConnectionPoints
|
||||
//purpose : read connection points for given dimension
|
||||
@ -2103,82 +2146,32 @@ void readConnectionPoints(const Handle(XSControl_TransferReader)& theTR,
|
||||
aFact = UnitsMethods::LengthFactor();
|
||||
}
|
||||
|
||||
if (theGDT->IsKind(STANDARD_TYPE(StepShape_DimensionalSize))) {
|
||||
// retrieve derived geometry
|
||||
if (theGDT->IsKind(STANDARD_TYPE(StepShape_DimensionalSize)))
|
||||
{
|
||||
Handle(StepShape_DimensionalSize) aDim = Handle(StepShape_DimensionalSize)::DownCast(theGDT);
|
||||
Handle(StepRepr_DerivedShapeAspect) aDSA = Handle(StepRepr_DerivedShapeAspect)::DownCast(aDim->AppliesTo());
|
||||
if (aDSA.IsNull())
|
||||
return;
|
||||
Handle(StepAP242_GeometricItemSpecificUsage) aGISU = NULL;
|
||||
for (Interface_EntityIterator anIt = aGraph.Sharings(aDSA); aGISU.IsNull() && anIt.More(); anIt.Next()) {
|
||||
aGISU = Handle(StepAP242_GeometricItemSpecificUsage)::DownCast(anIt.Value());
|
||||
gp_Pnt aPnt;
|
||||
if (computePMIReferensePosition(aDim->AppliesTo(), aGraph, aPnt))
|
||||
{
|
||||
// set connection point to object
|
||||
aPnt.SetXYZ(aPnt.XYZ() * aFact);
|
||||
theDimObject->SetPoint(aPnt);
|
||||
}
|
||||
if (aGISU.IsNull() || aGISU->NbIdentifiedItem() == 0)
|
||||
return;
|
||||
Handle(StepGeom_CartesianPoint) aPoint = Handle(StepGeom_CartesianPoint)::DownCast(aGISU->IdentifiedItem()->Value(1));
|
||||
if (aPoint.IsNull()) {
|
||||
// try Axis2Placement3d.location instead of CartesianPoint
|
||||
Handle(StepGeom_Axis2Placement3d) anA2P3D =
|
||||
Handle(StepGeom_Axis2Placement3d)::DownCast(aGISU->IdentifiedItem()->Value(1));
|
||||
if (anA2P3D.IsNull())
|
||||
return;
|
||||
aPoint = anA2P3D->Location();
|
||||
}
|
||||
|
||||
// set connection point to object
|
||||
gp_Pnt aPnt(aPoint->CoordinatesValue(1) * aFact, aPoint->CoordinatesValue(2) * aFact, aPoint->CoordinatesValue(3) * aFact);
|
||||
theDimObject->SetPoint(aPnt);
|
||||
}
|
||||
else if (theGDT->IsKind(STANDARD_TYPE(StepShape_DimensionalLocation))) {
|
||||
// retrieve derived geometry
|
||||
else if (theGDT->IsKind(STANDARD_TYPE(StepShape_DimensionalLocation)))
|
||||
{
|
||||
Handle(StepShape_DimensionalLocation) aDim = Handle(StepShape_DimensionalLocation)::DownCast(theGDT);
|
||||
Handle(StepRepr_DerivedShapeAspect) aDSA1 = Handle(StepRepr_DerivedShapeAspect)::DownCast(aDim->RelatingShapeAspect());
|
||||
Handle(StepRepr_DerivedShapeAspect) aDSA2 = Handle(StepRepr_DerivedShapeAspect)::DownCast(aDim->RelatedShapeAspect());
|
||||
if (aDSA1.IsNull() && aDSA2.IsNull())
|
||||
return;
|
||||
Handle(StepAP242_GeometricItemSpecificUsage) aGISU1 = NULL;
|
||||
Handle(StepAP242_GeometricItemSpecificUsage) aGISU2 = NULL;
|
||||
if (!aDSA1.IsNull()) {
|
||||
for (Interface_EntityIterator anIt = aGraph.Sharings(aDSA1); aGISU1.IsNull() && anIt.More(); anIt.Next()) {
|
||||
aGISU1 = Handle(StepAP242_GeometricItemSpecificUsage)::DownCast(anIt.Value());
|
||||
}
|
||||
gp_Pnt aPnt;
|
||||
if (computePMIReferensePosition(aDim->RelatingShapeAspect(), aGraph, aPnt))
|
||||
{
|
||||
// set connection point to object
|
||||
aPnt.SetXYZ(aPnt.XYZ() * aFact);
|
||||
theDimObject->SetPoint(aPnt);
|
||||
}
|
||||
if (!aDSA2.IsNull()) {
|
||||
for (Interface_EntityIterator anIt = aGraph.Sharings(aDSA2); aGISU2.IsNull() && anIt.More(); anIt.Next()) {
|
||||
aGISU2 = Handle(StepAP242_GeometricItemSpecificUsage)::DownCast(anIt.Value());
|
||||
}
|
||||
}
|
||||
// first point
|
||||
if (!aGISU1.IsNull() && aGISU1->NbIdentifiedItem() > 0) {
|
||||
Handle(StepGeom_CartesianPoint) aPoint = Handle(StepGeom_CartesianPoint)::DownCast(aGISU1->IdentifiedItem()->Value(1));
|
||||
if (aPoint.IsNull()) {
|
||||
// try Axis2Placement3d.location instead of CartesianPoint
|
||||
Handle(StepGeom_Axis2Placement3d) anA2P3D =
|
||||
Handle(StepGeom_Axis2Placement3d)::DownCast(aGISU1->IdentifiedItem()->Value(1));
|
||||
if (!anA2P3D.IsNull())
|
||||
aPoint = anA2P3D->Location();
|
||||
}
|
||||
if (!aPoint.IsNull()) {
|
||||
// set connection point to object
|
||||
gp_Pnt aPnt(aPoint->CoordinatesValue(1) * aFact, aPoint->CoordinatesValue(2) * aFact, aPoint->CoordinatesValue(3) * aFact);
|
||||
theDimObject->SetPoint(aPnt);
|
||||
}
|
||||
}
|
||||
// second point
|
||||
if (!aGISU2.IsNull() && aGISU2->NbIdentifiedItem() > 0) {
|
||||
Handle(StepGeom_CartesianPoint) aPoint = Handle(StepGeom_CartesianPoint)::DownCast(aGISU2->IdentifiedItem()->Value(1));
|
||||
if (aPoint.IsNull()) {
|
||||
// try Axis2Placement3d.location instead of CartesianPoint
|
||||
Handle(StepGeom_Axis2Placement3d) anA2P3D =
|
||||
Handle(StepGeom_Axis2Placement3d)::DownCast(aGISU2->IdentifiedItem()->Value(1));
|
||||
if (!anA2P3D.IsNull())
|
||||
aPoint = anA2P3D->Location();
|
||||
}
|
||||
if (!aPoint.IsNull()) {
|
||||
// set connection point to object
|
||||
gp_Pnt aPnt(aPoint->CoordinatesValue(1) * aFact, aPoint->CoordinatesValue(2) * aFact, aPoint->CoordinatesValue(3) * aFact);
|
||||
theDimObject->SetPoint2(aPnt);
|
||||
}
|
||||
if (computePMIReferensePosition(aDim->RelatedShapeAspect(), aGraph, aPnt))
|
||||
{
|
||||
// set connection point to object
|
||||
aPnt.SetXYZ(aPnt.XYZ() * aFact);
|
||||
theDimObject->SetPoint2(aPnt);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2792,8 +2785,9 @@ TDF_Label STEPCAFControl_Reader::createGDTObjectInXCAF(const Handle(Standard_Tra
|
||||
NCollection_Sequence<Handle(Standard_Transient)> aSeqRI1, aSeqRI2;
|
||||
|
||||
// Collect all Shape_Aspect entities
|
||||
Interface_EntityIterator anIter = aGraph.Shareds(theEnt);
|
||||
for (anIter.Start(); anIter.More(); anIter.Next()) {
|
||||
for (Interface_EntityIterator anIter = aGraph.Shareds(theEnt);
|
||||
anIter.More(); anIter.Next())
|
||||
{
|
||||
Handle(Standard_Transient) anAtr = anIter.Value();
|
||||
NCollection_Sequence<Handle(StepRepr_ShapeAspect)> aSAs;
|
||||
if (anAtr->IsKind(STANDARD_TYPE(StepRepr_ProductDefinitionShape)))
|
||||
@ -3082,65 +3076,15 @@ TDF_Label STEPCAFControl_Reader::createGDTObjectInXCAF(const Handle(Standard_Tra
|
||||
TDF_LabelSequence aShLS1, aShLS2;
|
||||
|
||||
// Collect shapes
|
||||
for (Standard_Integer i = aSeqRI1.Lower(); i <= aSeqRI1.Upper();i++)
|
||||
for (NCollection_Sequence<Handle(Standard_Transient)>::Iterator anIter(aSeqRI1);
|
||||
anIter.More(); anIter.Next())
|
||||
{
|
||||
Standard_Integer anIndex = FindShapeIndexForDGT(aSeqRI1.Value(i), theWS);
|
||||
TopoDS_Shape aSh;
|
||||
if (anIndex > 0) {
|
||||
Handle(Transfer_Binder) aBinder = aTP->MapItem(anIndex);
|
||||
aSh = TransferBRep::ShapeResult(aBinder);
|
||||
}
|
||||
if (!aSh.IsNull())
|
||||
{
|
||||
TDF_Label aShL;
|
||||
aSTool->Search(aSh, aShL, Standard_True, Standard_True, Standard_True);
|
||||
if (aShL.IsNull() && aSh.ShapeType() == TopAbs_WIRE)
|
||||
{
|
||||
TopExp_Explorer ex(aSh, TopAbs_EDGE, TopAbs_SHAPE);
|
||||
while (ex.More())
|
||||
{
|
||||
TDF_Label edgeL;
|
||||
aSTool->Search(ex.Current(), edgeL, Standard_True, Standard_True, Standard_True);
|
||||
if (!edgeL.IsNull())
|
||||
aShLS1.Append(edgeL);
|
||||
ex.Next();
|
||||
}
|
||||
}
|
||||
if (!aShL.IsNull())
|
||||
aShLS1.Append(aShL);
|
||||
}
|
||||
findReferenceGeometry(anIter.Value(), aSTool, aShLS1);
|
||||
}
|
||||
if (!aSeqRI2.IsEmpty())
|
||||
for (NCollection_Sequence<Handle(Standard_Transient)>::Iterator anIter(aSeqRI2);
|
||||
anIter.More(); anIter.Next())
|
||||
{
|
||||
//for dimensional location
|
||||
for (Standard_Integer i = aSeqRI2.Lower(); i <= aSeqRI2.Upper();i++)
|
||||
{
|
||||
Standard_Integer anIndex = FindShapeIndexForDGT(aSeqRI2.Value(i), theWS);
|
||||
TopoDS_Shape aSh;
|
||||
if (anIndex > 0) {
|
||||
Handle(Transfer_Binder) aBinder = aTP->MapItem(anIndex);
|
||||
aSh = TransferBRep::ShapeResult(aBinder);
|
||||
}
|
||||
if (!aSh.IsNull())
|
||||
{
|
||||
TDF_Label aShL;
|
||||
aSTool->Search(aSh, aShL, Standard_True, Standard_True, Standard_True);
|
||||
if (aShL.IsNull() && aSh.ShapeType() == TopAbs_WIRE)
|
||||
{
|
||||
TopExp_Explorer ex(aSh, TopAbs_EDGE, TopAbs_SHAPE);
|
||||
while (ex.More())
|
||||
{
|
||||
TDF_Label edgeL;
|
||||
aSTool->Search(ex.Current(), edgeL, Standard_True, Standard_True, Standard_True);
|
||||
if (!edgeL.IsNull())
|
||||
aShLS2.Append(edgeL);
|
||||
ex.Next();
|
||||
}
|
||||
}
|
||||
if (!aShL.IsNull())
|
||||
aShLS2.Append(aShL);
|
||||
}
|
||||
}
|
||||
findReferenceGeometry(anIter.Value(), aSTool, aShLS2);
|
||||
}
|
||||
|
||||
if (!aShLS1.IsEmpty())
|
||||
@ -3201,6 +3145,183 @@ TDF_Label STEPCAFControl_Reader::createGDTObjectInXCAF(const Handle(Standard_Tra
|
||||
return aGDTL;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : findReferenceGeometry
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean STEPCAFControl_Reader::findReferenceGeometry(const Handle(Standard_Transient)& theShapeStart,
|
||||
const Handle(XCAFDoc_ShapeTool)& theShTool,
|
||||
TDF_LabelSequence& theShLabelSeq)
|
||||
{
|
||||
const Handle(XSControl_TransferReader)& aTR = myReader.WS()->TransferReader();
|
||||
const Handle(Transfer_TransientProcess)& aTP = aTR->TransientProcess();
|
||||
TopoDS_Shape aSh = TransferBRep::ShapeResult(aTP, theShapeStart);
|
||||
if (!aSh.IsNull())
|
||||
{
|
||||
TDF_Label aShL;
|
||||
theShTool->Search(aSh, aShL, Standard_True, Standard_True, Standard_True);
|
||||
if (aShL.IsNull() && aSh.ShapeType() == TopAbs_WIRE)
|
||||
{
|
||||
for (TopExp_Explorer anExp(aSh, TopAbs_EDGE, TopAbs_SHAPE);
|
||||
anExp.More(); anExp.Next())
|
||||
{
|
||||
TDF_Label anEdgeL;
|
||||
theShTool->Search(anExp.Current(), anEdgeL, Standard_True, Standard_True, Standard_True);
|
||||
if (!anEdgeL.IsNull())
|
||||
{
|
||||
theShLabelSeq.Append(anEdgeL);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!aShL.IsNull())
|
||||
{
|
||||
theShLabelSeq.Append(aShL);
|
||||
return Standard_True;
|
||||
}
|
||||
}
|
||||
TDF_Label aFindResultL;
|
||||
if (myGDTMap.Find(theShapeStart, aFindResultL))
|
||||
{
|
||||
theShLabelSeq.Append(aFindResultL);
|
||||
return Standard_True;
|
||||
}
|
||||
const Handle(StepGeom_GeometricRepresentationItem)& aGeomItem =
|
||||
Handle(StepGeom_GeometricRepresentationItem)::DownCast(theShapeStart);
|
||||
if (aGeomItem.IsNull())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
if (theShapeStart->IsKind(STANDARD_TYPE(StepGeom_Curve)))
|
||||
{
|
||||
const Handle(StepGeom_Curve)& aStepCurve = Handle(StepGeom_Curve)::DownCast(theShapeStart);
|
||||
Handle(Geom_Curve) aCurve = StepToGeom::MakeCurve(aStepCurve);
|
||||
if (aCurve.IsNull())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
BRepBuilderAPI_MakeEdge aMaker;
|
||||
if (aCurve->IsKind(STANDARD_TYPE(Geom_Line)))
|
||||
{
|
||||
const Standard_Real aScale = UnitsMethods::LengthFactor();
|
||||
aMaker.Init(aCurve, 0, 1. * aScale);
|
||||
}
|
||||
else
|
||||
{
|
||||
aMaker.Init(aCurve);
|
||||
}
|
||||
if (aMaker.IsDone())
|
||||
{
|
||||
aSh = aMaker.Shape();
|
||||
}
|
||||
}
|
||||
else if (theShapeStart->IsKind(STANDARD_TYPE(StepGeom_Surface)))
|
||||
{
|
||||
const Handle(StepGeom_Surface)& aStepSurface = Handle(StepGeom_Surface)::DownCast(theShapeStart);
|
||||
Handle(Geom_Surface) aSurface = StepToGeom::MakeSurface(aStepSurface);
|
||||
if (aSurface.IsNull())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
BRepBuilderAPI_MakeFace aMaker;
|
||||
if (aSurface->IsKind(STANDARD_TYPE(Geom_Plane)))
|
||||
{
|
||||
const Standard_Real aScale = UnitsMethods::LengthFactor();
|
||||
aMaker.Init(aSurface, 0., 1. * aScale, 0., 1. * aScale, Precision::Confusion());
|
||||
}
|
||||
else
|
||||
{
|
||||
aMaker.Init(aSurface, Standard_True, Precision::Confusion());
|
||||
}
|
||||
if (aMaker.IsDone())
|
||||
{
|
||||
aSh = aMaker.Shape();
|
||||
}
|
||||
}
|
||||
if (aSh.IsNull())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
if (mySupplementalLabel.IsNull())
|
||||
{
|
||||
mySupplementalLabel = theShTool->NewShape();
|
||||
TDataStd_Name::Set(mySupplementalLabel, "Supplemental Geometry");
|
||||
TDataStd_UAttribute::Set(mySupplementalLabel, XCAFDoc::SupplementalContainerGUID());
|
||||
TDataStd_UAttribute::Set(mySupplementalLabel, XCAFDoc::InvisibleGUID());
|
||||
}
|
||||
TDF_Label aSupGeomLabel = theShTool->AddComponent(mySupplementalLabel, aSh);
|
||||
if (aSupGeomLabel.IsNull())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
TDataStd_UAttribute::Set(aSupGeomLabel, XCAFDoc::SupplementalGeometryGUID());
|
||||
|
||||
if (!aGeomItem->Name().IsNull())
|
||||
{
|
||||
TDataStd_Name::Set(aSupGeomLabel, aGeomItem->Name()->String());
|
||||
TDF_Label aReferredShapeL;
|
||||
theShTool->GetReferredShape(aSupGeomLabel, aReferredShapeL);
|
||||
TDataStd_Name::Set(aReferredShapeL, aGeomItem->Name()->String());
|
||||
TDataStd_UAttribute::Set(aReferredShapeL, XCAFDoc::SupplementalGeometryGUID());
|
||||
}
|
||||
TDF_Label aRefL;
|
||||
const Interface_Graph& aGraph = aTP->Graph();
|
||||
for (Interface_EntityIterator anIter(aGraph.Sharings(theShapeStart));
|
||||
anIter.More() && aRefL.IsNull(); anIter.Next())
|
||||
{
|
||||
Handle(StepAP242_GeometricItemSpecificUsage) aPGISU =
|
||||
Handle(StepAP242_GeometricItemSpecificUsage)::DownCast(anIter.Value());
|
||||
if (aPGISU.IsNull())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
Handle(StepRepr_ShapeAspect) aShAspect = aPGISU->Definition().ShapeAspect();
|
||||
if (aShAspect.IsNull())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
Handle(StepRepr_ProductDefinitionShape) aRefPDS = aShAspect->OfShape();
|
||||
if (aRefPDS.IsNull())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
TopoDS_Shape aRefSh = TransferBRep::ShapeResult(aTP, aRefPDS->Definition().Value());
|
||||
theShTool->Search(aRefSh, aRefL, Standard_True, Standard_True, Standard_False);
|
||||
}
|
||||
|
||||
if (aRefL.IsNull())
|
||||
{
|
||||
TDF_LabelSequence aFreeShapes;
|
||||
theShTool->GetFreeShapes(aFreeShapes);
|
||||
for(TDF_LabelSequence::Iterator anIter(aFreeShapes); anIter.More() && aRefL.IsNull(); anIter.Next())
|
||||
{
|
||||
const TDF_Label aLabel = anIter.Value();
|
||||
Handle(TDataStd_UAttribute) aSupGeomAttr;
|
||||
if (aLabel.FindAttribute(XCAFDoc::SupplementalContainerGUID(), aSupGeomAttr))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
TopoDS_Shape aTmpShape = theShTool->GetShape(aLabel);
|
||||
if (!aTmpShape.IsNull())
|
||||
{
|
||||
aRefL = aLabel;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (aRefL.IsNull())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
// set reference
|
||||
Handle(TDataStd_TreeNode) aMainNode = TDataStd_TreeNode::Set(aRefL, XCAFDoc::SupplementalRefGUID());
|
||||
Handle(TDataStd_TreeNode) aRefNode = TDataStd_TreeNode::Set(aSupGeomLabel, XCAFDoc::SupplementalRefGUID());
|
||||
aRefNode->Remove(); // abv: fix against bug in TreeNode::Append()
|
||||
aMainNode->Append(aRefNode);
|
||||
myGDTMap.Bind(theShapeStart, aSupGeomLabel);
|
||||
theShLabelSeq.Append(aSupGeomLabel);
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : convertAngleValue
|
||||
//purpose : auxilary
|
||||
|
@ -291,9 +291,18 @@ private:
|
||||
const Handle(TDocStd_Document)& theDoc,
|
||||
const Handle(XSControl_WorkSession)& theWS);
|
||||
|
||||
//! Finds reference geometry or create supplemental geometry label
|
||||
//! @param[in] theShapeStart step entity to get reference
|
||||
//! @param[in] theShTool tool to work with shape labels
|
||||
//! @param[out] theShLabelSeq container to put reference label
|
||||
//! @return TRUE if a reference is found or supplemental geometry is added
|
||||
Standard_Boolean findReferenceGeometry(const Handle(Standard_Transient)& theShapeStart,
|
||||
const Handle(XCAFDoc_ShapeTool)& theShTool,
|
||||
TDF_LabelSequence& theShLabelSeq);
|
||||
|
||||
STEPControl_Reader myReader;
|
||||
NCollection_DataMap<TCollection_AsciiString, Handle(STEPCAFControl_ExternFile)> myFiles;
|
||||
TDF_Label mySupplementalLabel;
|
||||
Standard_Boolean myColorMode;
|
||||
Standard_Boolean myNameMode;
|
||||
Standard_Boolean myLayerMode;
|
||||
|
@ -23,6 +23,8 @@
|
||||
#include <STEPCAFControl_Writer.hxx>
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <GeomToStep_MakeSurface.hxx>
|
||||
#include <GeomToStep_MakeCurve.hxx>
|
||||
#include <GeomToStep_MakeAxis2Placement3d.hxx>
|
||||
#include <GeomToStep_MakeCartesianPoint.hxx>
|
||||
#include <HeaderSection_FileSchema.hxx>
|
||||
@ -115,6 +117,7 @@
|
||||
#include <StepRepr_CompositeShapeAspect.hxx>
|
||||
#include <StepRepr_ConstructiveGeometryRepresentation.hxx>
|
||||
#include <StepRepr_ConstructiveGeometryRepresentationRelationship.hxx>
|
||||
#include <StepGeom_Curve.hxx>
|
||||
#include <StepRepr_DerivedShapeAspect.hxx>
|
||||
#include <StepRepr_DescriptiveRepresentationItem.hxx>
|
||||
#include <StepRepr_FeatureForDatumTargetRelationship.hxx>
|
||||
@ -198,6 +201,7 @@
|
||||
#include <TDF_LabelSequence.hxx>
|
||||
#include <TDF_Tool.hxx>
|
||||
#include <TDocStd_Document.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
@ -526,6 +530,12 @@ Standard_Boolean STEPCAFControl_Writer::Transfer (STEPControl_Writer &writer,
|
||||
TDF_Label L = labels.Value(i);
|
||||
if ( myLabels.IsBound ( L ) ) continue; // already processed
|
||||
|
||||
Handle(TDataStd_UAttribute) aSupGeomAttr;
|
||||
if (L.FindAttribute(XCAFDoc::SupplementalContainerGUID(), aSupGeomAttr))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
TopoDS_Shape shape = XCAFDoc_ShapeTool::GetShape ( L );
|
||||
if ( shape.IsNull() ) continue;
|
||||
|
||||
@ -2419,6 +2429,110 @@ Handle(StepRepr_ShapeAspect) STEPCAFControl_Writer::WriteShapeAspect (const Hand
|
||||
return aSA;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : WriteSupplementalGeometry
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(StepRepr_ShapeAspect) WriteSupplementalGeometry(const Handle(XSControl_WorkSession)& WS,
|
||||
const Handle(StepRepr_ConstructiveGeometryRepresentation)& theCGRepr,
|
||||
const TDF_Label& theLabel,
|
||||
const TopoDS_Shape& theShape,
|
||||
Handle(StepRepr_RepresentationContext)& theRC,
|
||||
Handle(StepAP242_GeometricItemSpecificUsage)& theGISU,
|
||||
NCollection_Vector<Handle(StepGeom_GeometricRepresentationItem)>& theGeomItems)
|
||||
{
|
||||
Handle(StepRepr_ShapeAspect) aResSA;
|
||||
// Get working data
|
||||
const Handle(Interface_InterfaceModel)& aModel = WS->Model();
|
||||
const Handle(XSControl_TransferWriter)& aTW = WS->TransferWriter();
|
||||
const Handle(Transfer_FinderProcess)& aFP = aTW->FinderProcess();
|
||||
const Handle(Interface_HGraph) aHGraph = WS->HGraph();
|
||||
if (aHGraph.IsNull())
|
||||
{
|
||||
return aResSA;
|
||||
}
|
||||
Interface_Graph aGraph = aHGraph->Graph();
|
||||
|
||||
// Shape_Aspect
|
||||
Handle(TCollection_HAsciiString) aName = new TCollection_HAsciiString();
|
||||
Handle(TDataStd_Name) aNameAttr;
|
||||
if (theLabel.FindAttribute(TDataStd_Name::GetID(), aNameAttr))
|
||||
{
|
||||
aName = new TCollection_HAsciiString(TCollection_AsciiString(aNameAttr->Get()));
|
||||
}
|
||||
Handle(TCollection_HAsciiString) aDescription = new TCollection_HAsciiString();
|
||||
|
||||
Handle(TDataStd_TreeNode) aRefNode;
|
||||
if (!theLabel.FindAttribute(XCAFDoc::SupplementalRefGUID(), aRefNode)
|
||||
|| aRefNode->Father().IsNull() || aRefNode->Father()->Label().IsNull())
|
||||
{
|
||||
return aResSA;
|
||||
}
|
||||
TopoDS_Shape aMainShape = XCAFDoc_ShapeTool::GetShape(aRefNode->Father()->Label());
|
||||
TopLoc_Location aLoc;
|
||||
TColStd_SequenceOfTransient aSeqRI;
|
||||
FindEntities(aFP, aMainShape, aLoc, aSeqRI);
|
||||
if (aSeqRI.Length() <= 0)
|
||||
{
|
||||
aFP->Messenger()->SendInfo() << "Warning: Cannot find RI for " << aMainShape.TShape()->DynamicType()->Name() << std::endl;
|
||||
return aResSA;
|
||||
}
|
||||
|
||||
Handle(StepRepr_ProductDefinitionShape) aPDS;
|
||||
Handle(StepRepr_RepresentationContext) aRC;
|
||||
Handle(Standard_Transient) anEnt = aSeqRI.Value(1);
|
||||
aPDS = FindPDS(aGraph, anEnt, aRC);
|
||||
if (aPDS.IsNull())
|
||||
return aResSA;
|
||||
|
||||
theRC = aRC;
|
||||
|
||||
Handle(StepGeom_GeometricRepresentationItem) anIdentifiedItem;
|
||||
if (theShape.ShapeType() == TopAbs_FACE)
|
||||
{
|
||||
const TopoDS_Face& aFace = TopoDS::Face(theShape);
|
||||
const Handle(Geom_Surface) aSurf = BRep_Tool::Surface(aFace);
|
||||
GeomToStep_MakeSurface aMaker(aSurf);
|
||||
if (aMaker.IsDone())
|
||||
{
|
||||
anIdentifiedItem = aMaker.Value();
|
||||
}
|
||||
}
|
||||
else if (theShape.ShapeType() == TopAbs_EDGE)
|
||||
{
|
||||
const TopoDS_Edge& anEdge = TopoDS::Edge(theShape);
|
||||
Standard_Real aTmpFirst, aTmpLast;
|
||||
const Handle(Geom_Curve) aCurv = BRep_Tool::Curve(anEdge, aTmpFirst, aTmpLast);
|
||||
GeomToStep_MakeCurve aMaker(aCurv);
|
||||
if (aMaker.IsDone())
|
||||
{
|
||||
anIdentifiedItem = aMaker.Value();
|
||||
}
|
||||
}
|
||||
if (anIdentifiedItem.IsNull())
|
||||
{
|
||||
return aResSA;
|
||||
}
|
||||
aResSA = new StepRepr_ShapeAspect();
|
||||
aResSA->Init(aName, aDescription, aPDS, StepData_LTrue);
|
||||
// Geometric_Item_Specific_Usage
|
||||
Handle(StepAP242_GeometricItemSpecificUsage) aGISU = new StepAP242_GeometricItemSpecificUsage();
|
||||
StepAP242_ItemIdentifiedRepresentationUsageDefinition aDefinition;
|
||||
aDefinition.SetValue(aResSA);
|
||||
Handle(StepRepr_HArray1OfRepresentationItem) anReprItems = new StepRepr_HArray1OfRepresentationItem(1, 1);
|
||||
|
||||
anIdentifiedItem->SetName(aName);
|
||||
theGISU = aGISU;
|
||||
anReprItems->SetValue(1, anIdentifiedItem);
|
||||
theGeomItems.Append(anIdentifiedItem);
|
||||
|
||||
// Set entities to model
|
||||
aGISU->Init(aName, aDescription, aDefinition, theCGRepr, anReprItems);
|
||||
aModel->AddWithRefs(aResSA);
|
||||
aModel->AddWithRefs(aGISU);
|
||||
return aResSA;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : WritePresentation
|
||||
//purpose : auxiliary (write annotation plane and presentation)
|
||||
@ -2958,14 +3072,14 @@ static void WriteDerivedGeometry (const Handle(XSControl_WorkSession) &WS,
|
||||
const Handle(StepRepr_ConstructiveGeometryRepresentation) theRepr,
|
||||
Handle(StepRepr_ShapeAspect)& theFirstSA,
|
||||
Handle(StepRepr_ShapeAspect)& theSecondSA,
|
||||
NCollection_Vector<Handle(StepGeom_CartesianPoint)>& thePnts)
|
||||
NCollection_Vector<Handle(StepGeom_GeometricRepresentationItem)>& theGeoms)
|
||||
{
|
||||
const Handle(Interface_InterfaceModel) &aModel = WS->Model();
|
||||
// First point
|
||||
if (theObject->HasPoint()) {
|
||||
GeomToStep_MakeCartesianPoint aPointMaker(theObject->GetPoint());
|
||||
Handle(StepGeom_CartesianPoint) aPoint = aPointMaker.Value();
|
||||
thePnts.Append(aPoint);
|
||||
theGeoms.Append(aPoint);
|
||||
Handle(StepRepr_DerivedShapeAspect) aDSA = new StepRepr_DerivedShapeAspect();
|
||||
aDSA->Init(new TCollection_HAsciiString(), new TCollection_HAsciiString(), theFirstSA->OfShape(), StepData_LFalse);
|
||||
Handle(StepAP242_GeometricItemSpecificUsage) aGISU = new StepAP242_GeometricItemSpecificUsage();
|
||||
@ -2985,7 +3099,7 @@ static void WriteDerivedGeometry (const Handle(XSControl_WorkSession) &WS,
|
||||
if (theObject->HasPoint2()) {
|
||||
GeomToStep_MakeCartesianPoint aPointMaker(theObject->GetPoint2());
|
||||
Handle(StepGeom_CartesianPoint) aPoint = aPointMaker.Value();
|
||||
thePnts.Append(aPoint);
|
||||
theGeoms.Append(aPoint);
|
||||
Handle(StepRepr_DerivedShapeAspect) aDSA = new StepRepr_DerivedShapeAspect();
|
||||
aDSA->Init(new TCollection_HAsciiString(), new TCollection_HAsciiString(), theFirstSA->OfShape(), StepData_LFalse);
|
||||
Handle(StepAP242_GeometricItemSpecificUsage) aGISU = new StepAP242_GeometricItemSpecificUsage();
|
||||
@ -3256,20 +3370,46 @@ void STEPCAFControl_Writer::WriteGeomTolerance (const Handle(XSControl_WorkSessi
|
||||
aLMWU->Init(aValueMember, aUnit);
|
||||
Model->AddWithRefs(aLMWU);
|
||||
|
||||
// Auxiliary entities for derived geometry
|
||||
Handle(StepRepr_ConstructiveGeometryRepresentation) aCGRepr =
|
||||
new StepRepr_ConstructiveGeometryRepresentation();
|
||||
Handle(StepRepr_ConstructiveGeometryRepresentationRelationship) aCGReprRel =
|
||||
new StepRepr_ConstructiveGeometryRepresentationRelationship();
|
||||
NCollection_Vector<Handle(StepGeom_GeometricRepresentationItem)> aConnectionGeometry;
|
||||
|
||||
// Geometric_Tolerance target
|
||||
Handle(StepRepr_ShapeAspect) aMainSA;
|
||||
Handle(StepRepr_RepresentationContext) dummyRC;
|
||||
Handle(StepAP242_GeometricItemSpecificUsage) dummyGISU;
|
||||
if (theShapeSeqL.Length() == 1) {
|
||||
TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(theShapeSeqL.Value(1));
|
||||
aMainSA = WriteShapeAspect(WS, theGeomTolL, aShape, dummyRC, dummyGISU);
|
||||
const TDF_Label& aShLabel = theShapeSeqL.Value(1);
|
||||
Handle(TDataStd_UAttribute) aSupAttr;
|
||||
TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(aShLabel);
|
||||
if (aShLabel.FindAttribute(XCAFDoc::SupplementalGeometryGUID(), aSupAttr))
|
||||
{
|
||||
aMainSA = WriteSupplementalGeometry(WS, aCGRepr, aShLabel, aShape, dummyRC, dummyGISU, aConnectionGeometry);
|
||||
}
|
||||
else
|
||||
{
|
||||
aMainSA = WriteShapeAspect(WS, theGeomTolL, aShape, dummyRC, dummyGISU);
|
||||
}
|
||||
Model->AddWithRefs(aMainSA);
|
||||
}
|
||||
else {
|
||||
Handle(StepRepr_CompositeShapeAspect) aCSA;
|
||||
for (Standard_Integer i = 1; i <= theShapeSeqL.Length(); i++) {
|
||||
TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(theShapeSeqL.Value(i));
|
||||
Handle(StepRepr_ShapeAspect) aSA = WriteShapeAspect(WS, theGeomTolL, aShape, dummyRC, dummyGISU);
|
||||
const TDF_Label& aShLabel = theShapeSeqL.Value(i);
|
||||
Handle(TDataStd_UAttribute) aSupAttr;
|
||||
TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(aShLabel);
|
||||
Handle(StepRepr_ShapeAspect) aSA;
|
||||
if (aShLabel.FindAttribute(XCAFDoc::SupplementalGeometryGUID(), aSupAttr))
|
||||
{
|
||||
aSA = WriteSupplementalGeometry(WS, aCGRepr, aShLabel, aShape, dummyRC, dummyGISU, aConnectionGeometry);
|
||||
}
|
||||
else
|
||||
{
|
||||
aSA = WriteShapeAspect(WS, theGeomTolL, aShape, dummyRC, dummyGISU);
|
||||
}
|
||||
if (aSA.IsNull())
|
||||
continue;
|
||||
if (aCSA.IsNull()) {
|
||||
@ -3283,6 +3423,17 @@ void STEPCAFControl_Writer::WriteGeomTolerance (const Handle(XSControl_WorkSessi
|
||||
}
|
||||
aMainSA = aCSA;
|
||||
}
|
||||
// Write Derived geometry
|
||||
if (aConnectionGeometry.Length() > 0)
|
||||
{
|
||||
Handle(StepRepr_HArray1OfRepresentationItem) anItems = new StepRepr_HArray1OfRepresentationItem(1, aConnectionGeometry.Length());
|
||||
for (Standard_Integer i = 0; i < aConnectionGeometry.Length(); i++)
|
||||
anItems->SetValue(i + 1, aConnectionGeometry(i));
|
||||
aCGRepr->Init(new TCollection_HAsciiString(), anItems, dummyRC);
|
||||
aCGReprRel->Init(new TCollection_HAsciiString(), new TCollection_HAsciiString(), dummyGISU->UsedRepresentation(), aCGRepr);
|
||||
Model->AddWithRefs(aCGReprRel);
|
||||
}
|
||||
|
||||
StepDimTol_GeometricToleranceTarget aGTTarget;
|
||||
aGTTarget.SetValue(aMainSA);
|
||||
|
||||
@ -3813,7 +3964,7 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTsAP242 (const Handle(XSControl_W
|
||||
new StepRepr_ConstructiveGeometryRepresentation();
|
||||
Handle(StepRepr_ConstructiveGeometryRepresentationRelationship) aCGReprRel =
|
||||
new StepRepr_ConstructiveGeometryRepresentationRelationship();
|
||||
NCollection_Vector<Handle(StepGeom_CartesianPoint)> aConnectionPnts;
|
||||
NCollection_Vector<Handle(StepGeom_GeometricRepresentationItem)> aConnectionGeometry;
|
||||
Handle(StepRepr_RepresentationContext) dummyRC;
|
||||
Handle(StepAP242_GeometricItemSpecificUsage) dummyGISU;
|
||||
for (Standard_Integer i = 1; i <= aDGTLabels.Length(); i++) {
|
||||
@ -3840,16 +3991,36 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTsAP242 (const Handle(XSControl_W
|
||||
// Write links with shapes
|
||||
Handle(StepRepr_ShapeAspect) aFirstSA, aSecondSA;
|
||||
if (aFirstShapeL.Length() == 1) {
|
||||
TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(aFirstShapeL.Value(1));
|
||||
aFirstSA = WriteShapeAspect(WS, aDimensionL, aShape, dummyRC, dummyGISU);
|
||||
const TDF_Label& aShLabel = aFirstShapeL.Value(1);
|
||||
TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(aShLabel);
|
||||
Handle(TDataStd_UAttribute) aSupAttr;
|
||||
if (aShLabel.FindAttribute(XCAFDoc::SupplementalGeometryGUID(), aSupAttr))
|
||||
{
|
||||
aFirstSA = WriteSupplementalGeometry(WS,aCGRepr, aShLabel, aShape, dummyRC, dummyGISU,aConnectionGeometry);
|
||||
}
|
||||
else
|
||||
{
|
||||
aFirstSA = WriteShapeAspect(WS, aDimensionL, aShape, dummyRC, dummyGISU);
|
||||
}
|
||||
if (aRC.IsNull() && !dummyRC.IsNull())
|
||||
aRC = dummyRC;
|
||||
}
|
||||
else if (aFirstShapeL.Length() > 1) {
|
||||
Handle(StepRepr_CompositeShapeAspect) aCSA;
|
||||
for (Standard_Integer shIt = 1; shIt <= aFirstShapeL.Length(); shIt++) {
|
||||
TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(aFirstShapeL.Value(shIt));
|
||||
Handle(StepRepr_ShapeAspect) aSA = WriteShapeAspect(WS, aDimensionL, aShape, dummyRC, dummyGISU);
|
||||
for (Standard_Integer shIt = 1; shIt <= aFirstShapeL.Length(); shIt++)
|
||||
{
|
||||
const TDF_Label& aShLabel = aFirstShapeL.Value(shIt);
|
||||
TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(aShLabel);
|
||||
Handle(TDataStd_UAttribute) aSupAttr;
|
||||
Handle(StepRepr_ShapeAspect) aSA;
|
||||
if (aShLabel.FindAttribute(XCAFDoc::SupplementalGeometryGUID(), aSupAttr))
|
||||
{
|
||||
aSA = WriteSupplementalGeometry(WS, aCGRepr, aShLabel, aShape, dummyRC, dummyGISU, aConnectionGeometry);
|
||||
}
|
||||
else
|
||||
{
|
||||
aSA = WriteShapeAspect(WS, aDimensionL, aShape, dummyRC, dummyGISU);
|
||||
}
|
||||
if (aSA.IsNull())
|
||||
continue;
|
||||
if (aCSA.IsNull()) {
|
||||
@ -3866,16 +4037,35 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTsAP242 (const Handle(XSControl_W
|
||||
aFirstSA = aCSA;
|
||||
}
|
||||
if (aSecondShapeL.Length() == 1) {
|
||||
TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(aSecondShapeL.Value(1));
|
||||
aSecondSA = WriteShapeAspect(WS, aDimensionL, aShape, dummyRC, dummyGISU);
|
||||
const TDF_Label& aShLabel = aSecondShapeL.Value(1);
|
||||
TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(aShLabel);
|
||||
Handle(TDataStd_UAttribute) aSupAttr;
|
||||
if (aShLabel.FindAttribute(XCAFDoc::SupplementalGeometryGUID(), aSupAttr))
|
||||
{
|
||||
aSecondSA = WriteSupplementalGeometry(WS, aCGRepr, aShLabel, aShape, dummyRC, dummyGISU, aConnectionGeometry);
|
||||
}
|
||||
else
|
||||
{
|
||||
aSecondSA = WriteShapeAspect(WS, aDimensionL, aShape, dummyRC, dummyGISU);
|
||||
}
|
||||
if (aRC.IsNull() && !dummyRC.IsNull())
|
||||
aRC = dummyRC;
|
||||
}
|
||||
else if (aSecondShapeL.Length() > 1) {
|
||||
Handle(StepRepr_CompositeShapeAspect) aCSA;
|
||||
for (Standard_Integer shIt = 1; shIt <= aSecondShapeL.Length(); shIt++) {
|
||||
TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(aSecondShapeL.Value(shIt));
|
||||
Handle(StepRepr_ShapeAspect) aSA = WriteShapeAspect(WS, aDimensionL, aShape, dummyRC, dummyGISU);
|
||||
const TDF_Label& aShLabel = aSecondShapeL.Value(shIt);
|
||||
TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(aShLabel);
|
||||
Handle(TDataStd_UAttribute) aSupAttr;
|
||||
Handle(StepRepr_ShapeAspect) aSA;
|
||||
if (aShLabel.FindAttribute(XCAFDoc::SupplementalGeometryGUID(), aSupAttr))
|
||||
{
|
||||
aSA = WriteSupplementalGeometry(WS, aCGRepr, aShLabel, aShape, dummyRC, dummyGISU, aConnectionGeometry);
|
||||
}
|
||||
else
|
||||
{
|
||||
aSA = WriteShapeAspect(WS, aDimensionL, aShape, dummyRC, dummyGISU);
|
||||
}
|
||||
if (aCSA.IsNull() && !aSA.IsNull())
|
||||
{
|
||||
aCSA = new StepRepr_CompositeShapeAspect();
|
||||
@ -3902,7 +4092,7 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTsAP242 (const Handle(XSControl_W
|
||||
// Write dimensions
|
||||
StepShape_DimensionalCharacteristic aDimension;
|
||||
if (anObject->HasPoint() || anObject->HasPoint2())
|
||||
WriteDerivedGeometry(WS, anObject, aCGRepr, aFirstSA, aSecondSA, aConnectionPnts);
|
||||
WriteDerivedGeometry(WS, anObject, aCGRepr, aFirstSA, aSecondSA, aConnectionGeometry);
|
||||
XCAFDimTolObjects_DimensionType aDimType = anObject->GetType();
|
||||
if (STEPCAFControl_GDTProperty::IsDimensionalLocation(aDimType)) {
|
||||
// Dimensional_Location
|
||||
@ -3972,10 +4162,10 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTsAP242 (const Handle(XSControl_W
|
||||
anObject->GetPlane(), anObject->GetPointTextAttach(), aDimension.Value());
|
||||
}
|
||||
// Write Derived geometry
|
||||
if (aConnectionPnts.Length() > 0) {
|
||||
Handle(StepRepr_HArray1OfRepresentationItem) anItems = new StepRepr_HArray1OfRepresentationItem(1, aConnectionPnts.Length());
|
||||
for (Standard_Integer i = 0; i < aConnectionPnts.Length(); i++)
|
||||
anItems->SetValue(i + 1, aConnectionPnts(i));
|
||||
if (aConnectionGeometry.Length() > 0) {
|
||||
Handle(StepRepr_HArray1OfRepresentationItem) anItems = new StepRepr_HArray1OfRepresentationItem(1, aConnectionGeometry.Length());
|
||||
for (Standard_Integer i = 0; i < aConnectionGeometry.Length(); i++)
|
||||
anItems->SetValue(i + 1, aConnectionGeometry(i));
|
||||
aCGRepr->Init(new TCollection_HAsciiString(), anItems, dummyRC);
|
||||
aCGReprRel->Init(new TCollection_HAsciiString(), new TCollection_HAsciiString(), dummyGISU->UsedRepresentation(), aCGRepr);
|
||||
aModel->AddWithRefs(aCGReprRel);
|
||||
|
@ -43,6 +43,35 @@ const Standard_GUID& XCAFDoc::AssemblyGUID ()
|
||||
return ID;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SupplementalContainerGUID
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const Standard_GUID& XCAFDoc::SupplementalContainerGUID()
|
||||
{
|
||||
static const Standard_GUID ID("da071945-9557-41b4-9e44-19e649f98b54");
|
||||
return ID;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SupplementalRefGUID
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const Standard_GUID& XCAFDoc::SupplementalRefGUID()
|
||||
{
|
||||
static const Standard_GUID ID("85a1b8d7-0936-4e8b-a953-a8bd7731411a");
|
||||
return ID;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SupplementalGeometryGUID
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const Standard_GUID& XCAFDoc::SupplementalGeometryGUID()
|
||||
{
|
||||
static const Standard_GUID ID("e17cce33-1aa2-4b7f-9060-6e469a7954a9");
|
||||
return ID;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ExternRefGUID
|
||||
|
@ -72,6 +72,15 @@ public:
|
||||
|
||||
//! Returns GUID for TreeNode representing assembly link
|
||||
Standard_EXPORT static const Standard_GUID& ShapeRefGUID();
|
||||
|
||||
//! Returns GUID for TreeNode representing compound of supplemental geometry
|
||||
Standard_EXPORT static const Standard_GUID& SupplementalContainerGUID();
|
||||
|
||||
//! Returns GUID for TreeNode representing reference for supplemental geometry
|
||||
Standard_EXPORT static const Standard_GUID& SupplementalRefGUID();
|
||||
|
||||
//! Returns GUID for TreeNode representing supplemental geometry
|
||||
Standard_EXPORT static const Standard_GUID& SupplementalGeometryGUID();
|
||||
|
||||
//! Return GUIDs for TreeNode representing specified types of colors
|
||||
Standard_EXPORT static const Standard_GUID& ColorRefGUID (const XCAFDoc_ColorType type);
|
||||
|
Loading…
x
Reference in New Issue
Block a user