mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-08 14:17:06 +03:00
Compare commits
19 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
9151e65161 | ||
|
b78ccf1f9b | ||
|
2956d432e2 | ||
|
d3e00bfaa6 | ||
|
983e35ed71 | ||
|
74095a8b46 | ||
|
576f376108 | ||
|
447396c9b9 | ||
|
9d93d9b9b8 | ||
|
d5bcd33386 | ||
|
3888b58c27 | ||
|
d1eae5b0d0 | ||
|
32f7b4e5bf | ||
|
993da38d54 | ||
|
a9becad233 | ||
|
5939991070 | ||
|
e8a36f3a02 | ||
|
f286953d85 | ||
|
20955d88da |
@@ -475,7 +475,7 @@ Modify this parameter with:
|
||||
if(!Interface_Static::SetIVal("read.step.tessellated",1))
|
||||
.. error ..
|
||||
~~~~
|
||||
Default value is 0 (On).
|
||||
Default value is 1 (On).
|
||||
|
||||
@subsubsection occt_step_2_3_4 Performing the STEP file translation
|
||||
|
||||
@@ -1653,6 +1653,13 @@ For each Saved View OCCT STEP Reader will retrieve the following attributes:
|
||||
- clipping planes (single plane of combination of planes);
|
||||
- front and back plane clipping.
|
||||
|
||||
### User defined attributes
|
||||
Attributes are implemented in accordance with <a href="https://www.mbx-if.org/documents/rec_prac_user_def_attributes_v18.pdf">Recommended practices for User Defined Attributes</a> section 4, 5, 6.1-6.3 and 7.
|
||||
Attributes can be read for shapes at levels:
|
||||
- Part/Product Level;
|
||||
- Component Instances in an Assembly;
|
||||
- Geometry Level.
|
||||
|
||||
@subsection occt_step_7_3 Writing to STEP
|
||||
|
||||
The translation from XDE to STEP can be initialized as follows:
|
||||
@@ -1730,5 +1737,8 @@ Interface_Static::SetIVal("write.step.schema", 5));
|
||||
### Saved views
|
||||
Saved Views are not exported by OCCT.
|
||||
|
||||
### User defined attributes
|
||||
Attributes can be imported from STEP.
|
||||
|
||||
|
||||
|
||||
|
@@ -162,7 +162,7 @@ void APIHeaderSection_MakeHeader::Apply
|
||||
Handle(StepData_Protocol) stepro = Handle(StepData_Protocol)::DownCast
|
||||
( model->Protocol());
|
||||
if (!stepro.IsNull()) sch = new TCollection_HAsciiString
|
||||
(stepro->SchemaName(model));
|
||||
(stepro->SchemaName());
|
||||
if (!sch.IsNull()) schid->SetValue (1,sch);
|
||||
}
|
||||
header.AddItem(fs);
|
||||
|
@@ -808,8 +808,11 @@ void Approx_BSplComputeLine::Parameters(const MultiLine& Line,
|
||||
const Standard_Integer aNbp = lastP - firstP + 1;
|
||||
|
||||
|
||||
// The first parameter should always be zero according to all the logic below,
|
||||
// so division by any value will give zero anyway, so it should never be scaled
|
||||
// to avoid case when there is only one parameter in the array thus division by zero happens.
|
||||
TheParameters(firstP) = 0.0;
|
||||
if (aNbp == 2) {
|
||||
TheParameters(firstP) = 0.0;
|
||||
TheParameters(lastP) = 1.0;
|
||||
}
|
||||
else if (Par == Approx_ChordLength || Par == Approx_Centripetal)
|
||||
@@ -820,7 +823,6 @@ void Approx_BSplComputeLine::Parameters(const MultiLine& Line,
|
||||
if (nbP3d == 0) mynbP3d = 1;
|
||||
if (nbP2d == 0) mynbP2d = 1;
|
||||
|
||||
TheParameters(firstP) = 0.0;
|
||||
dist = 0.0;
|
||||
TColgp_Array1OfPnt tabP(1, mynbP3d);
|
||||
TColgp_Array1OfPnt tabPP(1, mynbP3d);
|
||||
@@ -861,10 +863,10 @@ void Approx_BSplComputeLine::Parameters(const MultiLine& Line,
|
||||
TheParameters(i) = TheParameters(i - 1) + Sqrt(dist);
|
||||
}
|
||||
}
|
||||
for (i = firstP; i <= lastP; i++) TheParameters(i) /= TheParameters(lastP);
|
||||
for (i = firstP + 1; i <= lastP; i++) TheParameters(i) /= TheParameters(lastP);
|
||||
}
|
||||
else {
|
||||
for (i = firstP; i <= lastP; i++) {
|
||||
for (i = firstP + 1; i <= lastP; i++) {
|
||||
TheParameters(i) = (Standard_Real(i) - firstP) /
|
||||
(Standard_Real(lastP - Standard_Real(firstP)));
|
||||
}
|
||||
|
@@ -19,6 +19,7 @@
|
||||
#include <BRep_CurveOnClosedSurface.hxx>
|
||||
#include <BRep_CurveOnSurface.hxx>
|
||||
#include <BRep_CurveRepresentation.hxx>
|
||||
#include <BRep_GCurve.hxx>
|
||||
#include <BRep_Polygon3D.hxx>
|
||||
#include <BRep_PolygonOnSurface.hxx>
|
||||
#include <BRep_PolygonOnTriangulation.hxx>
|
||||
@@ -26,6 +27,7 @@
|
||||
#include <BRep_TFace.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRep_TVertex.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <ElSLib.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom2d_TrimmedCurve.hxx>
|
||||
@@ -61,7 +63,6 @@
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <TopTools_ShapeMapHasher.hxx>
|
||||
#include <BRep_GCurve.hxx>
|
||||
|
||||
//modified by NIZNHY-PKV Fri Oct 17 14:13:29 2008f
|
||||
static
|
||||
@@ -1672,3 +1673,13 @@ Standard_Real BRep_Tool::MaxTolerance (const TopoDS_Shape& theShape,
|
||||
|
||||
return aTol;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Tolerance2d
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Real BRep_Tool::Tolerance2d(const TopoDS_Face& theFace, const Standard_Real theTolerance)
|
||||
{
|
||||
BRepAdaptor_Surface aAdaptorSurface(theFace);
|
||||
return Max(aAdaptorSurface.UResolution(theTolerance), aAdaptorSurface.VResolution(theTolerance));
|
||||
}
|
||||
|
@@ -297,6 +297,11 @@ public:
|
||||
//@param theSubShape - Search subshape, only Face, Edge or Vertex are supported.
|
||||
Standard_EXPORT static Standard_Real MaxTolerance (const TopoDS_Shape& theShape, const TopAbs_ShapeEnum theSubShape);
|
||||
|
||||
//! Returns the 2d tolerance.
|
||||
//@param theFace - the input face to find 2d tolerance
|
||||
//@param theTolerance - the input tolerance to calculate 2d tolerance.
|
||||
Standard_EXPORT static Standard_Real Tolerance2d(const TopoDS_Face& theFace, const Standard_Real theTolerance);
|
||||
|
||||
};
|
||||
|
||||
#endif // _BRep_Tool_HeaderFile
|
||||
|
@@ -103,7 +103,7 @@ static Standard_Boolean ChangePCurve (TopoDS_Edge& E,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
static void ProjCurve3d (TopoDS_Edge& E,
|
||||
static bool ProjCurve3d (TopoDS_Edge& E,
|
||||
const Handle(Geom_Surface)& S,
|
||||
TopLoc_Location& L)
|
||||
{
|
||||
@@ -111,6 +111,10 @@ static void ProjCurve3d (TopoDS_Edge& E,
|
||||
TopLoc_Location LE;
|
||||
Standard_Real f,l;
|
||||
Handle(Geom_Curve) C = BRep_Tool::Curve(E,LE,f,l);
|
||||
if (C.IsNull())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
Handle(Geom_TrimmedCurve) CT = new Geom_TrimmedCurve(C,f,l);
|
||||
|
||||
TopLoc_Location LL = L.Inverted().Multiplied(LE);
|
||||
@@ -118,6 +122,7 @@ static void ProjCurve3d (TopoDS_Edge& E,
|
||||
|
||||
Handle(Geom2d_Curve) C2 = GeomProjLib::Curve2d (CT,S);
|
||||
BB.UpdateEdge(E,C2,S,L,Precision::Confusion());
|
||||
return true;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -165,13 +170,19 @@ void BRepAlgo_FaceRestrictor::Perform()
|
||||
// no pcurve on the reference surface.
|
||||
if (modeProj) {
|
||||
// Projection of the 3D curve on surface.
|
||||
ProjCurve3d ( E, S, L);
|
||||
if (!ProjCurve3d(E, S, L))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// return the first pcurve glued on <S>
|
||||
Standard_Boolean YaPCurve = ChangePCurve (E, S, L);
|
||||
if (!YaPCurve) {
|
||||
ProjCurve3d (E, S, L);
|
||||
if (!ProjCurve3d(E, S, L))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -333,7 +333,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
|
||||
Only2d = Standard_True;
|
||||
|
||||
if(Only2d && Only3d) {
|
||||
BRepLib_MakeEdge MKed(GeomAdaptor::MakeCurve(hcur->Curve()),
|
||||
BRepLib_MakeEdge MKed(GeomAdaptor::MakeCurve(*hcur),
|
||||
Udeb, Ufin);
|
||||
prj = MKed.Edge();
|
||||
BB.UpdateEdge(TopoDS::Edge(prj),
|
||||
@@ -369,7 +369,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
|
||||
|
||||
if(!Only3d) PCur2d = appr.Curve2d();
|
||||
if(Only2d) {
|
||||
BRepLib_MakeEdge MKed(GeomAdaptor::MakeCurve(hcur->Curve()),
|
||||
BRepLib_MakeEdge MKed(GeomAdaptor::MakeCurve(*hcur),
|
||||
Udeb, Ufin);
|
||||
prj = MKed.Edge();
|
||||
}
|
||||
|
@@ -441,7 +441,6 @@ static void PERFORM_C0(const TopoDS_Edge& S1, const TopoDS_Edge& S2,
|
||||
|
||||
gp_Pnt P1, Pt;
|
||||
Standard_Integer i, ii;
|
||||
BRepClass_FaceClassifier classifier;
|
||||
for (i = 1; i <= arrInter.Length(); i++)
|
||||
{
|
||||
const Standard_Real aParameter = arrInter(i);
|
||||
@@ -772,7 +771,7 @@ void BRepExtrema_DistanceSS::Perform(const TopoDS_Vertex& theS1,
|
||||
Standard_Real U, V;
|
||||
gp_Pnt Pt, P1 = BRep_Tool::Pnt(theS1);
|
||||
BRepClass_FaceClassifier classifier;
|
||||
const Standard_Real tol = BRep_Tool::Tolerance(theS2);
|
||||
const Standard_Real tol2d = BRep_Tool::Tolerance2d(theS2, BRep_Tool::Tolerance(theS2));
|
||||
|
||||
for (i = 1; i <= NbExtrema; i++)
|
||||
{
|
||||
@@ -784,7 +783,7 @@ void BRepExtrema_DistanceSS::Perform(const TopoDS_Vertex& theS1,
|
||||
// Check if the parameter does not correspond to a vertex
|
||||
Ext.Parameter(i, U, V);
|
||||
const gp_Pnt2d PUV(U, V);
|
||||
classifier.Perform(theS2, PUV, tol);
|
||||
classifier.Perform(theS2, PUV, tol2d);
|
||||
if (classifier.State() == TopAbs_IN)
|
||||
{
|
||||
if (myDstRef > Dstmin)
|
||||
@@ -922,7 +921,7 @@ void BRepExtrema_DistanceSS::Perform (const TopoDS_Edge& theS1, const TopoDS_Fac
|
||||
if ((Dstmin < myDstRef - myEps) || (fabs(Dstmin - myDstRef) < myEps))
|
||||
{
|
||||
Standard_Real U, V;
|
||||
const Standard_Real tol = BRep_Tool::Tolerance(theS2);
|
||||
const Standard_Real tol2d = BRep_Tool::Tolerance2d(theS2, BRep_Tool::Tolerance(theS2));
|
||||
|
||||
gp_Pnt Pt1, Pt2;
|
||||
const Standard_Real epsP = Precision::PConfusion();
|
||||
@@ -941,7 +940,7 @@ void BRepExtrema_DistanceSS::Perform (const TopoDS_Edge& theS1, const TopoDS_Fac
|
||||
{
|
||||
Ext.ParameterOnFace(i, U, V);
|
||||
const gp_Pnt2d PUV(U, V);
|
||||
classifier.Perform(theS2, PUV, tol);
|
||||
classifier.Perform(theS2, PUV, tol2d);
|
||||
if (classifier.State() == TopAbs_IN)
|
||||
{
|
||||
if (myDstRef > Dstmin)
|
||||
@@ -974,7 +973,7 @@ void BRepExtrema_DistanceSS::Perform (const TopoDS_Edge& theS1, const TopoDS_Fac
|
||||
|
||||
gp_Pnt Pt;
|
||||
Standard_Real U, V;
|
||||
const Standard_Real tol = BRep_Tool::Tolerance(theS2);
|
||||
const Standard_Real tol2d = BRep_Tool::Tolerance2d(theS2, BRep_Tool::Tolerance(theS2));
|
||||
|
||||
Standard_Integer i;
|
||||
for (i = 1; i <= arrInter.Length(); i++)
|
||||
@@ -1007,7 +1006,7 @@ void BRepExtrema_DistanceSS::Perform (const TopoDS_Edge& theS1, const TopoDS_Fac
|
||||
// Check if the parameter does not correspond to a vertex
|
||||
ExtPF.Parameter(ii, U, V);
|
||||
const gp_Pnt2d PUV(U, V);
|
||||
classifier.Perform(theS2, PUV, tol);
|
||||
classifier.Perform(theS2, PUV, tol2d);
|
||||
if (classifier.State() == TopAbs_IN)
|
||||
{
|
||||
if (myDstRef > Dstmin)
|
||||
@@ -1062,8 +1061,8 @@ void BRepExtrema_DistanceSS::Perform (const TopoDS_Face& theS1,
|
||||
Dstmin = sqrt(Dstmin);
|
||||
if ((Dstmin < myDstRef - myEps) || (fabs(Dstmin - myDstRef) < myEps))
|
||||
{
|
||||
const Standard_Real tol1 = BRep_Tool::Tolerance(theS1);
|
||||
const Standard_Real tol2 = BRep_Tool::Tolerance(theS2);
|
||||
const Standard_Real tol2d1 = BRep_Tool::Tolerance2d(theS1, BRep_Tool::Tolerance(theS1));
|
||||
const Standard_Real tol2d2 = BRep_Tool::Tolerance2d(theS2, BRep_Tool::Tolerance(theS2));
|
||||
|
||||
gp_Pnt Pt1, Pt2;
|
||||
gp_Pnt2d PUV;
|
||||
@@ -1081,12 +1080,12 @@ void BRepExtrema_DistanceSS::Perform (const TopoDS_Face& theS1,
|
||||
// Check if the parameter does not correspond to a vertex
|
||||
Ext.ParameterOnFace1(i, U1, V1);
|
||||
PUV.SetCoord(U1, V1);
|
||||
classifier.Perform(theS1, PUV, tol1);
|
||||
classifier.Perform(theS1, PUV, tol2d1);
|
||||
if (classifier.State() == TopAbs_IN)
|
||||
{
|
||||
Ext.ParameterOnFace2(i, U2, V2);
|
||||
PUV.SetCoord(U2, V2);
|
||||
classifier.Perform(theS2, PUV, tol2);
|
||||
classifier.Perform(theS2, PUV, tol2d2);
|
||||
if (classifier.State() == TopAbs_IN)
|
||||
{
|
||||
if (myDstRef > Dstmin)
|
||||
|
@@ -89,7 +89,7 @@ void BRepExtrema_ExtFF::Perform(const TopoDS_Face& F1, const TopoDS_Face& F2)
|
||||
{
|
||||
// Exploration of points and classification
|
||||
BRepClass_FaceClassifier classifier;
|
||||
const Standard_Real Tol2 = BRep_Tool::Tolerance(F2);
|
||||
const Standard_Real Tol2d2 = BRep_Tool::Tolerance2d(F2, BRep_Tool::Tolerance(F2));
|
||||
Extrema_POnSurf P1, P2;
|
||||
|
||||
Standard_Integer i;
|
||||
@@ -98,13 +98,14 @@ void BRepExtrema_ExtFF::Perform(const TopoDS_Face& F1, const TopoDS_Face& F2)
|
||||
myExtSS.Points(i, P1, P2);
|
||||
P1.Parameter(U1, U2);
|
||||
const gp_Pnt2d Puv1(U1, U2);
|
||||
classifier.Perform(F1, Puv1, Tol1);
|
||||
const Standard_Real Tol2d1 = BRep_Tool::Tolerance2d(F1, Tol1);
|
||||
classifier.Perform(F1, Puv1, Tol2d1);
|
||||
const TopAbs_State state1 = classifier.State();
|
||||
if (state1 == TopAbs_ON || state1 == TopAbs_IN)
|
||||
{
|
||||
P2.Parameter(U1, U2);
|
||||
const gp_Pnt2d Puv2(U1, U2);
|
||||
classifier.Perform(F2, Puv2, Tol2);
|
||||
classifier.Perform(F2, Puv2, Tol2d2);
|
||||
const TopAbs_State state2 = classifier.State();
|
||||
if (state2 == TopAbs_ON || state2 == TopAbs_IN)
|
||||
{
|
||||
|
@@ -85,12 +85,12 @@ void BRepExtrema_ExtPF::Perform(const TopoDS_Vertex& TheVertex, const TopoDS_Fac
|
||||
{
|
||||
BRepClass_FaceClassifier classifier;
|
||||
Standard_Real U1, U2;
|
||||
const Standard_Real Tol = BRep_Tool::Tolerance(TheFace);
|
||||
const Standard_Real Tol2d = BRep_Tool::Tolerance2d(TheFace, BRep_Tool::Tolerance(TheFace));
|
||||
for (Standard_Integer i = 1; i <= myExtPS.NbExt(); i++)
|
||||
{
|
||||
myExtPS.Point(i).Parameter(U1, U2);
|
||||
const gp_Pnt2d Puv(U1, U2);
|
||||
classifier.Perform(TheFace, Puv, Tol);
|
||||
classifier.Perform(TheFace, Puv, Tol2d);
|
||||
const TopAbs_State state = classifier.State();
|
||||
if(state == TopAbs_ON || state == TopAbs_IN)
|
||||
{
|
||||
|
@@ -1292,11 +1292,10 @@ void BRepOffset_Inter3d::ContextIntByArc(const TopTools_IndexedMapOfShape& Conte
|
||||
for ( ;exp2.More(); exp2.Next()) {
|
||||
LOE.Append(exp2.Current());
|
||||
}
|
||||
BRepOffset_Tool::TryProject(CF,OF1,LOE,LInt1,LInt2,mySide,myTol);
|
||||
//-------------------------------------------------------
|
||||
// If no trace try intersection.
|
||||
//-------------------------------------------------------
|
||||
if (LInt1.IsEmpty()) {
|
||||
if (!BRepOffset_Tool::TryProject(CF, OF1, LOE, LInt1, LInt2, mySide, myTol) || LInt1.IsEmpty()) {
|
||||
BRepOffset_Tool::Inter3D (CF,OF1,LInt1,LInt2,mySide,NullEdge,NullFace,NullFace);
|
||||
}
|
||||
Store (CF,OF1,LInt1,LInt2);
|
||||
|
@@ -1175,12 +1175,16 @@ void BRepOffset_MakeOffset::MakeThickSolid(const Message_ProgressRange& theRange
|
||||
{
|
||||
NbOF++;
|
||||
}
|
||||
if (NbOF <= NbF)
|
||||
if (NbOF < NbF)
|
||||
{
|
||||
myDone = Standard_False;
|
||||
myError = BRepOffset_UnknownError;
|
||||
return;
|
||||
}
|
||||
if (NbOF == NbF)
|
||||
{
|
||||
myOffset = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (myOffset > 0 ) myOffsetShape.Reverse();
|
||||
|
@@ -1881,6 +1881,10 @@ Standard_Boolean BRepOffset_Tool::TryProject
|
||||
if (C.IsNull()) {
|
||||
BRepLib::BuildCurve3d(CurE,BRep_Tool::Tolerance(CurE));
|
||||
C = BRep_Tool::Curve(CurE,L,f,l);
|
||||
if (C.IsNull())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
}
|
||||
C = new Geom_TrimmedCurve(C,f,l);
|
||||
if ( !L.IsIdentity()) C->Transform(L);
|
||||
@@ -3519,9 +3523,8 @@ void BRepOffset_Tool::ExtentFace (const TopoDS_Face& F,
|
||||
if (ToBuild.IsBound(E)) {
|
||||
TopTools_ListOfShape LOE;
|
||||
LOE.Append(E);
|
||||
BRepOffset_Tool::TryProject (TopoDS::Face(ToBuild(E)),
|
||||
EF,LOE,LInt2,LInt1,Side,TolConf);
|
||||
if (!LInt1.IsEmpty())
|
||||
if (BRepOffset_Tool::TryProject(TopoDS::Face(ToBuild(E)), EF, LOE, LInt2, LInt1, Side, TolConf)
|
||||
&& !LInt1.IsEmpty())
|
||||
ToBuild.UnBind(E);
|
||||
}
|
||||
}
|
||||
|
@@ -515,8 +515,13 @@ BSplCLib::EvalBsplineBasis
|
||||
//
|
||||
// this should be always invertible if ii is correctly computed
|
||||
//
|
||||
Factor = (Parameter - FlatKnots(ii - qq + pp + 1))
|
||||
/ (FlatKnots(ii + pp) - FlatKnots(ii - qq + pp + 1)) ;
|
||||
const Standard_Real aScale = (FlatKnots(ii + pp) - FlatKnots(ii - qq + pp + 1));
|
||||
if (Abs (aScale) < gp::Resolution())
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
Factor = (Parameter - FlatKnots(ii - qq + pp + 1)) / aScale;
|
||||
Saved = Factor * BsplineBasis(1,pp) ;
|
||||
BsplineBasis(1,pp) *= (1.0e0 - Factor) ;
|
||||
BsplineBasis(1,pp) += BsplineBasis(1,qq) ;
|
||||
@@ -536,7 +541,13 @@ BSplCLib::EvalBsplineBasis
|
||||
}
|
||||
|
||||
for (pp = 1 ; pp <= qq - 1 ; pp++) {
|
||||
Inverse = 1.0e0 / (FlatKnots(ii + pp) - FlatKnots(ii - qq + pp + 1)) ;
|
||||
const Standard_Real aScale = (FlatKnots(ii + pp) - FlatKnots(ii - qq + pp + 1));
|
||||
if (Abs (aScale) < gp::Resolution())
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
Inverse = 1.0e0 / aScale;
|
||||
Factor = (Parameter - FlatKnots(ii - qq + pp + 1)) * Inverse ;
|
||||
Saved = Factor * BsplineBasis(1,pp) ;
|
||||
BsplineBasis(1,pp) *= (1.0e0 - Factor) ;
|
||||
|
@@ -33,6 +33,7 @@
|
||||
#include <Storage_Schema.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <TCollection_ExtendedString.hxx>
|
||||
#include <TDataStd_TreeNode.hxx>
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <TDF_Data.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
@@ -324,7 +325,16 @@ void BinLDrivers_DocumentRetrievalDriver::Read (Standard_IStream&
|
||||
// read sub-tree of the root label
|
||||
if (!theFilter.IsNull())
|
||||
theFilter->StartIteration();
|
||||
Standard_Integer nbRead = ReadSubTree (theIStream, aData->Root(), theFilter, aQuickPart, aPS.Next());
|
||||
const auto aStreamStartPosition = theIStream.tellg();
|
||||
Standard_Integer nbRead = ReadSubTree (theIStream, aData->Root(), theFilter, aQuickPart, Standard_False, aPS.Next());
|
||||
if (!myUnresolvedLinks.IsEmpty())
|
||||
{
|
||||
// In case we have skipped some linked TreeNodes before getting to
|
||||
// their children.
|
||||
theFilter->StartIteration();
|
||||
theIStream.seekg(aStreamStartPosition, std::ios_base::beg);
|
||||
nbRead += ReadSubTree(theIStream, aData->Root(), theFilter, aQuickPart, Standard_True, aPS.Next());
|
||||
}
|
||||
if (!aPS.More())
|
||||
{
|
||||
myReaderStatus = PCDM_RS_UserBreak;
|
||||
@@ -373,6 +383,7 @@ Standard_Integer BinLDrivers_DocumentRetrievalDriver::ReadSubTree
|
||||
const TDF_Label& theLabel,
|
||||
const Handle(PCDM_ReaderFilter)& theFilter,
|
||||
const Standard_Boolean& theQuickPart,
|
||||
const Standard_Boolean theReadMissing,
|
||||
const Message_ProgressRange& theRange)
|
||||
{
|
||||
Standard_Integer nbRead = 0;
|
||||
@@ -393,7 +404,7 @@ Standard_Integer BinLDrivers_DocumentRetrievalDriver::ReadSubTree
|
||||
aLabelSize = InverseUint64(aLabelSize);
|
||||
#endif
|
||||
// no one sub-label is needed, so, skip everything
|
||||
if (aSkipAttrs && !theFilter->IsSubPassed())
|
||||
if (aSkipAttrs && !theFilter->IsSubPassed() && myUnresolvedLinks.IsEmpty())
|
||||
{
|
||||
aLabelSize -= sizeof (uint64_t);
|
||||
theIS.seekg (aLabelSize, std::ios_base::cur);
|
||||
@@ -403,6 +414,11 @@ Standard_Integer BinLDrivers_DocumentRetrievalDriver::ReadSubTree
|
||||
}
|
||||
}
|
||||
|
||||
if (theReadMissing)
|
||||
{
|
||||
aSkipAttrs = Standard_True;
|
||||
}
|
||||
const auto anAttStartPosition = theIS.tellg();
|
||||
// Read attributes:
|
||||
for (theIS >> myPAtt;
|
||||
theIS && myPAtt.TypeId() > 0 && // not an end marker ?
|
||||
@@ -415,6 +431,12 @@ Standard_Integer BinLDrivers_DocumentRetrievalDriver::ReadSubTree
|
||||
myReaderStatus = PCDM_RS_UserBreak;
|
||||
return -1;
|
||||
}
|
||||
if (myUnresolvedLinks.Remove(myPAtt.Id()) && aSkipAttrs)
|
||||
{
|
||||
aSkipAttrs = Standard_False;
|
||||
theIS.seekg(anAttStartPosition, std::ios_base::beg);
|
||||
continue;
|
||||
}
|
||||
if (aSkipAttrs)
|
||||
{
|
||||
if (myPAtt.IsDirect()) // skip direct written stream
|
||||
@@ -487,7 +509,17 @@ Standard_Integer BinLDrivers_DocumentRetrievalDriver::ReadSubTree
|
||||
aDriver->TypeName(), Message_Warning);
|
||||
}
|
||||
else if (!isBound)
|
||||
{
|
||||
myRelocTable.Bind(anID, tAtt);
|
||||
Handle(TDataStd_TreeNode) aNode = Handle(TDataStd_TreeNode)::DownCast(tAtt);
|
||||
if (!theFilter.IsNull() && !aNode.IsNull() && !aNode->Father().IsNull() && aNode->Father()->IsNew())
|
||||
{
|
||||
Standard_Integer anUnresolvedLink;
|
||||
myPAtt.SetPosition(BP_HEADSIZE);
|
||||
myPAtt >> anUnresolvedLink;
|
||||
myUnresolvedLinks.Add(anUnresolvedLink);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!myMapUnsupported.Contains(myPAtt.TypeId()))
|
||||
myMsgDriver->Send(aMethStr + "warning: type ID not registered in header: "
|
||||
@@ -522,7 +554,7 @@ Standard_Integer BinLDrivers_DocumentRetrievalDriver::ReadSubTree
|
||||
// read sub-tree
|
||||
if (!theFilter.IsNull())
|
||||
theFilter->Down (aTag);
|
||||
Standard_Integer nbSubRead = ReadSubTree (theIS, aLab, theFilter, theQuickPart, aPS.Next());
|
||||
Standard_Integer nbSubRead = ReadSubTree (theIS, aLab, theFilter, theQuickPart, theReadMissing, aPS.Next());
|
||||
// check for error
|
||||
if (nbSubRead == -1)
|
||||
return -1;
|
||||
|
@@ -80,6 +80,7 @@ protected:
|
||||
const TDF_Label& theData,
|
||||
const Handle(PCDM_ReaderFilter)& theFilter,
|
||||
const Standard_Boolean& theQuickPart,
|
||||
const Standard_Boolean theReadMissing,
|
||||
const Message_ProgressRange& theRanges = Message_ProgressRange());
|
||||
|
||||
|
||||
@@ -125,6 +126,7 @@ private:
|
||||
BinObjMgt_Persistent myPAtt;
|
||||
TColStd_MapOfInteger myMapUnsupported;
|
||||
BinLDrivers_VectorOfDocumentSection mySections;
|
||||
NCollection_Map<Standard_Integer> myUnresolvedLinks;
|
||||
|
||||
|
||||
};
|
||||
|
@@ -98,6 +98,8 @@
|
||||
#include <RWStepBasic_RWExternalIdentificationAssignment.hxx>
|
||||
#include <RWStepBasic_RWExternallyDefinedItem.hxx>
|
||||
#include <RWStepBasic_RWGeneralProperty.hxx>
|
||||
#include <RWStepBasic_RWGeneralPropertyAssociation.hxx>
|
||||
#include <RWStepBasic_RWGeneralPropertyRelationship.hxx>
|
||||
#include <RWStepBasic_RWGroupRelationship.hxx>
|
||||
#include <RWStepBasic_RWIdentificationAssignment.hxx>
|
||||
#include <RWStepBasic_RWIdentificationRole.hxx>
|
||||
@@ -325,6 +327,7 @@
|
||||
#include <RWStepRepr_RWMaterialDesignation.hxx>
|
||||
#include <RWStepRepr_RWMaterialProperty.hxx>
|
||||
#include <RWStepRepr_RWMaterialPropertyRepresentation.hxx>
|
||||
#include <RWStepRepr_RWMechanicalDesignAndDraughtingRelationship.hxx>
|
||||
#include <RWStepRepr_RWMeasureRepresentationItem.hxx>
|
||||
#include <RWStepRepr_RWProductConcept.hxx>
|
||||
#include <RWStepRepr_RWProductDefinitionShape.hxx>
|
||||
@@ -570,6 +573,8 @@
|
||||
#include <StepBasic_ExternalIdentificationAssignment.hxx>
|
||||
#include <StepBasic_ExternalSource.hxx>
|
||||
#include <StepBasic_GeneralProperty.hxx>
|
||||
#include <StepBasic_GeneralPropertyAssociation.hxx>
|
||||
#include <StepBasic_GeneralPropertyRelationship.hxx>
|
||||
#include <StepBasic_Group.hxx>
|
||||
#include <StepBasic_GroupRelationship.hxx>
|
||||
#include <StepBasic_IdentificationAssignment.hxx>
|
||||
@@ -785,6 +790,7 @@
|
||||
#include <StepRepr_ConfigurationEffectivity.hxx>
|
||||
#include <StepRepr_ConstructiveGeometryRepresentation.hxx>
|
||||
#include <StepRepr_ConstructiveGeometryRepresentationRelationship.hxx>
|
||||
#include <StepRepr_MechanicalDesignAndDraughtingRelationship.hxx>
|
||||
#include <StepRepr_DataEnvironment.hxx>
|
||||
#include <StepRepr_DescriptiveRepresentationItem.hxx>
|
||||
#include <StepRepr_Extension.hxx>
|
||||
@@ -1188,7 +1194,9 @@ IMPLEMENT_STANDARD_RTTIEXT(RWStepAP214_GeneralModule,StepData_GeneralModule)
|
||||
#include <StepDimTol_GeoTolAndGeoTolWthDatRefAndUneqDisGeoTol.hxx>
|
||||
#include <StepRepr_CompGroupShAspAndCompShAspAndDatumFeatAndShAsp.hxx>
|
||||
#include <StepRepr_CompShAspAndDatumFeatAndShAsp.hxx>
|
||||
#include <StepRepr_BooleanRepresentationItem.hxx>
|
||||
#include <StepRepr_IntegerRepresentationItem.hxx>
|
||||
#include <StepRepr_RealRepresentationItem.hxx>
|
||||
#include <StepRepr_ValueRepresentationItem.hxx>
|
||||
#include <StepAP242_DraughtingModelItemAssociation.hxx>
|
||||
#include <StepDimTol_GeoTolAndGeoTolWthDatRefAndGeoTolWthMaxTol.hxx>
|
||||
@@ -5876,6 +5884,27 @@ void RWStepAP214_GeneralModule::FillSharedCase(const Standard_Integer CN,
|
||||
aTool.Share(anEnt, iter);
|
||||
}
|
||||
break;
|
||||
case 820:
|
||||
{
|
||||
DeclareAndCast(StepBasic_GeneralPropertyAssociation, anEnt, ent);
|
||||
RWStepBasic_RWGeneralPropertyAssociation aTool;
|
||||
aTool.Share(anEnt, iter);
|
||||
}
|
||||
break;
|
||||
case 821:
|
||||
{
|
||||
DeclareAndCast(StepBasic_GeneralPropertyRelationship, anEnt, ent);
|
||||
RWStepBasic_RWGeneralPropertyRelationship aTool;
|
||||
aTool.Share(anEnt, iter);
|
||||
}
|
||||
break;
|
||||
case 824:
|
||||
{
|
||||
DeclareAndCast(StepRepr_MechanicalDesignAndDraughtingRelationship, anEnt, ent);
|
||||
RWStepRepr_RWMechanicalDesignAndDraughtingRelationship aTool;
|
||||
aTool.Share(anEnt, iter);
|
||||
}
|
||||
break;
|
||||
default : break;
|
||||
}
|
||||
}
|
||||
@@ -8185,6 +8214,21 @@ Standard_Boolean RWStepAP214_GeneralModule::NewVoid
|
||||
case 819:
|
||||
ent = new StepVisual_TriangulatedSurfaceSet;
|
||||
break;
|
||||
case 820:
|
||||
ent = new StepBasic_GeneralPropertyAssociation;
|
||||
break;
|
||||
case 821:
|
||||
ent = new StepBasic_GeneralPropertyRelationship;
|
||||
break;
|
||||
case 822:
|
||||
ent = new StepRepr_BooleanRepresentationItem;
|
||||
break;
|
||||
case 823:
|
||||
ent = new StepRepr_RealRepresentationItem;
|
||||
break;
|
||||
case 824:
|
||||
ent = new StepRepr_MechanicalDesignAndDraughtingRelationship;
|
||||
break;
|
||||
|
||||
default:
|
||||
return Standard_False;
|
||||
|
@@ -188,6 +188,8 @@ IMPLEMENT_STANDARD_RTTIEXT(RWStepAP214_ReadWriteModule,StepData_ReadWriteModule)
|
||||
#include <StepShape_GeometricallyBoundedWireframeShapeRepresentation.hxx>
|
||||
#include <StepRepr_GlobalUncertaintyAssignedContext.hxx>
|
||||
#include <StepRepr_GlobalUnitAssignedContext.hxx>
|
||||
#include <StepBasic_GeneralPropertyAssociation.hxx>
|
||||
#include <StepBasic_GeneralPropertyRelationship.hxx>
|
||||
#include <StepBasic_Group.hxx>
|
||||
#include <StepBasic_GroupRelationship.hxx>
|
||||
#include <StepShape_HalfSpaceSolid.hxx>
|
||||
@@ -622,6 +624,8 @@ IMPLEMENT_STANDARD_RTTIEXT(RWStepAP214_ReadWriteModule,StepData_ReadWriteModule)
|
||||
#include <RWStepShape_RWGeometricallyBoundedWireframeShapeRepresentation.hxx>
|
||||
#include <RWStepRepr_RWGlobalUncertaintyAssignedContext.hxx>
|
||||
#include <RWStepRepr_RWGlobalUnitAssignedContext.hxx>
|
||||
#include <RWStepBasic_RWGeneralPropertyAssociation.hxx>
|
||||
#include <RWStepBasic_RWGeneralPropertyRelationship.hxx>
|
||||
#include <RWStepBasic_RWGroup.hxx>
|
||||
#include <RWStepBasic_RWGroupRelationship.hxx>
|
||||
#include <RWStepShape_RWHalfSpaceSolid.hxx>
|
||||
@@ -637,6 +641,7 @@ IMPLEMENT_STANDARD_RTTIEXT(RWStepAP214_ReadWriteModule,StepData_ReadWriteModule)
|
||||
#include <RWStepShape_RWManifoldSurfaceShapeRepresentation.hxx>
|
||||
#include <RWStepRepr_RWMappedItem.hxx>
|
||||
#include <RWStepBasic_RWMeasureWithUnit.hxx>
|
||||
#include <RWStepRepr_RWMechanicalDesignAndDraughtingRelationship.hxx>
|
||||
#include <RWStepVisual_RWMechanicalDesignGeometricPresentationArea.hxx>
|
||||
#include <RWStepVisual_RWMechanicalDesignGeometricPresentationRepresentation.hxx>
|
||||
// Removed from Rev2 to Rev4 : <RWStepVisual_RWMechanicalDesignPresentationArea.hxx>
|
||||
@@ -1355,7 +1360,9 @@ IMPLEMENT_STANDARD_RTTIEXT(RWStepAP214_ReadWriteModule,StepData_ReadWriteModule)
|
||||
#include <RWStepDimTol_RWGeoTolAndGeoTolWthDatRefAndUneqDisGeoTol.hxx>
|
||||
#include <RWStepRepr_RWCompGroupShAspAndCompShAspAndDatumFeatAndShAsp.hxx>
|
||||
#include <RWStepRepr_RWCompShAspAndDatumFeatAndShAsp.hxx>
|
||||
#include <RWStepRepr_RWBooleanRepresentationItem.hxx>
|
||||
#include <RWStepRepr_RWIntegerRepresentationItem.hxx>
|
||||
#include <RWStepRepr_RWRealRepresentationItem.hxx>
|
||||
#include <RWStepRepr_RWValueRepresentationItem.hxx>
|
||||
#include <RWStepRepr_RWValueRepresentationItem.hxx>
|
||||
#include <RWStepAP242_RWDraughtingModelItemAssociation.hxx>
|
||||
@@ -1406,7 +1413,9 @@ IMPLEMENT_STANDARD_RTTIEXT(RWStepAP214_ReadWriteModule,StepData_ReadWriteModule)
|
||||
#include <StepDimTol_GeoTolAndGeoTolWthDatRefAndUneqDisGeoTol.hxx>
|
||||
#include <StepRepr_CompGroupShAspAndCompShAspAndDatumFeatAndShAsp.hxx>
|
||||
#include <StepRepr_CompShAspAndDatumFeatAndShAsp.hxx>
|
||||
#include <StepRepr_BooleanRepresentationItem.hxx>
|
||||
#include <StepRepr_IntegerRepresentationItem.hxx>
|
||||
#include <StepRepr_RealRepresentationItem.hxx>
|
||||
#include <StepRepr_ValueRepresentationItem.hxx>
|
||||
#include <StepAP242_DraughtingModelItemAssociation.hxx>
|
||||
#include <StepDimTol_GeoTolAndGeoTolWthDatRefAndGeoTolWthMaxTol.hxx>
|
||||
@@ -1423,6 +1432,7 @@ IMPLEMENT_STANDARD_RTTIEXT(RWStepAP214_ReadWriteModule,StepData_ReadWriteModule)
|
||||
#include <StepRepr_CharacterizedRepresentation.hxx>
|
||||
#include <StepRepr_ConstructiveGeometryRepresentation.hxx>
|
||||
#include <StepRepr_ConstructiveGeometryRepresentationRelationship.hxx>
|
||||
#include <StepRepr_MechanicalDesignAndDraughtingRelationship.hxx>
|
||||
|
||||
#include <RWStepVisual_RWTessellatedAnnotationOccurrence.hxx>
|
||||
#include <RWStepVisual_RWTessellatedItem.hxx>
|
||||
@@ -2352,6 +2362,11 @@ static TCollection_AsciiString Reco_ComplexTriangulatedSurfaceSet("COMPLEX_TRIAN
|
||||
static TCollection_AsciiString Reco_CubicBezierTessellatedEdge("CUBIC_BEZIER_TESSELLATED_EDGE");
|
||||
static TCollection_AsciiString Reco_CubicBezierTriangulatedFace("CUBIC_BEZIER_TRIANGULATED_FACE");
|
||||
static TCollection_AsciiString Reco_TriangulatedSurfaceSet("TRIANGULATED_SURFACE_SET");
|
||||
static TCollection_AsciiString Reco_GeneralPropertyAssociation("GENERAL_PROPERTY_ASSOCIATION");
|
||||
static TCollection_AsciiString Reco_GeneralPropertyRelationship("GENERAL_PROPERTY_RELATIONSHIP");
|
||||
static TCollection_AsciiString Reco_BooleanRepresentationItem("BOOLEAN_REPRESENTATION_ITEM");
|
||||
static TCollection_AsciiString Reco_RealRepresentationItem("REAL_REPRESENTATION_ITEM");
|
||||
static TCollection_AsciiString Reco_MechanicalDesignAndDraughtingRelationship("MECHANICAL_DESIGN_AND_DRAUGHTING_RELATIONSHIP");
|
||||
|
||||
// -- Definition of the libraries --
|
||||
|
||||
@@ -3109,6 +3124,11 @@ RWStepAP214_ReadWriteModule::RWStepAP214_ReadWriteModule ()
|
||||
typenums.Bind(Reco_CubicBezierTessellatedEdge, 817);
|
||||
typenums.Bind(Reco_CubicBezierTriangulatedFace, 818);
|
||||
typenums.Bind(Reco_TriangulatedSurfaceSet, 819);
|
||||
typenums.Bind(Reco_GeneralPropertyAssociation, 820);
|
||||
typenums.Bind(Reco_GeneralPropertyRelationship, 821);
|
||||
typenums.Bind(Reco_BooleanRepresentationItem, 822);
|
||||
typenums.Bind(Reco_RealRepresentationItem, 823);
|
||||
typenums.Bind(Reco_MechanicalDesignAndDraughtingRelationship, 824);
|
||||
|
||||
|
||||
// SHORT NAMES
|
||||
@@ -5097,6 +5117,11 @@ const TCollection_AsciiString& RWStepAP214_ReadWriteModule::StepType
|
||||
case 817: return Reco_CubicBezierTessellatedEdge;
|
||||
case 818: return Reco_CubicBezierTriangulatedFace;
|
||||
case 819: return Reco_TriangulatedSurfaceSet;
|
||||
case 820: return Reco_GeneralPropertyAssociation;
|
||||
case 821: return Reco_GeneralPropertyRelationship;
|
||||
case 822: return Reco_BooleanRepresentationItem;
|
||||
case 823: return Reco_RealRepresentationItem;
|
||||
case 824: return Reco_MechanicalDesignAndDraughtingRelationship;
|
||||
default : return PasReco;
|
||||
}
|
||||
}
|
||||
@@ -10706,6 +10731,41 @@ void RWStepAP214_ReadWriteModule::ReadStep(const Standard_Integer CN,
|
||||
aTool.ReadStep(data, num, ach, anEnt);
|
||||
}
|
||||
break;
|
||||
case 820:
|
||||
{
|
||||
DeclareAndCast(StepBasic_GeneralPropertyAssociation, anEnt, ent);
|
||||
RWStepBasic_RWGeneralPropertyAssociation aTool;
|
||||
aTool.ReadStep(data, num, ach, anEnt);
|
||||
}
|
||||
break;
|
||||
case 821:
|
||||
{
|
||||
DeclareAndCast(StepBasic_GeneralPropertyRelationship, anEnt, ent);
|
||||
RWStepBasic_RWGeneralPropertyRelationship aTool;
|
||||
aTool.ReadStep(data, num, ach, anEnt);
|
||||
}
|
||||
break;
|
||||
case 822:
|
||||
{
|
||||
DeclareAndCast(StepRepr_BooleanRepresentationItem, anent, ent);
|
||||
RWStepRepr_RWBooleanRepresentationItem aTool;
|
||||
aTool.ReadStep(data, num, ach, anent);
|
||||
}
|
||||
break;
|
||||
case 823:
|
||||
{
|
||||
DeclareAndCast(StepRepr_RealRepresentationItem, anent, ent);
|
||||
RWStepRepr_RWRealRepresentationItem aTool;
|
||||
aTool.ReadStep(data, num, ach, anent);
|
||||
}
|
||||
break;
|
||||
case 824:
|
||||
{
|
||||
DeclareAndCast(StepRepr_MechanicalDesignAndDraughtingRelationship, anent, ent);
|
||||
RWStepRepr_RWMechanicalDesignAndDraughtingRelationship aTool;
|
||||
aTool.ReadStep(data, num, ach, anent);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ach->AddFail("Type Mismatch when reading - Entity");
|
||||
}
|
||||
@@ -16257,6 +16317,41 @@ void RWStepAP214_ReadWriteModule::WriteStep(const Standard_Integer CN,
|
||||
aTool.WriteStep(SW, anEnt);
|
||||
}
|
||||
break;
|
||||
case 820:
|
||||
{
|
||||
DeclareAndCast(StepBasic_GeneralPropertyAssociation, anEnt, ent);
|
||||
RWStepBasic_RWGeneralPropertyAssociation aTool;
|
||||
aTool.WriteStep(SW, anEnt);
|
||||
}
|
||||
break;
|
||||
case 821:
|
||||
{
|
||||
DeclareAndCast(StepBasic_GeneralPropertyRelationship, anEnt, ent);
|
||||
RWStepBasic_RWGeneralPropertyRelationship aTool;
|
||||
aTool.WriteStep(SW, anEnt);
|
||||
}
|
||||
break;
|
||||
case 822:
|
||||
{
|
||||
DeclareAndCast(StepRepr_BooleanRepresentationItem, anent, ent);
|
||||
RWStepRepr_RWBooleanRepresentationItem aTool;
|
||||
aTool.WriteStep(SW, anent);
|
||||
}
|
||||
break;
|
||||
case 823:
|
||||
{
|
||||
DeclareAndCast(StepRepr_RealRepresentationItem, anent, ent);
|
||||
RWStepRepr_RWRealRepresentationItem aTool;
|
||||
aTool.WriteStep(SW, anent);
|
||||
}
|
||||
break;
|
||||
case 824:
|
||||
{
|
||||
DeclareAndCast(StepRepr_MechanicalDesignAndDraughtingRelationship, anent, ent);
|
||||
RWStepRepr_RWMechanicalDesignAndDraughtingRelationship aTool;
|
||||
aTool.WriteStep(SW, anent);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
@@ -108,6 +108,10 @@ RWStepBasic_RWExternalSource.cxx
|
||||
RWStepBasic_RWExternalSource.hxx
|
||||
RWStepBasic_RWGeneralProperty.cxx
|
||||
RWStepBasic_RWGeneralProperty.hxx
|
||||
RWStepBasic_RWGeneralPropertyAssociation.cxx
|
||||
RWStepBasic_RWGeneralPropertyAssociation.hxx
|
||||
RWStepBasic_RWGeneralPropertyRelationship.cxx
|
||||
RWStepBasic_RWGeneralPropertyRelationship.hxx
|
||||
RWStepBasic_RWGroup.cxx
|
||||
RWStepBasic_RWGroup.hxx
|
||||
RWStepBasic_RWGroupAssignment.cxx
|
||||
|
87
src/RWStepBasic/RWStepBasic_RWGeneralPropertyAssociation.cxx
Normal file
87
src/RWStepBasic/RWStepBasic_RWGeneralPropertyAssociation.cxx
Normal file
@@ -0,0 +1,87 @@
|
||||
// Copyright (c) 2024 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 <Interface_EntityIterator.hxx>
|
||||
#include <RWStepBasic_RWGeneralPropertyAssociation.hxx>
|
||||
#include <StepBasic_GeneralProperty.hxx>
|
||||
#include <StepBasic_GeneralPropertyAssociation.hxx>
|
||||
#include <StepData_StepReaderData.hxx>
|
||||
#include <StepData_StepWriter.hxx>
|
||||
#include <StepRepr_PropertyDefinition.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : RWStepBasic_RWGeneralPropertyAssociation
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
RWStepBasic_RWGeneralPropertyAssociation::RWStepBasic_RWGeneralPropertyAssociation()
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ReadStep
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void RWStepBasic_RWGeneralPropertyAssociation::ReadStep(const Handle(StepData_StepReaderData)& theData,
|
||||
const Standard_Integer theNum,
|
||||
Handle(Interface_Check)& theAch,
|
||||
const Handle(StepBasic_GeneralPropertyAssociation)& theEnt) const
|
||||
{
|
||||
// Check number of parameters
|
||||
if (!theData->CheckNbParams(theNum, 4, theAch, "general_property_association")) return;
|
||||
|
||||
Handle(TCollection_HAsciiString) aName;
|
||||
theData->ReadString(theNum, 1, "name", theAch, aName);
|
||||
|
||||
Handle(TCollection_HAsciiString) aDescription;
|
||||
theData->ReadString(theNum, 2, "description", theAch, aDescription);
|
||||
|
||||
Handle(StepBasic_GeneralProperty) aGeneralProperty;
|
||||
theData->ReadEntity(theNum, 3, "base_definition", theAch, STANDARD_TYPE(StepBasic_GeneralProperty), aGeneralProperty);
|
||||
|
||||
Handle(StepRepr_PropertyDefinition) aPropertyDefinition;
|
||||
theData->ReadEntity(theNum, 4, "derived_definition", theAch, STANDARD_TYPE(StepRepr_PropertyDefinition), aPropertyDefinition);
|
||||
|
||||
// Initialize entity
|
||||
theEnt->Init(aName,
|
||||
aDescription,
|
||||
aGeneralProperty,
|
||||
aPropertyDefinition);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : WriteStep
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void RWStepBasic_RWGeneralPropertyAssociation::WriteStep (StepData_StepWriter& theSW,
|
||||
const Handle(StepBasic_GeneralPropertyAssociation) &theEnt) const
|
||||
{
|
||||
theSW.Send(theEnt->Name());
|
||||
|
||||
theSW.Send(theEnt->Description());
|
||||
|
||||
theSW.Send(theEnt->GeneralProperty());
|
||||
|
||||
theSW.Send(theEnt->PropertyDefinition());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Share
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void RWStepBasic_RWGeneralPropertyAssociation::Share(const Handle(StepBasic_GeneralPropertyAssociation)& theEnt,
|
||||
Interface_EntityIterator& theIter) const
|
||||
{
|
||||
theIter.AddItem(theEnt->GeneralProperty());
|
||||
|
||||
theIter.AddItem(theEnt->PropertyDefinition());
|
||||
}
|
60
src/RWStepBasic/RWStepBasic_RWGeneralPropertyAssociation.hxx
Normal file
60
src/RWStepBasic/RWStepBasic_RWGeneralPropertyAssociation.hxx
Normal file
@@ -0,0 +1,60 @@
|
||||
// Copyright (c) 2024 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 _RWStepBasic_RWGeneralPropertyAssociation_HeaderFile
|
||||
#define _RWStepBasic_RWGeneralPropertyAssociation_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
class StepData_StepReaderData;
|
||||
class Interface_Check;
|
||||
class StepBasic_GeneralProperty;
|
||||
class StepData_StepWriter;
|
||||
class Interface_EntityIterator;
|
||||
|
||||
class StepBasic_GeneralPropertyAssociation;
|
||||
|
||||
//! Read & Write tool for GeneralPropertyAssociation
|
||||
class RWStepBasic_RWGeneralPropertyAssociation
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
//! Empty constructor
|
||||
Standard_EXPORT RWStepBasic_RWGeneralPropertyAssociation();
|
||||
|
||||
//! Reads GeneralPropertyAssociation
|
||||
Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& theData,
|
||||
const Standard_Integer theNum,
|
||||
Handle(Interface_Check)& theAch,
|
||||
const Handle(StepBasic_GeneralPropertyAssociation)& theEnt) const;
|
||||
|
||||
//! Writes GeneralPropertyAssociation
|
||||
Standard_EXPORT void WriteStep (StepData_StepWriter& theSW,
|
||||
const Handle(StepBasic_GeneralPropertyAssociation)& theEnt) const;
|
||||
|
||||
//! Fills data for graph (shared items)
|
||||
Standard_EXPORT void Share (const Handle(StepBasic_GeneralPropertyAssociation)& theEnt,
|
||||
Interface_EntityIterator& theIter) const;
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif // _RWStepBasic_RWGeneralPropertyAssociation_HeaderFile
|
103
src/RWStepBasic/RWStepBasic_RWGeneralPropertyRelationship.cxx
Normal file
103
src/RWStepBasic/RWStepBasic_RWGeneralPropertyRelationship.cxx
Normal file
@@ -0,0 +1,103 @@
|
||||
// Copyright (c) 2024 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 <Interface_EntityIterator.hxx>
|
||||
#include <RWStepBasic_RWGeneralPropertyRelationship.hxx>
|
||||
#include <StepBasic_GeneralProperty.hxx>
|
||||
#include <StepBasic_GeneralPropertyRelationship.hxx>
|
||||
#include <StepData_StepReaderData.hxx>
|
||||
#include <StepData_StepWriter.hxx>
|
||||
#include <StepRepr_PropertyDefinition.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : RWStepBasic_RWGeneralPropertyRelationship
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
RWStepBasic_RWGeneralPropertyRelationship::RWStepBasic_RWGeneralPropertyRelationship()
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ReadStep
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void RWStepBasic_RWGeneralPropertyRelationship::ReadStep(const Handle(StepData_StepReaderData)& theData,
|
||||
const Standard_Integer theNum,
|
||||
Handle(Interface_Check)& theAch,
|
||||
const Handle(StepBasic_GeneralPropertyRelationship)& theEnt) const
|
||||
{
|
||||
// Check number of parameters
|
||||
if (!theData->CheckNbParams(theNum, 4, theAch, "general_property_association")) return;
|
||||
|
||||
Handle(TCollection_HAsciiString) aName;
|
||||
theData->ReadString(theNum, 1, "name", theAch, aName);
|
||||
|
||||
Handle(TCollection_HAsciiString) aDescription;
|
||||
Standard_Boolean hasDescription = Standard_True;
|
||||
if (theData->IsParamDefined(theNum, 2))
|
||||
{
|
||||
theData->ReadString(theNum, 2, "description", theAch, aDescription);
|
||||
}
|
||||
else
|
||||
{
|
||||
hasDescription = Standard_False;
|
||||
}
|
||||
|
||||
Handle(StepBasic_GeneralProperty) aRelatingGeneralProperty;
|
||||
theData->ReadEntity(theNum, 3, "relating_property", theAch, STANDARD_TYPE(StepBasic_GeneralProperty), aRelatingGeneralProperty);
|
||||
|
||||
Handle(StepBasic_GeneralProperty) aRelatedGeneralProperty;
|
||||
theData->ReadEntity(theNum, 4, "related_property", theAch, STANDARD_TYPE(StepBasic_GeneralProperty), aRelatedGeneralProperty);
|
||||
|
||||
// Initialize entity
|
||||
theEnt->Init(aName,
|
||||
hasDescription,
|
||||
aDescription,
|
||||
aRelatingGeneralProperty,
|
||||
aRelatedGeneralProperty);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : WriteStep
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void RWStepBasic_RWGeneralPropertyRelationship::WriteStep(StepData_StepWriter& theSW,
|
||||
const Handle(StepBasic_GeneralPropertyRelationship)& theEnt) const
|
||||
{
|
||||
theSW.Send(theEnt->Name());
|
||||
|
||||
if (theEnt->HasDescription())
|
||||
{
|
||||
theSW.Send(theEnt->Description());
|
||||
}
|
||||
else
|
||||
{
|
||||
theSW.SendUndef();
|
||||
}
|
||||
|
||||
theSW.Send(theEnt->RelatingGeneralProperty());
|
||||
|
||||
theSW.Send(theEnt->RelatedGeneralProperty());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Share
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void RWStepBasic_RWGeneralPropertyRelationship::Share(const Handle(StepBasic_GeneralPropertyRelationship)& theEnt,
|
||||
Interface_EntityIterator& theIter) const
|
||||
{
|
||||
theIter.AddItem(theEnt->RelatingGeneralProperty());
|
||||
|
||||
theIter.AddItem(theEnt->RelatedGeneralProperty());
|
||||
}
|
@@ -0,0 +1,60 @@
|
||||
// Copyright (c) 2024 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 _RWStepBasic_RWGeneralPropertyRelationship_HeaderFile
|
||||
#define _RWStepBasic_RWGeneralPropertyRelationship_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
class StepData_StepReaderData;
|
||||
class Interface_Check;
|
||||
class StepBasic_GeneralProperty;
|
||||
class StepData_StepWriter;
|
||||
class Interface_EntityIterator;
|
||||
|
||||
class StepBasic_GeneralPropertyRelationship;
|
||||
|
||||
//! Read & Write tool for GeneralPropertyRelationship
|
||||
class RWStepBasic_RWGeneralPropertyRelationship
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
//! Empty constructor
|
||||
Standard_EXPORT RWStepBasic_RWGeneralPropertyRelationship();
|
||||
|
||||
//! Reads GeneralPropertyAssociation
|
||||
Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& theData,
|
||||
const Standard_Integer theNum,
|
||||
Handle(Interface_Check)& theAch,
|
||||
const Handle(StepBasic_GeneralPropertyRelationship)& theEnt) const;
|
||||
|
||||
//! Writes GeneralPropertyAssociation
|
||||
Standard_EXPORT void WriteStep (StepData_StepWriter& theSW,
|
||||
const Handle(StepBasic_GeneralPropertyRelationship)& theEnt) const;
|
||||
|
||||
//! Fills data for graph (shared items)
|
||||
Standard_EXPORT void Share (const Handle(StepBasic_GeneralPropertyRelationship)& theEnt,
|
||||
Interface_EntityIterator& theIter) const;
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif // _RWStepBasic_RWGeneralPropertyRelationship_HeaderFile
|
@@ -8,6 +8,8 @@ RWStepRepr_RWAssemblyComponentUsageSubstitute.cxx
|
||||
RWStepRepr_RWAssemblyComponentUsageSubstitute.hxx
|
||||
RWStepRepr_RWBetweenShapeAspect.cxx
|
||||
RWStepRepr_RWBetweenShapeAspect.hxx
|
||||
RWStepRepr_RWBooleanRepresentationItem.cxx
|
||||
RWStepRepr_RWBooleanRepresentationItem.hxx
|
||||
RWStepRepr_RWCentreOfSymmetry.cxx
|
||||
RWStepRepr_RWCentreOfSymmetry.hxx
|
||||
RWStepRepr_RWCharacterizedRepresentation.cxx
|
||||
@@ -70,6 +72,8 @@ RWStepRepr_RWMaterialPropertyRepresentation.cxx
|
||||
RWStepRepr_RWMaterialPropertyRepresentation.hxx
|
||||
RWStepRepr_RWMeasureRepresentationItem.cxx
|
||||
RWStepRepr_RWMeasureRepresentationItem.hxx
|
||||
RWStepRepr_RWMechanicalDesignAndDraughtingRelationship.cxx
|
||||
RWStepRepr_RWMechanicalDesignAndDraughtingRelationship.hxx
|
||||
RWStepRepr_RWParallelOffset.cxx
|
||||
RWStepRepr_RWParallelOffset.hxx
|
||||
RWStepRepr_RWParametricRepresentationContext.cxx
|
||||
@@ -88,6 +92,8 @@ RWStepRepr_RWPropertyDefinitionRepresentation.cxx
|
||||
RWStepRepr_RWPropertyDefinitionRepresentation.hxx
|
||||
RWStepRepr_RWQuantifiedAssemblyComponentUsage.cxx
|
||||
RWStepRepr_RWQuantifiedAssemblyComponentUsage.hxx
|
||||
RWStepRepr_RWRealRepresentationItem.cxx
|
||||
RWStepRepr_RWRealRepresentationItem.hxx
|
||||
RWStepRepr_RWRepresentation.cxx
|
||||
RWStepRepr_RWRepresentation.hxx
|
||||
RWStepRepr_RWRepresentationContext.cxx
|
||||
|
50
src/RWStepRepr/RWStepRepr_RWBooleanRepresentationItem.cxx
Normal file
50
src/RWStepRepr/RWStepRepr_RWBooleanRepresentationItem.cxx
Normal file
@@ -0,0 +1,50 @@
|
||||
// Copyright (c) 2024 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 <RWStepRepr_RWBooleanRepresentationItem.hxx>
|
||||
#include <StepData_StepReaderData.hxx>
|
||||
#include <StepData_StepWriter.hxx>
|
||||
#include <StepRepr_BooleanRepresentationItem.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
RWStepRepr_RWBooleanRepresentationItem::RWStepRepr_RWBooleanRepresentationItem()
|
||||
{
|
||||
}
|
||||
|
||||
void RWStepRepr_RWBooleanRepresentationItem::ReadStep(const Handle(StepData_StepReaderData)& theData,
|
||||
const Standard_Integer theNum,
|
||||
Handle(Interface_Check)& theAch,
|
||||
const Handle(StepRepr_BooleanRepresentationItem)& theEnt) const
|
||||
{
|
||||
// Check number of parameters
|
||||
if (!theData->CheckNbParams(theNum, 2, theAch, "boolean_representation_item") ) return;
|
||||
|
||||
// --- inherited field : name ---
|
||||
Handle(TCollection_HAsciiString) aName;
|
||||
theData->ReadString (theNum, 1, "name", theAch, aName);
|
||||
|
||||
// --- own field : value ---
|
||||
Standard_Boolean aValue;
|
||||
theData->ReadBoolean (theNum, 2, "value", theAch, aValue);
|
||||
|
||||
//--- Initialisation of the read entity ---
|
||||
theEnt->Init(aName, aValue);
|
||||
}
|
||||
|
||||
void RWStepRepr_RWBooleanRepresentationItem::WriteStep(StepData_StepWriter& theSW,
|
||||
const Handle(StepRepr_BooleanRepresentationItem)& theEnt) const
|
||||
{
|
||||
theSW.Send(theEnt->Name());
|
||||
theSW.Send(theEnt->Value());
|
||||
}
|
45
src/RWStepRepr/RWStepRepr_RWBooleanRepresentationItem.hxx
Normal file
45
src/RWStepRepr/RWStepRepr_RWBooleanRepresentationItem.hxx
Normal file
@@ -0,0 +1,45 @@
|
||||
// Copyright (c) 2024 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _RWStepRepr_RWBooleanRepresentationItem_HeaderFile
|
||||
#define _RWStepRepr_RWBooleanRepresentationItem_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
class StepData_StepReaderData;
|
||||
class Interface_Check;
|
||||
class StepRepr_BooleanRepresentationItem;
|
||||
class StepData_StepWriter;
|
||||
|
||||
|
||||
//! Read & Write Module for BooleanRepresentationItem
|
||||
class RWStepRepr_RWBooleanRepresentationItem
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
Standard_EXPORT RWStepRepr_RWBooleanRepresentationItem();
|
||||
|
||||
Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& theData,
|
||||
const Standard_Integer theNum,
|
||||
Handle(Interface_Check)& theAch,
|
||||
const Handle(StepRepr_BooleanRepresentationItem)& theEnt) const;
|
||||
|
||||
Standard_EXPORT void WriteStep (StepData_StepWriter& theSW,
|
||||
const Handle(StepRepr_BooleanRepresentationItem)& theEnt) const;
|
||||
};
|
||||
#endif // _RWStepRepr_RWBooleanRepresentationItem_HeaderFile
|
@@ -0,0 +1,78 @@
|
||||
// Copyright (c) 2024 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 <Standard_Type.hxx>
|
||||
#include <Interface_EntityIterator.hxx>
|
||||
#include <RWStepRepr_RWMechanicalDesignAndDraughtingRelationship.hxx>
|
||||
#include <StepData_StepReaderData.hxx>
|
||||
#include <StepData_StepWriter.hxx>
|
||||
#include <StepRepr_Representation.hxx>
|
||||
#include <StepRepr_MechanicalDesignAndDraughtingRelationship.hxx>
|
||||
|
||||
RWStepRepr_RWMechanicalDesignAndDraughtingRelationship::
|
||||
RWStepRepr_RWMechanicalDesignAndDraughtingRelationship() {}
|
||||
|
||||
void RWStepRepr_RWMechanicalDesignAndDraughtingRelationship::ReadStep
|
||||
(const Handle(StepData_StepReaderData)& theData,
|
||||
const Standard_Integer theNum,
|
||||
Handle(Interface_Check)& theAch,
|
||||
const Handle(StepRepr_MechanicalDesignAndDraughtingRelationship)& theEnt) const
|
||||
{
|
||||
// Number of Parameter Control
|
||||
if (!theData->CheckNbParams(theNum, 4, theAch, "mechanical_design_and_draughting_relationship")) return;
|
||||
|
||||
// Inherited field : name
|
||||
Handle(TCollection_HAsciiString) aName;
|
||||
theData->ReadString (theNum, 1, "name", theAch, aName);
|
||||
|
||||
// Inherited field : description
|
||||
Handle(TCollection_HAsciiString) aDescription;
|
||||
if (theData->IsParamDefined (theNum, 2)) {
|
||||
theData->ReadString (theNum, 2, "description", theAch, aDescription);
|
||||
}
|
||||
// Inherited field : rep_1
|
||||
Handle(StepRepr_Representation) aRep1;
|
||||
theData->ReadEntity(theNum, 3, "rep_1", theAch, STANDARD_TYPE(StepRepr_Representation), aRep1);
|
||||
|
||||
// Inherited field : rep_2
|
||||
Handle(StepRepr_Representation) aRep2;
|
||||
theData->ReadEntity(theNum, 4, "rep_2", theAch, STANDARD_TYPE(StepRepr_Representation), aRep2);
|
||||
|
||||
// Initialisation of the read entity
|
||||
theEnt->Init(aName, aDescription, aRep1, aRep2);
|
||||
}
|
||||
|
||||
void RWStepRepr_RWMechanicalDesignAndDraughtingRelationship::WriteStep
|
||||
(StepData_StepWriter& theSW,
|
||||
const Handle(StepRepr_MechanicalDesignAndDraughtingRelationship)& theEnt) const
|
||||
{
|
||||
// Inherited field : name
|
||||
theSW.Send(theEnt->Name());
|
||||
|
||||
// Inherited field : description
|
||||
theSW.Send(theEnt->Description());
|
||||
|
||||
// Inherited field : rep_1
|
||||
theSW.Send(theEnt->Rep1());
|
||||
|
||||
// Inherited field : rep_2
|
||||
theSW.Send(theEnt->Rep2());
|
||||
}
|
||||
|
||||
void RWStepRepr_RWMechanicalDesignAndDraughtingRelationship::Share
|
||||
(const Handle(StepRepr_MechanicalDesignAndDraughtingRelationship)& theEnt,
|
||||
Interface_EntityIterator& theIter) const
|
||||
{
|
||||
theIter.GetOneItem(theEnt->Rep1());
|
||||
theIter.GetOneItem(theEnt->Rep2());
|
||||
}
|
@@ -0,0 +1,50 @@
|
||||
// Copyright (c) 2024 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _RWStepRepr_RWMechanicalDesignAndDraughtingRelationship_HeaderFile
|
||||
#define _RWStepRepr_RWMechanicalDesignAndDraughtingRelationship_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
class StepData_StepReaderData;
|
||||
class Interface_Check;
|
||||
class StepRepr_MechanicalDesignAndDraughtingRelationship;
|
||||
class StepData_StepWriter;
|
||||
class Interface_EntityIterator;
|
||||
|
||||
|
||||
//! Read & Write Module for MechanicalDesignAndDraughtingRelationship
|
||||
class RWStepRepr_RWMechanicalDesignAndDraughtingRelationship
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
Standard_EXPORT RWStepRepr_RWMechanicalDesignAndDraughtingRelationship();
|
||||
|
||||
Standard_EXPORT void ReadStep(const Handle(StepData_StepReaderData)& theData,
|
||||
const Standard_Integer theNum,
|
||||
Handle(Interface_Check)& theAch,
|
||||
const Handle(StepRepr_MechanicalDesignAndDraughtingRelationship)& theEnt) const;
|
||||
|
||||
Standard_EXPORT void WriteStep(StepData_StepWriter& theSW,
|
||||
const Handle(StepRepr_MechanicalDesignAndDraughtingRelationship)& theEnt) const;
|
||||
|
||||
Standard_EXPORT void Share(const Handle(StepRepr_MechanicalDesignAndDraughtingRelationship)& theEnt,
|
||||
Interface_EntityIterator& theIter) const;
|
||||
|
||||
};
|
||||
#endif // _RWStepRepr_RWMechanicalDesignAndDraughtingRelationship_HeaderFile
|
50
src/RWStepRepr/RWStepRepr_RWRealRepresentationItem.cxx
Normal file
50
src/RWStepRepr/RWStepRepr_RWRealRepresentationItem.cxx
Normal file
@@ -0,0 +1,50 @@
|
||||
// Copyright (c) 2024 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 <RWStepRepr_RWRealRepresentationItem.hxx>
|
||||
#include <StepData_StepReaderData.hxx>
|
||||
#include <StepData_StepWriter.hxx>
|
||||
#include <StepRepr_RealRepresentationItem.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
RWStepRepr_RWRealRepresentationItem::RWStepRepr_RWRealRepresentationItem()
|
||||
{
|
||||
}
|
||||
|
||||
void RWStepRepr_RWRealRepresentationItem::ReadStep(const Handle(StepData_StepReaderData)& theData,
|
||||
const Standard_Integer theNum,
|
||||
Handle(Interface_Check)& theAch,
|
||||
const Handle(StepRepr_RealRepresentationItem)& theEnt) const
|
||||
{
|
||||
// Check number of parameters
|
||||
if (!theData->CheckNbParams (theNum, 2, theAch, "real_representation_item")) return;
|
||||
|
||||
// --- inherited field : name ---
|
||||
Handle(TCollection_HAsciiString) aName;
|
||||
theData->ReadString (theNum, 1, "name", theAch, aName);
|
||||
|
||||
// --- own field : value ---
|
||||
Standard_Real aValue;
|
||||
theData->ReadReal (theNum, 2, "value", theAch, aValue);
|
||||
|
||||
//--- Initialisation of the read entity ---
|
||||
theEnt->Init(aName, aValue);
|
||||
}
|
||||
|
||||
void RWStepRepr_RWRealRepresentationItem::WriteStep(StepData_StepWriter& theSW,
|
||||
const Handle(StepRepr_RealRepresentationItem)& theEnt) const
|
||||
{
|
||||
theSW.Send(theEnt->Name());
|
||||
theSW.Send(theEnt->Value());
|
||||
}
|
46
src/RWStepRepr/RWStepRepr_RWRealRepresentationItem.hxx
Normal file
46
src/RWStepRepr/RWStepRepr_RWRealRepresentationItem.hxx
Normal file
@@ -0,0 +1,46 @@
|
||||
// Copyright (c) 2024 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _RWStepRepr_RWRealRepresentationItem_HeaderFile
|
||||
#define _RWStepRepr_RWRealRepresentationItem_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
class StepData_StepReaderData;
|
||||
class Interface_Check;
|
||||
class StepRepr_RealRepresentationItem;
|
||||
class StepData_StepWriter;
|
||||
|
||||
|
||||
//! Read & Write Module for RealRepresentationItem
|
||||
class RWStepRepr_RWRealRepresentationItem
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT RWStepRepr_RWRealRepresentationItem();
|
||||
|
||||
Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& theData,
|
||||
const Standard_Integer theNum,
|
||||
Handle(Interface_Check)& theAch,
|
||||
const Handle(StepRepr_RealRepresentationItem)& theEnt) const;
|
||||
|
||||
Standard_EXPORT void WriteStep (StepData_StepWriter& theSW,
|
||||
const Handle(StepRepr_RealRepresentationItem)& theEnt) const;
|
||||
};
|
||||
#endif // _RWStepRepr_RWRealRepresentationItem_HeaderFile
|
@@ -116,6 +116,8 @@ bool STEPCAFControl_ConfigurationNode::Load(const Handle(DE_ConfigurationContext
|
||||
theResource->BooleanVal("read.layer", InternalParameters.ReadLayer, aScope);
|
||||
InternalParameters.ReadProps =
|
||||
theResource->BooleanVal("read.props", InternalParameters.ReadProps, aScope);
|
||||
InternalParameters.ReadMetadata =
|
||||
theResource->BooleanVal("read.metadata", InternalParameters.ReadMetadata, aScope);
|
||||
|
||||
InternalParameters.WritePrecisionMode = (StepData_ConfParameters::WriteMode_PrecisionMode)
|
||||
theResource->IntegerVal("write.precision.mode", InternalParameters.WritePrecisionMode, aScope);
|
||||
@@ -151,8 +153,6 @@ bool STEPCAFControl_ConfigurationNode::Load(const Handle(DE_ConfigurationContext
|
||||
theResource->BooleanVal("write.props", InternalParameters.WriteProps, aScope);
|
||||
InternalParameters.WriteModelType = (STEPControl_StepModelType)
|
||||
theResource->IntegerVal("write.model.type", InternalParameters.WriteModelType, aScope);
|
||||
InternalParameters.WriteNonmanifold =
|
||||
theResource->IntegerVal("write.nonmanifold", InternalParameters.WriteNonmanifold, aScope);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -372,6 +372,12 @@ TCollection_AsciiString STEPCAFControl_ConfigurationNode::Save() const
|
||||
aResult += aScope + "read.props :\t " + InternalParameters.ReadProps + "\n";
|
||||
aResult += "!\n";
|
||||
|
||||
aResult += "!\n";
|
||||
aResult += "!Setting up the read.metadata parameter which is used to indicate read Metadata or not\n";
|
||||
aResult += "!Default value: 1(\"ON\"). Available values: 0(\"OFF\"), 1(\"ON\")\n";
|
||||
aResult += aScope + "read.metadata :\t " + InternalParameters.ReadMetadata + "\n";
|
||||
aResult += "!\n";
|
||||
|
||||
aResult += "!\n";
|
||||
aResult += "!Write Parameters:\n";
|
||||
aResult += "!\n";
|
||||
|
@@ -73,13 +73,15 @@ bool STEPCAFControl_Provider::Read(const TCollection_AsciiString& thePath,
|
||||
aReader.SetNameMode(aNode->InternalParameters.ReadName);
|
||||
aReader.SetLayerMode(aNode->InternalParameters.ReadLayer);
|
||||
aReader.SetPropsMode(aNode->InternalParameters.ReadProps);
|
||||
aReader.SetMetaMode(aNode->InternalParameters.ReadMetadata);
|
||||
|
||||
IFSelect_ReturnStatus aReadStat = IFSelect_RetVoid;
|
||||
aReadStat = aReader.ReadFile(thePath.ToCString(), aNode->InternalParameters);
|
||||
StepData_ConfParameters aParams;
|
||||
aReadStat = aReader.ReadFile(thePath.ToCString(), aParams);
|
||||
if (aReadStat != IFSelect_RetDone)
|
||||
{
|
||||
Message::SendFail() << "Error in the STEPCAFControl_Provider during reading the file " <<
|
||||
thePath << "\t: abandon";
|
||||
aNode->InternalParameters.Reset();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -87,10 +89,8 @@ bool STEPCAFControl_Provider::Read(const TCollection_AsciiString& thePath,
|
||||
{
|
||||
Message::SendFail() << "Error in the STEPCAFControl_Provider during reading the file " <<
|
||||
thePath << "\t: Cannot read any relevant data from the STEP file";
|
||||
aNode->InternalParameters.Reset();
|
||||
return false;
|
||||
}
|
||||
aNode->InternalParameters.Reset();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -124,13 +124,13 @@ bool STEPCAFControl_Provider::Write(const TCollection_AsciiString& thePath,
|
||||
aWriter.SetNameMode(aNode->InternalParameters.WriteName);
|
||||
aWriter.SetLayerMode(aNode->InternalParameters.WriteLayer);
|
||||
aWriter.SetPropsMode(aNode->InternalParameters.WriteProps);
|
||||
aModel->SetWriteLengthUnit(UnitsMethods::GetLengthUnitScale(aNode->InternalParameters.WriteUnit, UnitsMethods_LengthUnit_Millimeter));
|
||||
|
||||
TDF_Label aLabel;
|
||||
if (!aWriter.Transfer(theDocument, aNode->InternalParameters, aMode, 0, theProgress))
|
||||
StepData_ConfParameters aParams;
|
||||
if (!aWriter.Transfer(theDocument, aParams, aMode, 0, theProgress))
|
||||
{
|
||||
Message::SendFail() << "Error in the STEPCAFControl_Provider during writing the file " <<
|
||||
thePath << "\t: The document cannot be translated or gives no result";
|
||||
aNode->InternalParameters.Reset();
|
||||
return false;
|
||||
}
|
||||
IFSelect_ReturnStatus aStatus = aWriter.Write(thePath.ToCString());
|
||||
@@ -140,7 +140,6 @@ bool STEPCAFControl_Provider::Write(const TCollection_AsciiString& thePath,
|
||||
{
|
||||
Message::SendFail() << "Error in the STEPCAFControl_Provider during writing the file " <<
|
||||
thePath << "\t: No file written";
|
||||
aNode->InternalParameters.Reset();
|
||||
return false;;
|
||||
}
|
||||
case IFSelect_RetDone:
|
||||
@@ -151,11 +150,9 @@ bool STEPCAFControl_Provider::Write(const TCollection_AsciiString& thePath,
|
||||
{
|
||||
Message::SendFail() << "Error in the STEPCAFControl_Provider during writing the file " <<
|
||||
thePath << "\t: Error on writing file";
|
||||
aNode->InternalParameters.Reset();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
aNode->InternalParameters.Reset();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -204,13 +201,13 @@ bool STEPCAFControl_Provider::Read(const TCollection_AsciiString& thePath,
|
||||
STEPControl_Reader aReader;
|
||||
aReader.SetWS(theWS);
|
||||
IFSelect_ReturnStatus aReadstat = IFSelect_RetVoid;
|
||||
aReadstat = aReader.ReadFile(thePath.ToCString(), aNode->InternalParameters);
|
||||
StepData_ConfParameters aParams;
|
||||
aReadstat = aReader.ReadFile(thePath.ToCString(), aParams);
|
||||
Handle(StepData_StepModel) aModel = aReader.StepModel();
|
||||
if (aReadstat != IFSelect_RetDone)
|
||||
{
|
||||
Message::SendFail() << "Error in the STEPCAFControl_Provider during reading the file " <<
|
||||
thePath << "\t: abandon, no model loaded";
|
||||
aNode->InternalParameters.Reset();
|
||||
return false;
|
||||
}
|
||||
aModel->SetLocalLengthUnit(aNode->GlobalParameters.LengthUnit);
|
||||
@@ -218,11 +215,9 @@ bool STEPCAFControl_Provider::Read(const TCollection_AsciiString& thePath,
|
||||
{
|
||||
Message::SendFail() << "Error in the STEPCAFControl_Provider during reading the file " <<
|
||||
thePath << "\t:Cannot read any relevant data from the STEP file";
|
||||
aNode->InternalParameters.Reset();
|
||||
return false;
|
||||
}
|
||||
theShape = aReader.OneShape();
|
||||
aNode->InternalParameters.Reset();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -249,21 +244,19 @@ bool STEPCAFControl_Provider::Write(const TCollection_AsciiString& thePath,
|
||||
IFSelect_ReturnStatus aWritestat = IFSelect_RetVoid;
|
||||
Handle(StepData_StepModel) aModel = aWriter.Model();
|
||||
aModel->SetWriteLengthUnit(UnitsMethods::GetLengthUnitScale(aNode->InternalParameters.WriteUnit, UnitsMethods_LengthUnit_Millimeter));
|
||||
aWritestat = aWriter.Transfer(theShape, aNode->InternalParameters.WriteModelType, aNode->InternalParameters, true, theProgress);
|
||||
StepData_ConfParameters aParams;
|
||||
aWritestat = aWriter.Transfer(theShape, aNode->InternalParameters.WriteModelType, aParams, true, theProgress);
|
||||
if (aWritestat != IFSelect_RetDone)
|
||||
{
|
||||
Message::SendFail() << "Error in the STEPCAFControl_Provider during reading the file " <<
|
||||
thePath << "\t: abandon, no model loaded";
|
||||
aNode->InternalParameters.Reset();
|
||||
return false;
|
||||
}
|
||||
if (aWriter.Write(thePath.ToCString()) != IFSelect_RetDone)
|
||||
{
|
||||
Message::SendFail() << "STEPCAFControl_Provider: Error on writing file";
|
||||
aNode->InternalParameters.Reset();
|
||||
return false;
|
||||
}
|
||||
aNode->InternalParameters.Reset();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -30,9 +30,12 @@
|
||||
#include <StepBasic_ConversionBasedUnitAndLengthUnit.hxx>
|
||||
#include <StepBasic_ConversionBasedUnitAndPlaneAngleUnit.hxx>
|
||||
#include <StepBasic_ConversionBasedUnitAndMassUnit.hxx>
|
||||
#include <StepBasic_ConversionBasedUnitAndTimeUnit.hxx>
|
||||
#include <StepBasic_DerivedUnit.hxx>
|
||||
#include <StepBasic_DerivedUnitElement.hxx>
|
||||
#include <StepBasic_DocumentFile.hxx>
|
||||
#include <StepBasic_GeneralProperty.hxx>
|
||||
#include <StepBasic_GeneralPropertyAssociation.hxx>
|
||||
#include <StepBasic_MeasureValueMember.hxx>
|
||||
#include <StepBasic_NamedUnit.hxx>
|
||||
#include <StepBasic_Product.hxx>
|
||||
@@ -40,6 +43,9 @@
|
||||
#include <StepBasic_ProductDefinitionFormation.hxx>
|
||||
#include <StepBasic_ProductDefinitionWithAssociatedDocuments.hxx>
|
||||
#include <StepBasic_SiUnitAndLengthUnit.hxx>
|
||||
#include <StepBasic_SiUnitAndMassUnit.hxx>
|
||||
#include <StepBasic_SiUnitAndThermodynamicTemperatureUnit.hxx>
|
||||
#include <StepBasic_SiUnitAndTimeUnit.hxx>
|
||||
#include <STEPCAFControl_Controller.hxx>
|
||||
#include <STEPCAFControl_DataMapOfPDExternFile.hxx>
|
||||
#include <STEPCAFControl_DataMapOfShapePD.hxx>
|
||||
@@ -129,6 +135,7 @@
|
||||
#include <StepShape_DimensionalLocation.hxx>
|
||||
#include <StepShape_EdgeCurve.hxx>
|
||||
#include <StepShape_EdgeLoop.hxx>
|
||||
#include <StepShape_GeometricCurveSet.hxx>
|
||||
#include <StepShape_GeometricSet.hxx>
|
||||
#include <StepShape_HArray1OfFace.hxx>
|
||||
#include <StepShape_HArray1OfFaceBound.hxx>
|
||||
@@ -214,6 +221,7 @@
|
||||
#include <XSControl_WorkSession.hxx>
|
||||
#include <StepAP242_DraughtingModelItemAssociation.hxx>
|
||||
#include <StepAP242_GeometricItemSpecificUsage.hxx>
|
||||
#include <StepAP242_IdAttribute.hxx>
|
||||
#include <StepGeom_CartesianPoint.hxx>
|
||||
#include <STEPCAFControl_GDTProperty.hxx>
|
||||
#include <StepVisual_TessellatedAnnotationOccurrence.hxx>
|
||||
@@ -225,7 +233,15 @@
|
||||
#include <StepVisual_OverRidingStyledItem.hxx>
|
||||
#include <StepVisual_ContextDependentOverRidingStyledItem.hxx>
|
||||
#include <StepRepr_ShapeRepresentationRelationshipWithTransformation.hxx>
|
||||
#include <StepRepr_BooleanRepresentationItem.hxx>
|
||||
#include <StepRepr_IntegerRepresentationItem.hxx>
|
||||
#include <StepRepr_ItemDefinedTransformation.hxx>
|
||||
#include <StepRepr_PropertyDefinitionRelationship.hxx>
|
||||
#include <StepRepr_RealRepresentationItem.hxx>
|
||||
#include <StepRepr_ValueRepresentationItem.hxx>
|
||||
|
||||
#include <StepRepr_ShapeAspectRelationship.hxx>
|
||||
|
||||
|
||||
#include <TColgp_HArray1OfXYZ.hxx>
|
||||
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||
@@ -275,6 +291,7 @@ STEPCAFControl_Reader::STEPCAFControl_Reader()
|
||||
myNameMode(Standard_True),
|
||||
myLayerMode(Standard_True),
|
||||
myPropsMode(Standard_True),
|
||||
myMetaMode(Standard_True),
|
||||
mySHUOMode(Standard_False),
|
||||
myGDTMode(Standard_True),
|
||||
myMatMode(Standard_True),
|
||||
@@ -299,6 +316,7 @@ STEPCAFControl_Reader::STEPCAFControl_Reader(const Handle(XSControl_WorkSession)
|
||||
myNameMode(Standard_True),
|
||||
myLayerMode(Standard_True),
|
||||
myPropsMode(Standard_True),
|
||||
myMetaMode(Standard_True),
|
||||
mySHUOMode(Standard_False),
|
||||
myGDTMode(Standard_True),
|
||||
myMatMode(Standard_True),
|
||||
@@ -573,7 +591,6 @@ Standard_Boolean STEPCAFControl_Reader::Transfer (STEPControl_Reader &reader,
|
||||
{
|
||||
reader.ClearShapes();
|
||||
Handle(StepData_StepModel) aModel = Handle(StepData_StepModel)::DownCast(reader.Model());
|
||||
myReader.WS()->TransferReader()->SetEncodeRegAngle(aModel->InternalParameters.EncodeRegAngle);
|
||||
StepData_Factors aLocalFactors;
|
||||
prepareUnits(aModel, doc, aLocalFactors);
|
||||
Standard_Integer i;
|
||||
@@ -771,6 +788,10 @@ Standard_Boolean STEPCAFControl_Reader::Transfer (STEPControl_Reader &reader,
|
||||
if (GetViewMode())
|
||||
ReadViews(reader.WS(), doc, aLocalFactors);
|
||||
|
||||
// read metadata
|
||||
if (GetMetaMode())
|
||||
ReadMetadata(reader.WS(), doc, aLocalFactors);
|
||||
|
||||
// Expand resulting CAF structure for sub-shapes (optionally with their
|
||||
// names) if requested
|
||||
ExpandSubShapes(STool, ShapePDMap);
|
||||
@@ -1958,7 +1979,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadSHUOs(const Handle(XSControl_WorkSes
|
||||
//function : GetMassConversionFactor
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
static Standard_Boolean GetMassConversionFactor(Handle(StepBasic_NamedUnit)& NU,
|
||||
static Standard_Boolean GetMassConversionFactor(const Handle(StepBasic_NamedUnit)& NU,
|
||||
Standard_Real& afact)
|
||||
{
|
||||
afact = 1.;
|
||||
@@ -1997,7 +2018,7 @@ Handle(Poly_Triangulation) createMesh(const Handle(StepVisual_ComplexTriangulate
|
||||
const Standard_Integer aNbNormals = theTriangulatedSufaceSet->NbNormals();
|
||||
// Number of pairs (Point, Normal). It is possible for one point to have multiple normals. This is
|
||||
// useful when the underlying surface is not C1 continuous.
|
||||
const Standard_Integer aNbPairs = aNbNormals > 1 ? theTriangulatedSufaceSet->NbPnindex() : aNodes->Length();
|
||||
const Standard_Integer aNbPairs = aNbNormals > 1 ? theTriangulatedSufaceSet->Pnmax() : aNodes->Length();
|
||||
const Standard_Boolean aHasNormals = aNbNormals > 0;
|
||||
|
||||
// Counting number of triangles in the triangle strips list.
|
||||
@@ -2022,7 +2043,7 @@ Handle(Poly_Triangulation) createMesh(const Handle(StepVisual_ComplexTriangulate
|
||||
|
||||
for (Standard_Integer j = 1; j <= aNbPairs; ++j)
|
||||
{
|
||||
const gp_XYZ& aPoint = aNodes->Value(aNbNormals > 1 ? theTriangulatedSufaceSet->PnindexValue(j) : j);
|
||||
const gp_XYZ& aPoint = aNodes->Value((aNbNormals > 1 && theTriangulatedSufaceSet->NbPnindex() > 0) ? theTriangulatedSufaceSet->PnindexValue(j) : j);
|
||||
aMesh->SetNode(j, theFact * aPoint);
|
||||
}
|
||||
|
||||
@@ -2113,11 +2134,12 @@ Standard_Boolean readPMIPresentation(const Handle(Standard_Transient)& thePresen
|
||||
return Standard_False;
|
||||
}
|
||||
Handle(Transfer_TransientProcess) aTP = theTR->TransientProcess();
|
||||
Handle(StepVisual_AnnotationOccurrence) anAO;
|
||||
Handle(StepVisual_StyledItem) anAO;
|
||||
NCollection_Vector<Handle(StepVisual_StyledItem)> anAnnotations;
|
||||
if (thePresentEntity->IsKind(STANDARD_TYPE(StepVisual_AnnotationOccurrence)))
|
||||
if (thePresentEntity->IsKind(STANDARD_TYPE(StepVisual_AnnotationOccurrence)) ||
|
||||
thePresentEntity->IsKind(STANDARD_TYPE(StepVisual_TessellatedAnnotationOccurrence)))
|
||||
{
|
||||
anAO = Handle(StepVisual_AnnotationOccurrence)::DownCast(thePresentEntity);
|
||||
anAO = Handle(StepVisual_StyledItem)::DownCast(thePresentEntity);
|
||||
if (!anAO.IsNull())
|
||||
{
|
||||
thePresentName = anAO->Name();
|
||||
@@ -4347,7 +4369,8 @@ Standard_Boolean STEPCAFControl_Reader::ReadGDTs(const Handle(XSControl_WorkSess
|
||||
}
|
||||
}
|
||||
else if (anEnt->IsKind(STANDARD_TYPE(StepVisual_DraughtingCallout)) ||
|
||||
anEnt->IsKind(STANDARD_TYPE(StepVisual_AnnotationOccurrence)))
|
||||
anEnt->IsKind(STANDARD_TYPE(StepVisual_AnnotationOccurrence)) ||
|
||||
anEnt->IsKind(STANDARD_TYPE(StepVisual_TessellatedAnnotationOccurrence)))
|
||||
{
|
||||
// Protection against import presentation twice
|
||||
Handle(StepVisual_DraughtingCallout) aDC;
|
||||
@@ -5244,6 +5267,26 @@ Standard_Boolean STEPCAFControl_Reader::GetPropsMode() const
|
||||
return myPropsMode;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetMetaMode
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void STEPCAFControl_Reader::SetMetaMode(const Standard_Boolean theMetaMode)
|
||||
{
|
||||
myMetaMode = theMetaMode;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetMetaMode
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean STEPCAFControl_Reader::GetMetaMode() const
|
||||
{
|
||||
return myMetaMode;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetSHUOMode
|
||||
//purpose :
|
||||
@@ -5324,3 +5367,427 @@ Standard_Boolean STEPCAFControl_Reader::GetViewMode() const
|
||||
{
|
||||
return myViewMode;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ReadMetadata
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean STEPCAFControl_Reader::ReadMetadata(const Handle(XSControl_WorkSession)& theWS,
|
||||
const Handle(TDocStd_Document)& theDoc,
|
||||
const StepData_Factors& theLocalFactors) const
|
||||
{
|
||||
const Handle(Interface_InterfaceModel)& aModel = theWS->Model();
|
||||
const Handle(XSControl_TransferReader)& aTR = theWS->TransferReader();
|
||||
const Handle(Transfer_TransientProcess)& aTP = aTR->TransientProcess();
|
||||
Handle(XCAFDoc_ShapeTool) aSTool = XCAFDoc_DocumentTool::ShapeTool(theDoc->Main());
|
||||
if (aSTool.IsNull())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
Standard_Integer aNb = aModel->NbEntities();
|
||||
STEPConstruct_Tool aTool(theWS);
|
||||
|
||||
for (Standard_Integer anEntityInd = 1; anEntityInd <= aNb; ++anEntityInd)
|
||||
{
|
||||
Handle(Standard_Transient) anEntity = aModel->Value(anEntityInd);
|
||||
Handle(StepBasic_GeneralProperty) aGeneralProp = Handle(StepBasic_GeneralProperty)::DownCast(anEntity);
|
||||
if (aGeneralProp.IsNull())
|
||||
continue;
|
||||
|
||||
Handle(StepBasic_GeneralPropertyAssociation) aPropAssociation;
|
||||
NCollection_List< Handle(StepRepr_PropertyDefinition)> aPropDefinitionList;
|
||||
Interface_EntityIterator aSharingListOfGP = theWS->Graph().Sharings(aGeneralProp);
|
||||
for (aSharingListOfGP.Start(); aSharingListOfGP.More(); aSharingListOfGP.Next())
|
||||
{
|
||||
aPropAssociation = Handle(StepBasic_GeneralPropertyAssociation)::DownCast(aSharingListOfGP.Value());
|
||||
if (aPropAssociation.IsNull())
|
||||
continue;
|
||||
|
||||
aPropDefinitionList.Append(aPropAssociation->PropertyDefinition());
|
||||
}
|
||||
|
||||
if (aPropDefinitionList.IsEmpty())
|
||||
continue;
|
||||
|
||||
NCollection_List< Handle(StepRepr_PropertyDefinition)>::Iterator aPropDefIter(aPropDefinitionList);
|
||||
for ( ; aPropDefIter.More(); aPropDefIter.Next())
|
||||
{
|
||||
Handle(StepRepr_PropertyDefinition) aPropDefinition = aPropDefIter.Value();
|
||||
|
||||
// check group of PropertyDefinition
|
||||
NCollection_List<Handle(StepRepr_PropertyDefinition)> aGroupedProperties;
|
||||
Interface_EntityIterator aSharingsListOfPD = theWS->Graph().Sharings(aPropDefinition);
|
||||
for (aSharingsListOfPD.Start(); aSharingsListOfPD.More(); aSharingsListOfPD.Next())
|
||||
{
|
||||
Handle(StepRepr_PropertyDefinitionRelationship) aRel =
|
||||
Handle(StepRepr_PropertyDefinitionRelationship)::DownCast(aSharingsListOfPD.Value());
|
||||
if (aRel.IsNull())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Handle(StepRepr_PropertyDefinition) aGroupedProp = aRel->RelatedPropertyDefinition();
|
||||
if (!aGroupedProp.IsNull())
|
||||
{
|
||||
aGroupedProperties.Append(aGroupedProp);
|
||||
}
|
||||
}
|
||||
|
||||
NCollection_List<Handle(Transfer_Binder)> aBinders;
|
||||
Interface_EntityIterator aSharedListOfPD = theWS->Graph().Shareds(aPropDefinition);
|
||||
for (aSharedListOfPD.Start(); aSharedListOfPD.More(); aSharedListOfPD.Next())
|
||||
{
|
||||
Handle(Transfer_Binder) aBinder;
|
||||
Handle(StepBasic_ProductDefinition) aProductDefinition =
|
||||
Handle(StepBasic_ProductDefinition)::DownCast(aSharedListOfPD.Value());
|
||||
if (!aProductDefinition.IsNull())
|
||||
{
|
||||
aBinder = aTP->Find(aProductDefinition);
|
||||
if (!aBinder.IsNull())
|
||||
{
|
||||
aBinders.Append(aBinder);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
Handle(StepRepr_ProductDefinitionShape) aProductDefinitionShape =
|
||||
Handle(StepRepr_ProductDefinitionShape)::DownCast(aSharedListOfPD.Value());
|
||||
if (!aProductDefinitionShape.IsNull())
|
||||
{
|
||||
Handle(StepBasic_ProductDefinition) aProductDef =
|
||||
aProductDefinitionShape->Definition().ProductDefinition();
|
||||
aBinder = aTP->Find(aProductDef);
|
||||
if (!aBinder.IsNull())
|
||||
{
|
||||
aBinders.Append(aBinder);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
Handle(StepRepr_NextAssemblyUsageOccurrence) aNextAssembUsOcc =
|
||||
Handle(StepRepr_NextAssemblyUsageOccurrence)::DownCast(aSharedListOfPD.Value());
|
||||
if (!aNextAssembUsOcc.IsNull())
|
||||
{
|
||||
aBinder = aTP->Find(aNextAssembUsOcc);
|
||||
if (!aBinder.IsNull())
|
||||
{
|
||||
aBinders.Append(aBinder);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
Handle(StepRepr_ShapeAspect) aShapeAspect =
|
||||
Handle(StepRepr_ShapeAspect)::DownCast(aSharedListOfPD.Value());
|
||||
if (!aShapeAspect.IsNull())
|
||||
{
|
||||
TDF_Label aLabel;
|
||||
if (!aBinder.IsNull())
|
||||
{
|
||||
TopoDS_Shape aShape = TransferBRep::ShapeResult(aTP, aBinder);
|
||||
if (aShape.IsNull())
|
||||
continue;
|
||||
|
||||
if (myMap.IsBound(aShape))
|
||||
{
|
||||
aLabel = myMap.Find(aShape);
|
||||
}
|
||||
}
|
||||
Interface_EntityIterator aSharedListOfSA = theWS->Graph().Sharings(aShapeAspect);
|
||||
for (aSharedListOfSA.Start(); aSharedListOfSA.More(); aSharedListOfSA.Next())
|
||||
{
|
||||
Handle(StepAP242_DraughtingModelItemAssociation) aDMIA =
|
||||
Handle(StepAP242_DraughtingModelItemAssociation)::DownCast(aSharedListOfSA.Value());
|
||||
if (!aDMIA.IsNull())
|
||||
break;
|
||||
|
||||
Handle(StepAP242_ItemIdentifiedRepresentationUsage) anItemIdentUsage =
|
||||
Handle(StepAP242_ItemIdentifiedRepresentationUsage)::DownCast(aSharedListOfSA.Value());
|
||||
if (!anItemIdentUsage.IsNull())
|
||||
{
|
||||
for (Standard_Integer anIndex = 1; anIndex <= anItemIdentUsage->NbIdentifiedItem(); ++anIndex)
|
||||
{
|
||||
Handle(StepRepr_RepresentationItem) aReprItem = anItemIdentUsage->IdentifiedItemValue(anIndex);
|
||||
if (aReprItem.IsNull())
|
||||
continue;
|
||||
aBinder = aTP->Find(aReprItem);
|
||||
if (!aBinder.IsNull())
|
||||
{
|
||||
aBinders.Append(aBinder);
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
Handle(StepRepr_PropertyDefinition) aPropDef =
|
||||
Handle(StepRepr_PropertyDefinition)::DownCast(aSharedListOfSA.Value());
|
||||
if (!aPropDef.IsNull() && aPropDef != aPropDefinition)
|
||||
{
|
||||
Interface_EntityIterator aSharingListOfPD = theWS->Graph().Sharings(aPropDef);
|
||||
for (aSharingListOfPD.Start(); aSharingListOfPD.More(); aSharingListOfPD.Next())
|
||||
{
|
||||
Handle(StepShape_ShapeDefinitionRepresentation) aShDef =
|
||||
Handle(StepShape_ShapeDefinitionRepresentation)::DownCast(aSharingListOfPD.Value());
|
||||
if (aShDef.IsNull())
|
||||
continue;
|
||||
|
||||
findReprItems(theWS, aShDef, aBinders);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
Handle(StepShape_ShapeDefinitionRepresentation) aShapeDefRepr =
|
||||
Handle(StepShape_ShapeDefinitionRepresentation)::DownCast(aSharedListOfSA.Value());
|
||||
if (!aShapeDefRepr.IsNull())
|
||||
{
|
||||
findReprItems(theWS, aShapeDefRepr, aBinders);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (aBinders.IsEmpty())
|
||||
continue;
|
||||
|
||||
TDF_LabelSequence aLabelSeq;
|
||||
NCollection_List<Handle(Transfer_Binder)>::Iterator aBindIt(aBinders);
|
||||
for (; aBindIt.More(); aBindIt.Next())
|
||||
{
|
||||
TopoDS_Shape aShape = TransferBRep::ShapeResult(aTP, aBindIt.Value());
|
||||
if (aShape.IsNull())
|
||||
continue;
|
||||
|
||||
TDF_Label aShapeLabel;
|
||||
if (myMap.IsBound(aShape))
|
||||
{
|
||||
aShapeLabel = myMap.Find(aShape);
|
||||
}
|
||||
if (!aShapeLabel.IsNull())
|
||||
{
|
||||
aLabelSeq.Append(aShapeLabel);
|
||||
}
|
||||
}
|
||||
|
||||
//create metadata
|
||||
for (TDF_LabelSequence::Iterator aLabelIt(aLabelSeq); aLabelIt.More(); aLabelIt.Next())
|
||||
{
|
||||
TDF_Label aLabel = aLabelIt.Value();
|
||||
Handle(TDataStd_NamedData) anAttr;
|
||||
if (!aLabel.FindAttribute(TDataStd_NamedData::GetID(), anAttr))
|
||||
{
|
||||
anAttr = new TDataStd_NamedData;
|
||||
aLabel.AddAttribute(anAttr);
|
||||
}
|
||||
|
||||
fillAttributes(theWS, aPropDefinition, theLocalFactors, anAttr);
|
||||
if (!aGroupedProperties.IsEmpty())
|
||||
{
|
||||
NCollection_List<Handle(StepRepr_PropertyDefinition)>::Iterator aPropIt(aGroupedProperties);
|
||||
for ( ; aPropIt.More(); aPropIt.Next())
|
||||
{
|
||||
fillAttributes(theWS, aPropIt.Value(), theLocalFactors, anAttr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : findReprItems
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean STEPCAFControl_Reader::findReprItems(const Handle(XSControl_WorkSession)& theWS,
|
||||
const Handle(StepShape_ShapeDefinitionRepresentation)& theShDefRepr,
|
||||
NCollection_List<Handle(Transfer_Binder)>& theBinders) const
|
||||
{
|
||||
Handle(StepRepr_Representation) aRepr = theShDefRepr->UsedRepresentation();
|
||||
if (aRepr.IsNull())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
Handle(Transfer_Binder) aBinder;
|
||||
const Handle(Transfer_TransientProcess)& aTP = theWS->TransferReader()->TransientProcess();
|
||||
Handle(StepRepr_HArray1OfRepresentationItem) aReprItems = aRepr->Items();
|
||||
if (!aReprItems->IsEmpty())
|
||||
{
|
||||
for (Standard_Integer anInd = aReprItems->Lower(); anInd <= aReprItems->Upper(); anInd++)
|
||||
{
|
||||
Handle(StepRepr_RepresentationItem) aReprItem = aReprItems->Value(anInd);
|
||||
aBinder = aTP->Find(aReprItem);
|
||||
if (!aBinder.IsNull())
|
||||
{
|
||||
theBinders.Append(aBinder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : fillAttributes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean STEPCAFControl_Reader::fillAttributes(const Handle(XSControl_WorkSession)& theWS,
|
||||
const Handle(StepRepr_PropertyDefinition)& thePropDef,
|
||||
const StepData_Factors& theLocalFactors,
|
||||
Handle(TDataStd_NamedData)& theAttr) const
|
||||
{
|
||||
// skip if key is null
|
||||
if (thePropDef->Name().IsNull())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
Handle(StepRepr_PropertyDefinitionRepresentation) aPropDefRepr;
|
||||
Interface_EntityIterator aSharingListOfPD = theWS->Graph().Sharings(thePropDef);
|
||||
for (aSharingListOfPD.Start(); aSharingListOfPD.More(); aSharingListOfPD.Next())
|
||||
{
|
||||
aPropDefRepr = Handle(StepRepr_PropertyDefinitionRepresentation)::DownCast(aSharingListOfPD.Value());
|
||||
if (aPropDefRepr.IsNull())
|
||||
continue;
|
||||
|
||||
Handle(StepRepr_Representation) aUsedRepr = aPropDefRepr->UsedRepresentation();
|
||||
if (aUsedRepr.IsNull())
|
||||
continue;
|
||||
|
||||
Handle(StepRepr_HArray1OfRepresentationItem) aReprItems = aUsedRepr->Items();
|
||||
if (!aReprItems.IsNull())
|
||||
{
|
||||
for (Standard_Integer anIndex = aReprItems->Lower(); anIndex <= aReprItems->Upper(); anIndex++)
|
||||
{
|
||||
Handle(StepRepr_RepresentationItem) anItem = aReprItems->Value(anIndex);
|
||||
if (anItem.IsNull())
|
||||
continue;
|
||||
|
||||
if (anItem->IsKind(STANDARD_TYPE(StepRepr_DescriptiveRepresentationItem)))
|
||||
{
|
||||
Handle(StepRepr_DescriptiveRepresentationItem) aDescrItem = Handle(StepRepr_DescriptiveRepresentationItem)::DownCast(anItem);
|
||||
Handle(TCollection_HAsciiString) aDescription = aDescrItem->Description();
|
||||
theAttr->SetString(thePropDef->Name()->ToCString(), aDescription->ToCString());
|
||||
}
|
||||
else if (anItem->IsKind(STANDARD_TYPE(StepRepr_MeasureRepresentationItem)))
|
||||
{
|
||||
Handle(StepRepr_MeasureRepresentationItem) aMeasureItem = Handle(StepRepr_MeasureRepresentationItem)::DownCast(anItem);
|
||||
Standard_Real aValue = aMeasureItem->Measure()->ValueComponent();
|
||||
TCollection_AsciiString aValType = aMeasureItem->Measure()->ValueComponentMember()->Name();
|
||||
StepBasic_Unit anUnit = aMeasureItem->Measure()->UnitComponent();
|
||||
if (!anUnit.IsNull())
|
||||
{
|
||||
Standard_Real aParam = 1.;
|
||||
if (anUnit.Type() == STANDARD_TYPE(StepBasic_DerivedUnit))
|
||||
{
|
||||
Handle(StepBasic_DerivedUnit) aDUnit = anUnit.DerivedUnit();
|
||||
for (Standard_Integer anInd = 1; anInd <= aDUnit->NbElements(); ++anInd)
|
||||
{
|
||||
Handle(StepBasic_DerivedUnitElement) aDUElem = aDUnit->ElementsValue(anInd);
|
||||
Standard_Real anExp = aDUElem->Exponent();
|
||||
Handle(StepBasic_NamedUnit) aNUnit = aDUElem->Unit();
|
||||
if (!aNUnit.IsNull())
|
||||
{
|
||||
if (aNUnit->IsKind(STANDARD_TYPE(StepBasic_ConversionBasedUnitAndLengthUnit)) ||
|
||||
aNUnit->IsKind(STANDARD_TYPE(StepBasic_SiUnitAndLengthUnit)))
|
||||
{
|
||||
STEPConstruct_UnitContext anUnitCtx;
|
||||
anUnitCtx.ComputeFactors(aNUnit, theLocalFactors);
|
||||
if (aValType == "VOLUME_MEASURE")
|
||||
{
|
||||
aParam = pow(theLocalFactors.LengthFactor(), anExp);
|
||||
}
|
||||
else
|
||||
{
|
||||
aParam = aParam / pow(theLocalFactors.LengthFactor(), anExp);
|
||||
}
|
||||
}
|
||||
else if (aNUnit->IsKind(STANDARD_TYPE(StepBasic_ConversionBasedUnitAndMassUnit))) {
|
||||
Standard_Real aFact = 1.;
|
||||
if (GetMassConversionFactor(aNUnit, aFact))
|
||||
{
|
||||
aParam = aParam * aFact;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
STEPConstruct_UnitContext anUnitCtx;
|
||||
anUnitCtx.ComputeFactors(aNUnit, theLocalFactors);
|
||||
if (anUnitCtx.AreaDone())
|
||||
aParam = anUnitCtx.AreaFactor();
|
||||
if (anUnitCtx.LengthDone())
|
||||
{
|
||||
Standard_Real aLengthFactor = anUnitCtx.LengthFactor();
|
||||
aParam *= pow(aLengthFactor, anExp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
aValue = aValue * aParam;
|
||||
}
|
||||
else
|
||||
{
|
||||
Handle(StepBasic_NamedUnit) aNUnit = anUnit.NamedUnit();
|
||||
if (!aNUnit.IsNull())
|
||||
{
|
||||
if (aNUnit->IsKind(STANDARD_TYPE(StepBasic_ConversionBasedUnitAndMassUnit)))
|
||||
{
|
||||
Standard_Real aFact = 1.;
|
||||
if (GetMassConversionFactor(aNUnit, aFact))
|
||||
{
|
||||
aValue *= aFact;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
STEPConstruct_UnitContext anUnitCtx;
|
||||
anUnitCtx.ComputeFactors(aNUnit, theLocalFactors);
|
||||
if (anUnitCtx.AreaDone())
|
||||
aParam = anUnitCtx.AreaFactor();
|
||||
if (anUnitCtx.VolumeDone())
|
||||
aParam = anUnitCtx.VolumeFactor();
|
||||
if (anUnitCtx.LengthDone())
|
||||
aParam = anUnitCtx.LengthFactor();
|
||||
|
||||
aValue *= aParam;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
theAttr->SetReal(thePropDef->Name()->ToCString(), aValue);
|
||||
}
|
||||
else if (anItem->IsKind(STANDARD_TYPE(StepRepr_ValueRepresentationItem)))
|
||||
{
|
||||
Handle(StepRepr_ValueRepresentationItem) aValueItem = Handle(StepRepr_ValueRepresentationItem)::DownCast(anItem);
|
||||
Handle(StepBasic_MeasureValueMember) aMeasureValueMem = aValueItem->ValueComponentMember();
|
||||
Interface_ParamType aParamType = aMeasureValueMem->ParamType();
|
||||
if (aParamType == Interface_ParamInteger)
|
||||
{
|
||||
theAttr->SetInteger(thePropDef->Name()->ToCString(), aMeasureValueMem->Integer());
|
||||
}
|
||||
else if (aParamType == Interface_ParamReal)
|
||||
{
|
||||
theAttr->SetReal(thePropDef->Name()->ToCString(), aMeasureValueMem->Real());
|
||||
}
|
||||
}
|
||||
else if (anItem->IsKind(STANDARD_TYPE(StepRepr_IntegerRepresentationItem)))
|
||||
{
|
||||
Handle(StepRepr_IntegerRepresentationItem) anIntegerItem = Handle(StepRepr_IntegerRepresentationItem)::DownCast(anItem);
|
||||
theAttr->SetInteger(thePropDef->Name()->ToCString(), anIntegerItem->Value());
|
||||
}
|
||||
else if (anItem->IsKind(STANDARD_TYPE(StepRepr_RealRepresentationItem)))
|
||||
{
|
||||
Handle(StepRepr_RealRepresentationItem) aRealItem = Handle(StepRepr_RealRepresentationItem)::DownCast(anItem);
|
||||
theAttr->SetReal(thePropDef->Name()->ToCString(), aRealItem->Value());
|
||||
}
|
||||
else if (anItem->IsKind(STANDARD_TYPE(StepRepr_BooleanRepresentationItem)))
|
||||
{
|
||||
Handle(StepRepr_BooleanRepresentationItem) aBoolItem = Handle(StepRepr_BooleanRepresentationItem)::DownCast(anItem);
|
||||
theAttr->SetInteger(thePropDef->Name()->ToCString(), aBoolItem->Value());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return Standard_True;
|
||||
}
|
||||
|
@@ -29,16 +29,21 @@
|
||||
#include <XCAFDimTolObjects_DatumModifWithValue.hxx>
|
||||
|
||||
class XSControl_WorkSession;
|
||||
class TDataStd_NamedData;
|
||||
class TDocStd_Document;
|
||||
class STEPCAFControl_ExternFile;
|
||||
class TopoDS_Shape;
|
||||
class XCAFDoc_ShapeTool;
|
||||
class StepRepr_RepresentationItem;
|
||||
class Transfer_TransientProcess;
|
||||
class StepBasic_NamedUnit;
|
||||
class StepShape_ConnectedFaceSet;
|
||||
class StepShape_ShapeDefinitionRepresentation;
|
||||
class StepRepr_NextAssemblyUsageOccurrence;
|
||||
class StepRepr_PropertyDefinition;
|
||||
class STEPConstruct_Tool;
|
||||
class StepDimTol_Datum;
|
||||
class Transfer_Binder;
|
||||
|
||||
//! Provides a tool to read STEP file and put it into
|
||||
//! DECAF document. Besides transfer of shapes (including
|
||||
@@ -175,6 +180,11 @@ public:
|
||||
Standard_EXPORT void SetPropsMode (const Standard_Boolean propsmode);
|
||||
|
||||
Standard_EXPORT Standard_Boolean GetPropsMode() const;
|
||||
|
||||
//! MetaMode for indicate read Metadata or not.
|
||||
Standard_EXPORT void SetMetaMode(const Standard_Boolean theMetaMode);
|
||||
|
||||
Standard_EXPORT Standard_Boolean GetMetaMode() const;
|
||||
|
||||
//! Set SHUO mode for indicate write SHUO or not.
|
||||
Standard_EXPORT void SetSHUOMode (const Standard_Boolean shuomode);
|
||||
@@ -246,6 +256,12 @@ protected:
|
||||
const Handle(TDocStd_Document)& doc,
|
||||
const STEPCAFControl_DataMapOfPDExternFile& PDFileMap,
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors()) const;
|
||||
|
||||
//! Reads metadata assigned to shapes in the STEP model and
|
||||
//! assigns them to corresponding labels in the DECAF document
|
||||
Standard_EXPORT Standard_Boolean ReadMetadata(const Handle(XSControl_WorkSession)& theWS,
|
||||
const Handle(TDocStd_Document)& theDoc,
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors()) const;
|
||||
|
||||
//! Reads layers of parts defined in the STEP model and
|
||||
//! set reference between shape and layers in the DECAF document
|
||||
@@ -333,6 +349,17 @@ private:
|
||||
const Handle(TDocStd_Document)& theDoc,
|
||||
StepData_Factors& theLocalFactors) const;
|
||||
|
||||
//! Find RepresentationItems
|
||||
Standard_Boolean findReprItems(const Handle(XSControl_WorkSession) & theWS,
|
||||
const Handle(StepShape_ShapeDefinitionRepresentation) & theShDefRepr,
|
||||
NCollection_List<Handle(Transfer_Binder)>& theBinders) const;
|
||||
|
||||
//! Fill metadata
|
||||
Standard_Boolean fillAttributes(const Handle(XSControl_WorkSession)& theWS,
|
||||
const Handle(StepRepr_PropertyDefinition)& thePropDef,
|
||||
const StepData_Factors& theLocalFactors,
|
||||
Handle(TDataStd_NamedData)& theAttr) const;
|
||||
|
||||
private:
|
||||
|
||||
STEPControl_Reader myReader;
|
||||
@@ -342,6 +369,7 @@ private:
|
||||
Standard_Boolean myNameMode;
|
||||
Standard_Boolean myLayerMode;
|
||||
Standard_Boolean myPropsMode;
|
||||
Standard_Boolean myMetaMode;
|
||||
Standard_Boolean mySHUOMode;
|
||||
Standard_Boolean myGDTMode;
|
||||
Standard_Boolean myMatMode;
|
||||
|
@@ -983,7 +983,7 @@ static Standard_Integer FindEntities(const Handle(Transfer_FinderProcess)& theFP
|
||||
//Handle(Transfer_TransientListBinder)::DownCast( bnd->Next(Standard_True) );
|
||||
Handle(Transfer_TransientListBinder)::DownCast(aBinder);
|
||||
Standard_Integer aResCount = 0;
|
||||
if (aTransientListBinder.IsNull() && theShape.ShapeType() == TopAbs_COMPOUND)
|
||||
if (aTransientListBinder.IsNull())
|
||||
{
|
||||
for (TopoDS_Iterator anIter(theShape); anIter.More(); anIter.Next())
|
||||
{
|
||||
|
@@ -122,6 +122,7 @@
|
||||
#include <XSAlgo_AlgoContainer.hxx>
|
||||
#include <StepRepr_ConstructiveGeometryRepresentationRelationship.hxx>
|
||||
#include <StepRepr_ConstructiveGeometryRepresentation.hxx>
|
||||
#include <StepRepr_MechanicalDesignAndDraughtingRelationship.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(STEPControl_ActorRead,Transfer_ActorOfTransientProcess)
|
||||
@@ -580,7 +581,7 @@ static void getSDR(const Handle(StepRepr_ProductDefinitionShape)& PDS,
|
||||
|
||||
// common progress indicator for translation of own shapes and sub-assemblies
|
||||
Message_ProgressScope PS(theProgress, "Part", nbEnt);
|
||||
Standard_Integer nbComponents=0, nbShapes=0;
|
||||
Standard_Integer nbComponents=0;
|
||||
|
||||
// translate sub-assemblies
|
||||
for ( Standard_Integer nbNauo =1; nbNauo <= listNAUO->Length() && PS.More(); nbNauo++) {
|
||||
@@ -662,7 +663,6 @@ static void getSDR(const Handle(StepRepr_ProductDefinitionShape)& PDS,
|
||||
else
|
||||
B.Add(Cund, theResult);
|
||||
// [END] ssv: OCCT#22436: extra compound in NMSSR case
|
||||
nbShapes++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -670,50 +670,20 @@ static void getSDR(const Handle(StepRepr_ProductDefinitionShape)& PDS,
|
||||
// way of writing hybrid models in AP203 since 1998, and AP209
|
||||
// Note that both AP203 and AP209 allow main representation to be non-empty
|
||||
if ( readSRR && /*theResult.IsNull() &&*/ i <= nbNotAspect) {
|
||||
Interface_EntityIterator subs1 = graph.Sharings(rep);
|
||||
Handle(Standard_Type) tSRR = STANDARD_TYPE(StepRepr_ShapeRepresentationRelationship);
|
||||
for (subs1.Start(); subs1.More(); subs1.Next()) {
|
||||
const Handle(Standard_Transient)& anitem = subs1.Value();
|
||||
if( !anitem->IsKind(STANDARD_TYPE(StepRepr_RepresentationRelationship)))
|
||||
continue;
|
||||
if (anitem->DynamicType() == tSRR)
|
||||
{
|
||||
Handle(StepRepr_ShapeRepresentationRelationship) SRR =
|
||||
Handle(StepRepr_ShapeRepresentationRelationship)::DownCast(anitem);
|
||||
Standard_Integer nbrep = (rep == SRR->Rep1() ? 2 : 1);
|
||||
// SKL for bug 29068: parameter useTrsf is used because if root entity has connection with other
|
||||
// by ShapeRepresentationRelationship then result after such transferring need to transform also.
|
||||
// This case is from test "bugs modalg_7 bug30196"
|
||||
binder = TransferEntity(SRR, TP, theLocalFactors, nbrep, useTrsf, aPS1.Next());
|
||||
if (! binder.IsNull()) {
|
||||
theResult = TransferBRep::ShapeResult (binder);
|
||||
Result1 = theResult;
|
||||
B.Add(Cund, theResult);
|
||||
nbShapes++;
|
||||
}
|
||||
}
|
||||
else if(readConstructiveGeomRR && anitem->IsKind(STANDARD_TYPE(StepRepr_ConstructiveGeometryRepresentationRelationship)))
|
||||
{
|
||||
Handle(StepRepr_ConstructiveGeometryRepresentationRelationship) aCSRR =
|
||||
Handle(StepRepr_ConstructiveGeometryRepresentationRelationship)::DownCast(anitem);
|
||||
binder = TransferEntity(aCSRR, TP, theLocalFactors);
|
||||
if (! binder.IsNull())
|
||||
{
|
||||
Result1 = TransferBRep::ShapeResult (binder);
|
||||
B.Add(Cund, Result1);
|
||||
nbShapes++;
|
||||
}
|
||||
}
|
||||
TopoDS_Shape aNewResult = TransferRelatedSRR(TP, rep, useTrsf, readConstructiveGeomRR, theLocalFactors, Cund, aPS1);
|
||||
if (!aNewResult.IsNull())
|
||||
{
|
||||
Result1 = aNewResult;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// make a warning if both own shape and sub-assemblies are present
|
||||
if ( nbShapes >0 && nbComponents > 0 )
|
||||
if ( (Cund.NbChildren() - nbComponents) > 0 && nbComponents > 0 )
|
||||
TP->AddWarning ( PD, "Product has both sub-assemblies and directly assigned shape" );
|
||||
|
||||
// if only single shape is read, add it as it is; otherwise add compound
|
||||
if( nbShapes == 1 && nbComponents == 0 )
|
||||
if( (Cund.NbChildren() - nbComponents) == 1 && nbComponents == 0 )
|
||||
shbinder = new TransferBRep_ShapeBinder (Result1);
|
||||
else
|
||||
shbinder = new TransferBRep_ShapeBinder (Cund);
|
||||
@@ -1255,6 +1225,72 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(
|
||||
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : TransferEntity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(
|
||||
const Handle(StepRepr_MechanicalDesignAndDraughtingRelationship)& theMDADR,
|
||||
const Handle(Transfer_TransientProcess)& theTP,
|
||||
const StepData_Factors& theLocalFactors,
|
||||
const Message_ProgressRange& theProgress)
|
||||
{
|
||||
Handle(TransferBRep_ShapeBinder) aShBinder;
|
||||
if (theMDADR.IsNull())
|
||||
return aShBinder;
|
||||
|
||||
Standard_Boolean aResetUnits = Standard_False;
|
||||
Handle(StepRepr_Representation) anOldSRContext = mySRContext;
|
||||
StepData_Factors aLocalFactors = theLocalFactors;
|
||||
TopoDS_Compound aComp;
|
||||
BRep_Builder aBuilder;
|
||||
aBuilder.MakeCompound(aComp);
|
||||
|
||||
Message_ProgressScope aPS(theProgress, NULL, 2);
|
||||
for (Standard_Integer anIndex = 1; anIndex <= 2; anIndex++)
|
||||
{
|
||||
Message_ProgressRange aRange = aPS.Next();
|
||||
Handle(StepRepr_Representation) aRepr = (anIndex == 1) ? theMDADR->Rep1() : theMDADR->Rep2();
|
||||
if (aRepr.IsNull())
|
||||
continue;
|
||||
if (mySRContext.IsNull() || aRepr->ContextOfItems() != mySRContext->ContextOfItems())
|
||||
{
|
||||
PrepareUnits(aRepr, theTP, aLocalFactors);
|
||||
aResetUnits = Standard_True;
|
||||
}
|
||||
Handle(Transfer_Binder) aBinder;
|
||||
if (aRepr->IsKind(STANDARD_TYPE(StepShape_ShapeRepresentation)))
|
||||
{
|
||||
Handle(StepShape_ShapeRepresentation) aShapeRepr = Handle(StepShape_ShapeRepresentation)::DownCast(aRepr);
|
||||
Standard_Boolean isBound = Standard_False;
|
||||
if (!theTP->IsBound(aShapeRepr))
|
||||
{
|
||||
aBinder = TransferEntity(aShapeRepr, theTP, theLocalFactors, isBound, false, aRange);
|
||||
}
|
||||
else
|
||||
{
|
||||
aBinder = theTP->Find(aShapeRepr);
|
||||
}
|
||||
}
|
||||
TopoDS_Shape aResult = TransferBRep::ShapeResult(aBinder);
|
||||
if (!aResult.IsNull())
|
||||
{
|
||||
aBuilder.Add(aComp, aResult);
|
||||
}
|
||||
}
|
||||
|
||||
aShBinder = new TransferBRep_ShapeBinder(aComp);
|
||||
mySRContext = anOldSRContext;
|
||||
if (anOldSRContext.IsNull() || aResetUnits)
|
||||
{
|
||||
PrepareUnits(anOldSRContext, theTP, aLocalFactors);
|
||||
}
|
||||
|
||||
theTP->Bind(theMDADR, aShBinder);
|
||||
|
||||
return aShBinder;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsNeedRepresentation
|
||||
//purpose :
|
||||
@@ -1555,8 +1591,8 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
|
||||
const Message_ProgressRange& theProgress)
|
||||
{
|
||||
Handle(TransferBRep_ShapeBinder) shbinder;
|
||||
|
||||
// --------------------------------------------------------------
|
||||
|
||||
// --------------------------------------------------------------
|
||||
// On se trouve ici dans un contexte " d'assemblage geometrique "
|
||||
// - MappedItem
|
||||
// --------------------------------------------------------------
|
||||
@@ -1567,7 +1603,8 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
|
||||
// La Shape, et la mise en position
|
||||
Handle(StepShape_ShapeRepresentation) maprep = Handle(StepShape_ShapeRepresentation)::
|
||||
DownCast(mapit->MappingSource()->MappedRepresentation());
|
||||
Standard_Boolean isBound = Standard_False;
|
||||
Standard_Boolean isBound = Standard_False;
|
||||
Message_ProgressScope aPSRoot(theProgress, NULL, 2);
|
||||
Handle(Transfer_Binder) binder = TP->Find(maprep);
|
||||
if (binder.IsNull()) binder = TransferEntity(maprep, TP, theLocalFactors, isBound, Standard_False, theProgress);
|
||||
shbinder = Handle(TransferBRep_ShapeBinder)::DownCast(binder);
|
||||
@@ -1575,7 +1612,6 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
|
||||
else {
|
||||
TopoDS_Shape mappedShape = shbinder->Result();
|
||||
if ( ! mappedShape.IsNull() ) {
|
||||
|
||||
// Positionnement : 2 formules
|
||||
// 1/ Ax2 dans Source et comme Target : passage de Source a Target
|
||||
// 2/ CartesianOperator3d comme Target : on applique
|
||||
@@ -1607,6 +1643,39 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
|
||||
shbinder = new TransferBRep_ShapeBinder (mappedShape);
|
||||
}
|
||||
}
|
||||
TopoDS_Compound aCund;
|
||||
TopoDS_Shape aResult;
|
||||
BRep_Builder aBuilder;
|
||||
aBuilder.MakeCompound(aCund);
|
||||
if (!shbinder.IsNull())
|
||||
{
|
||||
aResult = TransferBRep::ShapeResult(shbinder);
|
||||
aBuilder.Add(aCund, aResult);
|
||||
}
|
||||
// translate possible shapes related by SRRs, which corresponds to
|
||||
// way of writing hybrid models in AP203 since 1998, and AP209
|
||||
Standard_Integer aReadSRR = Interface_Static::IVal("read.step.shape.relationship");
|
||||
Standard_Integer aReadConstructiveGeomRR = Interface_Static::IVal("read.step.constructivegeom.relationship");
|
||||
if (aReadSRR)
|
||||
{
|
||||
const Interface_Graph& aGraph = TP->Graph();
|
||||
Standard_Integer aSRRnum = 0;
|
||||
for (Interface_EntityIterator aSubsIt(aGraph.Sharings(maprep)); aSubsIt.More(); aSubsIt.Next())
|
||||
++aSRRnum;
|
||||
Message_ProgressScope aPS(aPSRoot.Next(), "Part", aSRRnum);
|
||||
TopoDS_Shape aNewResult = TransferRelatedSRR(TP, maprep, Standard_False, aReadConstructiveGeomRR, theLocalFactors, aCund, aPS);
|
||||
if (!aNewResult.IsNull())
|
||||
{
|
||||
aResult = aNewResult;
|
||||
}
|
||||
// if only single shape is read, add it as it is; otherwise add compound
|
||||
if (aCund.NbChildren() == 1)
|
||||
shbinder = new TransferBRep_ShapeBinder(aResult);
|
||||
else if (aCund.NbChildren() > 1)
|
||||
{
|
||||
shbinder = new TransferBRep_ShapeBinder(aCund);
|
||||
}
|
||||
}
|
||||
TP->Bind(mapit, shbinder);
|
||||
return shbinder;
|
||||
}
|
||||
@@ -2091,3 +2160,53 @@ void STEPControl_ActorRead::SetModel(const Handle(Interface_InterfaceModel)& the
|
||||
{
|
||||
myModel = theModel;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Method : TransferRelatedSRR
|
||||
// Purpose : Helper method to transfer SRR related to the representation
|
||||
//=======================================================================
|
||||
TopoDS_Shape STEPControl_ActorRead::TransferRelatedSRR(const Handle(Transfer_TransientProcess)& theTP,
|
||||
const Handle(StepShape_ShapeRepresentation)& theRep,
|
||||
const Standard_Boolean theUseTrsf,
|
||||
const Standard_Integer theReadConstructiveGeomRR,
|
||||
const StepData_Factors& theLocalFactors,
|
||||
TopoDS_Compound& theCund,
|
||||
Message_ProgressScope& thePS)
|
||||
{
|
||||
BRep_Builder aBuilder;
|
||||
TopoDS_Shape aResult;
|
||||
const Interface_Graph& aGraph = theTP->Graph();
|
||||
for (Interface_EntityIterator aSubsIt(aGraph.Sharings(theRep)); aSubsIt.More() && thePS.More(); aSubsIt.Next())
|
||||
{
|
||||
Handle(Standard_Transient) anItem = aSubsIt.Value();
|
||||
if (!anItem->IsKind(STANDARD_TYPE(StepRepr_RepresentationRelationship)))
|
||||
continue;
|
||||
Handle(Transfer_Binder) aBinder;
|
||||
if (anItem->DynamicType() == STANDARD_TYPE(StepRepr_ShapeRepresentationRelationship))
|
||||
{
|
||||
Handle(StepRepr_ShapeRepresentationRelationship) aSRR =
|
||||
Handle(StepRepr_ShapeRepresentationRelationship)::DownCast(anItem);
|
||||
Standard_Integer aNbRep = (theRep == aSRR->Rep1() ? 2 : 1);
|
||||
aBinder = TransferEntity(aSRR, theTP, theLocalFactors, aNbRep, theUseTrsf, thePS.Next());
|
||||
}
|
||||
else if (anItem->DynamicType() == STANDARD_TYPE(StepRepr_MechanicalDesignAndDraughtingRelationship))
|
||||
{
|
||||
Handle(StepRepr_MechanicalDesignAndDraughtingRelationship) aMDADR =
|
||||
Handle(StepRepr_MechanicalDesignAndDraughtingRelationship)::DownCast(anItem);
|
||||
aBinder = TransferEntity(aMDADR, theTP, theLocalFactors, thePS.Next());
|
||||
}
|
||||
else if (theReadConstructiveGeomRR &&
|
||||
anItem->DynamicType() == STANDARD_TYPE(StepRepr_ConstructiveGeometryRepresentationRelationship))
|
||||
{
|
||||
Handle(StepRepr_ConstructiveGeometryRepresentationRelationship) aCGRR =
|
||||
Handle(StepRepr_ConstructiveGeometryRepresentationRelationship)::DownCast(anItem);
|
||||
aBinder = TransferEntity(aCGRR, theTP, theLocalFactors);
|
||||
}
|
||||
if (!aBinder.IsNull())
|
||||
{
|
||||
aResult = TransferBRep::ShapeResult(aBinder);
|
||||
aBuilder.Add(theCund, aResult);
|
||||
}
|
||||
}
|
||||
return aResult;
|
||||
}
|
||||
|
@@ -48,6 +48,7 @@ class StepShape_FaceSurface;
|
||||
class TopoDS_Shell;
|
||||
class TopoDS_Compound;
|
||||
class StepRepr_ConstructiveGeometryRepresentationRelationship;
|
||||
class StepRepr_MechanicalDesignAndDraughtingRelationship;
|
||||
class StepData_StepModel;
|
||||
|
||||
|
||||
@@ -191,6 +192,12 @@ protected:
|
||||
const Handle(Transfer_TransientProcess)& theTP,
|
||||
const StepData_Factors& theLocalFactors = StepData_Factors());
|
||||
|
||||
//! Transfers MechanicalDesignAndDraughtingRelationship entity
|
||||
Handle(TransferBRep_ShapeBinder) TransferEntity(const Handle(StepRepr_MechanicalDesignAndDraughtingRelationship)& theMDADR,
|
||||
const Handle(Transfer_TransientProcess)& theTP,
|
||||
const StepData_Factors& theLocalFactors,
|
||||
const Message_ProgressRange& theProgress);
|
||||
|
||||
//! Translates file by old way when CDSR are roots . Acts only if "read.step.product_mode" is equal Off.
|
||||
Standard_EXPORT Handle(TransferBRep_ShapeBinder) OldWay
|
||||
(const Handle(Standard_Transient)& start,
|
||||
@@ -206,6 +213,14 @@ private:
|
||||
|
||||
Standard_EXPORT void computeIDEASClosings (const TopoDS_Compound& comp, TopTools_IndexedDataMapOfShapeListOfShape& shellClosingMap);
|
||||
|
||||
Standard_EXPORT TopoDS_Shape TransferRelatedSRR(const Handle(Transfer_TransientProcess)& theTP,
|
||||
const Handle(StepShape_ShapeRepresentation)& theRep,
|
||||
const Standard_Boolean theUseTrsf,
|
||||
const Standard_Integer theReadConstructiveGeomRR,
|
||||
const StepData_Factors& theLocalFactors,
|
||||
TopoDS_Compound& theCund,
|
||||
Message_ProgressScope& thePS);
|
||||
|
||||
StepToTopoDS_NMTool myNMTool;
|
||||
Standard_Real myPrecision;
|
||||
Standard_Real myMaxTol;
|
||||
|
@@ -13,7 +13,6 @@
|
||||
|
||||
#include <STEPControl_Writer.hxx>
|
||||
|
||||
#include <APIHeaderSection_MakeHeader.hxx>
|
||||
#include <Interface_InterfaceModel.hxx>
|
||||
#include <Interface_Macros.hxx>
|
||||
#include <STEPControl_ActorWrite.hxx>
|
||||
@@ -163,12 +162,7 @@ IFSelect_ReturnStatus STEPControl_Writer::Transfer
|
||||
}
|
||||
if (!thesession->Model().IsNull())
|
||||
{
|
||||
Handle(StepData_StepModel) aStepModel = Handle(StepData_StepModel)::DownCast(thesession->Model());
|
||||
aStepModel->InternalParameters = theParams;
|
||||
thesession->TransferWriter()->SetNonmanifoldMode(aStepModel->InternalParameters.WriteNonmanifold);
|
||||
aStepModel->ClearHeader();
|
||||
APIHeaderSection_MakeHeader aHeaderApi;
|
||||
aHeaderApi.Apply(aStepModel);
|
||||
Handle(StepData_StepModel)::DownCast(thesession->Model())->InternalParameters = theParams;
|
||||
}
|
||||
Handle(STEPControl_ActorWrite) ActWrite =
|
||||
Handle(STEPControl_ActorWrite)::DownCast(WS()->NormAdaptor()->ActorWrite());
|
||||
|
@@ -27,7 +27,6 @@ static Standard_CString schemaAP242DIS = "AP242_MANAGED_MODEL_BASED_3D_ENGINEERI
|
||||
|
||||
#include <HeaderSection_Protocol.hxx>
|
||||
|
||||
#include <StepData_StepModel.hxx>
|
||||
#include <StepShape_AdvancedBrepShapeRepresentation.hxx>
|
||||
#include <StepShape_AdvancedFace.hxx>
|
||||
// Removed from CC1-Rev2 to Rev4 : <StepVisual_AnnotationCurveOccurrence.hxx>
|
||||
@@ -159,6 +158,8 @@ static Standard_CString schemaAP242DIS = "AP242_MANAGED_MODEL_BASED_3D_ENGINEERI
|
||||
#include <StepShape_GeometricallyBoundedWireframeShapeRepresentation.hxx>
|
||||
#include <StepRepr_GlobalUncertaintyAssignedContext.hxx>
|
||||
#include <StepRepr_GlobalUnitAssignedContext.hxx>
|
||||
#include <StepBasic_GeneralPropertyAssociation.hxx>
|
||||
#include <StepBasic_GeneralPropertyRelationship.hxx>
|
||||
#include <StepBasic_GroupRelationship.hxx>
|
||||
#include <StepShape_HalfSpaceSolid.hxx>
|
||||
#include <StepGeom_Hyperbola.hxx>
|
||||
@@ -640,7 +641,9 @@ static Standard_CString schemaAP242DIS = "AP242_MANAGED_MODEL_BASED_3D_ENGINEERI
|
||||
#include <StepDimTol_GeoTolAndGeoTolWthDatRefAndUneqDisGeoTol.hxx>
|
||||
#include <StepRepr_CompGroupShAspAndCompShAspAndDatumFeatAndShAsp.hxx>
|
||||
#include <StepRepr_CompShAspAndDatumFeatAndShAsp.hxx>
|
||||
#include <StepRepr_BooleanRepresentationItem.hxx>
|
||||
#include <StepRepr_IntegerRepresentationItem.hxx>
|
||||
#include <StepRepr_RealRepresentationItem.hxx>
|
||||
#include <StepRepr_ValueRepresentationItem.hxx>
|
||||
#include <StepAP242_DraughtingModelItemAssociation.hxx>
|
||||
#include <StepDimTol_GeoTolAndGeoTolWthDatRefAndGeoTolWthMaxTol.hxx>
|
||||
@@ -658,6 +661,7 @@ static Standard_CString schemaAP242DIS = "AP242_MANAGED_MODEL_BASED_3D_ENGINEERI
|
||||
#include <StepRepr_CharacterizedRepresentation.hxx>
|
||||
#include <StepRepr_ConstructiveGeometryRepresentation.hxx>
|
||||
#include <StepRepr_ConstructiveGeometryRepresentationRelationship.hxx>
|
||||
#include <StepRepr_MechanicalDesignAndDraughtingRelationship.hxx>
|
||||
#include <StepVisual_CharacterizedObjAndRepresentationAndDraughtingModel.hxx>
|
||||
#include <StepVisual_AnnotationFillArea.hxx>
|
||||
#include <StepVisual_AnnotationFillAreaOccurrence.hxx>
|
||||
@@ -1561,6 +1565,11 @@ StepAP214_Protocol::StepAP214_Protocol ()
|
||||
types.Bind(STANDARD_TYPE(StepVisual_CubicBezierTessellatedEdge), 817);
|
||||
types.Bind(STANDARD_TYPE(StepVisual_CubicBezierTriangulatedFace), 818);
|
||||
types.Bind(STANDARD_TYPE(StepVisual_TriangulatedSurfaceSet), 819);
|
||||
types.Bind(STANDARD_TYPE(StepBasic_GeneralPropertyAssociation), 820);
|
||||
types.Bind(STANDARD_TYPE(StepBasic_GeneralPropertyRelationship), 821);
|
||||
types.Bind(STANDARD_TYPE(StepRepr_BooleanRepresentationItem), 822);
|
||||
types.Bind(STANDARD_TYPE(StepRepr_RealRepresentationItem), 823);
|
||||
types.Bind(STANDARD_TYPE(StepRepr_MechanicalDesignAndDraughtingRelationship), 824);
|
||||
}
|
||||
|
||||
|
||||
@@ -1578,38 +1587,6 @@ Handle(Standard_Type)& atype) const
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SchemaName
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_CString StepAP214_Protocol::SchemaName(const Handle(Interface_InterfaceModel)& theModel) const
|
||||
{
|
||||
Handle(StepData_StepModel) aModel = Handle(StepData_StepModel)::DownCast(theModel);
|
||||
if (aModel.IsNull())
|
||||
{
|
||||
return "";
|
||||
}
|
||||
switch (aModel->InternalParameters.WriteSchema)
|
||||
{
|
||||
case StepData_ConfParameters::WriteMode_StepSchema_AP214CD:
|
||||
return schemaAP214CD;
|
||||
break;
|
||||
case StepData_ConfParameters::WriteMode_StepSchema_AP214DIS:
|
||||
return schemaAP214DIS;
|
||||
break;
|
||||
case StepData_ConfParameters::WriteMode_StepSchema_AP203:
|
||||
return schemaAP203;
|
||||
break;
|
||||
case StepData_ConfParameters::WriteMode_StepSchema_AP214IS:
|
||||
return schemaAP214IS;
|
||||
break;
|
||||
case StepData_ConfParameters::WriteMode_StepSchema_AP242DIS:
|
||||
return schemaAP242DIS;
|
||||
break;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SchemaName
|
||||
//purpose :
|
||||
|
@@ -42,8 +42,6 @@ public:
|
||||
//! Returns a Case Number for each of the StepAP214 Entities
|
||||
Standard_EXPORT virtual Standard_Integer TypeNumber (const Handle(Standard_Type)& atype) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual Standard_CString SchemaName(const Handle(Interface_InterfaceModel)& theModel) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual Standard_CString SchemaName() const Standard_OVERRIDE;
|
||||
|
||||
//! Returns count of Protocol used as Resources (level one)
|
||||
|
@@ -135,6 +135,10 @@ StepBasic_ExternalSource.cxx
|
||||
StepBasic_ExternalSource.hxx
|
||||
StepBasic_GeneralProperty.cxx
|
||||
StepBasic_GeneralProperty.hxx
|
||||
StepBasic_GeneralPropertyAssociation.cxx
|
||||
StepBasic_GeneralPropertyAssociation.hxx
|
||||
StepBasic_GeneralPropertyRelationship.cxx
|
||||
StepBasic_GeneralPropertyRelationship.hxx
|
||||
StepBasic_Group.cxx
|
||||
StepBasic_Group.hxx
|
||||
StepBasic_GroupAssignment.cxx
|
||||
|
117
src/StepBasic/StepBasic_GeneralPropertyAssociation.cxx
Normal file
117
src/StepBasic/StepBasic_GeneralPropertyAssociation.cxx
Normal file
@@ -0,0 +1,117 @@
|
||||
// Copyright (c) 2024 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 <StepBasic_GeneralPropertyAssociation.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(StepBasic_GeneralPropertyAssociation, Standard_Transient)
|
||||
|
||||
//=======================================================================
|
||||
//function : StepBasic_GeneralPropertyAssociation
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
StepBasic_GeneralPropertyAssociation::StepBasic_GeneralPropertyAssociation ()
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Init
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void StepBasic_GeneralPropertyAssociation::Init (const Handle(TCollection_HAsciiString)& aName,
|
||||
const Handle(TCollection_HAsciiString)& aDescription,
|
||||
const Handle(StepBasic_GeneralProperty)& aGeneralProperty,
|
||||
const Handle(StepRepr_PropertyDefinition)& aPropertyDefinition)
|
||||
{
|
||||
theName = aName;
|
||||
|
||||
theDescription = aDescription;
|
||||
|
||||
theGeneralProperty = aGeneralProperty;
|
||||
|
||||
thePropertyDefinition = aPropertyDefinition;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Name
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(TCollection_HAsciiString) StepBasic_GeneralPropertyAssociation::Name() const
|
||||
{
|
||||
return theName;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetName
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void StepBasic_GeneralPropertyAssociation::SetName(const Handle(TCollection_HAsciiString)& aName)
|
||||
{
|
||||
theName = aName;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Description
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(TCollection_HAsciiString) StepBasic_GeneralPropertyAssociation::Description() const
|
||||
{
|
||||
return theDescription;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetDescription
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void StepBasic_GeneralPropertyAssociation::SetDescription (const Handle(TCollection_HAsciiString)& aDescription)
|
||||
{
|
||||
theDescription = aDescription;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GeneralProperty
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(StepBasic_GeneralProperty) StepBasic_GeneralPropertyAssociation::GeneralProperty() const
|
||||
{
|
||||
return theGeneralProperty;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetGeneralProperty
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void StepBasic_GeneralPropertyAssociation::SetGeneralProperty(const Handle(StepBasic_GeneralProperty)& aGeneralProperty)
|
||||
{
|
||||
theGeneralProperty = aGeneralProperty;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : PropertyDefinition
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(StepRepr_PropertyDefinition) StepBasic_GeneralPropertyAssociation::PropertyDefinition() const
|
||||
{
|
||||
return thePropertyDefinition;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetPropertyDefinition
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void StepBasic_GeneralPropertyAssociation::SetPropertyDefinition(const Handle(StepRepr_PropertyDefinition)& aPropertyDefinition)
|
||||
{
|
||||
thePropertyDefinition = aPropertyDefinition;
|
||||
}
|
84
src/StepBasic/StepBasic_GeneralPropertyAssociation.hxx
Normal file
84
src/StepBasic/StepBasic_GeneralPropertyAssociation.hxx
Normal file
@@ -0,0 +1,84 @@
|
||||
// Copyright (c) 2024 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 _StepBasic_GeneralPropertyAssociation_HeaderFile
|
||||
#define _StepBasic_GeneralPropertyAssociation_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Transient.hxx>
|
||||
|
||||
class TCollection_HAsciiString;
|
||||
class StepBasic_GeneralProperty;
|
||||
class StepRepr_PropertyDefinition;
|
||||
|
||||
DEFINE_STANDARD_HANDLE(StepBasic_GeneralPropertyAssociation, Standard_Transient)
|
||||
|
||||
//! Representation of STEP entity GeneralPropertyAssociation
|
||||
class StepBasic_GeneralPropertyAssociation : public Standard_Transient
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Empty constructor
|
||||
Standard_EXPORT StepBasic_GeneralPropertyAssociation();
|
||||
|
||||
//! Initialize all fields (own and inherited)
|
||||
Standard_EXPORT void Init(const Handle(TCollection_HAsciiString)& aName,
|
||||
const Handle(TCollection_HAsciiString)& aDescription,
|
||||
const Handle(StepBasic_GeneralProperty)& aGeneralProperty,
|
||||
const Handle(StepRepr_PropertyDefinition)& aPropertyDefinition);
|
||||
|
||||
//! Returns field Name
|
||||
Standard_EXPORT Handle(TCollection_HAsciiString) Name() const;
|
||||
|
||||
//! Set field Name
|
||||
Standard_EXPORT void SetName(const Handle(TCollection_HAsciiString)& Name);
|
||||
|
||||
//! Returns field Description
|
||||
Standard_EXPORT Handle(TCollection_HAsciiString) Description() const;
|
||||
|
||||
//! Set field Description
|
||||
Standard_EXPORT void SetDescription(const Handle(TCollection_HAsciiString)& Description);
|
||||
|
||||
//! Returns field GeneralProperty
|
||||
Standard_EXPORT Handle(StepBasic_GeneralProperty) GeneralProperty() const;
|
||||
|
||||
//! Set field GeneralProperty
|
||||
Standard_EXPORT void SetGeneralProperty(const Handle(StepBasic_GeneralProperty)& GeneralProperty);
|
||||
|
||||
//! Returns field PropertyDefinition
|
||||
Standard_EXPORT Handle(StepRepr_PropertyDefinition) PropertyDefinition() const;
|
||||
|
||||
//! Set field PropertyDefinition
|
||||
Standard_EXPORT void SetPropertyDefinition(const Handle(StepRepr_PropertyDefinition)& PropertyDefinition);
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(StepBasic_GeneralPropertyAssociation, Standard_Transient)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
Handle(TCollection_HAsciiString) theName;
|
||||
Handle(TCollection_HAsciiString) theDescription;
|
||||
Handle(StepBasic_GeneralProperty) theGeneralProperty;
|
||||
Handle(StepRepr_PropertyDefinition) thePropertyDefinition;
|
||||
|
||||
};
|
||||
|
||||
#endif // _StepBasic_GeneralPropertyAssociation_HeaderFile
|
137
src/StepBasic/StepBasic_GeneralPropertyRelationship.cxx
Normal file
137
src/StepBasic/StepBasic_GeneralPropertyRelationship.cxx
Normal file
@@ -0,0 +1,137 @@
|
||||
// Copyright (c) 2024 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 <StepBasic_GeneralProperty.hxx>
|
||||
#include <StepBasic_GeneralPropertyRelationship.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(StepBasic_GeneralPropertyRelationship, Standard_Transient)
|
||||
|
||||
//=======================================================================
|
||||
//function : StepBasic_GeneralPropertyRelationship
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
StepBasic_GeneralPropertyRelationship::StepBasic_GeneralPropertyRelationship ()
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Init
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void StepBasic_GeneralPropertyRelationship::Init(const Handle(TCollection_HAsciiString)& aName,
|
||||
const Standard_Boolean hasDescription,
|
||||
const Handle(TCollection_HAsciiString)& aDescription,
|
||||
const Handle(StepBasic_GeneralProperty)& aRelatingGeneralProperty,
|
||||
const Handle(StepBasic_GeneralProperty)& aRelatedGeneralProperty)
|
||||
{
|
||||
theName = aName;
|
||||
|
||||
defDescription = hasDescription;
|
||||
if (defDescription) {
|
||||
theDescription = aDescription;
|
||||
}
|
||||
else theDescription.Nullify();
|
||||
|
||||
theRelatingGeneralProperty = aRelatingGeneralProperty;
|
||||
|
||||
theRelatedGeneralProperty = aRelatedGeneralProperty;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Name
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(TCollection_HAsciiString) StepBasic_GeneralPropertyRelationship::Name() const
|
||||
{
|
||||
return theName;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetName
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void StepBasic_GeneralPropertyRelationship::SetName(const Handle(TCollection_HAsciiString)& aName)
|
||||
{
|
||||
theName = aName;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : HasDescription
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean StepBasic_GeneralPropertyRelationship::HasDescription() const
|
||||
{
|
||||
return defDescription;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Description
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(TCollection_HAsciiString) StepBasic_GeneralPropertyRelationship::Description() const
|
||||
{
|
||||
return theDescription;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetDescription
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void StepBasic_GeneralPropertyRelationship::SetDescription (const Handle(TCollection_HAsciiString)& aDescription)
|
||||
{
|
||||
defDescription = true;
|
||||
if (aDescription.IsNull())
|
||||
{
|
||||
defDescription = false;
|
||||
}
|
||||
theDescription = aDescription;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : RelatingGeneralProperty
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(StepBasic_GeneralProperty) StepBasic_GeneralPropertyRelationship::RelatingGeneralProperty() const
|
||||
{
|
||||
return theRelatingGeneralProperty;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetRelatingGeneralProperty
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void StepBasic_GeneralPropertyRelationship::SetRelatingGeneralProperty(const Handle(StepBasic_GeneralProperty)& aRelatingGeneralProperty)
|
||||
{
|
||||
theRelatingGeneralProperty = aRelatingGeneralProperty;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : RelatedGeneralProperty
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(StepBasic_GeneralProperty) StepBasic_GeneralPropertyRelationship::RelatedGeneralProperty() const
|
||||
{
|
||||
return theRelatedGeneralProperty;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetRelatedGeneralProperty
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void StepBasic_GeneralPropertyRelationship::SetRelatedGeneralProperty(const Handle(StepBasic_GeneralProperty)& aRelatedGeneralProperty)
|
||||
{
|
||||
theRelatedGeneralProperty = aRelatedGeneralProperty;
|
||||
}
|
88
src/StepBasic/StepBasic_GeneralPropertyRelationship.hxx
Normal file
88
src/StepBasic/StepBasic_GeneralPropertyRelationship.hxx
Normal file
@@ -0,0 +1,88 @@
|
||||
// Copyright (c) 2024 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 _StepBasic_GeneralPropertyRelationship_HeaderFile
|
||||
#define _StepBasic_GeneralPropertyRelationship_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Transient.hxx>
|
||||
|
||||
class TCollection_HAsciiString;
|
||||
class StepBasic_GeneralProperty;
|
||||
|
||||
DEFINE_STANDARD_HANDLE(StepBasic_GeneralPropertyRelationship, Standard_Transient)
|
||||
|
||||
//! Representation of STEP entity GeneralPropertyRelationship
|
||||
class StepBasic_GeneralPropertyRelationship : public Standard_Transient
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Empty constructor
|
||||
Standard_EXPORT StepBasic_GeneralPropertyRelationship();
|
||||
|
||||
//! Initialize all fields (own and inherited)
|
||||
Standard_EXPORT void Init(const Handle(TCollection_HAsciiString)& aName,
|
||||
const Standard_Boolean hasDescription,
|
||||
const Handle(TCollection_HAsciiString)& aDescription,
|
||||
const Handle(StepBasic_GeneralProperty)& aRelatingGeneralProperty,
|
||||
const Handle(StepBasic_GeneralProperty)& aRelatedGeneralProperty);
|
||||
|
||||
//! Returns field Name
|
||||
Standard_EXPORT Handle(TCollection_HAsciiString) Name() const;
|
||||
|
||||
//! Set field Name
|
||||
Standard_EXPORT void SetName(const Handle(TCollection_HAsciiString)& Name);
|
||||
|
||||
//! Returns True if optional field Description is defined
|
||||
Standard_EXPORT Standard_Boolean HasDescription() const;
|
||||
|
||||
//! Returns field Description
|
||||
Standard_EXPORT Handle(TCollection_HAsciiString) Description() const;
|
||||
|
||||
//! Set field Description
|
||||
Standard_EXPORT void SetDescription(const Handle(TCollection_HAsciiString)& Description);
|
||||
|
||||
//! Returns field RelatingGeneralProperty
|
||||
Standard_EXPORT Handle(StepBasic_GeneralProperty) RelatingGeneralProperty() const;
|
||||
|
||||
//! Set field RelatingGeneralProperty
|
||||
Standard_EXPORT void SetRelatingGeneralProperty(const Handle(StepBasic_GeneralProperty)& RelatingGeneralProperty);
|
||||
|
||||
//! Returns field RelatedGeneralProperty
|
||||
Standard_EXPORT Handle(StepBasic_GeneralProperty) RelatedGeneralProperty() const;
|
||||
|
||||
//! Set field RelatedGeneralProperty
|
||||
Standard_EXPORT void SetRelatedGeneralProperty(const Handle(StepBasic_GeneralProperty)& RelatedGeneralProperty);
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(StepBasic_GeneralPropertyRelationship, Standard_Transient)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
Standard_Boolean defDescription;
|
||||
Handle(TCollection_HAsciiString) theName;
|
||||
Handle(TCollection_HAsciiString) theDescription;
|
||||
Handle(StepBasic_GeneralProperty) theRelatingGeneralProperty;
|
||||
Handle(StepBasic_GeneralProperty) theRelatedGeneralProperty;
|
||||
|
||||
};
|
||||
|
||||
#endif // _StepBasic_GeneralPropertyRelationship_HeaderFile
|
@@ -62,6 +62,7 @@ Standard_CString StepBasic_MeasureValueMember::Name () const
|
||||
case 13 : return "MASS_MEASURE";
|
||||
case 14 : return "THERMODYNAMIC_TEMPERATURE_MEASURE";
|
||||
case 15 : return "COUNT_MEASURE";
|
||||
case 16 : return "NUMERIC_MEASURE";
|
||||
default : break;
|
||||
}
|
||||
return "";
|
||||
@@ -92,6 +93,7 @@ Standard_Boolean StepBasic_MeasureValueMember::SetName (const Standard_CString
|
||||
else if (name[0] == 'M' && !strcmp (name,"MASS_MEASURE")) thecase = 13;
|
||||
else if (name[1] == 'H' && !strcmp (name,"THERMODYNAMIC_TEMPERATURE_MEASURE")) thecase = 14;
|
||||
else if (name[2] == 'U' && !strcmp (name,"COUNT_MEASURE")) thecase = 15;
|
||||
else if (name[0] == 'N' && !strcmp (name,"NUMERIC_MEASURE")) thecase = 16;
|
||||
else return Standard_False;
|
||||
|
||||
return Standard_True;
|
||||
|
@@ -58,6 +58,7 @@ void StepData_ConfParameters::InitFromStatic()
|
||||
ReadName = Interface_Static::IVal("read.name") == 1;
|
||||
ReadLayer = Interface_Static::IVal("read.layer") == 1;
|
||||
ReadProps = Interface_Static::IVal("read.props") == 1;
|
||||
ReadMetadata = Interface_Static::IVal("read.metadata") == 1;
|
||||
|
||||
WritePrecisionMode = (StepData_ConfParameters::WriteMode_PrecisionMode)Interface_Static::IVal("write.precision.mode");
|
||||
WritePrecisionVal = Interface_Static::RVal("write.precision.val");
|
||||
|
@@ -166,6 +166,7 @@ public:
|
||||
bool ReadName = true; //<! NameMode is used to indicate read Name or not
|
||||
bool ReadLayer = true; //<! LayerMode is used to indicate read Layers or not
|
||||
bool ReadProps = true; //<! PropsMode is used to indicate read Validation properties or not
|
||||
bool ReadMetadata = true; //! Parameter for metadata reading
|
||||
|
||||
// Write
|
||||
WriteMode_PrecisionMode WritePrecisionMode = WriteMode_PrecisionMode_Average; //<! Specifies the mode of writing the resolution value into the STEP file
|
||||
|
@@ -67,14 +67,9 @@ Standard_Integer StepData_Protocol::TypeNumber
|
||||
return 0;
|
||||
}
|
||||
|
||||
Standard_CString StepData_Protocol::SchemaName() const
|
||||
{
|
||||
return thename;
|
||||
}
|
||||
|
||||
Standard_CString StepData_Protocol::SchemaName (const Handle(Interface_InterfaceModel)& theModel) const
|
||||
Standard_CString StepData_Protocol::SchemaName () const
|
||||
{
|
||||
(void)theModel;
|
||||
return thename;
|
||||
}
|
||||
|
||||
|
@@ -67,8 +67,6 @@ public:
|
||||
//! To be redefined by each sub-class
|
||||
//! Here, SchemaName returns "(DEFAULT)"
|
||||
//! was C++ : return const
|
||||
Standard_EXPORT virtual Standard_CString SchemaName(const Handle(Interface_InterfaceModel)& theModel) const;
|
||||
|
||||
Standard_EXPORT virtual Standard_CString SchemaName() const;
|
||||
|
||||
//! Creates an empty Model for Step Norm
|
||||
|
@@ -299,7 +299,7 @@ void StepData_StepReaderData::cleanText(const Handle(TCollection_HAsciiString)&
|
||||
}
|
||||
}
|
||||
}
|
||||
if (aChar == '\n')
|
||||
if (aChar == '\n' || aChar == '\r')
|
||||
{
|
||||
aResString.SetValue(aSetCharInd, aResString.ToExtString() + aStringInd);
|
||||
aResStringSize--;
|
||||
@@ -1000,7 +1000,7 @@ Standard_Boolean StepData_StepReaderData::ReadAny(const Standard_Integer num,
|
||||
case Interface_ParamInteger: {
|
||||
if (!val.IsNull()) {
|
||||
DeclareAndCast(StepData_SelectMember, sm, val);
|
||||
sm->SetInteger(atoi(str));
|
||||
sm->SetReal(Interface_FileReaderData::Fastof(str));
|
||||
return Standard_True;
|
||||
}
|
||||
Handle(StepData_SelectInt) sin = new StepData_SelectInt;
|
||||
@@ -1358,16 +1358,27 @@ Standard_Boolean StepData_StepReaderData::ReadInteger(const Standard_Integer num
|
||||
Standard_Integer& val) const
|
||||
{
|
||||
Handle(String) errmess; // Null si pas d erreur
|
||||
Standard_Boolean warn = Standard_False;
|
||||
if (nump > 0 && nump <= NbParams(num)) {
|
||||
const Interface_FileParameter& FP = Param(num, nump);
|
||||
if (FP.ParamType() == Interface_ParamInteger) val = atoi(FP.CValue());
|
||||
else errmess = new String("Parameter n0.%d (%s) not an Integer");
|
||||
if (FP.ParamType() == Interface_ParamInteger)
|
||||
val = atoi(FP.CValue());
|
||||
else if (FP.ParamType() == Interface_ParamReal)
|
||||
{
|
||||
val = static_cast<Standard_Integer>(std::round(Interface_FileReaderData::Fastof(FP.CValue())));
|
||||
if (acceptvoid) warn = Standard_True;
|
||||
errmess = new String("Parameter n0.%d (%s) was rounded");
|
||||
}
|
||||
if (FP.ParamType() != Interface_ParamInteger &&
|
||||
FP.ParamType() != Interface_ParamReal)
|
||||
errmess = new String("Parameter n0.%d (%s) not an Integer");
|
||||
}
|
||||
else errmess = new String("Parameter n0.%d (%s) absent");
|
||||
|
||||
if (errmess.IsNull()) return Standard_True;
|
||||
sprintf(txtmes, errmess->ToCString(), nump, mess);
|
||||
ach->AddFail(txtmes, errmess->ToCString());
|
||||
if (warn) ach->AddWarning(txtmes, errmess->ToCString());
|
||||
else ach->AddFail(txtmes, errmess->ToCString());
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
|
@@ -12,6 +12,8 @@ StepRepr_AssemblyComponentUsageSubstitute.cxx
|
||||
StepRepr_AssemblyComponentUsageSubstitute.hxx
|
||||
StepRepr_BetweenShapeAspect.cxx
|
||||
StepRepr_BetweenShapeAspect.hxx
|
||||
StepRepr_BooleanRepresentationItem.cxx
|
||||
StepRepr_BooleanRepresentationItem.hxx
|
||||
StepRepr_CentreOfSymmetry.cxx
|
||||
StepRepr_CentreOfSymmetry.hxx
|
||||
StepRepr_CharacterizedDefinition.cxx
|
||||
@@ -86,6 +88,8 @@ StepRepr_MaterialPropertyRepresentation.cxx
|
||||
StepRepr_MaterialPropertyRepresentation.hxx
|
||||
StepRepr_MeasureRepresentationItem.cxx
|
||||
StepRepr_MeasureRepresentationItem.hxx
|
||||
StepRepr_MechanicalDesignAndDraughtingRelationship.cxx
|
||||
StepRepr_MechanicalDesignAndDraughtingRelationship.hxx
|
||||
StepRepr_NextAssemblyUsageOccurrence.cxx
|
||||
StepRepr_NextAssemblyUsageOccurrence.hxx
|
||||
StepRepr_ParallelOffset.cxx
|
||||
@@ -110,6 +114,8 @@ StepRepr_PropertyDefinitionRepresentation.cxx
|
||||
StepRepr_PropertyDefinitionRepresentation.hxx
|
||||
StepRepr_QuantifiedAssemblyComponentUsage.cxx
|
||||
StepRepr_QuantifiedAssemblyComponentUsage.hxx
|
||||
StepRepr_RealRepresentationItem.cxx
|
||||
StepRepr_RealRepresentationItem.hxx
|
||||
StepRepr_Representation.cxx
|
||||
StepRepr_Representation.hxx
|
||||
StepRepr_RepresentationContext.cxx
|
||||
|
28
src/StepRepr/StepRepr_BooleanRepresentationItem.cxx
Normal file
28
src/StepRepr/StepRepr_BooleanRepresentationItem.cxx
Normal file
@@ -0,0 +1,28 @@
|
||||
// Copyright (c) 2024 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 <StepRepr_BooleanRepresentationItem.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(StepRepr_BooleanRepresentationItem, StepRepr_RepresentationItem)
|
||||
|
||||
StepRepr_BooleanRepresentationItem::StepRepr_BooleanRepresentationItem()
|
||||
{
|
||||
}
|
||||
|
||||
void StepRepr_BooleanRepresentationItem::Init(const Handle(TCollection_HAsciiString)& theName,
|
||||
const Standard_Boolean theValue)
|
||||
{
|
||||
value = theValue;
|
||||
StepRepr_RepresentationItem::Init(theName);
|
||||
}
|
52
src/StepRepr/StepRepr_BooleanRepresentationItem.hxx
Normal file
52
src/StepRepr/StepRepr_BooleanRepresentationItem.hxx
Normal file
@@ -0,0 +1,52 @@
|
||||
// Copyright (c) 2024 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _StepRepr_BooleanRepresentationItem_HeaderFile
|
||||
#define _StepRepr_BooleanRepresentationItem_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <StepRepr_RepresentationItem.hxx>
|
||||
class TCollection_HAsciiString;
|
||||
|
||||
class StepRepr_BooleanRepresentationItem;
|
||||
DEFINE_STANDARD_HANDLE(StepRepr_BooleanRepresentationItem, StepRepr_RepresentationItem)
|
||||
|
||||
class StepRepr_BooleanRepresentationItem : public StepRepr_RepresentationItem
|
||||
{
|
||||
public:
|
||||
|
||||
//! Returns a BooleanRepresentationItem
|
||||
Standard_EXPORT StepRepr_BooleanRepresentationItem();
|
||||
|
||||
Standard_EXPORT void Init (const Handle(TCollection_HAsciiString)& theName, const Standard_Boolean theValue);
|
||||
|
||||
inline void SetValue(const Standard_Boolean theValue)
|
||||
{
|
||||
value = theValue;
|
||||
}
|
||||
|
||||
inline Standard_Boolean Value() const
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(StepRepr_BooleanRepresentationItem, StepRepr_RepresentationItem)
|
||||
|
||||
private:
|
||||
|
||||
Standard_Boolean value;
|
||||
};
|
||||
|
||||
#endif // _StepRepr_BooleanRepresentationItem_HeaderFile
|
@@ -0,0 +1,20 @@
|
||||
// Copyright (c) 2024 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 <Standard_Type.hxx>
|
||||
#include <StepRepr_MechanicalDesignAndDraughtingRelationship.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(StepRepr_MechanicalDesignAndDraughtingRelationship, StepRepr_RepresentationRelationship)
|
||||
|
||||
StepRepr_MechanicalDesignAndDraughtingRelationship::StepRepr_MechanicalDesignAndDraughtingRelationship() {}
|
@@ -0,0 +1,37 @@
|
||||
// Copyright (c) 2024 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _StepRepr_MechanicalDesignAndDraughtingRelationship_HeaderFile
|
||||
#define _StepRepr_MechanicalDesignAndDraughtingRelationship_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <StepRepr_RepresentationRelationship.hxx>
|
||||
|
||||
|
||||
class StepRepr_MechanicalDesignAndDraughtingRelationship;
|
||||
DEFINE_STANDARD_HANDLE(StepRepr_MechanicalDesignAndDraughtingRelationship, StepRepr_RepresentationRelationship)
|
||||
|
||||
|
||||
class StepRepr_MechanicalDesignAndDraughtingRelationship : public StepRepr_RepresentationRelationship
|
||||
{
|
||||
public:
|
||||
|
||||
//! Returns a MechanicalDesignAndDraughtingRelationship
|
||||
Standard_EXPORT StepRepr_MechanicalDesignAndDraughtingRelationship();
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(StepRepr_MechanicalDesignAndDraughtingRelationship, StepRepr_RepresentationRelationship)
|
||||
};
|
||||
|
||||
#endif // _StepRepr_MechanicalDesignAndDraughtingRelationship_HeaderFile
|
28
src/StepRepr/StepRepr_RealRepresentationItem.cxx
Normal file
28
src/StepRepr/StepRepr_RealRepresentationItem.cxx
Normal file
@@ -0,0 +1,28 @@
|
||||
// Copyright (c) 2024 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 <StepRepr_RealRepresentationItem.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(StepRepr_RealRepresentationItem, StepRepr_RepresentationItem)
|
||||
|
||||
StepRepr_RealRepresentationItem::StepRepr_RealRepresentationItem()
|
||||
{
|
||||
}
|
||||
|
||||
void StepRepr_RealRepresentationItem::Init(const Handle(TCollection_HAsciiString)& theName,
|
||||
const Standard_Real theValue)
|
||||
{
|
||||
value = theValue;
|
||||
StepRepr_RepresentationItem::Init(theName);
|
||||
}
|
53
src/StepRepr/StepRepr_RealRepresentationItem.hxx
Normal file
53
src/StepRepr/StepRepr_RealRepresentationItem.hxx
Normal file
@@ -0,0 +1,53 @@
|
||||
// Copyright (c) 2024 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _StepRepr_RealRepresentationItem_HeaderFile
|
||||
#define _StepRepr_RealRepresentationItem_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <StepRepr_RepresentationItem.hxx>
|
||||
class TCollection_HAsciiString;
|
||||
|
||||
class StepRepr_RealRepresentationItem;
|
||||
DEFINE_STANDARD_HANDLE(StepRepr_RealRepresentationItem, StepRepr_RepresentationItem)
|
||||
|
||||
class StepRepr_RealRepresentationItem : public StepRepr_RepresentationItem
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//! Returns a RealRepresentationItem
|
||||
Standard_EXPORT StepRepr_RealRepresentationItem();
|
||||
|
||||
Standard_EXPORT void Init (const Handle(TCollection_HAsciiString)& theName, const Standard_Real theValue);
|
||||
|
||||
inline void SetValue(const Standard_Real theValue)
|
||||
{
|
||||
value = theValue;
|
||||
}
|
||||
|
||||
inline Standard_Real Value() const
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(StepRepr_RealRepresentationItem, StepRepr_RepresentationItem)
|
||||
|
||||
private:
|
||||
|
||||
Standard_Real value;
|
||||
};
|
||||
|
||||
#endif // _StepRepr_RealRepresentationItem_HeaderFile
|
@@ -1008,7 +1008,7 @@ Handle(Geom_BSplineSurface) StepToGeom::MakeBSplineSurface (const Handle(StepGeo
|
||||
Handle(Geom_CartesianPoint) StepToGeom::MakeCartesianPoint (const Handle(StepGeom_CartesianPoint)& SP,
|
||||
const StepData_Factors& theLocalFactors)
|
||||
{
|
||||
if (SP->NbCoordinates() == 3)
|
||||
if (!SP.IsNull() && SP->NbCoordinates() == 3)
|
||||
{
|
||||
const Standard_Real LF = theLocalFactors.LengthFactor();
|
||||
const Standard_Real X = SP->CoordinatesValue(1) * LF;
|
||||
|
@@ -408,7 +408,24 @@ void StepToTopoDS_TranslateEdge::MakeFromCurve3D
|
||||
temp1 = pU1.Distance ( pv1 );
|
||||
temp2 = pU2.Distance ( pv2 );
|
||||
if ( temp1 > preci || temp2 > preci ) {
|
||||
TP->AddWarning (C3D,"Poor result from projection vertex / curve 3d");
|
||||
// #25415: handling of special case found on some STEP files produced by FPX Expert 2013 (PCB design system):
|
||||
// edge curve is line displaced from its true position but with correct direction;
|
||||
// we can shift the line in this case so that it passes through vertices correcty
|
||||
if (Abs (temp1 - temp2) < preci && Abs (U2 - U1 - pnt1.Distance(pnt2)) < Precision::Confusion() &&
|
||||
C1->IsKind(STANDARD_TYPE(Geom_Line)))
|
||||
{
|
||||
Handle(Geom_Line) aLine = Handle(Geom_Line)::DownCast (C1);
|
||||
gp_Lin aLin = aLine->Lin();
|
||||
gp_Pnt anOrigin = pnt1.XYZ() - aLin.Position().Direction().XYZ() * U1;
|
||||
aLin.SetLocation (anOrigin);
|
||||
C1 = new Geom_Line (aLin);
|
||||
|
||||
TP->AddWarning (C3D,"Poor result from projection vertex / line 3d, line shifted");
|
||||
}
|
||||
else
|
||||
{
|
||||
TP->AddWarning (C3D,"Poor result from projection vertex / curve 3d");
|
||||
}
|
||||
}
|
||||
B.UpdateVertex ( V1, 1.000001*temp1 ); //:h6 abv 14 Jul 98: PRO8845 #2746: *=1.0001
|
||||
B.UpdateVertex ( V2, 1.000001*temp2 ); //:h6
|
||||
|
@@ -105,12 +105,13 @@ namespace {
|
||||
// ============================================================================
|
||||
static void SetNodes(const Handle(Poly_Triangulation)& theMesh,
|
||||
Handle(TColgp_HArray1OfXYZ)& theNodes,
|
||||
const Standard_Integer theNumPnindex,
|
||||
Handle(TColStd_HArray1OfInteger)& thePnindices,
|
||||
const Standard_Real theLengthFactor)
|
||||
{
|
||||
for (Standard_Integer aPnIndex = 1; aPnIndex <= theMesh->NbNodes(); ++aPnIndex)
|
||||
{
|
||||
const gp_XYZ& aPoint = theNodes->Value(thePnindices->Value(aPnIndex));
|
||||
const gp_XYZ& aPoint = theNodes->Value((theNumPnindex > 0) ? thePnindices->Value(aPnIndex) : aPnIndex);
|
||||
theMesh->SetNode(aPnIndex, theLengthFactor * aPoint);
|
||||
}
|
||||
}
|
||||
@@ -326,10 +327,11 @@ namespace {
|
||||
|
||||
const Standard_Boolean aHasUVNodes = Standard_False;
|
||||
const Standard_Boolean aHasNormals = (aNormNum > 0);
|
||||
const Standard_Integer aNbNodes = (aNumPnindex > 0) ? aNumPnindex : aNodes->Length();
|
||||
|
||||
if (aTrianStripsNum == 0 && aTrianFansNum == 0)
|
||||
{
|
||||
aMesh = new Poly_Triangulation(aNumPnindex, aTrianNum, aHasUVNodes, aHasNormals);
|
||||
aMesh = new Poly_Triangulation(aNbNodes, aTrianNum, aHasUVNodes, aHasNormals);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -359,14 +361,14 @@ namespace {
|
||||
aNbTriaFans += aTriangleFan->Length() - 2;
|
||||
}
|
||||
|
||||
aMesh = new Poly_Triangulation(aNumPnindex, aNbTriaStrips + aNbTriaFans, aHasUVNodes, aHasNormals);
|
||||
aMesh = new Poly_Triangulation(aNbNodes, aNbTriaStrips + aNbTriaFans, aHasUVNodes, aHasNormals);
|
||||
}
|
||||
|
||||
SetNodes(aMesh, aNodes, aPnindices, theLocalFactors.LengthFactor());
|
||||
SetNodes(aMesh, aNodes, aNumPnindex, aPnindices, theLocalFactors.LengthFactor());
|
||||
|
||||
if (aHasNormals)
|
||||
{
|
||||
SetNormals(aMesh, aNormals, aNormNum, aNumPnindex);
|
||||
SetNormals(aMesh, aNormals, aNormNum, aNbNodes);
|
||||
}
|
||||
|
||||
SetTriangles(aMesh, aTriangles, aTrianStripsNum, aTriaStrips, aTrianFansNum, aTriaFans);
|
||||
@@ -761,6 +763,8 @@ void StepToTopoDS_TranslateFace::Init(const Handle(StepVisual_TessellatedFace)&
|
||||
if (theNMTool.IsActive())
|
||||
theNMTool.Bind(theTF, aF);
|
||||
|
||||
aTP->Bind(theTF, new TransferBRep_ShapeBinder(aF));
|
||||
|
||||
myResult = aF;
|
||||
myError = StepToTopoDS_TranslateFaceDone;
|
||||
done = Standard_True;
|
||||
|
@@ -96,6 +96,11 @@ void StepToTopoDS_TranslateVertex::Init(const Handle(StepShape_Vertex)& aVertex,
|
||||
//:S4136 Standard_Real preci = BRepAPI::Precision();
|
||||
const Handle(StepShape_VertexPoint) VP = Handle(StepShape_VertexPoint)::DownCast(aVertex);
|
||||
const Handle(StepGeom_Point) P = VP->VertexGeometry();
|
||||
if (P.IsNull()) {
|
||||
myError = StepToTopoDS_TranslateVertexOther;
|
||||
done = Standard_False;
|
||||
return;
|
||||
}
|
||||
const Handle(StepGeom_CartesianPoint) P1 = Handle(StepGeom_CartesianPoint)::DownCast(P);
|
||||
Handle(Geom_CartesianPoint) P2 = StepToGeom::MakeCartesianPoint (P1, theLocalFactors);
|
||||
BRep_Builder B;
|
||||
|
@@ -399,7 +399,7 @@ TopoDS_Shape XSControl_TransferReader::ShapeResult
|
||||
TopoDS_Shape sh = xu.BinderShape (mres->Binder());
|
||||
|
||||
// Ouh la vilaine verrue
|
||||
Standard_Real tolang = EncodeRegAngle();
|
||||
Standard_Real tolang = Interface_Static::RVal("read.encoderegularity.angle");
|
||||
if (tolang <= 0 || sh.IsNull()) return sh;
|
||||
ShapeFix::EncodeRegularity (sh,tolang);
|
||||
return sh;
|
||||
|
@@ -65,7 +65,6 @@ class XSControl_TransferReader : public Standard_Transient
|
||||
|
||||
//! Creates a TransferReader, empty
|
||||
XSControl_TransferReader()
|
||||
: myEncodeRegAngle(0.01)
|
||||
{}
|
||||
|
||||
//! Sets a Controller. It is required to generate the Actor.
|
||||
@@ -114,14 +113,6 @@ class XSControl_TransferReader : public Standard_Transient
|
||||
//! Returns actual value of file name
|
||||
Standard_CString FileName() const
|
||||
{ return myFileName.ToCString(); }
|
||||
|
||||
//! Sets value for EncodeRegularityAngle
|
||||
void SetEncodeRegAngle(const Standard_Real theEncRegAngle)
|
||||
{ myEncodeRegAngle = theEncRegAngle; }
|
||||
|
||||
//! Returns value of EncodeRegularityAngle
|
||||
Standard_Real EncodeRegAngle() const
|
||||
{ return myEncodeRegAngle; }
|
||||
|
||||
//! Clears data, according mode :
|
||||
//! -1 all
|
||||
@@ -368,7 +359,6 @@ class XSControl_TransferReader : public Standard_Transient
|
||||
Handle(Transfer_TransientProcess) myTP;
|
||||
TColStd_DataMapOfIntegerTransient myResults;
|
||||
Handle(TopTools_HSequenceOfShape) myShapeResult;
|
||||
Standard_Real myEncodeRegAngle;
|
||||
};
|
||||
|
||||
#endif // _XSControl_TransferReader_HeaderFile
|
||||
|
@@ -141,7 +141,7 @@ IFSelect_ReturnStatus XSControl_TransferWriter::TransferWriteShape
|
||||
if (theModel.IsNull()) return IFSelect_RetVoid;
|
||||
|
||||
TopoDS_Shape aShape = theShape;
|
||||
Standard_Boolean isNMMode = NonmanifoldMode() != 0;
|
||||
Standard_Boolean isNMMode = Interface_Static::IVal("write.step.nonmanifold") != 0;
|
||||
if (isNMMode)
|
||||
{
|
||||
ShapeUpgrade_RemoveLocations aRemLoc;
|
||||
|
@@ -46,8 +46,7 @@ class XSControl_TransferWriter : public Standard_Transient
|
||||
//! with an empty FinderProcess (but no controller, etc)
|
||||
XSControl_TransferWriter()
|
||||
: myTransferWriter(new Transfer_FinderProcess),
|
||||
myTransferMode(0),
|
||||
myNonmanifoldMode(0)
|
||||
myTransferMode(0)
|
||||
{}
|
||||
|
||||
//! Returns the FinderProcess itself
|
||||
@@ -85,14 +84,6 @@ class XSControl_TransferWriter : public Standard_Transient
|
||||
void SetTransferMode (const Standard_Integer theMode)
|
||||
{ myTransferMode = theMode; }
|
||||
|
||||
//! Returns Nonmanifold Mode
|
||||
Standard_Integer NonmanifoldMode() const
|
||||
{ return myNonmanifoldMode; }
|
||||
|
||||
//! Changes Nonmanifold Mode
|
||||
void SetNonmanifoldMode (const Standard_Integer theNonmMode)
|
||||
{ myNonmanifoldMode = theNonmMode; }
|
||||
|
||||
//! Prints statistics on current Trace File, according what,mode
|
||||
//! See PrintStatsProcess for details
|
||||
Standard_EXPORT void PrintStats (const Standard_Integer theWhat, const Standard_Integer theMode = 0) const;
|
||||
@@ -143,7 +134,6 @@ class XSControl_TransferWriter : public Standard_Transient
|
||||
Handle(XSControl_Controller) myController;
|
||||
Handle(Transfer_FinderProcess) myTransferWriter;
|
||||
Standard_Integer myTransferMode;
|
||||
Standard_Integer myNonmanifoldMode;
|
||||
};
|
||||
|
||||
#endif // _XSControl_TransferWriter_HeaderFile
|
||||
|
@@ -693,12 +693,11 @@ static Standard_Integer ReadStep(Draw_Interpretor& theDI,
|
||||
}
|
||||
|
||||
STEPCAFControl_Reader aReader(XSDRAW::Session(), isFileMode);
|
||||
|
||||
if (!aModeStr.IsEmpty())
|
||||
{
|
||||
Standard_Boolean aMode = Standard_True;
|
||||
|
||||
for (Standard_Integer i = 1; aModeStr.Value(i); ++i)
|
||||
for (Standard_Integer i = 1; i <= aModeStr.Length(); ++i)
|
||||
{
|
||||
switch (aModeStr.Value(i))
|
||||
{
|
||||
@@ -720,6 +719,9 @@ static Standard_Integer ReadStep(Draw_Interpretor& theDI,
|
||||
case 'v':
|
||||
aReader.SetPropsMode(aMode);
|
||||
break;
|
||||
case 'm':
|
||||
aReader.SetMetaMode(aMode);
|
||||
break;
|
||||
default:
|
||||
Message::SendFail() << "Syntax error at '" << aModeStr << "'\n";
|
||||
return 1;
|
||||
|
@@ -1,8 +1,3 @@
|
||||
puts "TODO OCC23068 ALL: ERROR. offsetperform operation not done."
|
||||
puts "TODO OCC23068 ALL: result is not a topological shape!!!"
|
||||
puts "TODO OCC23068 ALL: Error: The command cannot be built"
|
||||
puts "TODO OCC23068 ALL: TEST INCOMPLETE"
|
||||
|
||||
puts "========================"
|
||||
puts " OCC427 "
|
||||
puts "(case 6)"
|
||||
|
@@ -1,8 +1,4 @@
|
||||
puts "TODO OCC25925 ALL: ERROR. offsetperform operation not done."
|
||||
puts "TODO OCC25925 ALL: Error: The command cannot be built"
|
||||
puts "TODO OCC25925 ALL: Faulty OCC5805 : result is not Closed shape"
|
||||
puts "TODO OCC25925 ALL: TEST INCOMPLETE"
|
||||
puts "TODO OCC25925 ALL: Tcl Exception: Error : command \\\"nbshapes result\\\" gives an empty result"
|
||||
puts "TODO OCC25925 ALL: Error : The area of result shape is"
|
||||
|
||||
puts "============"
|
||||
puts "OCC5805"
|
||||
@@ -52,6 +48,6 @@ if {$index == -1} {
|
||||
|
||||
}
|
||||
|
||||
checknbshapes result -t -wire 5 -face 5 -shell 2 -solid 1
|
||||
checknbshapes result -t -wire 3 -face 3 -shell 1 -solid 1
|
||||
|
||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
||||
|
@@ -1,8 +1,4 @@
|
||||
puts "TODO OCC25925 ALL: Faulty OCC5805 : result is not Closed shape"
|
||||
puts "TODO OCC25925 ALL: ERROR. offsetperform operation not done."
|
||||
puts "TODO OCC25925 ALL: Tcl Exception: Error : command \\\"nbshapes result\\\" gives an empty result"
|
||||
puts "TODO OCC25925 ALL: Error: The command cannot be built"
|
||||
puts "TODO OCC25925 ALL: TEST INCOMPLETE"
|
||||
puts "TODO OCC25925 ALL: Error : The area of result shape is"
|
||||
|
||||
puts "============"
|
||||
puts "OCC5805"
|
||||
@@ -53,6 +49,6 @@ if {$index == -1} {
|
||||
|
||||
}
|
||||
|
||||
checknbshapes result -vertex 2 -edge 3 -wire 3 -face 3 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 13
|
||||
checknbshapes result -vertex 1 -edge 2 -wire 3 -face 3 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 11
|
||||
|
||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
||||
|
@@ -1,8 +1,4 @@
|
||||
puts "TODO OCC25925 ALL: Faulty OCC5805 : result is not Closed shape"
|
||||
puts "TODO OCC25925 ALL: ERROR. offsetperform operation not done."
|
||||
puts "TODO OCC25925 ALL: Tcl Exception: Error : command \\\"nbshapes result\\\" gives an empty result"
|
||||
puts "TODO OCC25925 ALL: Error: The command cannot be built"
|
||||
puts "TODO OCC25925 ALL: TEST INCOMPLETE"
|
||||
puts "TODO OCC25925 ALL: Error : The area of result shape is"
|
||||
|
||||
puts "============"
|
||||
puts "OCC5805"
|
||||
@@ -53,6 +49,6 @@ if {$index == -1} {
|
||||
|
||||
}
|
||||
|
||||
checknbshapes result -vertex 2 -edge 3 -wire 3 -face 3 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 13
|
||||
checknbshapes result -vertex 1 -edge 2 -wire 3 -face 3 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 11
|
||||
|
||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
||||
|
@@ -1,6 +1,4 @@
|
||||
puts "TODO OCC25925 ALL: Faulty OCC5805 : result is not Closed shape"
|
||||
puts "TODO OCC25925 ALL: ERROR. offsetperform operation not done."
|
||||
puts "TODO OCC25925 ALL: Error: The command cannot be built"
|
||||
puts "TODO OCC25925 ALL: Error : The area of result shape is"
|
||||
|
||||
puts "============"
|
||||
puts "OCC5805"
|
||||
|
@@ -1,7 +1,4 @@
|
||||
puts "TODO OCC23068 ALL: ERROR. offsetperform operation not done."
|
||||
puts "TODO OCC25925 ALL: Error: The command cannot be built"
|
||||
puts "TODO OCC25925 ALL: Tcl Exception: result is not a topological shape"
|
||||
puts "TODO OCC25925 ALL: TEST INCOMPLETE"
|
||||
puts "TODO OCC25925 ALL: Error : The area of result shape is"
|
||||
|
||||
puts "============"
|
||||
puts "OCC5805"
|
||||
|
@@ -1,8 +1,4 @@
|
||||
puts "TODO OCC25925 ALL: Faulty OCC5805 : result is not Closed shape"
|
||||
puts "TODO OCC25925 ALL: ERROR. offsetperform operation not done."
|
||||
puts "TODO OCC25925 ALL: Tcl Exception: Error : command \\\"nbshapes result\\\" gives an empty result"
|
||||
puts "TODO OCC25925 ALL: Error: The command cannot be built"
|
||||
puts "TODO OCC25925 ALL: TEST INCOMPLETE"
|
||||
puts "TODO OCC25925 ALL: Error : The area of result shape is"
|
||||
|
||||
puts "============"
|
||||
puts "OCC5805"
|
||||
|
@@ -1,5 +1,3 @@
|
||||
puts "TODO OCC25395 ALL: ERROR. offsetperform operation not done."
|
||||
|
||||
puts "========"
|
||||
puts "OCC25395"
|
||||
puts "========"
|
||||
|
@@ -1,5 +1,3 @@
|
||||
puts "TODO OCC25939 ALL: An exception was caught"
|
||||
|
||||
puts "============"
|
||||
puts "0025939: S I G S E G V in MakeThickSolid"
|
||||
puts "============"
|
||||
|
@@ -1,5 +1,3 @@
|
||||
puts "TODO OCC31845 All: ERROR. offsetperform operation not done."
|
||||
|
||||
puts "============================================"
|
||||
puts "OCC31845: BRepOffsetAPI_MakeThickSolid fails"
|
||||
puts "============================================"
|
||||
|
@@ -1,5 +1,3 @@
|
||||
puts "TODO OCC31845 All: ERROR. offsetperform operation not done."
|
||||
|
||||
puts "============================================"
|
||||
puts "OCC31845: BRepOffsetAPI_MakeThickSolid fails"
|
||||
puts "============================================"
|
||||
|
15
tests/bugs/modalg_8/bug31601
Normal file
15
tests/bugs/modalg_8/bug31601
Normal file
@@ -0,0 +1,15 @@
|
||||
puts "================================================================="
|
||||
puts "0031601: Modeling Algorithms - BRepOffset_Tool Segmentation Fault"
|
||||
puts "================================================================="
|
||||
puts ""
|
||||
|
||||
pload MODELING
|
||||
box b 50 50 10
|
||||
explode b E
|
||||
compound b_1 b_2 b_3 b_4 b_5 b_6 b_7 b_8 b_9 b_10 b_11 b_12 c
|
||||
fillet s b 4 c
|
||||
explode s F
|
||||
offsetparameter 1.e-7 c a
|
||||
offsetload s 1 s_11
|
||||
offsetperform r
|
||||
checkview -display r -2d -path ${imagedir}/${test_image}.png
|
17
tests/bugs/modalg_8/bug33367
Normal file
17
tests/bugs/modalg_8/bug33367
Normal file
@@ -0,0 +1,17 @@
|
||||
puts "==============================================================="
|
||||
puts "0033367: Modeling Algorithms - Normal projection or BOP problem"
|
||||
puts "==============================================================="
|
||||
puts ""
|
||||
|
||||
pload MODELING
|
||||
restore [locate_data_file bug33367_1.brep] sou
|
||||
restore [locate_data_file bug33367_2.brep] des
|
||||
checkshape sou
|
||||
checkshape des
|
||||
nproject prj sou des
|
||||
checknbshapes prj -vertex 2 -edge 2 -compound 1 -shape 5
|
||||
baddobjects des
|
||||
baddtools prj
|
||||
bfillds
|
||||
bbuild res
|
||||
checkshape res
|
14
tests/bugs/modalg_8/bug33383
Normal file
14
tests/bugs/modalg_8/bug33383
Normal file
@@ -0,0 +1,14 @@
|
||||
puts "========================================================="
|
||||
puts "0033383: Modeling Algorithms - Wire/Face creation problem"
|
||||
puts "========================================================="
|
||||
puts ""
|
||||
|
||||
pload MODELING
|
||||
restore [locate_data_file bug33383.brep] a
|
||||
connectedges res a 1e-07 0
|
||||
explode res
|
||||
mkplane pln1 res_1 1
|
||||
|
||||
if ![catch { buildfaces rebf pln1 res_2 }] then {
|
||||
puts "Error: buildfaces command should be failed"
|
||||
}
|
14
tests/bugs/modalg_8/bug33394
Normal file
14
tests/bugs/modalg_8/bug33394
Normal file
@@ -0,0 +1,14 @@
|
||||
puts "========================"
|
||||
puts "0033394: Modeling Algorithms - Wrong usage of BRepClass_FaceClassifier with 3d tolerance"
|
||||
puts "========================"
|
||||
puts ""
|
||||
|
||||
pload MODELING
|
||||
restore [locate_data_file bug33394.brep] fb
|
||||
vertex vert 1016.3915670000133 17180 -5689.3758362036951
|
||||
distmini aa fb vert
|
||||
set tolerance [checkmaxtol aa]
|
||||
|
||||
if { [dval aa_val] > ${tolerance} } {
|
||||
puts "Error: The distance should be 0"
|
||||
}
|
11
tests/bugs/step/bug25415
Normal file
11
tests/bugs/step/bug25415
Normal file
@@ -0,0 +1,11 @@
|
||||
puts "========"
|
||||
puts "OCC25415"
|
||||
puts "========"
|
||||
puts ""
|
||||
##########################################################################
|
||||
# Invalid result of loading a STEP file
|
||||
##########################################################################
|
||||
|
||||
stepread [locate_data_file bug25415_part_of_hdrv8w64p254_4x2_1016x502h838p.stp] a *
|
||||
|
||||
checkshape a_1
|
17
tests/bugs/step/bug33261
Normal file
17
tests/bugs/step/bug33261
Normal file
@@ -0,0 +1,17 @@
|
||||
puts "======="
|
||||
puts "0033261: Data Exchange, Step Import - Empty shape after reading process"
|
||||
puts "======="
|
||||
|
||||
pload OCAF MODELING
|
||||
|
||||
# Read file
|
||||
ReadStep D [locate_data_file bug33261.stp]
|
||||
|
||||
# get document model as a single shape
|
||||
XGetOneShape S1 D
|
||||
|
||||
# check number of subshapes in the shape restored from STEP
|
||||
checknbshapes S1 -face 2025 -solid 24 -compound 100
|
||||
|
||||
Close D -silent
|
||||
unset S1
|
12
tests/bugs/step/bug33410
Normal file
12
tests/bugs/step/bug33410
Normal file
@@ -0,0 +1,12 @@
|
||||
puts "========================"
|
||||
puts "0033410: Data Exchange, Step Import - TRIANGULATED_FACE from STEP where there are no pnval entries"
|
||||
puts "========================"
|
||||
|
||||
pload OCAF
|
||||
|
||||
# Read file
|
||||
ReadStep D [locate_data_file bug33410.step]
|
||||
XGetOneShape sh D
|
||||
checktrinfo sh -face 1 -nod 81 -tri 128
|
||||
|
||||
Close D
|
17
tests/bugs/step/bug33638
Normal file
17
tests/bugs/step/bug33638
Normal file
@@ -0,0 +1,17 @@
|
||||
puts "===================================="
|
||||
puts "0033638: Data Exchange, Step Import - Style for tessellated object missed"
|
||||
puts "===================================="
|
||||
puts ""
|
||||
|
||||
pload OCAF
|
||||
|
||||
ReadStep D [locate_data_file bug33638.stp]
|
||||
|
||||
if { [ XFindColor D 0 0 1 ] == "" } {
|
||||
puts "Error: Color not found"
|
||||
}
|
||||
if { [ XFindColor D 1 0 0 ] == "" } {
|
||||
puts "Error: Color not found"
|
||||
}
|
||||
|
||||
Close D
|
11
tests/bugs/xde/bug33616
Normal file
11
tests/bugs/xde/bug33616
Normal file
@@ -0,0 +1,11 @@
|
||||
puts "========"
|
||||
puts "0033616: Data Exchange - Using filter while reading XBF may result in unresolved links"
|
||||
puts "========"
|
||||
|
||||
pload ALL
|
||||
|
||||
XOpen [locate_data_file bug28905_as1-oc-214.xbf] D -read0:1:1:2:1
|
||||
XGetShape sh D 0:1:1:2:1
|
||||
checknbshapes sh -solid 1
|
||||
|
||||
Close D
|
22
tests/de/step_5/B8
Normal file
22
tests/de/step_5/B8
Normal file
@@ -0,0 +1,22 @@
|
||||
# !!!! This file is generated automatically, do not edit manually! See end script
|
||||
puts "TODO CR23096 ALL: TPSTAT : Faulty"
|
||||
puts "TODO CR23096 ALL: LABELS : Faulty"
|
||||
|
||||
|
||||
set filename bug29241.stp
|
||||
|
||||
set ref_data {
|
||||
DATA : Faulties = 0 ( 22 ) Warnings = 0 ( 22 ) Summary = 0 ( 44 )
|
||||
TPSTAT : Faulties = 0 ( 0 ) Warnings = 2 ( 1 ) Summary = 2 ( 1 )
|
||||
CHECKSHAPE : Wires = 0 ( 0 ) Faces = 0 ( 0 ) Shells = 0 ( 0 ) Solids = 0 ( 0 )
|
||||
NBSHAPES : Solid = 1 ( 1 ) Shell = 2 ( 2 ) Face = 205 ( 205 )
|
||||
STATSHAPE : Solid = 1 ( 1 ) Shell = 2 ( 2 ) Face = 205 ( 205 ) FreeWire = 0 ( 1 )
|
||||
TOLERANCE : MaxTol = 0.000584860357 ( 0.0009118447559 ) AvgTol = 2.354671626e-005 ( 3.258060117e-005 )
|
||||
LABELS : N0Labels = 1 ( 1 ) N1Labels = 3 ( 18 ) N2Labels = 0 ( 0 ) TotalLabels = 4 ( 19 ) NameLabels = 1 ( 1 ) ColorLabels = 3 ( 3 ) LayerLabels = 0 ( 0 )
|
||||
PROPS : Centroid = 0 ( 0 ) Volume = 0 ( 0 ) Area = 0 ( 0 )
|
||||
NCOLORS : NColors = 3 ( 3 )
|
||||
COLORS : Colors = LIGHTSTEELBLUE1 PALEGOLDENROD WHITE ( LIGHTSTEELBLUE1 PALEGOLDENROD WHITE )
|
||||
NLAYERS : NLayers = 0 ( 0 )
|
||||
LAYERS : Layers = ( )
|
||||
|
||||
}
|
@@ -44,6 +44,7 @@ provider.STEP.OCC.read.color : 1
|
||||
provider.STEP.OCC.read.name : 1
|
||||
provider.STEP.OCC.read.layer : 1
|
||||
provider.STEP.OCC.read.props : 1
|
||||
provider.STEP.OCC.read.metadata : 1
|
||||
provider.STEP.OCC.write.precision.mode : 0
|
||||
provider.STEP.OCC.write.precision.val : 0.0001
|
||||
provider.STEP.OCC.write.assembly : 0
|
||||
|
@@ -44,6 +44,7 @@ provider.STEP.OCC.read.color : 1
|
||||
provider.STEP.OCC.read.name : 1
|
||||
provider.STEP.OCC.read.layer : 1
|
||||
provider.STEP.OCC.read.props : 1
|
||||
provider.STEP.OCC.read.metadata : 1
|
||||
provider.STEP.OCC.write.precision.mode : 0
|
||||
provider.STEP.OCC.write.precision.val : 0.0001
|
||||
provider.STEP.OCC.write.assembly : 0
|
||||
|
@@ -3,12 +3,12 @@ set filename bug29362_MMT200.stp
|
||||
|
||||
set ref_data {
|
||||
|
||||
NbOfDimensions : 2
|
||||
NbOfDimensions : 4
|
||||
NbOfDimensionalSize : 1
|
||||
NbOfDimensionalLocation: 1
|
||||
NbOfAngular : 0
|
||||
NbOfWithPath : 0
|
||||
NbOfCommonLabels : 0
|
||||
NbOfCommonLabels : 1
|
||||
NbOfTolerances : 0
|
||||
NbOfGTWithModifiers : 0
|
||||
NbOfGTWithMaxTolerance : 0
|
||||
|
92
tests/gdt/import/A6
Normal file
92
tests/gdt/import/A6
Normal file
@@ -0,0 +1,92 @@
|
||||
# !!!! This file is generated automatically, do not edit manually! See end script
|
||||
set filename bug33661_nist_ftc_08_asme1_ap242-e1-tg.stp
|
||||
|
||||
set ref_data {
|
||||
|
||||
NbOfDimensions : 60
|
||||
NbOfTolerances : 0
|
||||
NbOfDatumFeature : 0
|
||||
NbOfAttachedDatum : 0
|
||||
NbOfDatumTarget : 0
|
||||
|
||||
0:1:1:2:1 Shape.4
|
||||
0:1:4:32 Dimension.4.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:1:2:2 Shape.5
|
||||
0:1:4:4 Dimension.5.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:4:5 Dimension.5.2 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:1:2:4 Shape.7
|
||||
0:1:4:14 Dimension.7.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:4:18 Dimension.7.2 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:4:20 Dimension.7.3 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:1:2:14 Shape.17
|
||||
0:1:4:27 Dimension.17.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:1:2:62 Shape.65
|
||||
0:1:4:35 Dimension.65.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:1:2:65 Shape.68
|
||||
0:1:4:36 Dimension.68.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:1:2:72 Shape.75
|
||||
0:1:4:53 Dimension.75.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:1:2:84 Shape.87
|
||||
0:1:4:54 Dimension.87.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:1:2:90 Shape.93
|
||||
0:1:4:31 Dimension.93.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:4:33 Dimension.93.2 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:4:34 Dimension.93.3 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:1:2:94 Shape.97
|
||||
0:1:4:39 Dimension.97.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:4:40 Dimension.97.2 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:4:51 Dimension.97.3 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:4:52 Dimension.97.4 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:4:55 Dimension.97.5 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:1:2:96 Shape.99
|
||||
0:1:4:43 Dimension.99.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:4:44 Dimension.99.2 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:4:45 Dimension.99.3 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:4:46 Dimension.99.4 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:4:57 Dimension.99.5 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:1:2:98 Shape.101
|
||||
0:1:4:47 Dimension.101.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:4:48 Dimension.101.2 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:4:49 Dimension.101.3 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:4:50 Dimension.101.4 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:4:56 Dimension.101.5 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:1:2:100 Shape.103
|
||||
0:1:4:37 Dimension.103.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:4:38 Dimension.103.2 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:4:41 Dimension.103.3 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:4:42 Dimension.103.4 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:4:58 Dimension.103.5 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:1:2:102 Shape.105
|
||||
0:1:4:25 Dimension.105.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:4:26 Dimension.105.2 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:1:2:116 Shape.119
|
||||
0:1:4:24 Dimension.119.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:1:2:120 Shape.123
|
||||
0:1:4:23 Dimension.123.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:1:2:161 Shape.164
|
||||
0:1:4:15 Dimension.164.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:1:2:179 Shape.182
|
||||
0:1:4:1 Dimension.182.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:4:2 Dimension.182.2 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:4:3 Dimension.182.3 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:1:2:237 Shape.240
|
||||
0:1:4:17 Dimension.240.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:4:19 Dimension.240.2 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:1:2:246 Shape.249
|
||||
0:1:4:6 Dimension.249.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:4:8 Dimension.249.2 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:4:9 Dimension.249.3 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:1:2:248 Shape.251
|
||||
0:1:4:7 Dimension.251.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:4:10 Dimension.251.2 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:4:11 Dimension.251.3 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:1:2:250 Shape.253
|
||||
0:1:4:12 Dimension.253.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:4:13 Dimension.253.2 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:1:2:256 Shape.259
|
||||
0:1:4:28 Dimension.259.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:4:29 Dimension.259.2 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:4:30 Dimension.259.3 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
0:1:1:3:1 Shape.276
|
||||
0:1:4:16 Dimension.276.1 ( N "DGT:Dimension" T 31, V 0, P 0 )
|
||||
}
|
@@ -2,7 +2,13 @@
|
||||
set filename bug29362_MMT200.stp
|
||||
|
||||
set ref_data {
|
||||
Centre of mass: 0 0 0
|
||||
Mass: 0
|
||||
Centre of mass: 13.412719368151439 6.1818909424750705 -13.415402720911091
|
||||
Mass: 252.25931515680639
|
||||
|
||||
}
|
||||
|
||||
set ref_data_write {
|
||||
Centre of mass: 13.412719368151233 6.1818909424748316 -13.415402720907935
|
||||
Mass: 252.25931515678892
|
||||
|
||||
}
|
||||
|
16
tests/gdt/presentation/C3
Normal file
16
tests/gdt/presentation/C3
Normal file
@@ -0,0 +1,16 @@
|
||||
# !!!! This file is generated automatically, do not edit manually! See end script
|
||||
puts "TODO CR11111 ALL: Error on writing file"
|
||||
|
||||
set filename bug33661_nist_ftc_08_asme1_ap242-e1-tg.stp
|
||||
|
||||
set ref_data {
|
||||
Centre of mass: -62.99891835601813 78.203476181663817 20.269103705327481
|
||||
Mass: 47784.542040997127
|
||||
|
||||
}
|
||||
|
||||
set ref_data_write {
|
||||
Centre of mass: -261.12759307366923 196.9986700086933 -13.86055926862322
|
||||
Mass: 17568.06377585962
|
||||
|
||||
}
|
5
tests/metadata/begin
Normal file
5
tests/metadata/begin
Normal file
@@ -0,0 +1,5 @@
|
||||
pload DCAF
|
||||
pload XDE
|
||||
|
||||
cpulimit 1000
|
||||
|
98
tests/metadata/end
Normal file
98
tests/metadata/end
Normal file
@@ -0,0 +1,98 @@
|
||||
# Set flag dump_file to 1 in order to regenerate script files with actual data
|
||||
# used as reference. In this mode all tests intentionally report failure.
|
||||
set dump_file 0
|
||||
########################################################################
|
||||
set mist 0;
|
||||
set todo_msg ""
|
||||
set todo_mask "puts \"TODO CR00000 ALL: "
|
||||
set end_line "\" \n"
|
||||
##################################################################
|
||||
|
||||
# Read original file
|
||||
if { [string length $filename] > 1} {
|
||||
set path_file [locate_data_file $filename]
|
||||
if { [catch { ReadFile D $path_file } catch_result] } {
|
||||
set err_msg "Error: file was not read - exception "
|
||||
puts $err_msg
|
||||
append todo_msg $todo_mask $err_msg $end_line
|
||||
set mist 1
|
||||
}
|
||||
} else {
|
||||
set mist 1
|
||||
}
|
||||
|
||||
# Get information about translation
|
||||
if { $mist < 1} {
|
||||
puts ""
|
||||
set prop [ XGetProperties D ]
|
||||
|
||||
if { [llength $prop] < 0 } {
|
||||
puts " Metadata was NOT provided"
|
||||
}
|
||||
}
|
||||
if { $mist < 1} {
|
||||
# Close the document
|
||||
if { [catch { Close D } catch_result] } {
|
||||
set err_msg "Error : cannot close a document D - exception"
|
||||
puts $err_msg
|
||||
append todo_msg $todo_mask $err_msg $end_line
|
||||
}
|
||||
}
|
||||
|
||||
if { $mist != 1 } {
|
||||
puts ""
|
||||
set result ""
|
||||
append result [format $prop]
|
||||
}
|
||||
|
||||
set ref_Compare 0
|
||||
# Put reference data to the test script file if option "dump" is set
|
||||
if { $dump_file == 1 } {
|
||||
set fd_stream [open $dirname/$groupname/$gridname/$casename w]
|
||||
fconfigure $fd_stream -encoding utf-8
|
||||
puts $fd_stream "# !!!! This file is generated automatically, do not edit manually! See end script"
|
||||
puts $fd_stream "set filename $filename"
|
||||
if { $mist != 1 } {
|
||||
puts $fd_stream ""
|
||||
puts $fd_stream "set ref_data \{"
|
||||
puts $fd_stream $result
|
||||
puts $fd_stream "\}"
|
||||
}
|
||||
close $fd_stream
|
||||
} elseif { $mist != 1 } {
|
||||
puts "========================== Comparison with reference data ========"
|
||||
|
||||
# Comparison of reference data with obtained result
|
||||
set ref_list [split $ref_data \n]
|
||||
set cur_list [split $result \n]
|
||||
set nb_ref [llength $ref_list]
|
||||
for { set i 0 } { $i < $nb_ref } { incr i } {
|
||||
set j [expr $i + 1]
|
||||
set refstr [lindex $ref_list $j]
|
||||
set curstr [lindex $cur_list $i]
|
||||
set isOK 1;
|
||||
|
||||
if {[string equal $refstr $curstr] == 0} {
|
||||
incr ref_Compare
|
||||
puts "Reference data - $refstr\n"
|
||||
puts "Current data - $curstr\n"
|
||||
puts "----------------------------------------------\n"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if { $dump_file != 0 } {
|
||||
puts "Error : Running in regeneration mode, comparison was not performed!"
|
||||
if { $mist != 1 } {
|
||||
puts "Generation of test file $groupname/$gridname/$casename successful"
|
||||
} else {
|
||||
puts "Generation of reference data failed"
|
||||
}
|
||||
} else {
|
||||
if { $ref_Compare >= 1} {
|
||||
puts "Error : differences with reference data found : $ref_Compare"
|
||||
} else {
|
||||
puts "Comparison of current result with reference data - OK\n"
|
||||
}
|
||||
}
|
||||
puts "TEST COMPLETED"
|
1
tests/metadata/grids.list
Normal file
1
tests/metadata/grids.list
Normal file
@@ -0,0 +1 @@
|
||||
001 step
|
11
tests/metadata/parse.rules
Normal file
11
tests/metadata/parse.rules
Normal file
@@ -0,0 +1,11 @@
|
||||
FAILED /\bFaulty\b/ error
|
||||
IGNORE /Software error/ message in tpstat
|
||||
IGNORE /Syntax error/ message in data c
|
||||
IGNORE /Transfer error/ message in tpstat
|
||||
IGNORE /Operator FixShape failed with exception/ message during reading
|
||||
IGNORE /Error on writing file/ message during writing file
|
||||
IGNORE /StepFile Error/ message during loading step file
|
||||
IGNORE /StepToTopoDS, GeometricSet/exception
|
||||
IGNORE /OSD_Exception_ACCESS_VIOLATION/ exception during reading step
|
||||
IGNORE /Exception Raised while reading Step File/ exception during reading step file
|
||||
IGNORE /Warning: ShapeFix_.* Exception/ internal exceptions caught by FixShape
|
30
tests/metadata/step/A1
Normal file
30
tests/metadata/step/A1
Normal file
@@ -0,0 +1,30 @@
|
||||
# !!!! This file is generated automatically, do not edit manually! See end script
|
||||
set filename bug28345_30338.stp
|
||||
|
||||
set ref_data {
|
||||
Property for [0:1:1:1]:
|
||||
H_CIP : 55.545955351400004
|
||||
Property for [0:1:1:2]:
|
||||
H : 45
|
||||
E : 55
|
||||
B : 16
|
||||
I : 15
|
||||
A : 3
|
||||
D : 3
|
||||
C : 140
|
||||
F : 0.29999999999999999
|
||||
DESCRIPTION :
|
||||
MODELED_BY :
|
||||
Property for [0:1:1:3]:
|
||||
H : 45
|
||||
E : 55
|
||||
B : 16
|
||||
I : 15
|
||||
A : 3
|
||||
D : 3
|
||||
C : 140
|
||||
F : 0.29999999999999999
|
||||
DESCRIPTION :
|
||||
MODELED_BY :
|
||||
|
||||
}
|
27
tests/metadata/step/A2
Normal file
27
tests/metadata/step/A2
Normal file
@@ -0,0 +1,27 @@
|
||||
# !!!! This file is generated automatically, do not edit manually! See end script
|
||||
set filename bug28389_CONFIDENTIAL_SHEET_METAL_F3D.stp
|
||||
|
||||
set ref_data {
|
||||
Property for [0:1:1:1]:
|
||||
yCenterOfGravity : 0.1148447698
|
||||
Ixz : 9.3210000000000004e-07
|
||||
Izx : 9.3210000000000004e-07
|
||||
OriginY : 0
|
||||
Surface : 0.34595390710000001
|
||||
Volume : 0.0001375456
|
||||
Iyz : -1.2030000000000001e-07
|
||||
zCenterOfGravity : -0.056064514900000001
|
||||
Iyy : 3.6385e-06
|
||||
Ixy : 2.044e-07
|
||||
xCenterOfGravity : -0.12673526900000001
|
||||
Izz : 3.3558999999999999e-06
|
||||
Density : 1000
|
||||
Ixx : 1.7740000000000001e-06
|
||||
Izy : -1.2030000000000001e-07
|
||||
Mass : 0.13754561600000001
|
||||
Iyx : 2.044e-07
|
||||
OriginX : 0
|
||||
OriginZ : 0
|
||||
JoggleFormula :
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user