mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-05 18:16:23 +03:00
0027293: Add debug function to save a list of shapes into a compound
This commit is contained in:
parent
73e5a645f3
commit
66d914e8ea
@ -62,6 +62,14 @@ Sets the specified shape as a value of DRAW interpreter variable with the given
|
||||
- *theNameStr* -- the DRAW interpreter variable name to set.
|
||||
- *theShapePtr* -- a pointer to *TopoDS_Shape* variable.
|
||||
|
||||
~~~~~
|
||||
const char* DBRep_SetComp (const char* theNameStr, void* theListPtr)
|
||||
~~~~~
|
||||
|
||||
Makes a compound from the specified list of shapes and sets it as a value of DRAW interpreter variable with the given name.
|
||||
- *theNameStr* -- the DRAW interpreter variable name to set.
|
||||
- *theListPtr* -- a pointer to *TopTools_ListOfShape* variable.
|
||||
|
||||
~~~~~
|
||||
const char* DrawTrSurf_Set (const char* theNameStr, void* theHandlePtr)
|
||||
const char* DrawTrSurf_SetPnt (const char* theNameStr, void* thePntPtr)
|
||||
@ -140,6 +148,7 @@ For convenience it is possible to define aliases to commands in this window, for
|
||||
~~~~~
|
||||
>alias deval ? ({,,TKDraw}Draw_Eval)
|
||||
>alias dsetshape ? ({,,TKDraw}DBRep_Set)
|
||||
>alias dsetcomp ? ({,,TKDraw}DBRep_SetComp)
|
||||
>alias dsetgeom ? ({,,TKDraw}DrawTrSurf_Set)
|
||||
>alias dsetpnt ? ({,,TKDraw}DrawTrSurf_SetPnt)
|
||||
>alias dsetpnt2d ? ({,,TKDraw}DrawTrSurf_SetPnt2d)
|
||||
|
@ -17,6 +17,9 @@
|
||||
#include <DBRep.hxx>
|
||||
#include <Standard_ErrorHandler.hxx>
|
||||
#include <Standard_Failure.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
|
||||
// This file defines global functions not declared in any public header,
|
||||
// intended for use from debugger prompt (Command Window in Visual Studio)
|
||||
@ -38,6 +41,39 @@ Standard_EXPORT const char* DBRep_Set (const char* theNameStr, void* theShapePtr
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DBRep_SetComp
|
||||
//purpose : make compound from the given list of shapes
|
||||
//=======================================================================
|
||||
Standard_EXPORT const char* DBRep_SetComp(const char* theNameStr, void* theListPtr)
|
||||
{
|
||||
if (theNameStr == 0 || theListPtr == 0)
|
||||
{
|
||||
return "Error: name or list of shapes is null";
|
||||
}
|
||||
try {
|
||||
TopTools_ListOfShape *pLS;
|
||||
pLS = (TopTools_ListOfShape *)theListPtr;
|
||||
|
||||
TopoDS_Compound aC;
|
||||
BRep_Builder aBB;
|
||||
TopTools_ListIteratorOfListOfShape aIt;
|
||||
|
||||
aBB.MakeCompound(aC);
|
||||
aIt.Initialize(*pLS);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
const TopoDS_Shape& aE = aIt.Value();
|
||||
aBB.Add(aC, aE);
|
||||
}
|
||||
DBRep::Set(theNameStr, aC);
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user