1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-08 14:17:06 +03:00

Compare commits

...

6 Commits

Author SHA1 Message Date
dpasukhi
706b94cc6d 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.
2022-11-15 19:48:11 +00:00
dpasukhi
3e1adab2d9 Data Exchange, Step Import - Incorrect computing of PMI text location
Fixed problem with too large box of the representation. In this case incorrect annotation plane is used as internal location.
2022-03-03 13:20:54 +03:00
dpasukhi
fcdfd45836 0032731: Data Exchange, Step Import - Incorrect PMI text location
Added new complex Entity for representation of PMI
Added moving the presentation with new entity
2022-02-01 13:38:08 +03:00
mgn
3bd2f8ebbe Fixed mapping the given an interactive object and a corresponding status passed in the setObjectStatus method. 2021-02-25 17:56:33 +03:00
kgv
49c3828bcf 0032168: Visualization - Wrong computation of screen axis in V3d_View::SetTwist method
Fixed wrong axis check.
2021-02-25 17:29:04 +03:00
jgv
19f77300a8 Fix of regression in Extrema, improvement in 3D offset. 2021-02-25 15:20:48 +03:00
22 changed files with 1068 additions and 172 deletions

View File

@@ -2440,7 +2440,7 @@ void AIS_InteractiveContext::setObjectStatus (const Handle(AIS_InteractiveObject
{
if (theStatus != AIS_DS_None)
{
Handle(AIS_GlobalStatus) aStatus = new AIS_GlobalStatus (AIS_DS_Displayed, theDispMode, theSelectionMode);
Handle(AIS_GlobalStatus) aStatus = new AIS_GlobalStatus (theStatus, theDispMode, theSelectionMode);
myObjects.Bind (theIObj, aStatus);
}
else

View File

@@ -3115,12 +3115,23 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
}
else
{
Standard_Real FaceDU = UF2 - UF1;
Standard_Real FaceDV = VF2 - VF1;
UU1 = UF1 - 10*FaceDU;
UU2 = UF2 + 10*FaceDU;
VV1 = VF1 - 10*FaceDV;
VV2 = VF2 + 10*FaceDV;
if (theExtensionMode == 2)
{
Standard_Real FaceDU = UF2 - UF1;
Standard_Real FaceDV = VF2 - VF1;
UU1 = UF1 - 10*FaceDU;
UU2 = UF2 + 10*FaceDU;
VV1 = VF1 - 10*FaceDV;
VV2 = VF2 + 10*FaceDV;
}
else
{
Standard_Real aSize = theLenBeforeUfirst;
UU1 = UF1 - aSize;
UU2 = UF2 + aSize;
VV1 = VF1 - aSize;
VV2 = VF2 + aSize;
}
coeff = 1.;
}

View File

@@ -526,6 +526,8 @@
#include <RWStepVisual_RWPresentationStyleByContext.hxx>
#include <RWStepVisual_RWPresentationView.hxx>
#include <RWStepVisual_RWPresentedItemRepresentation.hxx>
#include <RWStepVisual_RWRepositionedTessellatedGeometricSet.hxx>
#include <RWStepVisual_RWRepositionedTessellatedItem.hxx>
#include <RWStepVisual_RWStyledItem.hxx>
#include <RWStepVisual_RWSurfaceSideStyle.hxx>
#include <RWStepVisual_RWSurfaceStyleBoundary.hxx>
@@ -1082,6 +1084,8 @@
#include <StepVisual_PresentationStyleByContext.hxx>
#include <StepVisual_PresentationView.hxx>
#include <StepVisual_PresentedItemRepresentation.hxx>
#include <StepVisual_RepositionedTessellatedGeometricSet.hxx>
#include <StepVisual_RepositionedTessellatedItem.hxx>
#include <StepVisual_StyledItem.hxx>
#include <StepVisual_SurfaceSideStyle.hxx>
#include <StepVisual_SurfaceStyleBoundary.hxx>
@@ -5193,6 +5197,13 @@ void RWStepAP214_GeneralModule::FillSharedCase(const Standard_Integer CN,
tool.Share(anent, iter);
}
break;
case 802:
{
DeclareAndCast(StepVisual_RepositionedTessellatedGeometricSet, anEnt, ent);
RWStepVisual_RWRepositionedTessellatedGeometricSet aTool;
aTool.Share(anEnt, iter);
break;
}
default : break;
}
}
@@ -7217,6 +7228,12 @@ Standard_Boolean RWStepAP214_GeneralModule::NewVoid
case 723:
ent = new StepVisual_SurfaceStyleRenderingWithProperties;
break;
case 802:
ent = new StepVisual_RepositionedTessellatedGeometricSet;
break;
case 803:
ent = new StepVisual_RepositionedTessellatedItem;
break;
default:
return Standard_False;
}
@@ -7819,7 +7836,8 @@ Standard_Integer RWStepAP214_GeneralModule::CategoryNumber
case 721:
case 722:
case 723: return catdr;
case 802: return cataux;
case 803: return cataux;
default : break;
}
return 0;

View File

@@ -258,6 +258,8 @@ IMPLEMENT_STANDARD_RTTIEXT(RWStepAP214_ReadWriteModule,StepData_ReadWriteModule)
#include <StepVisual_PresentationStyleAssignment.hxx>
#include <StepVisual_PresentationStyleByContext.hxx>
#include <StepVisual_PresentationView.hxx>
#include <StepVisual_RepositionedTessellatedGeometricSet.hxx>
#include <StepVisual_RepositionedTessellatedItem.hxx>
#include <StepBasic_Product.hxx>
#include <StepBasic_ProductCategory.hxx>
#include <StepBasic_ProductContext.hxx>
@@ -654,6 +656,8 @@ IMPLEMENT_STANDARD_RTTIEXT(RWStepAP214_ReadWriteModule,StepData_ReadWriteModule)
#include <RWStepVisual_RWPresentationStyleAssignment.hxx>
#include <RWStepVisual_RWPresentationStyleByContext.hxx>
#include <RWStepVisual_RWPresentationView.hxx>
#include <RWStepVisual_RWRepositionedTessellatedGeometricSet.hxx>
#include <RWStepVisual_RWRepositionedTessellatedItem.hxx>
#include <RWStepBasic_RWProduct.hxx>
#include <RWStepBasic_RWProductCategory.hxx>
#include <RWStepBasic_RWProductContext.hxx>
@@ -2047,6 +2051,8 @@ static TCollection_AsciiString Reco_AnnotationPlane("ANNOTATION_PLANE");
static TCollection_AsciiString Reco_TessellatedAnnotationOccurrence("TESSELLATED_ANNOTATION_OCCURRENCE");
static TCollection_AsciiString Reco_TessellatedGeometricSet("TESSELLATED_GEOMETRIC_SET");
static TCollection_AsciiString Reco_TessellatedCurveSet("TESSELLATED_CURVE_SET");
static TCollection_AsciiString Reco_TessellatedItem("TESSELLATED_ITEM");
static TCollection_AsciiString Reco_RepositionedTessellatedItem("REPOSITIONED_TESSELLATED_ITEM");
static TCollection_AsciiString Reco_CoordinatesList("COORDINATES_LIST");
static TCollection_AsciiString Reco_ConstructiveGeometryRepresentation("CONSTRUCTIVE_GEOMETRY_REPRESENTATION");
static TCollection_AsciiString Reco_ConstructiveGeometryRepresentationRelationship("CONSTRUCTIVE_GEOMETRY_REPRESENTATION_RELATIONSHIP");
@@ -2721,6 +2727,7 @@ RWStepAP214_ReadWriteModule::RWStepAP214_ReadWriteModule ()
typenums.Bind (Reco_SurfaceStyleReflectanceAmbient, 721);
typenums.Bind (Reco_SurfaceStyleRendering, 722);
typenums.Bind (Reco_SurfaceStyleRenderingWithProperties, 723);
typenums.Bind (Reco_RepositionedTessellatedItem, 803);
// SHORT NAMES
// NB : la liste est celle de AP203
@@ -3489,13 +3496,22 @@ Standard_Integer RWStepAP214_ReadWriteModule::CaseStep
types(5).IsEqual(StepType(624))))) {
return 705;
}
if ((types(1).IsEqual(StepType(4))) &&
else if ((types(1).IsEqual(StepType(4))) &&
(types(2).IsEqual(StepType(7))) &&
(types(3).IsEqual(StepType(144))) &&
(types(4).IsEqual(StepType(247))) &&
(types(5).IsEqual(StepType(270)))) {
(types(5).IsEqual(StepType(270))))
{
return 719;
}
else if ((types(1).IsEqual(StepType(144))) &&
(types(2).IsEqual(StepType(803))) &&
(types(3).IsEqual(StepType(247))) &&
(types(4).IsEqual(StepType(709))) &&
(types(5).IsEqual(StepType(708))))
{
return 802;
}
}
else if (NbComp == 4) {
if ((types(1).IsEqual(StepType(161))) &&
@@ -4565,6 +4581,7 @@ const TCollection_AsciiString& RWStepAP214_ReadWriteModule::StepType
case 704: return Reco_AnnotationPlane;
case 707 : return Reco_TessellatedAnnotationOccurrence;
case 708 : return Reco_TessellatedItem;
case 709 : return Reco_TessellatedGeometricSet;
case 710 : return Reco_TessellatedCurveSet;
@@ -4581,6 +4598,7 @@ const TCollection_AsciiString& RWStepAP214_ReadWriteModule::StepType
case 722 : return Reco_SurfaceStyleRendering;
case 723 : return Reco_SurfaceStyleRenderingWithProperties;
case 803: return Reco_RepositionedTessellatedItem;
default : return PasReco;
}
}
@@ -4864,7 +4882,6 @@ Standard_Boolean RWStepAP214_ReadWriteModule::ComplexType(const Standard_Integer
types.Append (StepType(625));
types.Append (StepType(677));
break;
default : return Standard_False;
case 698:
types.Append (StepType(671));
types.Append (StepType(470));
@@ -4902,6 +4919,14 @@ Standard_Boolean RWStepAP214_ReadWriteModule::ComplexType(const Standard_Integer
types.Append(StepType(247));
types.Append(StepType(270));
break;
case 802:
types.Append(StepType(144));
types.Append(StepType(803));
types.Append(StepType(247));
types.Append(StepType(709));
types.Append(StepType(708));
break;
default: return Standard_False;
}
return Standard_True;
}
@@ -9508,6 +9533,20 @@ void RWStepAP214_ReadWriteModule::ReadStep(const Standard_Integer CN,
tool.ReadStep(data, num, ach, anent);
}
break;
case 802:
{
DeclareAndCast(StepVisual_RepositionedTessellatedGeometricSet, anEnt, ent);
RWStepVisual_RWRepositionedTessellatedGeometricSet aTool;
aTool.ReadStep(data, num, ach, anEnt);
break;
}
case 803:
{
DeclareAndCast(StepVisual_RepositionedTessellatedItem, anEnt, ent);
RWStepVisual_RWRepositionedTessellatedItem aTool;
aTool.ReadStep(data, num, ach, anEnt);
break;
}
default:
ach->AddFail("Type Mismatch when reading - Entity");
@@ -14392,6 +14431,21 @@ void RWStepAP214_ReadWriteModule::WriteStep(const Standard_Integer CN,
tool.WriteStep(SW, anent);
}
break;
break;
case 802:
{
DeclareAndCast(StepVisual_RepositionedTessellatedGeometricSet, anEnt, ent);
RWStepVisual_RWRepositionedTessellatedGeometricSet aTool;
aTool.WriteStep(SW, anEnt);
break;
}
case 803:
{
DeclareAndCast(StepVisual_RepositionedTessellatedItem, anEnt, ent);
RWStepVisual_RWRepositionedTessellatedItem aTool;
aTool.WriteStep(SW, anEnt);
break;
}
default:
return;
}

View File

@@ -106,6 +106,10 @@ RWStepVisual_RWPresentationView.cxx
RWStepVisual_RWPresentationView.hxx
RWStepVisual_RWPresentedItemRepresentation.cxx
RWStepVisual_RWPresentedItemRepresentation.hxx
RWStepVisual_RWRepositionedTessellatedGeometricSet.cxx
RWStepVisual_RWRepositionedTessellatedGeometricSet.hxx
RWStepVisual_RWRepositionedTessellatedItem.cxx
RWStepVisual_RWRepositionedTessellatedItem.hxx
RWStepVisual_RWStyledItem.cxx
RWStepVisual_RWStyledItem.hxx
RWStepVisual_RWSurfaceSideStyle.cxx

View File

@@ -0,0 +1,99 @@
// Copyright (c) 2022 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 <RWStepVisual_RWRepositionedTessellatedGeometricSet.hxx>
#include <Interface_Check.hxx>
#include <Interface_EntityIterator.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
#include <StepRepr_RepresentationItem.hxx>
#include <StepVisual_HArray1OfPresentationStyleAssignment.hxx>
#include <StepVisual_PresentationStyleAssignment.hxx>
#include <StepVisual_RepositionedTessellatedGeometricSet.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
//=======================================================================
//function : ReadStep
//purpose :
//=======================================================================
void RWStepVisual_RWRepositionedTessellatedGeometricSet::ReadStep
(const Handle(StepData_StepReaderData)& theData,
const Standard_Integer theNum,
Handle(Interface_Check)& theAch,
const Handle(StepVisual_RepositionedTessellatedGeometricSet)& theEnt) const
{
Standard_Integer aNum = 0;
theData->NamedForComplex("REPOSITIONED_TESSELLATED_ITEM", theNum, aNum, theAch);
if (!theData->CheckNbParams(aNum, 1, theAch, "location"))
return;
Handle(StepGeom_Axis2Placement3d) aLocation;
theData->ReadEntity(aNum,1,"location",theAch,STANDARD_TYPE(StepGeom_Axis2Placement3d), aLocation);
theData->NamedForComplex("REPRESENTATION_ITEM", theNum, aNum, theAch);
if (!theData->CheckNbParams(aNum, 1, theAch, "name"))
return;
Handle(TCollection_HAsciiString) aName;
theData->ReadString (aNum, 1, "name", theAch, aName);
theData->NamedForComplex("TESSELLATED_GEOMETRIC_SET", theNum, aNum, theAch);
NCollection_Handle<StepVisual_Array1OfTessellatedItem> anItems;
Standard_Integer aNSub2;
if (theData->ReadSubList (aNum,1,"items",theAch,aNSub2)) {
Standard_Integer aNb2 = theData->NbParams(aNSub2);
anItems = new StepVisual_Array1OfTessellatedItem(1, aNb2);
for (Standard_Integer i2 = 1; i2 <= aNb2; i2 ++) {
Handle(StepVisual_TessellatedItem) anItem;
if (theData->ReadEntity (aNSub2,i2,"item",theAch,STANDARD_TYPE(StepVisual_TessellatedItem), anItem))
anItems->SetValue(i2,anItem);
}
}
theEnt->Init(aName, anItems, aLocation);
}
//=======================================================================
//function : WriteStep
//purpose :
//=======================================================================
void RWStepVisual_RWRepositionedTessellatedGeometricSet::WriteStep
(StepData_StepWriter& theSW,
const Handle(StepVisual_RepositionedTessellatedGeometricSet)& theEnt) const
{
theSW.StartEntity("GEOMETRIC_REPRESENTATION_ITEM");
theSW.StartEntity("REPOSITIONED_TESSELLATED_ITEM");
theSW.Send(theEnt->Location());
theSW.StartEntity("REPRESENTATION_ITEM");
theSW.Send(theEnt->Name());
theSW.StartEntity("TESSELLATED_GEOMETRIC_SET");
theSW.OpenSub();
for(StepVisual_Array1OfTessellatedItem::Iterator anIter(*theEnt->Items());
anIter.More(); anIter.Next())
{
theSW.Send(anIter.Value());
}
theSW.CloseSub();
theSW.StartEntity("TESSELLATED_ITEM");
}
//=======================================================================
//function : Share
//purpose :
//=======================================================================
void RWStepVisual_RWRepositionedTessellatedGeometricSet::Share(const Handle(StepVisual_RepositionedTessellatedGeometricSet)& theEnt,
Interface_EntityIterator& theIter) const
{
// Own field : children
for (Standard_Integer i = 1; i <= theEnt->Items()->Length(); i++)
theIter.AddItem(theEnt->Items()->Value(i));
theIter.AddItem(theEnt->Location());
}

View File

@@ -0,0 +1,50 @@
// Copyright (c) 2022 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 _RWStepVisual_RWRepositionedTessellatedGeometricSet_HeaderFile
#define _RWStepVisual_RWRepositionedTessellatedGeometricSet_HeaderFile
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
class StepData_StepReaderData;
class Interface_Check;
class StepVisual_RepositionedTessellatedGeometricSet;
class StepData_StepWriter;
class Interface_EntityIterator;
//! Read & Write tool for complex RepositionedTessellatedGeometricSet
class RWStepVisual_RWRepositionedTessellatedGeometricSet
{
public:
DEFINE_STANDARD_ALLOC
//! Empty constructor
RWStepVisual_RWRepositionedTessellatedGeometricSet() {};
//! Reads RepositionedTessellatedGeometricSet
Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& theData,
const Standard_Integer theNum,
Handle(Interface_Check)& theAch,
const Handle(StepVisual_RepositionedTessellatedGeometricSet)& theEnt) const;
//! Writes RepositionedTessellatedGeometricSet
Standard_EXPORT void WriteStep (StepData_StepWriter& theSW,
const Handle(StepVisual_RepositionedTessellatedGeometricSet)& theEnt) const;
//! Fills data for graph (shared items)
Standard_EXPORT void Share (const Handle(StepVisual_RepositionedTessellatedGeometricSet)& theEnt,
Interface_EntityIterator& theIter) const;
};
#endif // _RWStepVisual_RWRepositionedTessellatedGeometricSet_HeaderFile

View File

@@ -0,0 +1,58 @@
// Copyright (c) 2022 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 <RWStepVisual_RWRepositionedTessellatedItem.hxx>
#include <Interface_Check.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
#include <StepVisual_RepositionedTessellatedItem.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
//=======================================================================
//function : ReadStep
//purpose :
//=======================================================================
void RWStepVisual_RWRepositionedTessellatedItem::ReadStep
(const Handle(StepData_StepReaderData)& theData,
const Standard_Integer theNum,
Handle(Interface_Check)& theAch,
const Handle(StepVisual_RepositionedTessellatedItem)& theEnt) const
{
// --- Number of Parameter Control ---
if (!theData->CheckNbParams(theNum,2,theAch,"tessellated_item"))
return;
// --- inherited field : name ---
Handle(TCollection_HAsciiString) aName;
theData->ReadString (theNum,1,"name",theAch,aName);
// --- inherited field : location ---
Handle(StepGeom_Axis2Placement3d) aLocation;
theData->ReadEntity(theNum,2,"location", theAch, STANDARD_TYPE(StepGeom_Axis2Placement3d),aLocation);
//--- Initialisation of the read entity ---
theEnt->Init(aName, aLocation);
}
//=======================================================================
//function : WriteStep
//purpose :
//=======================================================================
void RWStepVisual_RWRepositionedTessellatedItem::WriteStep
(StepData_StepWriter& theSW,
const Handle(StepVisual_RepositionedTessellatedItem)& theEnt) const
{
// --- inherited field name ---
theSW.Send(theEnt->Name());
theSW.Send(theEnt->Location());
}

View File

@@ -0,0 +1,46 @@
// Copyright (c) 2022 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 _RWStepVisual_RWRepositionedTessellatedItem_HeaderFile
#define _RWStepVisual_RWRepositionedTessellatedItem_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
class StepData_StepReaderData;
class Interface_Check;
class StepVisual_RepositionedTessellatedItem;
class StepData_StepWriter;
//! Read & Write tool for RepositionedTessellatedItem
class RWStepVisual_RWRepositionedTessellatedItem
{
public:
DEFINE_STANDARD_ALLOC
//! Empty constructor
RWStepVisual_RWRepositionedTessellatedItem() {};
//! Reads RepositionedTessellatedItem
Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& theData,
const Standard_Integer theNum,
Handle(Interface_Check)& theAch,
const Handle(StepVisual_RepositionedTessellatedItem)& theEnt) const;
//! Writes RepositionedTessellatedItem
Standard_EXPORT void WriteStep (StepData_StepWriter& theSW,
const Handle(StepVisual_RepositionedTessellatedItem)& theEnt) const;
};
#endif // _RWStepVisual_RWRepositionedTessellatedItem_HeaderFile

View File

@@ -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>
@@ -203,6 +207,7 @@
#include <StepVisual_PlanarBox.hxx>
#include <StepVisual_PresentationLayerAssignment.hxx>
#include <StepVisual_PresentationStyleByContext.hxx>
#include <StepVisual_RepositionedTessellatedGeometricSet.hxx>
#include <StepVisual_StyleContextSelect.hxx>
#include <StepVisual_StyledItem.hxx>
#include <StepVisual_ViewVolume.hxx>
@@ -752,7 +757,6 @@ Standard_Boolean STEPCAFControl_Reader::Transfer (STEPControl_Reader &reader,
// Update assembly compounds
STool->UpdateAssemblies();
return Standard_True;
}
@@ -1850,6 +1854,25 @@ Standard_Boolean readPMIPresentation(const Handle(Standard_Transient)& thePresen
Handle(StepVisual_TessellatedGeometricSet) aTessSet = Handle(StepVisual_TessellatedGeometricSet)::DownCast(aTessItem);
if (aTessSet.IsNull())
continue;
gp_Trsf aTransf;
if (aTessSet->IsKind(STANDARD_TYPE(StepVisual_RepositionedTessellatedGeometricSet)))
{
Handle(StepVisual_RepositionedTessellatedGeometricSet) aRTGS =
Handle(StepVisual_RepositionedTessellatedGeometricSet)::DownCast(aTessSet);
Handle(Geom_Axis2Placement) aLocation = StepToGeom::MakeAxis2Placement(aRTGS->Location());
if (!aLocation.IsNull())
{
const gp_Ax3 anAx3Orig = gp::XOY();
const gp_Ax3 anAx3Targ(aLocation->Ax2());
if (anAx3Targ.Location().SquareDistance(anAx3Orig.Location()) >= Precision::SquareConfusion() ||
!anAx3Targ.Direction().IsEqual(anAx3Orig.Direction(), Precision::Angular()) ||
!anAx3Targ.XDirection().IsEqual(anAx3Orig.XDirection(), Precision::Angular()) ||
!anAx3Targ.YDirection().IsEqual(anAx3Orig.YDirection(), Precision::Angular()))
{
aTransf.SetTransformation(anAx3Targ, anAx3Orig);
}
}
}
NCollection_Handle<StepVisual_Array1OfTessellatedItem> aListItems = aTessSet->Items();
Standard_Integer nb = aListItems.IsNull() ? 0 : aListItems->Length();
Handle(StepVisual_TessellatedCurveSet) aTessCurve;
@@ -1895,7 +1918,7 @@ Standard_Boolean readPMIPresentation(const Handle(Standard_Transient)& thePresen
}
aB.Add(aComp, aCurW);
}
anAnnotationShape = aComp;
anAnnotationShape = aComp.Moved(aTransf);
}
if (!anAnnotationShape.IsNull())
{
@@ -2023,12 +2046,7 @@ void readAnnotation(const Handle(XSControl_TransferReader)& theTR,
{
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
aBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
if (isHasPlane && !aBox.IsOut(aPlaneAxes.Location())) {
aPtext = aPlaneAxes.Location();
}
else {
aPtext = gp_Pnt((aXmin + aXmax) * 0.5, (aYmin + aYmax) * 0.5, (aZmin + aZmax) * 0.5);
}
aPtext = gp_Pnt((aXmin + aXmax) * 0.5, (aYmin + aYmax) * 0.5, (aZmin + aZmax) * 0.5);
}
else {
aPtext = aPlaneAxes.Location();
@@ -2056,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
@@ -2088,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);
}
}
}
@@ -2777,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)))
@@ -3067,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())
@@ -3186,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

View File

@@ -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;

View File

@@ -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);

View File

@@ -738,6 +738,8 @@ static Standard_CString schemaAP242DIS = "AP242_MANAGED_MODEL_BASED_3D_ENGINEERI
#include <StepVisual_TessellatedItem.hxx>
#include <StepVisual_TessellatedGeometricSet.hxx>
#include <StepVisual_TessellatedCurveSet.hxx>
#include <StepVisual_RepositionedTessellatedGeometricSet.hxx>
#include <StepVisual_RepositionedTessellatedItem.hxx>
#include <StepVisual_CoordinatesList.hxx>
#include <StepRepr_CharacterizedRepresentation.hxx>
#include <StepRepr_ConstructiveGeometryRepresentation.hxx>
@@ -756,7 +758,7 @@ static Standard_CString schemaAP242DIS = "AP242_MANAGED_MODEL_BASED_3D_ENGINEERI
#include <StepVisual_SurfaceStyleRenderingWithProperties.hxx>
static int THE_StepAP214_Protocol_init = 0;
static Interface_DataMapOfTransientInteger types(800);
static Interface_DataMapOfTransientInteger types(803);
//=======================================================================
//function : StepAP214_Protocol
@@ -1468,6 +1470,8 @@ StepAP214_Protocol::StepAP214_Protocol ()
types.Bind (STANDARD_TYPE(StepVisual_SurfaceStyleReflectanceAmbient), 721);
types.Bind (STANDARD_TYPE(StepVisual_SurfaceStyleRendering), 722);
types.Bind (STANDARD_TYPE(StepVisual_SurfaceStyleRenderingWithProperties), 723);
types.Bind(STANDARD_TYPE(StepVisual_RepositionedTessellatedGeometricSet), 802);
types.Bind(STANDARD_TYPE(StepVisual_RepositionedTessellatedItem), 803);
}

View File

@@ -197,6 +197,10 @@ StepVisual_PresentedItemRepresentation.cxx
StepVisual_PresentedItemRepresentation.hxx
StepVisual_RenderingPropertiesSelect.cxx
StepVisual_RenderingPropertiesSelect.hxx
StepVisual_RepositionedTessellatedGeometricSet.hxx
StepVisual_RepositionedTessellatedGeometricSet.cxx
StepVisual_RepositionedTessellatedItem.hxx
StepVisual_RepositionedTessellatedItem.cxx
StepVisual_ShadingSurfaceMethod.hxx
StepVisual_StyleContextSelect.cxx
StepVisual_StyleContextSelect.hxx

View File

@@ -0,0 +1,30 @@
// Copyright (c) 2022 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 <StepVisual_RepositionedTessellatedGeometricSet.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
IMPLEMENT_STANDARD_RTTIEXT(StepVisual_RepositionedTessellatedGeometricSet, StepVisual_TessellatedGeometricSet)
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void StepVisual_RepositionedTessellatedGeometricSet::Init(const Handle(TCollection_HAsciiString)& theName,
const NCollection_Handle<StepVisual_Array1OfTessellatedItem>& theItems,
const Handle(StepGeom_Axis2Placement3d)& theLocation)
{
StepVisual_TessellatedGeometricSet::Init(theName, theItems);
myLocation = theLocation;
}

View File

@@ -0,0 +1,50 @@
// Copyright (c) 2022 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 _StepVisual_RepositionedTessellatedGeometricSet_HeaderFile
#define _StepVisual_RepositionedTessellatedGeometricSet_HeaderFile
#include <StepVisual_TessellatedGeometricSet.hxx>
class StepGeom_Axis2Placement3d;
DEFINE_STANDARD_HANDLE(StepVisual_RepositionedTessellatedGeometricSet, StepVisual_TessellatedGeometricSet)
//! Representation of complex STEP entity RepositionedTessellatedGeometricSet
class StepVisual_RepositionedTessellatedGeometricSet : public StepVisual_TessellatedGeometricSet
{
public:
DEFINE_STANDARD_ALLOC
DEFINE_STANDARD_RTTIEXT(StepVisual_RepositionedTessellatedGeometricSet, StepVisual_TessellatedGeometricSet)
//! Default constructor
StepVisual_RepositionedTessellatedGeometricSet() {};
//! Initialize all fields (own and inherited)
Standard_EXPORT void Init(const Handle(TCollection_HAsciiString)& theName,
const NCollection_Handle<StepVisual_Array1OfTessellatedItem>& theItems,
const Handle(StepGeom_Axis2Placement3d)& theLocation);
//! Returns location
Handle(StepGeom_Axis2Placement3d) Location() const { return myLocation; }
//! Sets location
void SetLocation(const Handle(StepGeom_Axis2Placement3d)& theLocation) { myLocation = theLocation; }
private:
Handle(StepGeom_Axis2Placement3d) myLocation;
};
#endif // StepVisual_RepositionedTessellatedGeometricSet_HeaderFile

View File

@@ -0,0 +1,29 @@
// Copyright (c) 2022 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 <StepVisual_RepositionedTessellatedItem.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
IMPLEMENT_STANDARD_RTTIEXT(StepVisual_RepositionedTessellatedItem, StepVisual_TessellatedItem)
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void StepVisual_RepositionedTessellatedItem::Init(const Handle(TCollection_HAsciiString)& theName,
const Handle(StepGeom_Axis2Placement3d)& theLocation)
{
StepVisual_TessellatedItem::Init(theName);
myLocation = theLocation;
}

View File

@@ -0,0 +1,49 @@
// Copyright (c) 2022 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 _StepVisual_RepositionedTessellatedItem_HeaderFile
#define _StepVisual_RepositionedTessellatedItem_HeaderFile
#include <StepVisual_TessellatedItem.hxx>
class StepGeom_Axis2Placement3d;
DEFINE_STANDARD_HANDLE(StepVisual_RepositionedTessellatedItem, StepVisual_TessellatedItem)
//! Representation of STEP entity RepositionedTessellatedItem
class StepVisual_RepositionedTessellatedItem : public StepVisual_TessellatedItem
{
public:
DEFINE_STANDARD_RTTIEXT(StepVisual_RepositionedTessellatedItem, StepVisual_TessellatedItem)
DEFINE_STANDARD_ALLOC
//! Default constructor
StepVisual_RepositionedTessellatedItem() {};
//! Initialize all fields (own and inherited)
Standard_EXPORT void Init(const Handle(TCollection_HAsciiString)& theName,
const Handle(StepGeom_Axis2Placement3d)& theLocation);
//! Returns location
Handle(StepGeom_Axis2Placement3d) Location() const { return myLocation; }
//! Sets location
void SetLocation(const Handle(StepGeom_Axis2Placement3d)& theLocation) { myLocation = theLocation; }
private:
Handle(StepGeom_Axis2Placement3d) myLocation;
};
#endif // StepVisual_RepositionedTessellatedItem_HeaderFile

View File

@@ -968,7 +968,7 @@ void V3d_View::SetTwist(const Standard_Real angle)
const gp_Dir aReferencePlane (aCamera->Direction().Reversed());
if (!screenAxis (aReferencePlane, gp::DZ(), myXscreenAxis, myYscreenAxis, myZscreenAxis)
&& !screenAxis (aReferencePlane, gp::DY(), myXscreenAxis, myYscreenAxis, myZscreenAxis)
&& !screenAxis (aReferencePlane, gp::DZ(), myXscreenAxis, myYscreenAxis, myZscreenAxis))
&& !screenAxis (aReferencePlane, gp::DX(), myXscreenAxis, myYscreenAxis, myZscreenAxis))
{
throw V3d_BadValue ("V3d_ViewSetTwist, alignment of Eye,At,Up,");
}

View File

@@ -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

View File

@@ -73,6 +73,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);

17
tests/bugs/step/bug32731 Normal file
View File

@@ -0,0 +1,17 @@
puts "======="
puts "0032731: Data Exchange, Step Import - Incorrect PMI text location"
puts "======="
pload OCAF
catch {Close D}
# Read file
ReadStep D [locate_data_file bug32731_A5E46910589A.stp]
#Checking
XGetShape repr0 D 0:1:4:106:15
checkgravitycenter repr0 -l -109.847 153.679 0 1e-7
XGetShape repr1 D 0:1:4:56:15
checkgravitycenter repr1 -l -68.7 123.272 -18.5624 1e-7