0030949: Foundation Classes - Dump improvement for OCCT classes
[occt.git] / src / Bnd / Bnd_Box.cxx
index 1b4ab44..ce7a6af 100644 (file)
@@ -21,6 +21,7 @@
 #include <gp_Pnt.hxx>
 #include <gp_Trsf.hxx>
 #include <Standard_ConstructionError.hxx>
+#include <Standard_Dump.hxx>
 
 // set the flag to one
 #define ClearVoidFlag() ( Flags &= ~VoidMask )
@@ -43,6 +44,18 @@ Bnd_Box::Bnd_Box()
   SetVoid();
 }
 
+//=======================================================================
+//function : Bnd_Box
+//purpose  : 
+//=======================================================================
+Bnd_Box::Bnd_Box (const gp_Pnt theMin, const gp_Pnt theMax)
+: Gap (0.0)
+{
+  SetVoid();
+  Update (theMin.X(), theMin.Y(), theMin.Z(), theMax.X(), theMax.Y(), theMax.Z());
+}
+
+
 //=======================================================================
 //function : Set
 //purpose  : 
@@ -957,3 +970,18 @@ void Bnd_Box::Dump () const
   std::cout << "\n Gap : " << Gap;
   std::cout << "\n";
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void Bnd_Box::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
+{
+  DUMP_CLASS_BEGIN (theOStream, Bnd_Box);
+
+  DUMP_FIELD_VALUES_NUMERICAL (theOStream, "CornerMin", 3, Xmin, Ymin, Zmin)
+  DUMP_FIELD_VALUES_NUMERICAL (theOStream, "CornerMax", 3, Xmax, Ymax, Zmax)
+
+  DUMP_FIELD_VALUE_NUMERICAL (theOStream, Gap);
+  DUMP_FIELD_VALUE_NUMERICAL (theOStream, Flags);
+}