: BinMDF_ADriver (theMsgDriver, STANDARD_TYPE(TNaming_NamedShape)->Name()),
myShapeSet (NULL),
myFormatNb (BinTools_FormatVersion_VERSION_1),
- myIsQuickPart (Standard_False),
- myWithTriangles (Standard_False)
+ myWithTriangles (Standard_False),
+ myIsQuickPart (Standard_False)
{
}
TopoDS_Shape anOldShape, aNewShape;
if (anEvol != TNaming_PRIMITIVE)
+ {
if (myIsQuickPart)
aShapeSet->Read (*aDirectStream, anOldShape);
else
if (TranslateFrom (theSource, anOldShape, static_cast<BinTools_ShapeSet*>(aShapeSet))) return Standard_False;
+ }
if (anEvol != TNaming_DELETE)
+ {
if (myIsQuickPart)
aShapeSet->Read (*aDirectStream, aNewShape);
else
if (TranslateFrom (theSource, aNewShape, static_cast<BinTools_ShapeSet*>(aShapeSet))) return Standard_False;
+ }
// Here we add shapes in reverse order because TNaming_Builder also adds them in reverse order.
anOldShapes.Prepend (anOldShape);
BinTools_ShapeSetBase* BinMNaming_NamedShapeDriver::ShapeSet (const Standard_Boolean theReading)
{
if (!myShapeSet)
+ {
if (myIsQuickPart)
+ {
if (theReading)
myShapeSet = new BinTools_ShapeReader();
else
myShapeSet = new BinTools_ShapeWriter (myWithTriangles);
+ }
else
myShapeSet = new BinTools_ShapeSet (myWithTriangles);
+ }
return myShapeSet;
}
//=======================================================================
BinTools_IStream::operator bool() const
{
- return myStream->operator bool();
+ return *myStream ? Standard_True : Standard_False;
}
//=======================================================================
class Poly_PolygonOnTriangulation;
class Poly_Triangulation;
+//! Computes a hash code for the given value of the uint64_t type, in range [1, theUpperBound]
+inline Standard_Integer HashCode (const uint64_t theValue, const Standard_Integer theUpperBound)
+{
+ return IntegerHashCode(theValue, 0xffffffffffffffff, theUpperBound);
+}
//! Reads topology from IStream in binary format without grouping of objects by types
//! and using relative positions in a file as references.