return aCylinder;
}
+//=============================================================================
+/*!
+ * MakeCylinderRHA
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeCylinderRHA (double theR, double theH, double theA)
+{
+ SetErrorCode(KO);
+
+ //Add a new Cylinder object
+ Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GetDocID(), GEOM_CYLINDER);
+
+ //Add a new Cylinder function with R and H parameters
+ Handle(GEOM_Function) aFunction = aCylinder->AddFunction(GEOMImpl_CylinderDriver::GetID(), CYLINDER_R_H_A);
+ if (aFunction.IsNull()) return NULL;
+
+ //Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != GEOMImpl_CylinderDriver::GetID()) return NULL;
+
+ GEOMImpl_ICylinder aCI (aFunction);
+
+ aCI.SetR(theR);
+ aCI.SetH(theH);
+ aCI.SetA(theA);
+
+ //Compute the Cylinder value
+ try {
+ OCC_CATCH_SIGNALS;
+ if (!GetSolver()->ComputeFunction(aFunction)) {
+ SetErrorCode("Cylinder 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(aFunction) << aCylinder
+ << " = geompy.MakeCylinderRHA(" << theR << ", " << theH << ", " << theA*180./M_PI << "*math.pi/180.)";
+
+ SetErrorCode(OK);
+ return aCylinder;
+}
//=============================================================================
/*!
return aCylinder;
}
+//=============================================================================
+/*!
+ * MakeCylinderPntVecRHA
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeCylinderPntVecRHA (Handle(GEOM_Object) thePnt,
+ Handle(GEOM_Object) theVec,
+ double theR, double theH, double theA)
+{
+ SetErrorCode(KO);
+
+ if (thePnt.IsNull() || theVec.IsNull()) return NULL;
+
+ //Add a new Cylinder object
+ Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GetDocID(), GEOM_CYLINDER);
+
+ //Add a new Cylinder function for creation a cylinder relatively to point and vector
+ Handle(GEOM_Function) aFunction =
+ aCylinder->AddFunction(GEOMImpl_CylinderDriver::GetID(), CYLINDER_PNT_VEC_R_H_A);
+ if (aFunction.IsNull()) return NULL;
+
+ //Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != GEOMImpl_CylinderDriver::GetID()) return NULL;
+
+ GEOMImpl_ICylinder aCI (aFunction);
+
+ Handle(GEOM_Function) aRefPnt = thePnt->GetLastFunction();
+ Handle(GEOM_Function) aRefVec = theVec->GetLastFunction();
+
+ if (aRefPnt.IsNull() || aRefVec.IsNull()) return NULL;
+
+ aCI.SetPoint(aRefPnt);
+ aCI.SetVector(aRefVec);
+ aCI.SetR(theR);
+ aCI.SetH(theH);
+ aCI.SetA(theA);
+
+ //Compute the Cylinder value
+ try {
+ OCC_CATCH_SIGNALS;
+ if (!GetSolver()->ComputeFunction(aFunction)) {
+ SetErrorCode("Cylinder 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(aFunction) << aCylinder << " = geompy.MakeCylinderA("
+ << thePnt << ", " << theVec << ", " << theR << ", " << theH << ", " << theA*180./M_PI << "*math.pi/180.)";
+
+ SetErrorCode(OK);
+ return aCylinder;
+}
+
//=============================================================================
/*!