* Create a face specified dimensions along OX-OY coordinate axes,
* with edges parallel to the coordinate axes.
* Center of the face will be at point (0, 0, 0).
- * \param theH length of Face edge, parallel to OX axis.
- * \param theW lenght of Face edge, patallel to OY axis.
+ * \param theH Height of the Face.
+ * \param theW Width of the Face.
+ * \param theOrientation Orientation belong axis OXY OYZ OZX
* \return New GEOM_Object, containing the created face.
*/
- GEOM_Object MakeFaceHW (in double theH, in double theW);
+ GEOM_Object MakeFaceHW (in double theH, in double theW, in short theOrientation);
/*!
- * Create a face by another plane and two specified sizes,
+ * Create a face by normale vector or edge and two specified sizes,
* vertical (H) and horisontal (W).
- * \param theFace defines plane.
+ * \param theVec defines plane.
* \param theH vertical size (height).
* \param theW horisontal size (width).
* \return New GEOM_Object, containing the created face.
*/
- GEOM_Object MakeFacePlaneHW (in GEOM_Object theFace, in double theH, in double theW);
+ GEOM_Object MakeFaceVecHW (in GEOM_Object theVec, in double theH, in double theW);
/*!
* Create a Disk (circular face) with given center, normal vector and radius.
* \param thePnt disk center.
GEOM_Object MakeDiskThreePnt (in GEOM_Object thePnt1,
in GEOM_Object thePnt2,
in GEOM_Object thePnt3);
+
+ /*!
+ * Create a disk specified dimensions along OX-OY coordinate axes,
+ * Center of the disk at point (0, 0, 0).
+ * \param theR of the Disk.
+ * \param theOrientation Orientation belong axis OXY OYZ OZX
+ * \return New GEOM_Object, containing the created disk.
+ */
+ GEOM_Object MakeDiskR (in double theR, in short theOrientation);
+
/*!
* Create a cylinder with given radius and height at
* the origin of coordinate system. Axis of the cylinder
GEOM_Object MakeBoxTwoPnt (in GEOM_Object thePnt1,
in GEOM_Object thePnt2) ;
GEOM_Object MakeFaceHW (in double theH,
- in double theW) ;
- GEOM_Object MakeFacePlaneHW (in GEOM_Object theFace,
- in double theH,
- in double theW) ;
+ in double theW,
+ in short theOrientation) ;
+ GEOM_Object MakeFaceVecHW (in GEOM_Object theVec,
+ in double theH,
+ in double theW) ;
GEOM_Object MakeDiskPntVecR (in GEOM_Object thePnt,
in GEOM_Object theVec,
in double theR) ;
GEOM_Object MakeDiskThreePnt (in GEOM_Object thePnt1,
in GEOM_Object thePnt2,
in GEOM_Object thePnt3) ;
+ GEOM_Object MakeDiskR (in double theR,
+ in short theOrientation) ;
GEOM_Object MakeCylinderPntVecRH (in GEOM_Object thePnt,
in GEOM_Object theAxis,
in double theRadius,
disk.png \
disk3points.png \
disk_pntvecr.png \
+disk_r.png \
display.png \
displayonly.png \
displayall.png \
erase.png \
eraseall.png \
face_hw.png \
-face_planehw.png \
+face_vechw.png \
fillet.png \
filletall.png \
filletedge.png \
<source>ICON_DLG_DISK_THREE_POINTS</source>
<translation>disk3points.png</translation>
</message>
+ <message>
+ <source>ICON_DLG_DISK_R</source>
+ <translation>disk_r.png</translation>
+ </message>
<message>
<source>ICON_DLG_BUILD_EDGE</source>
<translation>build_edge.png</translation>
<translation>face_hw.png</translation>
</message>
<message>
- <source>ICON_DLG_FACE_PLANE_HW</source>
- <translation>face_planehw.png</translation>
+ <source>ICON_DLG_FACE_VEC_HW</source>
+ <translation>face_vechw.png</translation>
</message>
<message>
<source>ICON_DLG_BUILD_SHELL</source>
BRepBuilderAPI_MakeFace MF (MW, Standard_False);
aShape = MF.Shape();
}
+ }
+ else if (aType == DISK_R) {
+ int anOrient = aCI.GetOrientation();
+ gp_Pnt aP = gp::Origin();
+ gp_Vec aV;
+ if (anOrient == 1)
+ aV = gp::DZ();
+ else if (anOrient == 2)
+ aV = gp::DX();
+ else if (anOrient == 3)
+ aV = gp::DY();
+
+ gp_Ax2 anAxes (aP, aV);
+ gp_Circ aCirc (anAxes, aCI.GetRadius());
+ TopoDS_Shape aCircle = BRepBuilderAPI_MakeEdge(aCirc).Edge();
+ BRepBuilderAPI_MakeWire MW;
+ MW.Add(TopoDS::Edge(aCircle));
+ BRepBuilderAPI_MakeFace MF (MW, Standard_False);
+ aShape = MF.Shape();
}
else {
}
TopoDS_Shape aShape;
- if (aType == FACE_PLANE_H_W) {
- Handle(GEOM_Function) aRefPlane = aFI.GetRef1();
- TopoDS_Shape aShapePlane = aRefPlane->GetValue();
- double aH = aFI.GetH() / 2.0;
- double aW = aFI.GetW() / 2.0;
- gp_Ax3 anAx = GEOMImpl_IMeasureOperations::GetPosition(aShapePlane);
- gp_Pln aPln (anAx);
- aShape = BRepBuilderAPI_MakeFace(aPln, -aH, +aH, -aW, +aW).Shape();
+ if (aType == FACE_VEC_H_W) {
+ Handle(GEOM_Function) aRefVec = aFI.GetRef1();
+ TopoDS_Shape aShapeVec = aRefVec->GetValue();
+ if (aShapeVec.ShapeType() == TopAbs_EDGE) {
+ TopoDS_Edge anEdge = TopoDS::Edge(aShapeVec);
+ double aH = aFI.GetH() / 2.0;
+ double aW = aFI.GetW() / 2.0;
+ TopoDS_Vertex V1, V2;
+ TopExp::Vertices(anEdge, V1, V2, Standard_True);
+ gp_Pnt aP (BRep_Tool::Pnt(V1));
+ gp_Vec aV (BRep_Tool::Pnt(V1), BRep_Tool::Pnt(V2));
+ gp_Pln aPlane (aP, aV);
+ aShape = BRepBuilderAPI_MakeFace(aPlane, -aH, +aH, -aW, +aW).Shape();
+ }
}
else if (aType == FACE_H_W) {
double aH = aFI.GetH() / 2.0;
double aW = aFI.GetW() / 2.0;
TopoDS_Vertex V1, V2;
+ int anOrient = aFI.GetOrientation();
gp_Pnt aP = gp::Origin();
- gp_Vec aV = gp::DZ();
+ gp_Vec aV;
+ if (anOrient == 1)
+ aV = gp::DZ();
+ else if (anOrient == 2)
+ aV = gp::DX();
+ else if (anOrient == 3)
+ aV = gp::DY();
+
gp_Pln aPlane (aP, aV);
aShape = BRepBuilderAPI_MakeFace(aPlane, -aH, +aH, -aW, +aW).Shape();
}
* MakeFaceHW
*/
//=============================================================================
-Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFaceHW (double theH, double theW)
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFaceHW (double theH, double theW, int theOrientation)
{
SetErrorCode(KO);
aFI.SetH(theH);
aFI.SetW(theW);
+ aFI.SetOrientation(theOrientation);
//Compute the Face
try {
//Make a Python command
GEOM::TPythonDump(aFunction) << aFace << " = geompy.MakeFaceHW("
- << theH << ", " << theW << ")";
+ << theH << ", " << theW << ", " << theOrientation << ")";
SetErrorCode(OK);
return aFace;
//=============================================================================
/*!
- * MakeFacePlaneHW
+ * MakeFaceVecHW
*/
//=============================================================================
-Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFacePlaneHW (Handle(GEOM_Object) theFace,
- double theH, double theW)
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFaceVecHW (Handle(GEOM_Object) theVec,
+ double theH, double theW)
{
SetErrorCode(KO);
- if (theFace.IsNull()) return NULL;
+ if (theVec.IsNull()) return NULL;
//Add a new Face object
Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
//Add a new Box function for creation a box relatively to two points
- Handle(GEOM_Function) aFunction = aFace->AddFunction(GEOMImpl_FaceDriver::GetID(), FACE_PLANE_H_W);
+ Handle(GEOM_Function) aFunction = aFace->AddFunction(GEOMImpl_FaceDriver::GetID(), FACE_VEC_H_W);
if (aFunction.IsNull()) return NULL;
//Check if the function is set correctly
GEOMImpl_IFace aFI (aFunction);
- Handle(GEOM_Function) aRefFunction1 = theFace->GetLastFunction();
+ Handle(GEOM_Function) aRefFunction1 = theVec->GetLastFunction();
if (aRefFunction1.IsNull())
return aFace;
}
//Make a Python command
- GEOM::TPythonDump(aFunction) << aFace << " = geompy.MakeFacePlaneHW("
- << theFace << ", " << theH << ", " << theW << ")";
+ GEOM::TPythonDump(aFunction) << aFace << " = geompy.MakeFaceVecHW("
+ << theVec << ", " << theH << ", " << theW << ")";
SetErrorCode(OK);
return aFace;
return aDisk;
}
+//=============================================================================
+/*!
+ * MakeDiskR
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeDiskR (double theR, int theOrientation)
+{
+ SetErrorCode(KO);
+
+ if (theR == 0 ) return NULL;
+
+ //Add a new Disk object
+ Handle(GEOM_Object) aDisk = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+
+ //Add a new Box function for creation a box relatively to two points
+ Handle(GEOM_Function) aFunction = aDisk->AddFunction(GEOMImpl_DiskDriver::GetID(), DISK_R);
+ if (aFunction.IsNull()) return NULL;
+
+ //Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != GEOMImpl_DiskDriver::GetID()) return aDisk;
+
+ GEOMImpl_IDisk aDI (aFunction);
+
+ aDI.SetRadius(theR);
+ aDI.SetOrientation(theOrientation);
+
+ //Compute the Disk
+ try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+ OCC_CATCH_SIGNALS;
+#endif
+ if (!GetSolver()->ComputeFunction(aFunction)) {
+ SetErrorCode("Disk 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) << aDisk << " = geompy.MakeDiskR("
+ << theR << ", " << theOrientation << ")";
+
+ SetErrorCode(OK);
+ return aDisk;
+}
+
//=============================================================================
/*!
* MakeCylinderRH
Standard_EXPORT Handle(GEOM_Object) MakeBoxDXDYDZ (double theDX, double theDY, double theDZ);
Standard_EXPORT Handle(GEOM_Object) MakeBoxTwoPnt (Handle(GEOM_Object) thePnt1,
Handle(GEOM_Object) thePnt2);
- Standard_EXPORT Handle(GEOM_Object) MakeFaceHW (double theH, double theW);
- Standard_EXPORT Handle(GEOM_Object) MakeFacePlaneHW (Handle(GEOM_Object) theFace,
- double theH, double theW);
+ Standard_EXPORT Handle(GEOM_Object) MakeFaceHW (double theH, double theW, int theOrientation);
+ Standard_EXPORT Handle(GEOM_Object) MakeFaceVecHW (Handle(GEOM_Object) theVec,
+ double theH, double theW);
Standard_EXPORT Handle(GEOM_Object) MakeDiskThreePnt (Handle(GEOM_Object) thePnt1,
Handle(GEOM_Object) thePnt2,
Handle(GEOM_Object) thePnt3);
Standard_EXPORT Handle(GEOM_Object) MakeDiskPntVecR (Handle(GEOM_Object) thePnt1,
Handle(GEOM_Object) theVec,
double theR);
+ Standard_EXPORT Handle(GEOM_Object) MakeDiskR (double theR, int theOrientation);
Standard_EXPORT Handle(GEOM_Object) MakeCylinderRH (double theR, double theH);
Standard_EXPORT Handle(GEOM_Object) MakeCylinderPntVecRH (Handle(GEOM_Object) thePnt,
Handle(GEOM_Object) theVec,
#include "GEOM_Function.hxx"
-#define DISK_ARG_P1 1
-#define DISK_ARG_P2 2
-#define DISK_ARG_P3 3
+#define DISK_ARG_P1 1
+#define DISK_ARG_P2 2
+#define DISK_ARG_P3 3
-#define DISK_ARG_CC 4
-#define DISK_ARG_VV 5
-#define DISK_ARG_RR 6
+#define DISK_ARG_CC 4
+#define DISK_ARG_VV 5
+#define DISK_ARG_RR 6
+
+#define DISK_ARG_ORIENT 7
class GEOMImpl_IDisk
{
void SetVector(Handle(GEOM_Function) theV) { _func->SetReference(DISK_ARG_VV, theV); }
void SetRadius(double theR) { _func->SetReal(DISK_ARG_RR, theR); }
+ void SetOrientation(double theO) { _func->SetReal(DISK_ARG_ORIENT, theO); }
Handle(GEOM_Function) GetPoint1() { return _func->GetReference(DISK_ARG_P1); }
Handle(GEOM_Function) GetPoint2() { return _func->GetReference(DISK_ARG_P2); }
Handle(GEOM_Function) GetVector() { return _func->GetReference(DISK_ARG_VV); }
double GetRadius() { return _func->GetReal(DISK_ARG_RR); }
+ double GetOrientation() { return _func->GetReal(DISK_ARG_ORIENT); }
private:
#include "GEOM_Function.hxx"
-#define FACE_ARG_REF1 1
-#define FACE_ARG_REF2 2
-#define FACE_ARG_REF3 3
+#define FACE_ARG_REF1 1
+#define FACE_ARG_ORIENT 2
-#define FACE_ARG_PLANE 4
-#define FACE_ARG_H 5
-#define FACE_ARG_W 6
+#define FACE_ARG_PLANE 4
+#define FACE_ARG_H 5
+#define FACE_ARG_W 6
class GEOMImpl_IFace
{
void SetRef1(Handle(GEOM_Function) theRefPoint1) { _func->SetReference(FACE_ARG_REF1, theRefPoint1); }
Handle(GEOM_Function) GetRef1() { return _func->GetReference(FACE_ARG_REF1); }
- void SetRef2(Handle(GEOM_Function) theRefPoint2) { _func->SetReference(FACE_ARG_REF2, theRefPoint2); }
- Handle(GEOM_Function) GetRef2() { return _func->GetReference(FACE_ARG_REF2); }
-
- void SetRef3(Handle(GEOM_Function) theRefVec) { _func->SetReference(FACE_ARG_REF3, theRefVec); }
- Handle(GEOM_Function) GetRef3() { return _func->GetReference(FACE_ARG_REF3); }
+ void SetOrientation(int theOrientation) { _func->SetReal(FACE_ARG_ORIENT, theOrientation); }
+ int GetOrientation() { return _func->GetReal(FACE_ARG_ORIENT); }
void SetH(double theH) { _func->SetReal(FACE_ARG_H, theH); }
void SetW(double theW) { _func->SetReal(FACE_ARG_W, theW); }
#define BOX_DX_DY_DZ 1
#define BOX_TWO_PNT 2
-#define FACE_PLANE_H_W 1
+#define FACE_VEC_H_W 1
#define FACE_H_W 2
#define DISK_PNT_VEC_R 1
#define DISK_THREE_PNT 2
+#define DISK_R 3
#define CYLINDER_R_H 1
#define CYLINDER_PNT_VEC_R_H 2
*/
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeFaceHW (CORBA::Double theH,
- CORBA::Double theW)
+ CORBA::Double theW,
+ CORBA::Short theOrientation)
{
GEOM::GEOM_Object_var aGEOMObject;
return aGEOMObject._retn();
//Create the Face
- Handle(GEOM_Object) anObject = GetOperations()->MakeFaceHW(theH, theW);
+ Handle(GEOM_Object) anObject = GetOperations()->MakeFaceHW(theH, theW, theOrientation);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
//=============================================================================
/*!
- * MakeFacePlaneHW
+ * MakeFaceVecHW
*/
//=============================================================================
-GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeFacePlaneHW
- (GEOM::GEOM_Object_ptr theFace,
+GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeFaceVecHW
+ (GEOM::GEOM_Object_ptr theVec,
CORBA::Double theH,
CORBA::Double theW)
{
//Set a not done flag
GetOperations()->SetNotDone();
- if (theFace == NULL || theH == 0 || theW == 0)
+ if (theVec == NULL || theH == 0 || theW == 0)
return aGEOMObject._retn();
//Get the reference points
Handle(GEOM_Object) aFace = GetOperations()->GetEngine()->GetObject
- (theFace->GetStudyID(), theFace->GetEntry());
+ (theVec->GetStudyID(), theVec->GetEntry());
if (aFace.IsNull())
return aGEOMObject._retn();
//Create the Face
- Handle(GEOM_Object) anObject = GetOperations()->MakeFacePlaneHW(aFace, theH, theW);
+ Handle(GEOM_Object) anObject = GetOperations()->MakeFaceVecHW(aFace, theH, theW);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
return GetObject(anObject);
}
+//=============================================================================
+/*!
+ * MakeDiskR
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeDiskR (CORBA::Double theR,
+ CORBA::Short theOrientation)
+{
+ GEOM::GEOM_Object_var aGEOMObject;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ if (theR == 0)
+ return aGEOMObject._retn();
+
+ //Create the Face
+ Handle(GEOM_Object) anObject = GetOperations()->MakeDiskR(theR, theOrientation);
+ if (!GetOperations()->IsDone() || anObject.IsNull())
+ return aGEOMObject._retn();
+
+ return GetObject(anObject);
+}
+
//=============================================================================
/*!
* MakeCylinderRH
GEOM::GEOM_Object_ptr thePnt2);
GEOM::GEOM_Object_ptr MakeFaceHW (CORBA::Double theH,
- CORBA::Double theW);
+ CORBA::Double theW,
+ CORBA::Short theOrientation);
- GEOM::GEOM_Object_ptr MakeFacePlaneHW (GEOM::GEOM_Object_ptr theFace,
+ GEOM::GEOM_Object_ptr MakeFaceVecHW (GEOM::GEOM_Object_ptr theFace,
CORBA::Double theH,
CORBA::Double theW);
GEOM::GEOM_Object_ptr thePnt2,
GEOM::GEOM_Object_ptr thePnt3);
+ GEOM::GEOM_Object_ptr MakeDiskR (CORBA::Double theR,
+ CORBA::Short theOrientation);
+
GEOM::GEOM_Object_ptr MakeCylinderRH (CORBA::Double theR,
CORBA::Double theH);
// MakeFaceHW:
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFaceHW (CORBA::Double theH,
- CORBA::Double theW)
+ CORBA::Double theW,
+ CORBA::Short theOrientation)
{
beginService( " GEOM_Superv_i::MakeFaceHW" );
MESSAGE("GEOM_Superv_i::MakeFaceHW");
get3DPrimOp();
- GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeFaceHW(theH, theW);
+ GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeFaceHW(theH, theW, theOrientation);
endService( " GEOM_Superv_i::MakeFaceHW" );
return anObj;
}
//=============================================================================
-// MakeFaceTwoPlaneHW:
+// MakeFaceVecHW:
//=============================================================================
-GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFacePlaneHW (GEOM::GEOM_Object_ptr theFace,
- CORBA::Double theH,
- CORBA::Double theW)
+GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFaceVecHW (GEOM::GEOM_Object_ptr theVec,
+ CORBA::Double theH,
+ CORBA::Double theW)
{
- beginService( " GEOM_Superv_i::MakeFacePlaneHW" );
- MESSAGE("GEOM_Superv_i::MakeFacePlaneHW");
+ beginService( " GEOM_Superv_i::MakeFaceVecHW" );
+ MESSAGE("GEOM_Superv_i::MakeFaceVecHW");
get3DPrimOp();
- GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeFacePlaneHW(theFace, theH, theW);
- endService( " GEOM_Superv_i::MakeFacePlaneHW" );
+ GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeFaceVecHW(theVec, theH, theW);
+ endService( " GEOM_Superv_i::MakeFaceVecHW" );
return anObj;
}
return anObj;
}
+//=============================================================================
+// MakeDiskR:
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeDiskR (CORBA::Double theR,
+ CORBA::Short theOrientation)
+{
+ beginService( " GEOM_Superv_i::MakeDiskR" );
+ MESSAGE("GEOM_Superv_i::MakeDiskR");
+ get3DPrimOp();
+ GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeDiskR(theR, theOrientation);
+ endService( " GEOM_Superv_i::MakeDiskR" );
+ return anObj;
+}
+
//=============================================================================
// MakeCylinderPntVecRH:
//=============================================================================
GEOM::GEOM_Object_ptr MakeBoxTwoPnt (GEOM::GEOM_Object_ptr thePnt1,
GEOM::GEOM_Object_ptr thePnt2);
GEOM::GEOM_Object_ptr MakeFaceHW (CORBA::Double theH,
- CORBA::Double theW);
- GEOM::GEOM_Object_ptr MakeFacePlaneHW (GEOM::GEOM_Object_ptr theFace,
- CORBA::Double theH,
- CORBA::Double theW);
+ CORBA::Double theW,
+ CORBA::Short theOrientation);
+ GEOM::GEOM_Object_ptr MakeFaceVecHW (GEOM::GEOM_Object_ptr theFace,
+ CORBA::Double theH,
+ CORBA::Double theW);
GEOM::GEOM_Object_ptr MakeDiskPntVecR (GEOM::GEOM_Object_ptr theCenter,
GEOM::GEOM_Object_ptr theVector,
CORBA::Double theR);
GEOM::GEOM_Object_ptr MakeDiskThreePnt (GEOM::GEOM_Object_ptr thePnt1,
GEOM::GEOM_Object_ptr thePnt2,
GEOM::GEOM_Object_ptr thePnt3);
+ GEOM::GEOM_Object_ptr MakeDiskR (CORBA::Double theR,
+ CORBA::Short theOrientation);
GEOM::GEOM_Object_ptr MakeCylinderPntVecRH (GEOM::GEOM_Object_ptr thePnt,
GEOM::GEOM_Object_ptr theAxis,
CORBA::Double theRadius,
Face1 = geompy.MakeFaceWires([Wire, Sketcher],
WantPlanarFace) #(List of GEOM_Object_ptr, Boolean)->GEOM_Object_ptr
Face2 = geompy.MakeFace(Sketcher, WantPlanarFace)
- Face3 = geompy.MakeFaceHW (100., 200.) #(2 Doubles)->GEOM_Object_ptr
- Face4 = geompy.MakeFacePlaneHW (Face, 200., 200.)#(1 GEOM_Object_ptr, 2 Doubles)->GEOM_Object_ptr
+ Face3 = geompy.MakeFaceHW (100., 200., 1) #(2 Doubles, 1 Int)->GEOM_Object_ptr
+ Face4 = geompy.MakeFaceVecHW (vz, 200., 100.) #(1 GEOM_Object_ptr, 2 Doubles)->GEOM_Object_ptr
Disk = geompy.MakeDiskPntVecR (p0, vz, radius) #(2 GEOM_Object_ptr, 1 Double)->GEOM_Object_ptr
Disk2 = geompy.MakeDiskThreePnt(p0, p200, pz) #(3 GEOM_Object_ptr)->GEOM_Object_ptr
+ Disk3 = geompy.MakeDiskR(100., 1) #(1 Doubles, 1 Int)->GEOM_Object_ptr
Shell = geompy.MakeShell([Face, Face1]) #(List of GEOM_Object_ptr)->GEOM_Object_ptr
Prism1 = geompy.MakePrism(Face2, p0, pxyz) #(3 GEOM_Object_ptr)->GEOM_Object_ptr
id_Face4 = geompy.addToStudy(Face4, "Face Plane_HW")
id_Disk = geompy.addToStudy(Disk, "Disk PntVecR")
id_Disk2 = geompy.addToStudy(Disk2, "Disk Three Points")
+ id_Disk3 = geompy.addToStudy(Disk3, "Disk OXY Radius")
id_Shell = geompy.addToStudy(Shell, "Shell")
id_p_on_face = geompy.addToStudy(p_on_face, "Vertex on Face (0.1, 0.8)")
## Create a face with specified dimensions along OX-OY coordinate axes,
# with edges, parallel to this coordinate axes.
- # @param theH length of Face edge, parallel to OX axis.
- # @param theW length of Face edge, parallel to OY axis.
+ # @param theH height of Face.
+ # @param theW width of Face.
+ # @param theOrientation orientation belong axis OXY OYZ OZX
# @return New GEOM_Object, containing the created face.
#
# @ref tui_creation_face "Example"
- def MakeFaceHW(self,theH, theW):
+ def MakeFaceHW(self,theH, theW, theOrientation):
# Example: see GEOM_TestAll.py
- anObj = self.PrimOp.MakeFaceHW(theH, theW)
+ anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
RaiseIfFailed("MakeFaceHW", self.PrimOp)
return anObj
## Create a face from another plane and two sizes,
# vertical size and horisontal size.
- # @param thePlane Plane in that axis will be create new face.
+ # @param theVec Normale vector to the creating face.
# @param theH Height (vertical size).
# @param theW Width (horisontal size).
# @return New GEOM_Object, containing the created face.
#
# @ref tui_creation_face "Example"
- def MakeFacePlaneHW(self, theFace, theH, theW):
+ def MakeFaceVecHW(self, theVec, theH, theW):
# Example: see GEOM_TestAll.py
- anObj = self.PrimOp.MakeFacePlaneHW(theFace, theH, theW)
- RaiseIfFailed("MakeFacePlaneHW", self.PrimOp)
+ anObj = self.PrimOp.MakeFaceVecHW(theVec, theH, theW)
+ RaiseIfFailed("MakeFaceVecHW", self.PrimOp)
return anObj
## Create a disk with given center, normal vector and radius.
RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
return anObj
+ ## Create a disk with specified dimensions along OX-OY coordinate axes.
+ # @param theR Radius of Face.
+ # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
+ # @return New GEOM_Object, containing the created disk.
+ #
+ # @ref tui_creation_face "Example"
+ def MakeDiskR(self,theR, theOrientation):
+ # Example: see GEOM_TestAll.py
+ anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
+ RaiseIfFailed("MakeDiskR", self.PrimOp)
+ return anObj
+
## Create a cylinder with given base point, axis, radius and height.
# @param thePnt Central point of cylinder base.
# @param theAxis Cylinder axis.
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_DISK_PNT_VEC_R" ) ) );
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
QPixmap image2( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_DISK_THREE_POINTS" ) ) );
+ QPixmap image3( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_DISK_R" ) ) );
setWindowTitle( tr( "GEOM_DISK_TITLE" ) );
mainFrame()->GroupConstructors->setTitle( tr( "GEOM_DISK" ) );
mainFrame()->RadioButton1->setIcon( image0 );
mainFrame()->RadioButton2->setIcon( image2 );
- mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
- mainFrame()->RadioButton3->close();
+ mainFrame()->RadioButton3->setIcon( image3 );
GroupPntVecR = new DlgRef_2Sel1Spin( centralWidget() );
-
GroupPntVecR->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
GroupPntVecR->TextLabel1->setText( tr( "GEOM_CENTER_POINT" ) );
GroupPntVecR->TextLabel2->setText( tr( "GEOM_VECTOR" ) );
GroupPntVecR->TextLabel3->setText( tr( "GEOM_RADIUS" ) );
GroupPntVecR->PushButton1->setIcon( image1 );
GroupPntVecR->PushButton2->setIcon( image1 );
-
GroupPntVecR->LineEdit1->setReadOnly( true );
GroupPntVecR->LineEdit2->setReadOnly( true );
Group3Pnts = new DlgRef_3Sel( centralWidget() );
-
- Group3Pnts->GroupBox1->setTitle( tr( "GEOM_3_POINTS" ) );
+ Group3Pnts->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
Group3Pnts->TextLabel1->setText( tr( "GEOM_POINT1" ) );
Group3Pnts->TextLabel2->setText( tr( "GEOM_POINT2" ) );
Group3Pnts->TextLabel3->setText( tr( "GEOM_POINT3" ) );
Group3Pnts->PushButton1->setIcon( image1 );
Group3Pnts->PushButton2->setIcon( image1 );
Group3Pnts->PushButton3->setIcon( image1 );
-
Group3Pnts->LineEdit1->setReadOnly( true );
Group3Pnts->LineEdit2->setReadOnly( true );
Group3Pnts->LineEdit3->setReadOnly( true );
+ GroupDimensions = new DlgRef_1Spin( centralWidget() );
+ GroupDimensions->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
+ GroupDimensions->TextLabel1->setText( tr( "GEOM_RADIUS" ) );
+
+ GroupOrientation = new DlgRef_3Check( centralWidget() );
+ GroupOrientation->GroupBox1->setTitle( tr( "GEOM_ORIENTATION" ) );
+ GroupOrientation->RadioButton1->setText( tr( "GEOM_WPLANE_OXY" ) );
+ GroupOrientation->RadioButton2->setText( tr( "GEOM_WPLANE_OYZ" ) );
+ GroupOrientation->RadioButton3->setText( tr( "GEOM_WPLANE_OZX" ) );
+
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
layout->setMargin( 0 ); layout->setSpacing( 6 );
layout->addWidget( GroupPntVecR );
layout->addWidget( Group3Pnts );
+ layout->addWidget( GroupDimensions );
+ layout->addWidget( GroupOrientation );
/***************************************************************/
setHelpFileName( "create_disk_page.html" );
{
/* init variables */
myEditCurrentArgument = GroupPntVecR->LineEdit1;
+ myOrientationType = 1;
myPoint = myDir = myPoint1 = myPoint2 = myPoint3 = GEOM::GEOM_Object::_nil();
/* min, max, step and decimals for spin boxes & initial values */
initSpinBox( GroupPntVecR->SpinBox_DX, 0.001, COORD_MAX, aStep, 3 ); // VSR:TODO : DBL_DIGITS_DISPLAY
GroupPntVecR->SpinBox_DX->setValue( 100 );
+ initSpinBox( GroupDimensions->SpinBox_DX, 0.001, COORD_MAX, aStep, 3 ); // VSR:TODO : DBL_DIGITS_DISPLAY
+ GroupDimensions->SpinBox_DX->setValue( 100 );
/* signals and slots connections */
connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) );
connect( GroupPntVecR->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT(ValueChangedInSpinBox() ) );
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), this, SLOT( SetDoubleSpinBoxStep( double ) ) );
+ connect( GroupDimensions->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
+ connect( GroupOrientation->RadioButton1, SIGNAL( clicked() ), this, SLOT( RadioButtonClicked() ) );
+ connect( GroupOrientation->RadioButton2, SIGNAL( clicked() ), this, SLOT( RadioButtonClicked() ) );
+ connect( GroupOrientation->RadioButton3, SIGNAL( clicked() ), this, SLOT( RadioButtonClicked() ) );
+
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
this, SLOT( SelectionIntoArgument() ) );
GroupPntVecR->SpinBox_DX->setSingleStep(step);
}
+//=================================================================================
+// function : RadioBittonClicked()
+// purpose : Radio button management
+//=================================================================================
+void PrimitiveGUI_DiskDlg::RadioButtonClicked()
+{
+ if ( GroupOrientation->RadioButton1->isChecked() )
+ myOrientationType = 1;
+ else if ( GroupOrientation->RadioButton2->isChecked() )
+ myOrientationType = 2;
+ else if ( GroupOrientation->RadioButton3->isChecked() )
+ myOrientationType = 3;
+ displayPreview();
+}
+
//=================================================================================
// function : ConstructorsClicked()
// purpose : Radio button management
{
Group3Pnts->hide();
GroupPntVecR->show();
-
+ GroupDimensions->hide();
+ GroupOrientation->hide();
myEditCurrentArgument = GroupPntVecR->LineEdit1;
GroupPntVecR->LineEdit1->setText( "" );
GroupPntVecR->LineEdit2->setText( "" );
{
GroupPntVecR->hide();
Group3Pnts->show();
-
+ GroupDimensions->hide();
+ GroupOrientation->hide();
myEditCurrentArgument = Group3Pnts->LineEdit1;
Group3Pnts->LineEdit1->setText( "" );
Group3Pnts->LineEdit2->setText( "" );
Group3Pnts->LineEdit3->setText( "" );
break;
}
+ case 2:
+ {
+ GroupPntVecR->hide();
+ Group3Pnts->hide();
+ GroupDimensions->show();
+ GroupOrientation->show();
+ GroupOrientation->RadioButton1->setChecked( true );
+ myOrientationType = 1;
+ }
}
qApp->processEvents();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged() ),
this, SLOT( SelectionIntoArgument() ) );
+ displayPreview();
}
//=================================================================================
//=================================================================================
void PrimitiveGUI_DiskDlg::SelectionIntoArgument()
{
+ if (getConstructorId() == 2) {
+ displayPreview();
+ return;
+ }
+
myEditCurrentArgument->setText( "" );
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
switch ( getConstructorId() ) {
case 0:
r = GroupPntVecR->SpinBox_DX->value(); break;
+ case 2:
+ r = GroupDimensions->SpinBox_DX->value(); break;
}
return r;
}
else if ( id == 1 )
return !myPoint1->_is_nil() && !myPoint2->_is_nil() && !myPoint3->_is_nil() &&
!isEqual( myPoint1, myPoint2 ) && !isEqual( myPoint1, myPoint3 ) && !isEqual( myPoint2, myPoint3 );
+ else if ( id == 2 )
+ return true;
return false;
}
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeDiskThreePnt( myPoint1, myPoint2, myPoint3 );
res = true;
break;
+ case 2 :
+ anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeDiskR( getRadius(), myOrientationType );
+ res = true;
+ break;
}
if ( !anObj->_is_nil() )
class DlgRef_3Sel;
class DlgRef_2Sel1Spin;
+class DlgRef_1Spin;
+class DlgRef_3Check;
//=================================================================================
// class : PrimitiveGUI_DiskDlg
void Init();
void enterEvent( QEvent* );
double getRadius() const;
+ int myOrientationType;
private:
GEOM::GEOM_Object_var myPoint, myDir, myPoint1, myPoint2, myPoint3;
DlgRef_2Sel1Spin* GroupPntVecR;
DlgRef_3Sel* Group3Pnts;
+ DlgRef_1Spin* GroupDimensions;
+ DlgRef_3Check* GroupOrientation;
private slots:
void ClickOnOk();
void SetEditCurrentArgument();
void ValueChangedInSpinBox();
void SetDoubleSpinBoxStep( double );
+ void RadioButtonClicked();
};
#endif // BASICGUI_DISKDLG_H
bool modal, Qt::WindowFlags fl )
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
{
- QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_FACE_PLANE_HW" ) ) );
+ QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_FACE_VEC_HW" ) ) );
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
QPixmap image2( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_FACE_HW" ) ) );
mainFrame()->RadioButton3->close();
GroupPlane = new DlgRef_1Sel2Spin( centralWidget() );
- GroupPlane->GroupBox1->setTitle( tr( "GEOM_FACES" ) );
- GroupPlane->TextLabel1->setText( tr( "GEOM_FACE" ) );
+ GroupPlane->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
+ GroupPlane->TextLabel1->setText( tr( "GEOM_EDGE" ) );
GroupPlane->TextLabel2->setText( tr( "GEOM_HEIGHT" ) );
GroupPlane->TextLabel3->setText( tr( "GEOM_WIDTH" ) );
GroupPlane->PushButton1->setIcon( image1 );
GroupDimensions->TextLabel1->setText( tr( "GEOM_HEIGHT" ) );
GroupDimensions->TextLabel2->setText( tr( "GEOM_WIDTH" ) );
+ GroupOrientation = new DlgRef_3Check( centralWidget() );
+
+ GroupOrientation->GroupBox1->setTitle( tr( "GEOM_ORIENTATION" ) );
+ GroupOrientation->RadioButton1->setText( tr( "GEOM_WPLANE_OXY" ) );
+ GroupOrientation->RadioButton2->setText( tr( "GEOM_WPLANE_OYZ" ) );
+ GroupOrientation->RadioButton3->setText( tr( "GEOM_WPLANE_OZX" ) );
+
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
layout->setMargin( 0 ); layout->setSpacing( 6 );
layout->addWidget( GroupPlane );
layout->addWidget( GroupDimensions );
+ layout->addWidget( GroupOrientation );
/***************************************************************/
{
/* init variables */
myEditCurrentArgument = GroupPlane->LineEdit1;
- myFace = GEOM::GEOM_Object::_nil();
+ myEdge = GEOM::GEOM_Object::_nil();
globalSelection(); // close local contexts, if any
- localSelection( GEOM::GEOM_Object::_nil(), TopAbs_FACE );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+
+ myOrientationType = 1;
/* Get setting of step value from file configuration */
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
connect( GroupDimensions->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
connect( GroupDimensions->SpinBox_DY, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
+ connect( GroupOrientation->RadioButton1, SIGNAL( clicked() ), this, SLOT( RadioButtonClicked() ) );
+ connect( GroupOrientation->RadioButton2, SIGNAL( clicked() ), this, SLOT( RadioButtonClicked() ) );
+ connect( GroupOrientation->RadioButton3, SIGNAL( clicked() ), this, SLOT( RadioButtonClicked() ) );
+
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
this, SLOT( SelectionIntoArgument() ) );
displayPreview();
}
+//=================================================================================
+// function : RadioBittonClicked()
+// purpose : Radio button management
+//=================================================================================
+void PrimitiveGUI_FaceDlg::RadioButtonClicked()
+{
+ if ( GroupOrientation->RadioButton1->isChecked() )
+ myOrientationType = 1;
+ else if ( GroupOrientation->RadioButton2->isChecked() )
+ myOrientationType = 2;
+ else if ( GroupOrientation->RadioButton3->isChecked() )
+ myOrientationType = 3;
+ displayPreview();
+}
+
//=================================================================================
// function : ClickOnOk()
// purpose :
case 0:
{
globalSelection(); // close local contexts, if any
- localSelection( GEOM::GEOM_Object::_nil(), TopAbs_FACE );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
myEditCurrentArgument = GroupPlane->LineEdit1;
myEditCurrentArgument->setText("");
- myFace = GEOM::GEOM_Object::_nil();
+ myEdge = GEOM::GEOM_Object::_nil();
GroupDimensions->hide();
+ GroupOrientation->hide();
GroupPlane->show();
break;
}
globalSelection(); // close local contexts, if any
GroupPlane->hide();
GroupDimensions->show();
+ GroupOrientation->show();
+ GroupOrientation->RadioButton1->setChecked( true );
+ myOrientationType = 1;
break;
}
}
updateGeometry();
resize( minimumSize() );
SelectionIntoArgument();
+ displayPreview();
}
//=================================================================================
myEditCurrentArgument->setText( "" );
if ( IObjectCount() != 1 ) {
- if ( myEditCurrentArgument == GroupPlane->LineEdit1 ) myFace = GEOM::GEOM_Object::_nil();
+ if ( myEditCurrentArgument == GroupPlane->LineEdit1 ) myEdge = GEOM::GEOM_Object::_nil();
return;
}
aSelMgr->GetIndexes( firstIObject(), aMap );
if ( aMap.Extent() == 1 ) { // Local Selection
int anIndex = aMap( 1 );
- aName += QString( ":face_%1" ).arg( anIndex );
+ aName += QString( ":edge_%1" ).arg( anIndex );
//Find SubShape Object in Father
GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( aSelectedObject, aName );
aSelectedObject = aFindedObject; // get Object from study
}
else { // Global Selection
- if ( aShape.ShapeType() != TopAbs_FACE ) {
+ if ( aShape.ShapeType() != TopAbs_EDGE ) {
aSelectedObject = GEOM::GEOM_Object::_nil();
aName = "";
}
}
myEditCurrentArgument->setText( aName );
- if ( myEditCurrentArgument == GroupPlane->LineEdit1 ) myFace = aSelectedObject;
+ if ( myEditCurrentArgument == GroupPlane->LineEdit1 ) myEdge = aSelectedObject;
}
displayPreview();
}
globalSelection(); // close previous local contexts
if ( send == GroupPlane->PushButton1 ) {
myEditCurrentArgument = GroupPlane->LineEdit1;
- localSelection( GEOM::GEOM_Object::_nil(), TopAbs_FACE );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
}
myEditCurrentArgument->setFocus();
{
const int id = getConstructorId();
if ( id == 0 )
- return !myFace->_is_nil();
+ return !myEdge->_is_nil();
else if ( id == 1 )
return true;
return false;
GEOM::GEOM_Object_var anObj;
switch ( getConstructorId() ) {
case 0 :
- anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeFacePlaneHW( myFace, GroupPlane->SpinBox_DX->value(), GroupPlane->SpinBox_DY->value() );
+ anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeFaceVecHW( myEdge, GroupPlane->SpinBox_DX->value(), GroupPlane->SpinBox_DY->value() );
res = true;
break;
case 1 :
- anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeFaceHW( GroupDimensions->SpinBox_DX->value(), GroupDimensions->SpinBox_DY->value() );
+ anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeFaceHW( GroupDimensions->SpinBox_DX->value(), GroupDimensions->SpinBox_DY->value(), myOrientationType );
res = true;
break;
}
QMap<QString, GEOM::GEOM_Object_var> objMap;
switch ( getConstructorId() ) {
case 0 :
- objMap[GroupPlane->LineEdit1->text()] = myFace;
+ objMap[GroupPlane->LineEdit1->text()] = myEdge;
break;
}
addSubshapesToFather( objMap );
class DlgRef_2Spin;
class DlgRef_1Sel2Spin;
+class DlgRef_3Check;
//=================================================================================
// class : PrimitiveGUI_FaceDlg
GEOM::GEOM_Object_var myPoint1;
GEOM::GEOM_Object_var myPoint2;
GEOM::GEOM_Object_var myVector;
- GEOM::GEOM_Object_var myFace;
+ GEOM::GEOM_Object_var myEdge;
+
+ int myOrientationType;
DlgRef_2Spin* GroupDimensions;
DlgRef_1Sel2Spin* GroupPlane;
+ DlgRef_3Check* GroupOrientation;
private slots:
void ClickOnOk();
void SetEditCurrentArgument();
void ValueChangedInSpinBox( double );
void SetDoubleSpinBoxStep( double );
+ void RadioButtonClicked();
};
#endif // BASICGUI_FACEDLG_H