mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-05-01 10:26:12 +03:00
Global functions are added to allow a user performing DRAW commands from VS Command Window when DRAW is interrupted on a breakpoint. Previously existing functions are adapted to work with Visual Studio debugger (Command Window). A manual describing use of these functions and other debugging facilities and some hints is added to Developer Guides. Minor corrections and refinement of debug.md.
66 lines
2.0 KiB
C++
66 lines
2.0 KiB
C++
// Created on: 1994-07-25
|
|
// Created by: Remi LEQUETTE
|
|
// Copyright (c) 1994-1999 Matra Datavision
|
|
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
|
//
|
|
// This file is part of Open CASCADE Technology software library.
|
|
//
|
|
// This library is free software; you can redistribute it and/or modify it under
|
|
// the terms of the GNU Lesser General Public License version 2.1 as published
|
|
// by the Free Software Foundation, with special exception defined in the file
|
|
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
|
// distribution for complete text of the license and disclaimer of any warranty.
|
|
//
|
|
// Alternatively, this file may be used under the terms of Open CASCADE
|
|
// commercial license or contractual agreement.
|
|
|
|
#include <DBRep.hxx>
|
|
#include <Standard_ErrorHandler.hxx>
|
|
#include <Standard_Failure.hxx>
|
|
|
|
// This file defines global functions not declared in any public header,
|
|
// intended for use from debugger prompt (Command Window in Visual Studio)
|
|
|
|
//! Save shape identified by pointer
|
|
Standard_EXPORT const char* DBRep_Set (const char* theNameStr, void* theShapePtr)
|
|
{
|
|
if (theNameStr == 0 || theShapePtr == 0)
|
|
{
|
|
return "Error: name or shape is null";
|
|
}
|
|
try {
|
|
DBRep::Set (theNameStr, *(TopoDS_Shape*)theShapePtr);
|
|
return theNameStr;
|
|
}
|
|
catch (Standard_Failure)
|
|
{
|
|
return Standard_Failure::Caught()->GetMessageString();
|
|
}
|
|
}
|
|
|
|
// MSVC debugger cannot deal correctly with functions whose argunments
|
|
// have non-standard types. Here we define alternative to the above functions
|
|
// with good types with the hope that GDB on Linux or other debugger could
|
|
// work with them (DBX could, on SUN Solaris).
|
|
#ifndef _MSC_VER
|
|
|
|
const char* DBRep_Set (char* theName, const TopoDS_Shape& theShape)
|
|
{
|
|
return DBRep_Set (theName, (void*)&theShape);
|
|
}
|
|
|
|
#endif /* _MSC_VER */
|
|
|
|
// old function, perhaps too dangerous to be used
|
|
/*
|
|
void DBRep_Get(char* name, TopoDS_Shape& S)
|
|
{
|
|
char n[255];
|
|
strcpy(n,name);
|
|
Standard_CString cs = (Standard_CString)n;
|
|
S = DBRep::Get(cs);
|
|
if (*name == '.')
|
|
cout << "Name : " << n << endl;
|
|
}
|
|
*/
|