#include <GEOMImpl_Types.hxx>
#include <GEOMImpl_FilletDriver.hxx>
+#include <GEOMImpl_Fillet1dDriver.hxx>
#include <GEOMImpl_Fillet2dDriver.hxx>
#include <GEOMImpl_ChamferDriver.hxx>
#include <GEOMImpl_IFillet.hxx>
+#include <GEOMImpl_IFillet1d.hxx>
#include <GEOMImpl_IFillet2d.hxx>
#include <GEOMImpl_IChamfer.hxx>
return aFillet2D;
}
+//=============================================================================
+/*!
+ * MakeFillet1D
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFillet1D
+ (Handle(GEOM_Object) theShape, double theR, std::list<int> theVertexes)
+{
+ SetErrorCode(KO);
+
+ //Add a new Fillet object
+ Handle(GEOM_Object) aFillet1D = GetEngine()->AddObject(GetDocID(), GEOM_FILLET_1D);
+
+ //Add a new Fillet function
+ Handle(GEOM_Function) aFunction =
+ aFillet1D->AddFunction(GEOMImpl_Fillet1dDriver::GetID(), FILLET_1D_SHAPE_VERTEXES);
+ if (aFunction.IsNull()) return NULL;
+
+ //Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != GEOMImpl_Fillet1dDriver::GetID()) return NULL;
+
+ GEOMImpl_IFillet1d aCI (aFunction);
+
+ Handle(GEOM_Function) aRefShape = theShape->GetLastFunction();
+ if (aRefShape.IsNull()) return NULL;
+
+ aCI.SetShape(aRefShape);
+ aCI.SetR(theR);
+ int aLen = theVertexes.size();
+ aCI.SetLength(aLen);
+
+ int ind = 1;
+ std::list<int>::iterator it = theVertexes.begin();
+ for (; it != theVertexes.end(); it++, ind++) {
+ aCI.SetVertex(ind, (*it));
+ }
+
+ //Compute the Fillet value
+ try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+ OCC_CATCH_SIGNALS;
+#endif
+ if (!GetSolver()->ComputeFunction(aFunction)) {
+ SetErrorCode("1D Fillet driver failed");
+ return NULL;
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+
+ //Make a Python command
+ GEOM::TPythonDump pd (aFunction);
+ pd << aFillet1D << " = geompy.MakeFillet1D(" << theShape
+ << ", " << theR << ", [";
+
+ it = theVertexes.begin();
+ pd << (*it++);
+ while (it != theVertexes.end()) {
+ pd << ", " << (*it++);
+ }
+ pd << "])";
+
+ SetErrorCode(OK);
+ return aFillet1D;
+}
+
//=============================================================================
/*!
* MakeChamferAll
//Check if the function is set correctly
if (aFunction->GetDriverGUID() != GEOMImpl_ChamferDriver::GetID())
- { MESSAGE ( "Chamfer Driver is NULL!!!" ); return NULL; }
+ { MESSAGE ( "Chamfer Driver is NULL!!!" ); return NULL; }
GEOMImpl_IChamfer aCI (aFunction);
//Check if the function is set correctly
if (aFunction->GetDriverGUID() != GEOMImpl_ChamferDriver::GetID())
- { MESSAGE("Chamfer Driver is NULL!!!"); return NULL;}
+ { MESSAGE("Chamfer Driver is NULL!!!"); return NULL;}
GEOMImpl_IChamfer aCI (aFunction);