- *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)
~~~~~
>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)
#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)
}
}
+//=======================================================================
+//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