GEOM_Object MakeMarker (in double theOX , in double theOY , in double theOZ,
in double theXDX, in double theXDY, in double theXDZ,
in double theYDX, in double theYDY, in double theYDZ);
+
+ /*!
+ * Create a tangent plane to specified face in the point with specified parameters.
+ * Values of parameters should be between 0. and 1.0
+ * \param theFace - face for which tangent plane shuold be built.
+ * \param theParameterU - value of parameter by U
+ * \param theParameterV - value of parameter Vthe
+ * \param theTrimSize - defines sizes of created face
+ * \return New GEOM_Object, containing the face built on tangent plane.
+ */
+ GEOM_Object MakeTangentPlaneOnFace(in GEOM_Object theFace,
+ in double theParameterU,
+ in double theParameterV,
+ in double theTrimSize);
};
interface GEOM_ITransformOperations : GEOM_IOperations
in double theXDX, in double theXDY, in double theXDZ,
in double theYDX, in double theYDY, in double theYDZ) ;
+ /*!
+ * Create a tangent plane to specified face in the point with specified parameters.
+ * Values of parameters should be between 0. and 1.0
+ * \param theFace - face for which tangent plane shuold be built.
+ * \param theParameterU - value of parameter by U
+ * \param theParameterV - value of parameter Vthe
+ * \param theTrimSize - defines sizes of created face
+ * \return New GEOM_Object, containing the face built on tangent plane.
+ */
+ GEOM_Object MakeTangentPlaneOnFace(in GEOM_Object theFace,
+ in double theParameterU,
+ in double theParameterV,
+ in double theTrimSize);
+
//-----------------------------------------------------------//
// Primitives Construction : 3DPrimOperations //
//-----------------------------------------------------------//
SetErrorCode(OK);
return aMarker;
}
+
+//=============================================================================
+/*!
+ * MakeTangentPlaneOnFace
+ */
+//=============================================================================
+
+Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeTangentPlaneOnFace(const Handle(GEOM_Object)& theFace,
+ double theParamU,
+ double theParamV,
+ double theSize)
+{
+ SetErrorCode(KO);
+
+ if (theFace.IsNull()) return NULL;
+
+ //Add a new Plane object
+ Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE);
+
+ //Add a new Plane function
+ Handle(GEOM_Function) aFunction =
+ aPlane->AddFunction(GEOMImpl_PlaneDriver::GetID(), PLANE_TANGENT_FACE);
+
+ //Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != GEOMImpl_PlaneDriver::GetID()) return NULL;
+
+ GEOMImpl_IPlane aPI (aFunction);
+
+ Handle(GEOM_Function) aRef = theFace->GetLastFunction();
+ if (aRef.IsNull()) return NULL;
+
+ aPI.SetFace(aRef);
+ aPI.SetSize(theSize);
+ aPI.SetParameterU(theParamU);
+ aPI.SetParameterV(theParamV);
+
+ //Compute the Plane value
+ try {
+ if (!GetSolver()->ComputeFunction(aFunction)) {
+ SetErrorCode("Plane 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) << aPlane << " = geompy.MakeTangentPlaneOnFace("
+ << theFace << ", " <<theParamU <<", "<<theParamV <<", "<< theSize << ")";
+
+ SetErrorCode(OK);
+ return aPlane;
+}
+
Standard_EXPORT Handle(GEOM_Object) MakeMarker (double theOX, double theOY, double theOZ,
double theXDX, double theXDY, double theXDZ,
double theYDX, double theYDY, double theYDZ);
+
+ Standard_EXPORT Handle(GEOM_Object) MakeTangentPlaneOnFace(const Handle(GEOM_Object)& theFace,
+ double theParamU,
+ double theParamV,
+ double theSize);
+
};
#endif
#define PLN_ARG_REF 6
+#define PLN_ARG_PARAM_U 7
+
+#define PLN_ARG_PARAM_V 8
+
class GEOMImpl_IPlane
{
public:
Handle(GEOM_Function) GetPoint1() { return _func->GetReference(PLN_ARG_PNT1); }
Handle(GEOM_Function) GetPoint2() { return _func->GetReference(PLN_ARG_PNT2); }
Handle(GEOM_Function) GetPoint3() { return _func->GetReference(PLN_ARG_PNT3); }
+
+ void SetParameterU(double theParamU) { _func->SetReal(PLN_ARG_PARAM_U, theParamU); }
+ double GetParameterU() { return _func->GetReal(PLN_ARG_PARAM_U); }
+
+ void SetParameterV(double theParamV) { _func->SetReal(PLN_ARG_PARAM_V, theParamV); }
+ double GetParameterV() { return _func->GetReal(PLN_ARG_PARAM_V); }
private:
return GetObject(anObject);
}
+
+//=============================================================================
+/*!
+ * MakeTangentPlaneOnFace
+ */
+//=============================================================================
+
+GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakeTangentPlaneOnFace
+ (GEOM::GEOM_Object_ptr theFace,
+ CORBA::Double theParameterU,
+ CORBA::Double theParameterV,
+ CORBA::Double theTrimSize)
+{
+ GEOM::GEOM_Object_var aGEOMObject;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ if (theFace == NULL) return aGEOMObject._retn();
+
+ //Get the reference face
+
+ Handle(GEOM_Object) aRef = GetOperations()->GetEngine()->GetObject
+ (theFace->GetStudyID(), theFace->GetEntry());
+ if (aRef.IsNull()) return aGEOMObject._retn();
+
+ //Create the plane
+
+ Handle(GEOM_Object) anObject =
+ GetOperations()->MakeTangentPlaneOnFace(aRef, theParameterU,theParameterV,theTrimSize);
+ if (!GetOperations()->IsDone() || anObject.IsNull())
+ return aGEOMObject._retn();
+
+ return GetObject(anObject);
+}
+
CORBA::Double theXDX, CORBA::Double theXDY, CORBA::Double theXDZ,
CORBA::Double theYDX, CORBA::Double theYDY, CORBA::Double theYDZ);
+ GEOM::GEOM_Object_ptr MakeTangentPlaneOnFace (GEOM::GEOM_Object_ptr theFace,
+ CORBA::Double theParameterU,
+ CORBA::Double theParameterV,
+ CORBA::Double theTrimSize);
+
::GEOMImpl_IBasicOperations* GetOperations() { return (::GEOMImpl_IBasicOperations*)GetImpl(); }
};
return myBasicOp->MakeMarker(theOX, theOY, theOZ, theXDX, theXDY, theXDZ, theYDX, theYDY, theYDZ);
}
+//=============================================================================
+// MakeTangentPlaneOnFace:
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeTangentPlaneOnFace (GEOM::GEOM_Object_ptr theFace,
+ CORBA::Double theParameterU,
+ CORBA::Double theParameterV,
+ CORBA::Double theTrimSize)
+{
+ MESSAGE("GEOM_Superv_i::MakeTangentPlaneOnFace");
+ getBasicOp();
+ return myBasicOp->MakeTangentPlaneOnFace(theFace, theParameterU,theParameterV,theTrimSize);
+}
+
//================= Primitives Construction : 3DPrimOperations ================
//=============================================================================
// MakeBox:
CORBA::Double theXDX, CORBA::Double theXDY, CORBA::Double theXDZ,
CORBA::Double theYDX, CORBA::Double theYDY, CORBA::Double theYDZ);
+ GEOM::GEOM_Object_ptr MakeTangentPlaneOnFace (GEOM::GEOM_Object_ptr theFace,
+ CORBA::Double theParameterU,
+ CORBA::Double theParameterV,
+ CORBA::Double theTrimSize);
+
//-----------------------------------------------------------//
// Primitives Construction : 3DPrimOperations //
//-----------------------------------------------------------//