1 // Created on: 1994-07-25
2 // Created by: Remi LEQUETTE
3 // Copyright (c) 1994-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #include <GeomTools.hxx>
18 #include <GeomTools_SurfaceSet.hxx>
19 #include <GeomTools_CurveSet.hxx>
20 #include <GeomTools_Curve2dSet.hxx>
21 #include <Standard_ErrorHandler.hxx>
22 #include <Standard_Failure.hxx>
23 #include <Geom_Surface.hxx>
24 #include <Geom_Curve.hxx>
25 #include <Geom2d_Curve.hxx>
27 // This file defines global functions not declared in any public header,
28 // intended for use from debugger prompt (Command Window in Visual Studio)
30 //! Dump content of the geometric object to cout
31 const char* GeomTools_Dump (void* theHandlePtr)
33 if (theHandlePtr == 0)
35 return "Error: argument is null";
39 const Handle(Standard_Transient)& aHandle = *(Handle(Standard_Transient)*)theHandlePtr;
41 Handle(Geom_Surface) GS = Handle(Geom_Surface)::DownCast(aHandle);
44 GeomTools_SurfaceSet::PrintSurface (GS,cout);
46 return "Found Geom_Surface, see dump in cout";
49 Handle(Geom_Curve) GC = Handle(Geom_Curve)::DownCast(aHandle);
52 GeomTools_CurveSet::PrintCurve(GC,cout);
54 return "Found Geom_Curve, see dump in cout";
57 Handle(Geom2d_Curve) GC2d = Handle(Geom2d_Curve)::DownCast(aHandle);
60 GeomTools_Curve2dSet::PrintCurve2d(GC2d,cout);
62 return "Found Geom2d_Curve, see dump in cout";
65 return "Error: Not a geometric object";
67 catch (Standard_Failure)
69 return Standard_Failure::Caught()->GetMessageString();
73 // MSVC debugger cannot deal correctly with functions whose argunments
74 // have non-standard types. Here we define alternative to the above functions
75 // with good types with the hope that GDB on Linux or other debugger could
76 // work with them (DBX could, on SUN Solaris).
79 const char* GeomTools_Dump (const Handle(Standard_Transient)& theGeom)
81 return GeomTools_Dump ((void*)&theGeom);