mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-03 14:10:33 +03:00
Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
0252e6edb0 |
@@ -322,7 +322,8 @@ Standard_Boolean IGESCAFControl_Reader::Transfer (const Handle(TDocStd_Document)
|
||||
|
||||
//Checks that current entity is a subfigure
|
||||
Handle(IGESBasic_SubfigureDef) aSubfigure = Handle(IGESBasic_SubfigureDef)::DownCast (ent);
|
||||
if (GetNameMode() && !aSubfigure.IsNull() && STool->Search (S, L, Standard_True, Standard_True))
|
||||
if (GetNameMode() && !aSubfigure.IsNull() && !aSubfigure->Name().IsNull() &&
|
||||
STool->Search(S, L, Standard_True, Standard_True))
|
||||
{
|
||||
//In this case we attach subfigure name to the label, instead of default "COMPOUND"
|
||||
Handle(TCollection_HAsciiString) aName = aSubfigure->Name();
|
||||
|
@@ -150,7 +150,6 @@ static Standard_Boolean Connect (const Handle(ShapeAnalysis_Wire)& theSAW,
|
||||
const Standard_Integer number,
|
||||
Handle(ShapeExtend_WireData)& Gsewd)
|
||||
{
|
||||
(void)number;
|
||||
Gsewd = new ShapeExtend_WireData;//local translation (for mysewd)
|
||||
Handle(ShapeExtend_WireData) Gsewd3d = new ShapeExtend_WireData;//local translation (for mysewd3d)
|
||||
Handle(ShapeExtend_WireData) Gsewd2d = new ShapeExtend_WireData;//local translation (for mysewd2d)
|
||||
@@ -385,31 +384,17 @@ static Standard_Boolean Connect (const Handle(ShapeAnalysis_Wire)& theSAW,
|
||||
}
|
||||
}
|
||||
|
||||
if (!mysewd.IsNull())
|
||||
{
|
||||
okCurve = okCurve && Connect(saw, mysewd, Gsewd, (len3d > 1) || (len2d > 1), maxtol,
|
||||
distmin, revsewd, revnextsewd);
|
||||
}
|
||||
else
|
||||
{
|
||||
mysewd = Gsewd;
|
||||
}
|
||||
if (!mysewd3d.IsNull())
|
||||
{
|
||||
if (number > 1) {
|
||||
okCurve = okCurve && Connect (saw, mysewd, Gsewd, (len3d > 1) || (len2d > 1), maxtol,
|
||||
distmin, revsewd, revnextsewd);
|
||||
okCurve3d = okCurve3d && Connect (saw3d, mysewd3d, Gsewd3d, len3d > 1, maxtol,
|
||||
distmin, revsewd, revnextsewd);
|
||||
}
|
||||
else
|
||||
{
|
||||
mysewd3d = Gsewd3d;
|
||||
}
|
||||
if (!mysewd2d.IsNull())
|
||||
{
|
||||
okCurve2d = okCurve2d && Connect (saw2d, mysewd2d, Gsewd2d, len2d > 1, maxtol,
|
||||
distmin, revsewd, revnextsewd);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
mysewd = Gsewd;
|
||||
mysewd3d = Gsewd3d;
|
||||
mysewd2d = Gsewd2d;
|
||||
}
|
||||
return okCurve;
|
||||
|
@@ -633,34 +633,55 @@ Standard_Boolean IGESData_ParamReader::ReadXYZ
|
||||
|
||||
//=======================================================================
|
||||
//function : ReadText
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean IGESData_ParamReader::ReadText
|
||||
(const IGESData_ParamCursor& PC, const Message_Msg& amsg,
|
||||
Handle(TCollection_HAsciiString)& val)
|
||||
Standard_Boolean IGESData_ParamReader::ReadText(const IGESData_ParamCursor& thePC,
|
||||
const Message_Msg& theMsg,
|
||||
Handle(TCollection_HAsciiString)& theVal)
|
||||
{
|
||||
if (!PrepareRead(PC,Standard_False)) return Standard_False;
|
||||
const Interface_FileParameter& FP = theparams->Value(theindex+thebase);
|
||||
if (FP.ParamType() != Interface_ParamText) {
|
||||
if (FP.ParamType() == Interface_ParamVoid) {
|
||||
val = new TCollection_HAsciiString("");
|
||||
if (!PrepareRead(thePC, Standard_False))
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
const Interface_FileParameter& aFP = theparams->Value(theindex + thebase);
|
||||
if (aFP.ParamType() != Interface_ParamText)
|
||||
{
|
||||
theVal = new TCollection_HAsciiString("");
|
||||
if (aFP.ParamType() == Interface_ParamVoid)
|
||||
{
|
||||
return Standard_True;
|
||||
}
|
||||
SendFail (amsg);
|
||||
SendFail(theMsg);
|
||||
return Standard_False;
|
||||
}
|
||||
Handle(TCollection_HAsciiString) tval = new TCollection_HAsciiString (FP.CValue());
|
||||
Standard_Integer lnt = tval->Length();
|
||||
Standard_Integer lnh = tval->Location(1,'H',1,lnt);
|
||||
if (lnh <= 1 || lnh >= lnt) {
|
||||
SendFail (amsg);
|
||||
const Handle(TCollection_HAsciiString) aBaseValue = new TCollection_HAsciiString(aFP.CValue());
|
||||
const Standard_Integer aBaseLength = aBaseValue->Length();
|
||||
const Standard_Integer aSymbolLocation = aBaseValue->Location(1, 'H', 1, aBaseLength);
|
||||
if (aSymbolLocation <= 1 || aSymbolLocation > aBaseLength)
|
||||
{
|
||||
theVal = new TCollection_HAsciiString("");
|
||||
SendFail(theMsg);
|
||||
return Standard_False;
|
||||
} else {
|
||||
Standard_Integer hol = atoi (tval->SubString(1,lnh-1)->ToCString());
|
||||
if (hol != (lnt-lnh)) SendWarning (amsg);
|
||||
}
|
||||
val = new TCollection_HAsciiString(tval->SubString(lnh+1,lnt)->ToCString());
|
||||
const TCollection_AsciiString aSpecialSubString = aBaseValue->String().SubString(1, aSymbolLocation - 1);
|
||||
if (!aSpecialSubString.IsIntegerValue())
|
||||
{
|
||||
theVal = new TCollection_HAsciiString("");
|
||||
SendFail(theMsg);
|
||||
return Standard_False;
|
||||
}
|
||||
Standard_Integer aResLength = aSpecialSubString.IntegerValue();
|
||||
if (aResLength != (aBaseLength - aSymbolLocation))
|
||||
{
|
||||
SendWarning(theMsg);
|
||||
aResLength = aBaseLength - aSymbolLocation;
|
||||
}
|
||||
TCollection_AsciiString aResString;
|
||||
if (aResLength > 0)
|
||||
{
|
||||
aResString = aBaseValue->String().SubString(aSymbolLocation + 1, aBaseLength);
|
||||
}
|
||||
theVal = new TCollection_HAsciiString(aResString);
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
|
@@ -200,7 +200,7 @@ public:
|
||||
//! For Message
|
||||
Standard_EXPORT Standard_Boolean ReadXYZ (const IGESData_ParamCursor& PC, const Standard_CString mess, gp_XYZ& val);
|
||||
|
||||
Standard_EXPORT Standard_Boolean ReadText (const IGESData_ParamCursor& PC, const Message_Msg& amsg, Handle(TCollection_HAsciiString)& val);
|
||||
Standard_EXPORT Standard_Boolean ReadText (const IGESData_ParamCursor& thePC, const Message_Msg& theMsg, Handle(TCollection_HAsciiString)& theVal);
|
||||
|
||||
//! Reads a Text value from parameter "num", as a String from
|
||||
//! Collection, that is, Hollerith text without leading "nnnH"
|
||||
|
@@ -1249,7 +1249,7 @@ Handle(Geom_Curve) IGESToBRep_BasicCurve::TransferLine
|
||||
|
||||
// modif du 15/10/97 : test moins severe
|
||||
// beaucoup de points confondus a GetEpsGeom()*GetUnitFactor()
|
||||
if (!Ps.IsEqual(Pe,Precision::Confusion() / GetUnitFactor())) { //:l3 abv 11 Jan 99: GetEpsGeom()*GetUnitFactor()/10.)) {
|
||||
if (!Ps.IsEqual(Pe,Precision::Confusion())) { //:l3 abv 11 Jan 99: GetEpsGeom()*GetUnitFactor()/10.)) {
|
||||
gp_Lin line(Ps, gp_Dir(gp_Vec(Ps,Pe)));
|
||||
Standard_Real t1 = ElCLib::Parameter(line, Ps);
|
||||
Standard_Real t2 = ElCLib::Parameter(line, Pe);
|
||||
@@ -1299,7 +1299,7 @@ Handle(Geom2d_Curve) IGESToBRep_BasicCurve::Transfer2dLine
|
||||
start->EndPoint().Y());
|
||||
}
|
||||
|
||||
if (!beg.IsEqual(end,Precision::PConfusion() / GetUnitFactor())) { //:l3 abv 11 Jan 99: GetEpsCoeff())) {
|
||||
if (!beg.IsEqual(end,Precision::PConfusion())) { //:l3 abv 11 Jan 99: GetEpsCoeff())) {
|
||||
gp_Lin2d line2d(beg, gp_Dir2d(gp_Vec2d(beg,end)));
|
||||
Standard_Real t1 = ElCLib::Parameter(line2d, beg);
|
||||
Standard_Real t2 = ElCLib::Parameter(line2d, end);
|
||||
|
@@ -1,17 +0,0 @@
|
||||
puts "==================================================="
|
||||
puts "0033326: Data Exchange, IGES Import - Ignoring unit value for validating geometry"
|
||||
puts "==================================================="
|
||||
puts ""
|
||||
|
||||
pload DCAF
|
||||
|
||||
Close D -silent
|
||||
|
||||
ReadIges D [locate_data_file "bug33326.igs"]
|
||||
vclear
|
||||
vinit View1
|
||||
XDisplay -dispMode 1 D
|
||||
vfit
|
||||
vdump "$imagedir/${casename}_src.png"
|
||||
|
||||
Close D
|
16
tests/bugs/iges/bug33327
Normal file
16
tests/bugs/iges/bug33327
Normal file
@@ -0,0 +1,16 @@
|
||||
puts "============"
|
||||
puts "0033327: Data Exchange, IGES Import - SubfigureDef can't read string"
|
||||
puts "============"
|
||||
|
||||
pload DCAF
|
||||
|
||||
Close D -silent
|
||||
|
||||
ReadIges D [locate_data_file "bug33327.igs"]
|
||||
vclear
|
||||
vinit View1
|
||||
XDisplay -dispMode 1 D
|
||||
vfit
|
||||
vdump "$imagedir/${casename}_src.png"
|
||||
|
||||
Close D
|
Reference in New Issue
Block a user