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

Compare commits

..

1 Commits

Author SHA1 Message Date
atereshi
26fbdc46fc 0033221: Resource files are not deleted after testing
Problem: The old way of managing resource files was used, without deleting the temporary file.
Change: Changing the shape healing options is done by using InterfaceStatic.
Result: There is no need to replace the resource file.
2022-11-30 16:35:57 +03:00
28 changed files with 144 additions and 587 deletions

View File

@@ -90,9 +90,6 @@ public:
Standard_EXPORT void TolFixTangents (Standard_Real& aTolCheck, Standard_Real& aTolAngCheck); Standard_EXPORT void TolFixTangents (Standard_Real& aTolCheck, Standard_Real& aTolAngCheck);
//! Set angular tolerance
Standard_EXPORT void SetAngularTolerance (Standard_Real theAngularTolerance);
//! converts RLine to Geom(2d)_Curve. //! converts RLine to Geom(2d)_Curve.
Standard_EXPORT static void TreatRLine (const Handle(IntPatch_RLine)& theRL, const Handle(GeomAdaptor_Surface)& theHS1, const Handle(GeomAdaptor_Surface)& theHS2, Handle(Geom_Curve)& theC3d, Handle(Geom2d_Curve)& theC2d1, Handle(Geom2d_Curve)& theC2d2, Standard_Real& theTolReached); Standard_EXPORT static void TreatRLine (const Handle(IntPatch_RLine)& theRL, const Handle(GeomAdaptor_Surface)& theHS1, const Handle(GeomAdaptor_Surface)& theHS2, Handle(Geom_Curve)& theC3d, Handle(Geom2d_Curve)& theC2d1, Handle(Geom2d_Curve)& theC2d2, Standard_Real& theTolReached);

View File

@@ -146,12 +146,3 @@ inline GeomInt_IntSS::GeomInt_IntSS ()
{ {
return myIntersector.Point(Index).Value(); return myIntersector.Point(Index).Value();
} }
//=======================================================================
//function : SetAngularTolerance
//purpose :
//=======================================================================
inline void GeomInt_IntSS::SetAngularTolerance (Standard_Real theAngularTolerance)
{
myIntersector.SetAngularTolerance(theAngularTolerance);
}

View File

@@ -268,39 +268,10 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(void)
param1bis(0), param1bis(0),
param2bis(0), param2bis(0),
myCommonGen(Standard_False), myCommonGen(Standard_False),
myPChar(0,0,0), myPChar(0,0,0)
myAngularTolerance(0.0),
myUseAngularTolerance(Standard_False)
{ {
InitTolerances(); InitTolerances();
} }
//=======================================================================
//function : IntAna_QuadQuadGeo
//purpose : Constructor with angular tolerance
//=======================================================================
IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(Standard_Real theAngularTolerance, Standard_Boolean theUseAngularTolerance)
: done(Standard_False),
nbint(0),
typeres(IntAna_Empty),
pt1(0,0,0),
pt2(0,0,0),
pt3(0,0,0),
pt4(0,0,0),
param1(0),
param2(0),
param3(0),
param4(0),
param1bis(0),
param2bis(0),
myCommonGen(Standard_False),
myPChar(0,0,0),
myAngularTolerance(theAngularTolerance),
myUseAngularTolerance(theUseAngularTolerance)
{
InitTolerances();
}
//======================================================================= //=======================================================================
//function : InitTolerances //function : InitTolerances
//purpose : //purpose :
@@ -308,20 +279,12 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(Standard_Real theAngularTolerance, Standa
void IntAna_QuadQuadGeo::InitTolerances() void IntAna_QuadQuadGeo::InitTolerances()
{ {
myEPSILON_DISTANCE = 1.0e-14; myEPSILON_DISTANCE = 1.0e-14;
if (myUseAngularTolerance)
{
myEPSILON_ANGLE_CONE = myAngularTolerance;
}
else
{
myEPSILON_ANGLE_CONE = Precision::Angular(); myEPSILON_ANGLE_CONE = Precision::Angular();
}
myEPSILON_MINI_CIRCLE_RADIUS = 0.01*Precision::Confusion(); myEPSILON_MINI_CIRCLE_RADIUS = 0.01*Precision::Confusion();
myEPSILON_CYLINDER_DELTA_RADIUS = 1.0e-13; myEPSILON_CYLINDER_DELTA_RADIUS = 1.0e-13;
myEPSILON_CYLINDER_DELTA_DISTANCE= Precision::Confusion(); myEPSILON_CYLINDER_DELTA_DISTANCE= Precision::Confusion();
myEPSILON_AXES_PARA = Precision::Angular(); myEPSILON_AXES_PARA = Precision::Angular();
} }
//======================================================================= //=======================================================================
//function : IntAna_QuadQuadGeo //function : IntAna_QuadQuadGeo
//purpose : Pln Pln //purpose : Pln Pln
@@ -344,9 +307,7 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(const gp_Pln& P1,
param1bis(0), param1bis(0),
param2bis(0), param2bis(0),
myCommonGen(Standard_False), myCommonGen(Standard_False),
myPChar(0,0,0), myPChar(0,0,0)
myAngularTolerance(0.0),
myUseAngularTolerance(Standard_False)
{ {
InitTolerances(); InitTolerances();
Perform(P1,P2,TolAng,Tol); Perform(P1,P2,TolAng,Tol);
@@ -691,9 +652,7 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo( const gp_Pln& P
param1bis(0), param1bis(0),
param2bis(0), param2bis(0),
myCommonGen(Standard_False), myCommonGen(Standard_False),
myPChar(0,0,0), myPChar(0,0,0)
myAngularTolerance(0.0),
myUseAngularTolerance(Standard_False)
{ {
InitTolerances(); InitTolerances();
Perform(P,Co,Tolang,Tol); Perform(P,Co,Tolang,Tol);
@@ -909,9 +868,7 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(const gp_Pln& P,
param1bis(0), param1bis(0),
param2bis(0), param2bis(0),
myCommonGen(Standard_False), myCommonGen(Standard_False),
myPChar(0,0,0), myPChar(0,0,0)
myAngularTolerance(0.0),
myUseAngularTolerance(Standard_False)
{ {
InitTolerances(); InitTolerances();
Perform(P,S); Perform(P,S);
@@ -980,9 +937,7 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(const gp_Cylinder& Cyl1,
param1bis(0), param1bis(0),
param2bis(0), param2bis(0),
myCommonGen(Standard_False), myCommonGen(Standard_False),
myPChar(0,0,0), myPChar(0,0,0)
myAngularTolerance(0.0),
myUseAngularTolerance(Standard_False)
{ {
InitTolerances(); InitTolerances();
Perform(Cyl1,Cyl2,Tol); Perform(Cyl1,Cyl2,Tol);
@@ -1267,9 +1222,7 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(const gp_Cylinder& Cyl,
param1bis(0), param1bis(0),
param2bis(0), param2bis(0),
myCommonGen(Standard_False), myCommonGen(Standard_False),
myPChar(0,0,0), myPChar(0,0,0)
myAngularTolerance(0.0),
myUseAngularTolerance(Standard_False)
{ {
InitTolerances(); InitTolerances();
Perform(Cyl,Con,Tol); Perform(Cyl,Con,Tol);
@@ -1325,9 +1278,7 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(const gp_Cylinder& Cyl,
param1bis(0), param1bis(0),
param2bis(0), param2bis(0),
myCommonGen(Standard_False), myCommonGen(Standard_False),
myPChar(0,0,0), myPChar(0,0,0)
myAngularTolerance(0.0),
myUseAngularTolerance(Standard_False)
{ {
InitTolerances(); InitTolerances();
Perform(Cyl,Sph,Tol); Perform(Cyl,Sph,Tol);
@@ -1393,9 +1344,7 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(const gp_Cylinder& Cyl,
param1bis(0), param1bis(0),
param2bis(0), param2bis(0),
myCommonGen(Standard_False), myCommonGen(Standard_False),
myPChar(0,0,0), myPChar(0,0,0)
myAngularTolerance(0.0),
myUseAngularTolerance(Standard_False)
{ {
InitTolerances(); InitTolerances();
Perform(Con1,Con2,Tol); Perform(Con1,Con2,Tol);
@@ -1851,9 +1800,7 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(const gp_Cylinder& Cyl,
param1bis(0), param1bis(0),
param2bis(0), param2bis(0),
myCommonGen(Standard_False), myCommonGen(Standard_False),
myPChar(0,0,0), myPChar(0,0,0)
myAngularTolerance(0.0),
myUseAngularTolerance(Standard_False)
{ {
InitTolerances(); InitTolerances();
Perform(Sph,Con,Tol); Perform(Sph,Con,Tol);
@@ -1965,9 +1912,7 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(const gp_Cylinder& Cyl,
param1bis(0), param1bis(0),
param2bis(0), param2bis(0),
myCommonGen(Standard_False), myCommonGen(Standard_False),
myPChar(0,0,0), myPChar(0,0,0)
myAngularTolerance(0.0),
myUseAngularTolerance(Standard_False)
{ {
InitTolerances(); InitTolerances();
Perform(Sph1,Sph2,Tol); Perform(Sph1,Sph2,Tol);
@@ -2081,9 +2026,7 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(const gp_Pln& Pln,
param1bis(0), param1bis(0),
param2bis(0), param2bis(0),
myCommonGen(Standard_False), myCommonGen(Standard_False),
myPChar(0,0,0), myPChar(0,0,0)
myAngularTolerance(0.0),
myUseAngularTolerance(Standard_False)
{ {
InitTolerances(); InitTolerances();
Perform(Pln,Tor,Tol); Perform(Pln,Tor,Tol);
@@ -2195,9 +2138,7 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(const gp_Cylinder& Cyl,
param1bis(0), param1bis(0),
param2bis(0), param2bis(0),
myCommonGen(Standard_False), myCommonGen(Standard_False),
myPChar(0,0,0), myPChar(0,0,0)
myAngularTolerance(0.0),
myUseAngularTolerance(Standard_False)
{ {
InitTolerances(); InitTolerances();
Perform(Cyl,Tor,Tol); Perform(Cyl,Tor,Tol);
@@ -2280,9 +2221,7 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(const gp_Cone& Con,
param1bis(0), param1bis(0),
param2bis(0), param2bis(0),
myCommonGen(Standard_False), myCommonGen(Standard_False),
myPChar(0,0,0), myPChar(0,0,0)
myAngularTolerance(0.0),
myUseAngularTolerance(Standard_False)
{ {
InitTolerances(); InitTolerances();
Perform(Con,Tor,Tol); Perform(Con,Tor,Tol);
@@ -2420,9 +2359,7 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(const gp_Sphere& Sph,
param1bis(0), param1bis(0),
param2bis(0), param2bis(0),
myCommonGen(Standard_False), myCommonGen(Standard_False),
myPChar(0,0,0), myPChar(0,0,0)
myAngularTolerance(0.0),
myUseAngularTolerance(Standard_False)
{ {
InitTolerances(); InitTolerances();
Perform(Sph,Tor,Tol); Perform(Sph,Tor,Tol);
@@ -2519,9 +2456,7 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(const gp_Torus& Tor1,
param1bis(0), param1bis(0),
param2bis(0), param2bis(0),
myCommonGen(Standard_False), myCommonGen(Standard_False),
myPChar(0,0,0), myPChar(0,0,0)
myAngularTolerance(0.0),
myUseAngularTolerance(Standard_False)
{ {
InitTolerances(); InitTolerances();
Perform(Tor1,Tor2,Tol); Perform(Tor1,Tor2,Tol);
@@ -2757,7 +2692,6 @@ const gp_Pnt& IntAna_QuadQuadGeo::PChar() const
{ {
return myPChar; return myPChar;
} }
//======================================================================= //=======================================================================
//function : RefineDir //function : RefineDir
//purpose : //purpose :

View File

@@ -61,9 +61,6 @@ public:
//! Empty constructor. //! Empty constructor.
Standard_EXPORT IntAna_QuadQuadGeo(); Standard_EXPORT IntAna_QuadQuadGeo();
//! Constructor with angular tolerance
Standard_EXPORT IntAna_QuadQuadGeo(Standard_Real theAngularTolerance, Standard_Boolean theUseAngularTolerance);
//! Creates the intersection between two planes. //! Creates the intersection between two planes.
//! TolAng is the angular tolerance used to determine //! TolAng is the angular tolerance used to determine
//! if the planes are parallel. //! if the planes are parallel.
@@ -264,8 +261,7 @@ protected:
Standard_Real myEPSILON_AXES_PARA; Standard_Real myEPSILON_AXES_PARA;
Standard_Boolean myCommonGen; Standard_Boolean myCommonGen;
gp_Pnt myPChar; gp_Pnt myPChar;
Standard_Real myAngularTolerance;
Standard_Boolean myUseAngularTolerance;
private: private:

View File

@@ -108,8 +108,8 @@ public:
//! An exception is raised if Index<=0 or Index>NbLine. //! An exception is raised if Index<=0 or Index>NbLine.
const Handle(IntPatch_Line)& Line (const Standard_Integer Index) const; const Handle(IntPatch_Line)& Line (const Standard_Integer Index) const;
//! Sets the angular tolerance
void SetAngularTolerance (Standard_Real theAngularTolerance);
protected: protected:
@@ -128,8 +128,7 @@ private:
IntPatch_SequenceOfPoint spnt; IntPatch_SequenceOfPoint spnt;
IntPatch_SequenceOfLine slin; IntPatch_SequenceOfLine slin;
IntPatch_TheSOnBounds solrst; IntPatch_TheSOnBounds solrst;
Standard_Real myAngularTolerance;
Standard_Boolean myUseAngularTolerance;
}; };

View File

@@ -71,9 +71,3 @@ inline const Handle(IntPatch_Line)& IntPatch_ImpImpIntersection::Line (const Sta
if (!IsDone ()) { throw StdFail_NotDone(); } if (!IsDone ()) { throw StdFail_NotDone(); }
return slin(Index); return slin(Index);
} }
inline void IntPatch_ImpImpIntersection::SetAngularTolerance (Standard_Real theAngularTolerance)
{
myAngularTolerance = theAngularTolerance;
myUseAngularTolerance = Standard_True;
}

View File

@@ -125,9 +125,7 @@ static Standard_Boolean IntCoCo(const IntSurf_Quadric&,
Standard_Boolean&, Standard_Boolean&,
Standard_Boolean&, Standard_Boolean&,
IntPatch_SequenceOfLine&, IntPatch_SequenceOfLine&,
IntPatch_SequenceOfPoint&, IntPatch_SequenceOfPoint&);
Standard_Boolean theUseAngularTolerance = Standard_False,
Standard_Real theAngularTolerance = 0.0);
//torus //torus
static Standard_Boolean IntPTo(const IntSurf_Quadric&, static Standard_Boolean IntPTo(const IntSurf_Quadric&,

View File

@@ -29,8 +29,7 @@ IntPatch_ImpImpIntersection::IntPatch_ImpImpIntersection ():
myDone(IntStatus_Fail), myDone(IntStatus_Fail),
empt(Standard_True), empt(Standard_True),
tgte(Standard_False), tgte(Standard_False),
oppo(Standard_False), oppo(Standard_False)
myUseAngularTolerance(Standard_False)
{ {
} }
//======================================================================= //=======================================================================
@@ -232,7 +231,7 @@ void IntPatch_ImpImpIntersection::Perform(const Handle(Adaptor3d_Surface)& S1,
} }
// //
case 33: { // Cone/Cone case 33: { // Cone/Cone
if (!IntCoCo(quad1, quad2, TolTang, empt, SameSurf, multpoint, slin, spnt, myUseAngularTolerance, myAngularTolerance)) { if (!IntCoCo(quad1, quad2, TolTang, empt, SameSurf, multpoint, slin, spnt)) {
return; return;
} }
bEmpty = empt; bEmpty = empt;

View File

@@ -27,9 +27,7 @@ Standard_Boolean IntCoCo(const IntSurf_Quadric& Quad1,
Standard_Boolean& Same, Standard_Boolean& Same,
Standard_Boolean& Multpoint, Standard_Boolean& Multpoint,
IntPatch_SequenceOfLine& slin, IntPatch_SequenceOfLine& slin,
IntPatch_SequenceOfPoint& spnt, IntPatch_SequenceOfPoint& spnt)
Standard_Boolean theUseAngularTolerance,
Standard_Real theAngularTolerance)
{ {
Standard_Integer i, NbSol; Standard_Integer i, NbSol;
@@ -40,8 +38,7 @@ Standard_Boolean IntCoCo(const IntSurf_Quadric& Quad1,
gp_Cone Co1(Quad1.Cone()); gp_Cone Co1(Quad1.Cone());
gp_Cone Co2(Quad2.Cone()); gp_Cone Co2(Quad2.Cone());
// //
IntAna_QuadQuadGeo inter(theAngularTolerance, theUseAngularTolerance); IntAna_QuadQuadGeo inter(Co1,Co2,Tol);
inter.Perform(Co1,Co2,Tol);
if (!inter.IsDone()) { if (!inter.IsDone()) {
return Standard_False; return Standard_False;
} }

View File

@@ -53,8 +53,7 @@ IntPatch_Intersection::IntPatch_Intersection ()
myU1Start(0.0), myU1Start(0.0),
myV1Start(0.0), myV1Start(0.0),
myU2Start(0.0), myU2Start(0.0),
myV2Start(0.0), myV2Start(0.0)
myUseAngularTolerance(Standard_False)
{ {
} }
@@ -77,8 +76,7 @@ IntPatch_Intersection::IntPatch_Intersection(const Handle(Adaptor3d_Surface)& S
myU1Start(0.0), myU1Start(0.0),
myV1Start(0.0), myV1Start(0.0),
myU2Start(0.0), myU2Start(0.0),
myV2Start(0.0), myV2Start(0.0)
myUseAngularTolerance(Standard_False)
{ {
if(myTolArc<1e-8) myTolArc=1e-8; if(myTolArc<1e-8) myTolArc=1e-8;
if(myTolTang<1e-8) myTolTang=1e-8; if(myTolTang<1e-8) myTolTang=1e-8;
@@ -104,8 +102,7 @@ IntPatch_Intersection::IntPatch_Intersection(const Handle(Adaptor3d_Surface)& S
myU1Start(0.0), myU1Start(0.0),
myV1Start(0.0), myV1Start(0.0),
myU2Start(0.0), myU2Start(0.0),
myV2Start(0.0), myV2Start(0.0)
myUseAngularTolerance(Standard_False)
{ {
Perform(S1,D1,TolArc,TolTang); Perform(S1,D1,TolArc,TolTang);
} }
@@ -132,12 +129,6 @@ void IntPatch_Intersection::SetTolerances(const Standard_Real TolArc,
if(myUVMaxStep>0.5) myUVMaxStep=0.5; if(myUVMaxStep>0.5) myUVMaxStep=0.5;
} }
void IntPatch_Intersection::SetAngularTolerance (Standard_Real theAngularTolerance)
{
myAngularTolerance = theAngularTolerance;
myUseAngularTolerance = Standard_True;
}
//====================================================================== //======================================================================
// function: Perform // function: Perform
//====================================================================== //======================================================================
@@ -1363,13 +1354,8 @@ void IntPatch_Intersection::GeomGeomPerfom(const Handle(Adaptor3d_Surface)& theS
const GeomAbs_SurfaceType theTyps2, const GeomAbs_SurfaceType theTyps2,
const Standard_Boolean theIsReqToKeepRLine) const Standard_Boolean theIsReqToKeepRLine)
{ {
IntPatch_ImpImpIntersection interii; IntPatch_ImpImpIntersection interii(theS1,theD1,theS2,theD2,
myTolArc,myTolTang, theIsReqToKeepRLine);
if (myUseAngularTolerance)
{
interii.SetAngularTolerance(myAngularTolerance);
}
interii.Perform(theS1, theD1, theS2, theD2, myTolArc, myTolTang, theIsReqToKeepRLine);
if (!interii.IsDone()) if (!interii.IsDone())
{ {

View File

@@ -62,8 +62,6 @@ public:
//! points in their respective parametric spaces. //! points in their respective parametric spaces.
Standard_EXPORT void SetTolerances (const Standard_Real TolArc, const Standard_Real TolTang, const Standard_Real UVMaxStep, const Standard_Real Fleche); Standard_EXPORT void SetTolerances (const Standard_Real TolArc, const Standard_Real TolTang, const Standard_Real UVMaxStep, const Standard_Real Fleche);
Standard_EXPORT void SetAngularTolerance (Standard_Real theAngularTolerance);
//! Flag theIsReqToKeepRLine has been entered only for //! Flag theIsReqToKeepRLine has been entered only for
//! compatibility with TopOpeBRep package. It shall be deleted //! compatibility with TopOpeBRep package. It shall be deleted
//! after deleting TopOpeBRep. //! after deleting TopOpeBRep.
@@ -199,8 +197,7 @@ private:
Standard_Real myV1Start; Standard_Real myV1Start;
Standard_Real myU2Start; Standard_Real myU2Start;
Standard_Real myV2Start; Standard_Real myV2Start;
Standard_Real myAngularTolerance;
Standard_Boolean myUseAngularTolerance;
}; };

View File

@@ -59,47 +59,3 @@ proc checktime {value expected tol_rel message} {
puts "Improvement. ${message}, ${value} seconds, is less than expected time - ${expected} seconds" puts "Improvement. ${message}, ${value} seconds, is less than expected time - ${expected} seconds"
} }
} }
# Reads resource file, returns options from file as key-value dict
proc parse_resource_file {theFileName} {
# Creating empty dictionary
set aDict [dict create];
# Check for resource file
if { [info exists theFileName] == 0 } {
puts "Error: resource file \"${theFileName}\" isn't found"
return $aDict
}
# Open a resource file
set aFD [open "${theFileName}" "rb"]
set aLineNo 0
# Read line by line
while {[gets $aFD aLine] !=-1 } {
incr aLineNo
# Clear the line from comment
if {[regexp {(^[^!]+)} $aLine match aClearLine]} {
# remove spaces
set aClearLine [string trim $aClearLine]
if {[string length $aClearLine] != 0} {
if {[regexp {(\S+)\s*:\s*(\S*)} $aClearLine match aKey aValue]} {
dict set aDict $aKey $aValue
} else {
puts "Error: syntax error in resource file at line: ${aLineNo}"
}
}
}
}
close $aFD
return $aDict
}
# Creates new resource file with options as key-value dict
proc create_resource_file {theFileName theOptions} {
# Open a resource file
set aFD [open "${theFileName}" "wb"]
set aLineNo 0
# Write line by line
dict for {aKey aValue} $theOptions {
puts $aFD "${aKey} : ${aValue}"
}
close $aFD
}

View File

@@ -8,28 +8,15 @@ pload XDE
# Due to the ambiguous interpretation of the "inner" wire on the surfaces # Due to the ambiguous interpretation of the "inner" wire on the surfaces
# that have natural bound (is it the cutout in the whole surface, or it's just wrong wire orientation), # that have natural bound (is it the cutout in the whole surface, or it's just wrong wire orientation),
# we must manually turn off the adding of the natural bound option of the shape healing for this test. # we must manually turn off the adding of the natural bound option of the shape healing for this test.
if { [info exists imagedir] == 0 } {
set imagedir ../BugNumber # Empty resource file name to take params from InterfaceStatic
if {![file exists ${imagedir}]} { param "read.step.resource.name" "\"\""
file mkdir ${imagedir}
}
}
# remember the path to the old resource file
set old_resource_path $::env(CSF_STEPDefaults)
# reading old resource file
set anOptions [parse_resource_file "${old_resource_path}/STEP"]
# activation of ignoring the adding of natural bound # activation of ignoring the adding of natural bound
dict set anOptions "FromSTEP.FixShape.FixAddNaturalBoundMode" "0" param "FromSTEP.FixShape.FixAddNaturalBoundMode" 0
# path to new resource file
set new_resource_path ${imagedir}
# creating resource file
create_resource_file "${new_resource_path}/STEP" $anOptions
# changing the path to the resource file
set ::env(CSF_STEPDefaults) ${new_resource_path}
stepread [locate_data_file bug30273.stp] res * stepread [locate_data_file bug30273.stp] res *
# Restoring the path to the old resource file param "read.step.resource.name" "STEP"
set ::env(CSF_STEPDefaults) ${old_resource_path} param "FromSTEP.FixShape.FixAddNaturalBoundMode" -1
checknbshapes res_1 -solid 176 -face 10463 -shape 72893 checknbshapes res_1 -solid 176 -face 10463 -shape 72893

View File

@@ -9,24 +9,10 @@ puts ""
pload MODELING XDE pload MODELING XDE
if { [info exists imagedir] == 0 } { # Empty resource file name to take params from InterfaceStatic
set imagedir ../bug32922 param "read.step.resource.name" "\"\""
if {![file exists ${imagedir}]} {
file mkdir ${imagedir}
}
}
# remember the path to the old resource file
set old_resource_path $::env(CSF_STEPDefaults)
# reading old resource file
set anOptions [parse_resource_file "${old_resource_path}/STEP"]
# turn off shape healing # turn off shape healing
dict set anOptions "FromSTEP.exec.op" "" param "FromSTEP.exec.op" "\"\""
# path to new resource file
set new_resource_path ${imagedir}
# creating resource file
create_resource_file "${new_resource_path}/STEP" $anOptions
# changing the path to the resource file
set ::env(CSF_STEPDefaults) ${new_resource_path}
# Generating, writing and reading the torus # Generating, writing and reading the torus
ptorus tor 20 5 ptorus tor 20 5
@@ -45,5 +31,5 @@ view 1 -2D- 728 20 400 400
2dfit 2dfit
checkview -screenshot -2d -path ${imagedir}/${test_image}.png checkview -screenshot -2d -path ${imagedir}/${test_image}.png
# Restoring the path to the old resource file param "read.step.resource.name" "STEP"
set ::env(CSF_STEPDefaults) ${old_resource_path} param "FromSTEP.exec.op" "FixShape"

View File

@@ -11,24 +11,11 @@ set BugNumber OCC6283
# Due to the ambiguous interpretation of the "inner" wire on the surfaces # Due to the ambiguous interpretation of the "inner" wire on the surfaces
# that have natural bound (is it the cutout in the whole surface, or it's just wrong wire orientation), # that have natural bound (is it the cutout in the whole surface, or it's just wrong wire orientation),
# we must manually turn off the adding of the natural bound option of the shape healing for this test. # we must manually turn off the adding of the natural bound option of the shape healing for this test.
if { [info exists imagedir] == 0 } {
set imagedir ../BugNumber # Empty resource file name to take params from InterfaceStatic
if {![file exists ${imagedir}]} { param "read.step.resource.name" "\"\""
file mkdir ${imagedir}
}
}
# remember the path to the old resource file
set old_resource_path $::env(CSF_STEPDefaults)
# reading old resource file
set anOptions [parse_resource_file "${old_resource_path}/STEP"]
# activation of ignoring the adding of natural bound # activation of ignoring the adding of natural bound
dict set anOptions "FromSTEP.FixShape.FixAddNaturalBoundMode" "0" param "FromSTEP.FixShape.FixAddNaturalBoundMode" 0
# path to new resource file
set new_resource_path ${imagedir}
# creating resource file
create_resource_file "${new_resource_path}/STEP" $anOptions
# changing the path to the resource file
set ::env(CSF_STEPDefaults) ${new_resource_path}
set list [stepread [locate_data_file wgehaeuse_surface.stp] a *] set list [stepread [locate_data_file wgehaeuse_surface.stp] a *]
@@ -51,6 +38,6 @@ if {[lsearch ${list} Error] > -1} {
} }
} }
# Restoring the path to the old resource file param "read.step.resource.name" "STEP"
set ::env(CSF_STEPDefaults) ${old_resource_path} param "FromSTEP.FixShape.FixAddNaturalBoundMode" -1

View File

@@ -13,47 +13,3 @@ set lengthunit_start ""
# Open a transaction # Open a transaction
NewCommand D NewCommand D
# Reads resource file, returns options from file as key-value dict
proc parse_resource_file {theFileName} {
# Creating empty dictionary
set aDict [dict create];
# Check for resource file
if { [info exists theFileName] == 0 } {
puts "Error: resource file \"${theFileName}\" isn't found"
return $aDict
}
# Open a resource file
set aFD [open "${theFileName}" "rb"]
set aLineNo 0
# Read line by line
while {[gets $aFD aLine] !=-1 } {
incr aLineNo
# Clear the line from comment
if {[regexp {(^[^!]+)} $aLine match aClearLine]} {
# remove spaces
set aClearLine [string trim $aClearLine]
if {[string length $aClearLine] != 0} {
if {[regexp {(\S+)\s*:\s*(\S*)} $aClearLine match aKey aValue]} {
dict set aDict $aKey $aValue
} else {
puts "Error: syntax error in resource file at line: ${aLineNo}"
}
}
}
}
close $aFD
return $aDict
}
# Creates new resource file with options as key-value dict
proc create_resource_file {theFileName theOptions} {
# Open a resource file
set aFD [open "${theFileName}" "wb"]
set aLineNo 0
# Write line by line
dict for {aKey aValue} $theOptions {
puts $aFD "${aKey} : ${aValue}"
}
close $aFD
}

View File

@@ -70,7 +70,7 @@ if { [string length $filename] > 1} {
if { [info exists de_use_custom_scripts] } { if { [info exists de_use_custom_scripts] } {
puts "Executing custom script for the test before reading data from file..." puts "Executing custom script for the test before reading data from file..."
set old_resource_path [de_before_script $filename] de_before_script
} }
if { [catch { $ReadCommand D_First $path_file } catch_result] } { if { [catch { $ReadCommand D_First $path_file } catch_result] } {
@@ -82,7 +82,7 @@ if { [string length $filename] > 1} {
if { [info exists de_use_custom_scripts] } { if { [info exists de_use_custom_scripts] } {
puts "Executing custom script for the test after reading data from file..." puts "Executing custom script for the test after reading data from file..."
de_after_script $old_resource_path de_after_script
unset de_use_custom_scripts unset de_use_custom_scripts
} }

View File

@@ -23,32 +23,14 @@ LAYERS : Layers = ( )
set de_use_custom_scripts 1 set de_use_custom_scripts 1
proc de_before_script {TheFileName} { proc de_before_script {} {
if { [info exists imagedir] == 0 } { # Empty resource file name to take params from InterfaceStatic
set imagedir ../[file rootname $TheFileName] param "read.iges.resource.name" "\"\""
if {![file exists ${imagedir}]} {
file mkdir ${imagedir}
}
}
# remember the path to the old resource file
set old_resource_path $::env(CSF_IGESDefaults)
# reading old resource file
set anOptions [parse_resource_file "${old_resource_path}/IGES"]
# activation of ignoring the adding of natural bound # activation of ignoring the adding of natural bound
dict set anOptions "FromIGES.FixShape.FixAddNaturalBoundMode" "0" param "FromIGES.FixShape.FixAddNaturalBoundMode" 0
# path to new resource file
set new_resource_path ${imagedir}
# creating resource file
create_resource_file "${new_resource_path}/IGES" $anOptions
# changing the path to the resource file
set ::env(CSF_IGESDefaults) ${new_resource_path}
puts "New path to IGES resource file is: \"${new_resource_path}\""
return ${old_resource_path}
} }
proc de_after_script {old_resource_path} { proc de_after_script {} {
# Restoring the path to the old resource file param "read.iges.resource.name" "IGES"
set ::env(CSF_IGESDefaults) ${old_resource_path} param "FromIGES.FixShape.FixAddNaturalBoundMode" -1
puts "Restore path to IGES resource file: \"${old_resource_path}\""
} }

View File

@@ -27,32 +27,14 @@ LAYERS : Layers = ( )
set de_use_custom_scripts 1 set de_use_custom_scripts 1
proc de_before_script {TheFileName} { proc de_before_script {} {
if { [info exists imagedir] == 0 } { # Empty resource file name to take params from InterfaceStatic
set imagedir ../[file rootname $TheFileName] param "read.iges.resource.name" "\"\""
if {![file exists ${imagedir}]} {
file mkdir ${imagedir}
}
}
# remember the path to the old resource file
set old_resource_path $::env(CSF_IGESDefaults)
# reading old resource file
set anOptions [parse_resource_file "${old_resource_path}/IGES"]
# activation of ignoring the adding of natural bound # activation of ignoring the adding of natural bound
dict set anOptions "FromIGES.FixShape.FixAddNaturalBoundMode" "0" param "FromIGES.FixShape.FixAddNaturalBoundMode" 0
# path to new resource file
set new_resource_path ${imagedir}
# creating resource file
create_resource_file "${new_resource_path}/IGES" $anOptions
# changing the path to the resource file
set ::env(CSF_IGESDefaults) ${new_resource_path}
puts "New path to IGES resource file is: \"${new_resource_path}\""
return ${old_resource_path}
} }
proc de_after_script {old_resource_path} { proc de_after_script {} {
# Restoring the path to the old resource file param "read.iges.resource.name" "IGES"
set ::env(CSF_IGESDefaults) ${old_resource_path} param "FromIGES.FixShape.FixAddNaturalBoundMode" -1
puts "Restore path to IGES resource file: \"${old_resource_path}\""
} }

View File

@@ -27,32 +27,14 @@ LAYERS : Layers = ( )
set de_use_custom_scripts 1 set de_use_custom_scripts 1
proc de_before_script {TheFileName} { proc de_before_script {} {
if { [info exists imagedir] == 0 } { # Empty resource file name to take params from InterfaceStatic
set imagedir ../[file rootname $TheFileName] param "read.step.resource.name" "\"\""
if {![file exists ${imagedir}]} {
file mkdir ${imagedir}
}
}
# remember the path to the old resource file
set old_resource_path $::env(CSF_STEPDefaults)
# reading old resource file
set anOptions [parse_resource_file "${old_resource_path}/STEP"]
# activation of ignoring the adding of natural bound # activation of ignoring the adding of natural bound
dict set anOptions "FromSTEP.FixShape.FixAddNaturalBoundMode" "0" param "FromSTEP.FixShape.FixAddNaturalBoundMode" 0
# path to new resource file
set new_resource_path ${imagedir}
# creating resource file
create_resource_file "${new_resource_path}/STEP" $anOptions
# changing the path to the resource file
set ::env(CSF_STEPDefaults) ${new_resource_path}
puts "New path to STEP resource file is: \"${new_resource_path}\""
return ${old_resource_path}
} }
proc de_after_script {old_resource_path} { proc de_after_script {} {
# Restoring the path to the old resource file param "read.step.resource.name" "STEP"
set ::env(CSF_STEPDefaults) ${old_resource_path} param "FromSTEP.FixShape.FixAddNaturalBoundMode" -1
puts "Restore path to STEP resource file: \"${old_resource_path}\""
} }

View File

@@ -27,32 +27,14 @@ LAYERS : Layers = ( )
set de_use_custom_scripts 1 set de_use_custom_scripts 1
proc de_before_script {TheFileName} { proc de_before_script {} {
if { [info exists imagedir] == 0 } { # Empty resource file name to take params from InterfaceStatic
set imagedir ../[file rootname $TheFileName] param "read.step.resource.name" "\"\""
if {![file exists ${imagedir}]} {
file mkdir ${imagedir}
}
}
# remember the path to the old resource file
set old_resource_path $::env(CSF_STEPDefaults)
# reading old resource file
set anOptions [parse_resource_file "${old_resource_path}/STEP"]
# activation of ignoring the adding of natural bound # activation of ignoring the adding of natural bound
dict set anOptions "FromSTEP.FixShape.FixAddNaturalBoundMode" "0" param "FromSTEP.FixShape.FixAddNaturalBoundMode" 0
# path to new resource file
set new_resource_path ${imagedir}
# creating resource file
create_resource_file "${new_resource_path}/STEP" $anOptions
# changing the path to the resource file
set ::env(CSF_STEPDefaults) ${new_resource_path}
puts "New path to STEP resource file is: \"${new_resource_path}\""
return ${old_resource_path}
} }
proc de_after_script {old_resource_path} { proc de_after_script {} {
# Restoring the path to the old resource file param "read.step.resource.name" "STEP"
set ::env(CSF_STEPDefaults) ${old_resource_path} param "FromSTEP.FixShape.FixAddNaturalBoundMode" -1
puts "Restore path to STEP resource file: \"${old_resource_path}\""
} }

View File

@@ -29,32 +29,14 @@ LAYERS : Layers = ( 001 )
set de_use_custom_scripts 1 set de_use_custom_scripts 1
proc de_before_script {TheFileName} { proc de_before_script {} {
if { [info exists imagedir] == 0 } { # Empty resource file name to take params from InterfaceStatic
set imagedir ../[file rootname $TheFileName] param "read.step.resource.name" "\"\""
if {![file exists ${imagedir}]} {
file mkdir ${imagedir}
}
}
# remember the path to the old resource file
set old_resource_path $::env(CSF_STEPDefaults)
# reading old resource file
set anOptions [parse_resource_file "${old_resource_path}/STEP"]
# activation of ignoring the adding of natural bound # activation of ignoring the adding of natural bound
dict set anOptions "FromSTEP.FixShape.FixAddNaturalBoundMode" "0" param "FromSTEP.FixShape.FixAddNaturalBoundMode" 0
# path to new resource file
set new_resource_path ${imagedir}
# creating resource file
create_resource_file "${new_resource_path}/STEP" $anOptions
# changing the path to the resource file
set ::env(CSF_STEPDefaults) ${new_resource_path}
puts "New path to STEP resource file is: \"${new_resource_path}\""
return ${old_resource_path}
} }
proc de_after_script {old_resource_path} { proc de_after_script {} {
# Restoring the path to the old resource file param "read.step.resource.name" "STEP"
set ::env(CSF_STEPDefaults) ${old_resource_path} param "FromSTEP.FixShape.FixAddNaturalBoundMode" -1
puts "Restore path to STEP resource file: \"${old_resource_path}\""
} }

View File

@@ -27,32 +27,14 @@ LAYERS : Layers = ( )
set de_use_custom_scripts 1 set de_use_custom_scripts 1
proc de_before_script {TheFileName} { proc de_before_script {} {
if { [info exists imagedir] == 0 } { # Empty resource file name to take params from InterfaceStatic
set imagedir ../[file rootname $TheFileName] param "read.step.resource.name" "\"\""
if {![file exists ${imagedir}]} {
file mkdir ${imagedir}
}
}
# remember the path to the old resource file
set old_resource_path $::env(CSF_STEPDefaults)
# reading old resource file
set anOptions [parse_resource_file "${old_resource_path}/STEP"]
# activation of ignoring the adding of natural bound # activation of ignoring the adding of natural bound
dict set anOptions "FromSTEP.FixShape.FixAddNaturalBoundMode" "0" param "FromSTEP.FixShape.FixAddNaturalBoundMode" 0
# path to new resource file
set new_resource_path ${imagedir}
# creating resource file
create_resource_file "${new_resource_path}/STEP" $anOptions
# changing the path to the resource file
set ::env(CSF_STEPDefaults) ${new_resource_path}
puts "New path to STEP resource file is: \"${new_resource_path}\""
return ${old_resource_path}
} }
proc de_after_script {old_resource_path} { proc de_after_script {} {
# Restoring the path to the old resource file param "read.step.resource.name" "STEP"
set ::env(CSF_STEPDefaults) ${old_resource_path} param "FromSTEP.FixShape.FixAddNaturalBoundMode" -1
puts "Restore path to STEP resource file: \"${old_resource_path}\""
} }

View File

@@ -23,33 +23,14 @@ LAYERS : Layers = ( )
set de_use_custom_scripts 1 set de_use_custom_scripts 1
proc de_before_script {TheFileName} { proc de_before_script {} {
if { [info exists imagedir] == 0 } { # Empty resource file name to take params from InterfaceStatic
set imagedir ../[file rootname $TheFileName] param "read.step.resource.name" "\"\""
if {![file exists ${imagedir}]} {
file mkdir ${imagedir}
}
}
# remember the path to the old resource file
set old_resource_path $::env(CSF_STEPDefaults)
# reading old resource file
set anOptions [parse_resource_file "${old_resource_path}/STEP"]
# activation of ignoring the adding of natural bound # activation of ignoring the adding of natural bound
dict set anOptions "FromSTEP.FixShape.FixAddNaturalBoundMode" "0" param "FromSTEP.FixShape.FixAddNaturalBoundMode" 0
# path to new resource file
set new_resource_path ${imagedir}
# creating resource file
create_resource_file "${new_resource_path}/STEP" $anOptions
# changing the path to the resource file
set ::env(CSF_STEPDefaults) ${new_resource_path}
puts "New path to STEP resource file is: \"${new_resource_path}\""
return ${old_resource_path}
} }
proc de_after_script {old_resource_path} { proc de_after_script {} {
# Restoring the path to the old resource file param "read.step.resource.name" "STEP"
set ::env(CSF_STEPDefaults) ${old_resource_path} param "FromSTEP.FixShape.FixAddNaturalBoundMode" -1
puts "Restore path to STEP resource file: \"${old_resource_path}\""
} }

View File

@@ -23,33 +23,14 @@ LAYERS : Layers = ( )
set de_use_custom_scripts 1 set de_use_custom_scripts 1
proc de_before_script {TheFileName} { proc de_before_script {} {
if { [info exists imagedir] == 0 } { # Empty resource file name to take params from InterfaceStatic
set imagedir ../[file rootname $TheFileName] param "read.step.resource.name" "\"\""
if {![file exists ${imagedir}]} { # activation of ignoring the adding of natural bound
file mkdir ${imagedir} param "FromSTEP.FixShape.FixAddNaturalBoundMode" 0
}
}
# remember the path to the old resource file
set old_resource_path $::env(CSF_STEPDefaults)
# reading old resource file
set anOptions [parse_resource_file "${old_resource_path}/STEP"]
# turn off the adding of natural bound
dict set anOptions "FromSTEP.FixShape.FixAddNaturalBoundMode" "0"
# path to new resource file
set new_resource_path ${imagedir}
# creating resource file
create_resource_file "${new_resource_path}/STEP" $anOptions
# changing the path to the resource file
set ::env(CSF_STEPDefaults) ${new_resource_path}
puts "New path to STEP resource file is: \"${new_resource_path}\""
return ${old_resource_path}
} }
proc de_after_script {old_resource_path} { proc de_after_script {} {
# Restoring the path to the old resource file param "read.step.resource.name" "STEP"
set ::env(CSF_STEPDefaults) ${old_resource_path} param "FromSTEP.FixShape.FixAddNaturalBoundMode" -1
puts "Restore path to STEP resource file: \"${old_resource_path}\""
} }

View File

@@ -29,33 +29,14 @@ LAYERS : Layers = ( )
set de_use_custom_scripts 1 set de_use_custom_scripts 1
proc de_before_script {TheFileName} { proc de_before_script {} {
if { [info exists imagedir] == 0 } { # Empty resource file name to take params from InterfaceStatic
set imagedir ../[file rootname $TheFileName] param "read.step.resource.name" "\"\""
if {![file exists ${imagedir}]} {
file mkdir ${imagedir}
}
}
# remember the path to the old resource file
set old_resource_path $::env(CSF_STEPDefaults)
# reading old resource file
set anOptions [parse_resource_file "${old_resource_path}/STEP"]
# activation of ignoring the adding of natural bound # activation of ignoring the adding of natural bound
dict set anOptions "FromSTEP.FixShape.FixAddNaturalBoundMode" "0" param "FromSTEP.FixShape.FixAddNaturalBoundMode" 0
# path to new resource file
set new_resource_path ${imagedir}
# creating resource file
create_resource_file "${new_resource_path}/STEP" $anOptions
# changing the path to the resource file
set ::env(CSF_STEPDefaults) ${new_resource_path}
puts "New path to STEP resource file is: \"${new_resource_path}\""
return ${old_resource_path}
} }
proc de_after_script {old_resource_path} { proc de_after_script {} {
# Restoring the path to the old resource file param "read.step.resource.name" "STEP"
set ::env(CSF_STEPDefaults) ${old_resource_path} param "FromSTEP.FixShape.FixAddNaturalBoundMode" -1
puts "Restore path to STEP resource file: \"${old_resource_path}\""
} }

View File

@@ -27,33 +27,14 @@ LAYERS : Layers = ( )
set de_use_custom_scripts 1 set de_use_custom_scripts 1
proc de_before_script {TheFileName} { proc de_before_script {} {
if { [info exists imagedir] == 0 } { # Empty resource file name to take params from InterfaceStatic
set imagedir ../[file rootname $TheFileName] param "read.step.resource.name" "\"\""
if {![file exists ${imagedir}]} {
file mkdir ${imagedir}
}
}
# remember the path to the old resource file
set old_resource_path $::env(CSF_STEPDefaults)
# reading old resource file
set anOptions [parse_resource_file "${old_resource_path}/STEP"]
# activation of ignoring the adding of natural bound # activation of ignoring the adding of natural bound
dict set anOptions "FromSTEP.FixShape.FixAddNaturalBoundMode" "0" param "FromSTEP.FixShape.FixAddNaturalBoundMode" 0
# path to new resource file
set new_resource_path ${imagedir}
# creating resource file
create_resource_file "${new_resource_path}/STEP" $anOptions
# changing the path to the resource file
set ::env(CSF_STEPDefaults) ${new_resource_path}
puts "New path to STEP resource file is: \"${new_resource_path}\""
return ${old_resource_path}
} }
proc de_after_script {old_resource_path} { proc de_after_script {} {
# Restoring the path to the old resource file param "read.step.resource.name" "STEP"
set ::env(CSF_STEPDefaults) ${old_resource_path} param "FromSTEP.FixShape.FixAddNaturalBoundMode" -1
puts "Restore path to STEP resource file: \"${old_resource_path}\""
} }

View File

@@ -27,33 +27,14 @@ LAYERS : Layers = ( )
set de_use_custom_scripts 1 set de_use_custom_scripts 1
proc de_before_script {TheFileName} { proc de_before_script {} {
if { [info exists imagedir] == 0 } { # Empty resource file name to take params from InterfaceStatic
set imagedir ../[file rootname $TheFileName] param "read.step.resource.name" "\"\""
if {![file exists ${imagedir}]} {
file mkdir ${imagedir}
}
}
# remember the path to the old resource file
set old_resource_path $::env(CSF_STEPDefaults)
# reading old resource file
set anOptions [parse_resource_file "${old_resource_path}/STEP"]
# activation of ignoring the adding of natural bound # activation of ignoring the adding of natural bound
dict set anOptions "FromSTEP.FixShape.FixAddNaturalBoundMode" "0" param "FromSTEP.FixShape.FixAddNaturalBoundMode" 0
# path to new resource file
set new_resource_path ${imagedir}
# creating resource file
create_resource_file "${new_resource_path}/STEP" $anOptions
# changing the path to the resource file
set ::env(CSF_STEPDefaults) ${new_resource_path}
puts "New path to STEP resource file is: \"${new_resource_path}\""
return ${old_resource_path}
} }
proc de_after_script {old_resource_path} { proc de_after_script {} {
# Restoring the path to the old resource file param "read.step.resource.name" "STEP"
set ::env(CSF_STEPDefaults) ${old_resource_path} param "FromSTEP.FixShape.FixAddNaturalBoundMode" -1
puts "Restore path to STEP resource file: \"${old_resource_path}\""
} }