* MakeSketcher
*/
//=============================================================================
-Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSketcher
- (const TCollection_AsciiString& theCommand,
- list<double> theWorkingPlane)
+Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSketcher (const char* theCommand,
+ list<double> theWorkingPlane)
{
SetErrorCode(KO);
- if (theCommand.IsEmpty()) return NULL;
+ if (!theCommand || strcmp(theCommand, "") == 0) return NULL;
//Add a new Sketcher object
Handle(GEOM_Object) aSketcher = GetEngine()->AddObject(GetDocID(), GEOM_SKETCHER);
GEOMImpl_ISketcher aCI (aFunction);
- aCI.SetCommand(theCommand);
+ TCollection_AsciiString aCommand((char*) theCommand);
+ aCI.SetCommand(aCommand);
int ind = 1;
list<double>::iterator it = theWorkingPlane.begin();
//Make a Python command
GEOM::TPythonDump pd (aFunction);
- pd << aSketcher << " = geompy.MakeSketcher(\"" << theCommand.ToCString() << "\", [";
+ pd << aSketcher << " = geompy.MakeSketcher(\"" << aCommand.ToCString() << "\", [";
it = theWorkingPlane.begin();
pd << (*it++);
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSketcherOnPlane
- (const TCollection_AsciiString& theCommand,
+ (const char* theCommand,
Handle(GEOM_Object) theWorkingPlane)
{
SetErrorCode(KO);
- if (theCommand.IsEmpty()) return NULL;
+ if (!theCommand || strcmp(theCommand, "") == 0) return NULL;
//Add a new Sketcher object
Handle(GEOM_Object) aSketcher = GetEngine()->AddObject(GetDocID(), GEOM_SKETCHER);
if (aFunction->GetDriverGUID() != GEOMImpl_SketcherDriver::GetID()) return NULL;
GEOMImpl_ISketcher aCI (aFunction);
- aCI.SetCommand(theCommand);
+
+ TCollection_AsciiString aCommand((char*) theCommand);
+ aCI.SetCommand(aCommand);
Handle(GEOM_Function) aRefPlane = theWorkingPlane->GetLastFunction();
if (aRefPlane.IsNull()) return NULL;
//Make a Python command
GEOM::TPythonDump (aFunction) << aSketcher << " = geompy.MakeSketcherOnPlane(\""
- << theCommand.ToCString() << "\", " << theWorkingPlane << " )";
+ << aCommand.ToCString() << "\", " << theWorkingPlane << " )";
SetErrorCode(OK);
return aSketcher;
Standard_EXPORT Handle(GEOM_Object) MakeSplineBezier (list<Handle(GEOM_Object)> thePoints);
Standard_EXPORT Handle(GEOM_Object) MakeSplineInterpolation (list<Handle(GEOM_Object)> thePoints);
- Standard_EXPORT Handle(GEOM_Object) MakeSketcher (const TCollection_AsciiString& theCommand,
+ Standard_EXPORT Handle(GEOM_Object) MakeSketcher (const char* theCommand,
list<double> theWorkingPlane);
- Standard_EXPORT Handle(GEOM_Object) MakeSketcherOnPlane (const TCollection_AsciiString& theCommand,
+ Standard_EXPORT Handle(GEOM_Object) MakeSketcherOnPlane (const char* theCommand,
Handle(GEOM_Object) theWorkingPlane);
};
// Make Sketcher
Handle(GEOM_Object) anObject =
- GetOperations()->MakeSketcher((char*)theCommand, aWorkingPlane);
+ GetOperations()->MakeSketcher(theCommand, aWorkingPlane);
if (!GetOperations()->IsDone() || anObject.IsNull())
return GEOM::GEOM_Object::_nil();
// Make Sketcher
Handle(GEOM_Object) anObject =
- GetOperations()->MakeSketcherOnPlane((char*)theCommand, aWorkingPlane);
+ GetOperations()->MakeSketcherOnPlane(theCommand, aWorkingPlane);
if (!GetOperations()->IsDone() || anObject.IsNull())
return GEOM::GEOM_Object::_nil();