mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-24 13:50:49 +03:00
0031326: Foundation Classes - Init from Json for base OCCT classes
InitFromJson method implementation for some simple classes. OCCT_INIT_* defines introduction to do automatic parsing of the stream into values. Inspector is extended to visualize objects created on the dump stream if it might be created.
This commit is contained in:
@@ -983,3 +983,22 @@ void Bnd_Box::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Gap)
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Flags)
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : InitFromJson
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean Bnd_Box::InitFromJson (const Standard_SStream& theSStream, Standard_Integer& theStreamPos)
|
||||
{
|
||||
Standard_Integer aPos = theStreamPos;
|
||||
|
||||
TCollection_AsciiString aStreamStr = Standard_Dump::Text (theSStream);
|
||||
OCCT_INIT_VECTOR_CLASS (aStreamStr, "CornerMin", aPos, 3, &Xmin, &Ymin, &Zmin)
|
||||
OCCT_INIT_VECTOR_CLASS (aStreamStr, "CornerMax", aPos, 3, &Xmax, &Ymax, &Zmax)
|
||||
|
||||
OCCT_INIT_FIELD_VALUE_REAL (aStreamStr, aPos, Gap);
|
||||
OCCT_INIT_FIELD_VALUE_INTEGER (aStreamStr, aPos, Flags);
|
||||
|
||||
theStreamPos = aPos;
|
||||
return Standard_True;
|
||||
}
|
||||
|
Reference in New Issue
Block a user