mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0030378: Data Exchange - extract of subset of model entities fails (regression)
Field theflags in class Interface_BitMap is always initialized to avoid exception on operations with the class. Added test bugs step bug30378
This commit is contained in:
parent
afe3ff9aaa
commit
b81a7e3160
@ -33,11 +33,7 @@ void Interface_BitMap::Initialize(const Standard_Integer nbitems, const Standard
|
|||||||
thenbitems = nbitems;
|
thenbitems = nbitems;
|
||||||
thenbwords = nbitems/32 + 1;
|
thenbwords = nbitems/32 + 1;
|
||||||
thenbflags = 0;
|
thenbflags = 0;
|
||||||
if(nbitems)
|
theflags = new TColStd_HArray1OfInteger(0, thenbwords*(resflags + 1), 0);
|
||||||
{
|
|
||||||
theflags = new TColStd_HArray1OfInteger (0,thenbwords*(resflags+1));
|
|
||||||
theflags->Init(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Interface_BitMap::Interface_BitMap
|
Interface_BitMap::Interface_BitMap
|
||||||
@ -50,32 +46,23 @@ Interface_BitMap::Interface_BitMap
|
|||||||
void Interface_BitMap::Initialize(const Interface_BitMap& other,
|
void Interface_BitMap::Initialize(const Interface_BitMap& other,
|
||||||
const Standard_Boolean copied)
|
const Standard_Boolean copied)
|
||||||
{
|
{
|
||||||
other.Internals (thenbitems,thenbwords,thenbflags,theflags,thenames);
|
thenbitems = other.thenbitems;
|
||||||
if (!copied) return;
|
thenbwords = other.thenbwords;
|
||||||
Standard_Integer nb = theflags->Upper ();
|
thenbflags = other.thenbflags;
|
||||||
Handle(TColStd_HArray1OfInteger) flags = new TColStd_HArray1OfInteger(0,nb);
|
if (!copied)
|
||||||
Standard_Integer i; // svv Jan11 2000 : porting on DEC
|
|
||||||
for (i = 0; i <= nb; i ++)
|
|
||||||
flags->SetValue (i,theflags->Value(i));
|
|
||||||
theflags = flags;
|
|
||||||
if (thenames.IsNull()) return;
|
|
||||||
nb = thenames->Length();
|
|
||||||
Handle(TColStd_HSequenceOfAsciiString) names = new TColStd_HSequenceOfAsciiString();
|
|
||||||
for (i = 1; i <= nb; i ++)
|
|
||||||
names->Append ( TCollection_AsciiString(thenames->Value(i)) );
|
|
||||||
thenames = names;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Interface_BitMap::Internals
|
|
||||||
(Standard_Integer& nbitems, Standard_Integer& nbwords,
|
|
||||||
Standard_Integer& nbflags,
|
|
||||||
Handle(TColStd_HArray1OfInteger)& flags,
|
|
||||||
Handle(TColStd_HSequenceOfAsciiString)& names) const
|
|
||||||
{
|
{
|
||||||
nbitems = thenbitems; nbwords = thenbwords; nbflags = thenbflags;
|
theflags = other.theflags;
|
||||||
flags = theflags; names = thenames;
|
thenames = other.thenames;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
theflags = new TColStd_HArray1OfInteger(other.theflags->Array1());
|
||||||
|
if (! other.thenames.IsNull())
|
||||||
|
{
|
||||||
|
thenames = new TColStd_HSequenceOfAsciiString(other.thenames->Sequence());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Interface_BitMap::Reservate (const Standard_Integer moreflags)
|
void Interface_BitMap::Reservate (const Standard_Integer moreflags)
|
||||||
{
|
{
|
||||||
|
@ -70,10 +70,6 @@ public:
|
|||||||
//! Initialize a BitMap from another one
|
//! Initialize a BitMap from another one
|
||||||
Standard_EXPORT void Initialize (const Interface_BitMap& other, const Standard_Boolean copied = Standard_False);
|
Standard_EXPORT void Initialize (const Interface_BitMap& other, const Standard_Boolean copied = Standard_False);
|
||||||
|
|
||||||
//! Returns internal values, used for copying
|
|
||||||
//! Flags values start at false
|
|
||||||
Standard_EXPORT void Internals (Standard_Integer& nbitems, Standard_Integer& nbwords, Standard_Integer& nbflags, Handle(TColStd_HArray1OfInteger)& flags, Handle(TColStd_HSequenceOfAsciiString)& names) const;
|
|
||||||
|
|
||||||
//! Reservates for a count of more flags
|
//! Reservates for a count of more flags
|
||||||
Standard_EXPORT void Reservate (const Standard_Integer moreflags);
|
Standard_EXPORT void Reservate (const Standard_Integer moreflags);
|
||||||
|
|
||||||
|
14
tests/bugs/step/bug30378
Normal file
14
tests/bugs/step/bug30378
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
puts "# ==============================================================================="
|
||||||
|
puts "# 0030378: Data Exchange - extract of subset of model entities fails (regression)"
|
||||||
|
puts "# ==============================================================================="
|
||||||
|
|
||||||
|
puts "Prepare simple STEP model"
|
||||||
|
pload MODELING XSDRAW
|
||||||
|
box b 10 10 10
|
||||||
|
stepwrite a b
|
||||||
|
|
||||||
|
puts "Write entity #3"
|
||||||
|
set res [writeent ${imagedir}/${test_image}.stp 3]
|
||||||
|
if { ! [regexp {Write\s+Done} $res] } {
|
||||||
|
puts "Error: expected output is not found"
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user