mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-02-27 17:55:36 +05:00
0016757: EDF 546 GEOM : Add Face and Disc in geom primitives
This commit is contained in:
parent
0aaa28ad2d
commit
917ced834c
@ -825,20 +825,21 @@ module GEOM
|
|||||||
* Create a face specified dimensions along OX-OY coordinate axes,
|
* Create a face specified dimensions along OX-OY coordinate axes,
|
||||||
* with edges parallel to the coordinate axes.
|
* with edges parallel to the coordinate axes.
|
||||||
* Center of the face will be at point (0, 0, 0).
|
* Center of the face will be at point (0, 0, 0).
|
||||||
* \param theH length of Face edge, parallel to OX axis.
|
* \param theH Height of the Face.
|
||||||
* \param theW lenght of Face edge, patallel to OY axis.
|
* \param theW Width of the Face.
|
||||||
|
* \param theOrientation Orientation belong axis OXY OYZ OZX
|
||||||
* \return New GEOM_Object, containing the created face.
|
* \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).
|
* vertical (H) and horisontal (W).
|
||||||
* \param theFace defines plane.
|
* \param theVec defines plane.
|
||||||
* \param theH vertical size (height).
|
* \param theH vertical size (height).
|
||||||
* \param theW horisontal size (width).
|
* \param theW horisontal size (width).
|
||||||
* \return New GEOM_Object, containing the created face.
|
* \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.
|
* Create a Disk (circular face) with given center, normal vector and radius.
|
||||||
* \param thePnt disk center.
|
* \param thePnt disk center.
|
||||||
@ -857,6 +858,16 @@ module GEOM
|
|||||||
GEOM_Object MakeDiskThreePnt (in GEOM_Object thePnt1,
|
GEOM_Object MakeDiskThreePnt (in GEOM_Object thePnt1,
|
||||||
in GEOM_Object thePnt2,
|
in GEOM_Object thePnt2,
|
||||||
in GEOM_Object thePnt3);
|
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
|
* Create a cylinder with given radius and height at
|
||||||
* the origin of coordinate system. Axis of the cylinder
|
* the origin of coordinate system. Axis of the cylinder
|
||||||
|
@ -127,16 +127,19 @@ module GEOM
|
|||||||
GEOM_Object MakeBoxTwoPnt (in GEOM_Object thePnt1,
|
GEOM_Object MakeBoxTwoPnt (in GEOM_Object thePnt1,
|
||||||
in GEOM_Object thePnt2) ;
|
in GEOM_Object thePnt2) ;
|
||||||
GEOM_Object MakeFaceHW (in double theH,
|
GEOM_Object MakeFaceHW (in double theH,
|
||||||
in double theW) ;
|
in double theW,
|
||||||
GEOM_Object MakeFacePlaneHW (in GEOM_Object theFace,
|
in short theOrientation) ;
|
||||||
in double theH,
|
GEOM_Object MakeFaceVecHW (in GEOM_Object theVec,
|
||||||
in double theW) ;
|
in double theH,
|
||||||
|
in double theW) ;
|
||||||
GEOM_Object MakeDiskPntVecR (in GEOM_Object thePnt,
|
GEOM_Object MakeDiskPntVecR (in GEOM_Object thePnt,
|
||||||
in GEOM_Object theVec,
|
in GEOM_Object theVec,
|
||||||
in double theR) ;
|
in double theR) ;
|
||||||
GEOM_Object MakeDiskThreePnt (in GEOM_Object thePnt1,
|
GEOM_Object MakeDiskThreePnt (in GEOM_Object thePnt1,
|
||||||
in GEOM_Object thePnt2,
|
in GEOM_Object thePnt2,
|
||||||
in GEOM_Object thePnt3) ;
|
in GEOM_Object thePnt3) ;
|
||||||
|
GEOM_Object MakeDiskR (in double theR,
|
||||||
|
in short theOrientation) ;
|
||||||
GEOM_Object MakeCylinderPntVecRH (in GEOM_Object thePnt,
|
GEOM_Object MakeCylinderPntVecRH (in GEOM_Object thePnt,
|
||||||
in GEOM_Object theAxis,
|
in GEOM_Object theAxis,
|
||||||
in double theRadius,
|
in double theRadius,
|
||||||
|
@ -75,13 +75,14 @@ delete.png \
|
|||||||
disk.png \
|
disk.png \
|
||||||
disk3points.png \
|
disk3points.png \
|
||||||
disk_pntvecr.png \
|
disk_pntvecr.png \
|
||||||
|
disk_r.png \
|
||||||
display.png \
|
display.png \
|
||||||
displayonly.png \
|
displayonly.png \
|
||||||
displayall.png \
|
displayall.png \
|
||||||
erase.png \
|
erase.png \
|
||||||
eraseall.png \
|
eraseall.png \
|
||||||
face_hw.png \
|
face_hw.png \
|
||||||
face_planehw.png \
|
face_vechw.png \
|
||||||
fillet.png \
|
fillet.png \
|
||||||
filletall.png \
|
filletall.png \
|
||||||
filletedge.png \
|
filletedge.png \
|
||||||
|
BIN
resources/disk_r.png
Normal file
BIN
resources/disk_r.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 886 B |
Binary file not shown.
Before Width: | Height: | Size: 712 B |
BIN
resources/face_vechw.png
Normal file
BIN
resources/face_vechw.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 692 B |
@ -74,6 +74,10 @@
|
|||||||
<source>ICON_DLG_DISK_THREE_POINTS</source>
|
<source>ICON_DLG_DISK_THREE_POINTS</source>
|
||||||
<translation>disk3points.png</translation>
|
<translation>disk3points.png</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>ICON_DLG_DISK_R</source>
|
||||||
|
<translation>disk_r.png</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>ICON_DLG_BUILD_EDGE</source>
|
<source>ICON_DLG_BUILD_EDGE</source>
|
||||||
<translation>build_edge.png</translation>
|
<translation>build_edge.png</translation>
|
||||||
@ -87,8 +91,8 @@
|
|||||||
<translation>face_hw.png</translation>
|
<translation>face_hw.png</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>ICON_DLG_FACE_PLANE_HW</source>
|
<source>ICON_DLG_FACE_VEC_HW</source>
|
||||||
<translation>face_planehw.png</translation>
|
<translation>face_vechw.png</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>ICON_DLG_BUILD_SHELL</source>
|
<source>ICON_DLG_BUILD_SHELL</source>
|
||||||
|
@ -128,6 +128,25 @@ Standard_Integer GEOMImpl_DiskDriver::Execute(TFunction_Logbook& log) const
|
|||||||
BRepBuilderAPI_MakeFace MF (MW, Standard_False);
|
BRepBuilderAPI_MakeFace MF (MW, Standard_False);
|
||||||
aShape = MF.Shape();
|
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 {
|
else {
|
||||||
}
|
}
|
||||||
|
@ -74,21 +74,35 @@ Standard_Integer GEOMImpl_FaceDriver::Execute(TFunction_Logbook& log) const
|
|||||||
|
|
||||||
TopoDS_Shape aShape;
|
TopoDS_Shape aShape;
|
||||||
|
|
||||||
if (aType == FACE_PLANE_H_W) {
|
if (aType == FACE_VEC_H_W) {
|
||||||
Handle(GEOM_Function) aRefPlane = aFI.GetRef1();
|
Handle(GEOM_Function) aRefVec = aFI.GetRef1();
|
||||||
TopoDS_Shape aShapePlane = aRefPlane->GetValue();
|
TopoDS_Shape aShapeVec = aRefVec->GetValue();
|
||||||
double aH = aFI.GetH() / 2.0;
|
if (aShapeVec.ShapeType() == TopAbs_EDGE) {
|
||||||
double aW = aFI.GetW() / 2.0;
|
TopoDS_Edge anEdge = TopoDS::Edge(aShapeVec);
|
||||||
gp_Ax3 anAx = GEOMImpl_IMeasureOperations::GetPosition(aShapePlane);
|
double aH = aFI.GetH() / 2.0;
|
||||||
gp_Pln aPln (anAx);
|
double aW = aFI.GetW() / 2.0;
|
||||||
aShape = BRepBuilderAPI_MakeFace(aPln, -aH, +aH, -aW, +aW).Shape();
|
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) {
|
else if (aType == FACE_H_W) {
|
||||||
double aH = aFI.GetH() / 2.0;
|
double aH = aFI.GetH() / 2.0;
|
||||||
double aW = aFI.GetW() / 2.0;
|
double aW = aFI.GetW() / 2.0;
|
||||||
TopoDS_Vertex V1, V2;
|
TopoDS_Vertex V1, V2;
|
||||||
|
int anOrient = aFI.GetOrientation();
|
||||||
gp_Pnt aP = gp::Origin();
|
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);
|
gp_Pln aPlane (aP, aV);
|
||||||
aShape = BRepBuilderAPI_MakeFace(aPlane, -aH, +aH, -aW, +aW).Shape();
|
aShape = BRepBuilderAPI_MakeFace(aPlane, -aH, +aH, -aW, +aW).Shape();
|
||||||
}
|
}
|
||||||
|
@ -201,7 +201,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeBoxTwoPnt (Handle(GEOM_Objec
|
|||||||
* MakeFaceHW
|
* 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);
|
SetErrorCode(KO);
|
||||||
|
|
||||||
@ -221,6 +221,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFaceHW (double theH, double
|
|||||||
|
|
||||||
aFI.SetH(theH);
|
aFI.SetH(theH);
|
||||||
aFI.SetW(theW);
|
aFI.SetW(theW);
|
||||||
|
aFI.SetOrientation(theOrientation);
|
||||||
|
|
||||||
//Compute the Face
|
//Compute the Face
|
||||||
try {
|
try {
|
||||||
@ -240,7 +241,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFaceHW (double theH, double
|
|||||||
|
|
||||||
//Make a Python command
|
//Make a Python command
|
||||||
GEOM::TPythonDump(aFunction) << aFace << " = geompy.MakeFaceHW("
|
GEOM::TPythonDump(aFunction) << aFace << " = geompy.MakeFaceHW("
|
||||||
<< theH << ", " << theW << ")";
|
<< theH << ", " << theW << ", " << theOrientation << ")";
|
||||||
|
|
||||||
SetErrorCode(OK);
|
SetErrorCode(OK);
|
||||||
return aFace;
|
return aFace;
|
||||||
@ -248,21 +249,21 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFaceHW (double theH, double
|
|||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
/*!
|
/*!
|
||||||
* MakeFacePlaneHW
|
* MakeFaceVecHW
|
||||||
*/
|
*/
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFacePlaneHW (Handle(GEOM_Object) theFace,
|
Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFaceVecHW (Handle(GEOM_Object) theVec,
|
||||||
double theH, double theW)
|
double theH, double theW)
|
||||||
{
|
{
|
||||||
SetErrorCode(KO);
|
SetErrorCode(KO);
|
||||||
|
|
||||||
if (theFace.IsNull()) return NULL;
|
if (theVec.IsNull()) return NULL;
|
||||||
|
|
||||||
//Add a new Face object
|
//Add a new Face object
|
||||||
Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
|
Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
|
||||||
|
|
||||||
//Add a new Box function for creation a box relatively to two points
|
//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;
|
if (aFunction.IsNull()) return NULL;
|
||||||
|
|
||||||
//Check if the function is set correctly
|
//Check if the function is set correctly
|
||||||
@ -270,7 +271,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFacePlaneHW (Handle(GEOM_Obj
|
|||||||
|
|
||||||
GEOMImpl_IFace aFI (aFunction);
|
GEOMImpl_IFace aFI (aFunction);
|
||||||
|
|
||||||
Handle(GEOM_Function) aRefFunction1 = theFace->GetLastFunction();
|
Handle(GEOM_Function) aRefFunction1 = theVec->GetLastFunction();
|
||||||
|
|
||||||
if (aRefFunction1.IsNull())
|
if (aRefFunction1.IsNull())
|
||||||
return aFace;
|
return aFace;
|
||||||
@ -296,8 +297,8 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFacePlaneHW (Handle(GEOM_Obj
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Make a Python command
|
//Make a Python command
|
||||||
GEOM::TPythonDump(aFunction) << aFace << " = geompy.MakeFacePlaneHW("
|
GEOM::TPythonDump(aFunction) << aFace << " = geompy.MakeFaceVecHW("
|
||||||
<< theFace << ", " << theH << ", " << theW << ")";
|
<< theVec << ", " << theH << ", " << theW << ")";
|
||||||
|
|
||||||
SetErrorCode(OK);
|
SetErrorCode(OK);
|
||||||
return aFace;
|
return aFace;
|
||||||
@ -421,6 +422,56 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeDiskThreePnt (Handle(GEOM_Ob
|
|||||||
return aDisk;
|
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
|
* MakeCylinderRH
|
||||||
|
@ -36,15 +36,16 @@ class GEOMImpl_I3DPrimOperations : public GEOM_IOperations {
|
|||||||
Standard_EXPORT Handle(GEOM_Object) MakeBoxDXDYDZ (double theDX, double theDY, double theDZ);
|
Standard_EXPORT Handle(GEOM_Object) MakeBoxDXDYDZ (double theDX, double theDY, double theDZ);
|
||||||
Standard_EXPORT Handle(GEOM_Object) MakeBoxTwoPnt (Handle(GEOM_Object) thePnt1,
|
Standard_EXPORT Handle(GEOM_Object) MakeBoxTwoPnt (Handle(GEOM_Object) thePnt1,
|
||||||
Handle(GEOM_Object) thePnt2);
|
Handle(GEOM_Object) thePnt2);
|
||||||
Standard_EXPORT Handle(GEOM_Object) MakeFaceHW (double theH, double theW);
|
Standard_EXPORT Handle(GEOM_Object) MakeFaceHW (double theH, double theW, int theOrientation);
|
||||||
Standard_EXPORT Handle(GEOM_Object) MakeFacePlaneHW (Handle(GEOM_Object) theFace,
|
Standard_EXPORT Handle(GEOM_Object) MakeFaceVecHW (Handle(GEOM_Object) theVec,
|
||||||
double theH, double theW);
|
double theH, double theW);
|
||||||
Standard_EXPORT Handle(GEOM_Object) MakeDiskThreePnt (Handle(GEOM_Object) thePnt1,
|
Standard_EXPORT Handle(GEOM_Object) MakeDiskThreePnt (Handle(GEOM_Object) thePnt1,
|
||||||
Handle(GEOM_Object) thePnt2,
|
Handle(GEOM_Object) thePnt2,
|
||||||
Handle(GEOM_Object) thePnt3);
|
Handle(GEOM_Object) thePnt3);
|
||||||
Standard_EXPORT Handle(GEOM_Object) MakeDiskPntVecR (Handle(GEOM_Object) thePnt1,
|
Standard_EXPORT Handle(GEOM_Object) MakeDiskPntVecR (Handle(GEOM_Object) thePnt1,
|
||||||
Handle(GEOM_Object) theVec,
|
Handle(GEOM_Object) theVec,
|
||||||
double theR);
|
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) MakeCylinderRH (double theR, double theH);
|
||||||
Standard_EXPORT Handle(GEOM_Object) MakeCylinderPntVecRH (Handle(GEOM_Object) thePnt,
|
Standard_EXPORT Handle(GEOM_Object) MakeCylinderPntVecRH (Handle(GEOM_Object) thePnt,
|
||||||
Handle(GEOM_Object) theVec,
|
Handle(GEOM_Object) theVec,
|
||||||
|
@ -22,13 +22,15 @@
|
|||||||
|
|
||||||
#include "GEOM_Function.hxx"
|
#include "GEOM_Function.hxx"
|
||||||
|
|
||||||
#define DISK_ARG_P1 1
|
#define DISK_ARG_P1 1
|
||||||
#define DISK_ARG_P2 2
|
#define DISK_ARG_P2 2
|
||||||
#define DISK_ARG_P3 3
|
#define DISK_ARG_P3 3
|
||||||
|
|
||||||
#define DISK_ARG_CC 4
|
#define DISK_ARG_CC 4
|
||||||
#define DISK_ARG_VV 5
|
#define DISK_ARG_VV 5
|
||||||
#define DISK_ARG_RR 6
|
#define DISK_ARG_RR 6
|
||||||
|
|
||||||
|
#define DISK_ARG_ORIENT 7
|
||||||
|
|
||||||
class GEOMImpl_IDisk
|
class GEOMImpl_IDisk
|
||||||
{
|
{
|
||||||
@ -44,6 +46,7 @@ class GEOMImpl_IDisk
|
|||||||
void SetVector(Handle(GEOM_Function) theV) { _func->SetReference(DISK_ARG_VV, theV); }
|
void SetVector(Handle(GEOM_Function) theV) { _func->SetReference(DISK_ARG_VV, theV); }
|
||||||
|
|
||||||
void SetRadius(double theR) { _func->SetReal(DISK_ARG_RR, theR); }
|
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) GetPoint1() { return _func->GetReference(DISK_ARG_P1); }
|
||||||
Handle(GEOM_Function) GetPoint2() { return _func->GetReference(DISK_ARG_P2); }
|
Handle(GEOM_Function) GetPoint2() { return _func->GetReference(DISK_ARG_P2); }
|
||||||
@ -53,6 +56,7 @@ class GEOMImpl_IDisk
|
|||||||
Handle(GEOM_Function) GetVector() { return _func->GetReference(DISK_ARG_VV); }
|
Handle(GEOM_Function) GetVector() { return _func->GetReference(DISK_ARG_VV); }
|
||||||
|
|
||||||
double GetRadius() { return _func->GetReal(DISK_ARG_RR); }
|
double GetRadius() { return _func->GetReal(DISK_ARG_RR); }
|
||||||
|
double GetOrientation() { return _func->GetReal(DISK_ARG_ORIENT); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -22,13 +22,12 @@
|
|||||||
|
|
||||||
#include "GEOM_Function.hxx"
|
#include "GEOM_Function.hxx"
|
||||||
|
|
||||||
#define FACE_ARG_REF1 1
|
#define FACE_ARG_REF1 1
|
||||||
#define FACE_ARG_REF2 2
|
#define FACE_ARG_ORIENT 2
|
||||||
#define FACE_ARG_REF3 3
|
|
||||||
|
|
||||||
#define FACE_ARG_PLANE 4
|
#define FACE_ARG_PLANE 4
|
||||||
#define FACE_ARG_H 5
|
#define FACE_ARG_H 5
|
||||||
#define FACE_ARG_W 6
|
#define FACE_ARG_W 6
|
||||||
|
|
||||||
class GEOMImpl_IFace
|
class GEOMImpl_IFace
|
||||||
{
|
{
|
||||||
@ -39,11 +38,8 @@ class GEOMImpl_IFace
|
|||||||
void SetRef1(Handle(GEOM_Function) theRefPoint1) { _func->SetReference(FACE_ARG_REF1, theRefPoint1); }
|
void SetRef1(Handle(GEOM_Function) theRefPoint1) { _func->SetReference(FACE_ARG_REF1, theRefPoint1); }
|
||||||
Handle(GEOM_Function) GetRef1() { return _func->GetReference(FACE_ARG_REF1); }
|
Handle(GEOM_Function) GetRef1() { return _func->GetReference(FACE_ARG_REF1); }
|
||||||
|
|
||||||
void SetRef2(Handle(GEOM_Function) theRefPoint2) { _func->SetReference(FACE_ARG_REF2, theRefPoint2); }
|
void SetOrientation(int theOrientation) { _func->SetReal(FACE_ARG_ORIENT, theOrientation); }
|
||||||
Handle(GEOM_Function) GetRef2() { return _func->GetReference(FACE_ARG_REF2); }
|
int GetOrientation() { return _func->GetReal(FACE_ARG_ORIENT); }
|
||||||
|
|
||||||
void SetRef3(Handle(GEOM_Function) theRefVec) { _func->SetReference(FACE_ARG_REF3, theRefVec); }
|
|
||||||
Handle(GEOM_Function) GetRef3() { return _func->GetReference(FACE_ARG_REF3); }
|
|
||||||
|
|
||||||
void SetH(double theH) { _func->SetReal(FACE_ARG_H, theH); }
|
void SetH(double theH) { _func->SetReal(FACE_ARG_H, theH); }
|
||||||
void SetW(double theW) { _func->SetReal(FACE_ARG_W, theW); }
|
void SetW(double theW) { _func->SetReal(FACE_ARG_W, theW); }
|
||||||
|
@ -158,11 +158,12 @@
|
|||||||
#define BOX_DX_DY_DZ 1
|
#define BOX_DX_DY_DZ 1
|
||||||
#define BOX_TWO_PNT 2
|
#define BOX_TWO_PNT 2
|
||||||
|
|
||||||
#define FACE_PLANE_H_W 1
|
#define FACE_VEC_H_W 1
|
||||||
#define FACE_H_W 2
|
#define FACE_H_W 2
|
||||||
|
|
||||||
#define DISK_PNT_VEC_R 1
|
#define DISK_PNT_VEC_R 1
|
||||||
#define DISK_THREE_PNT 2
|
#define DISK_THREE_PNT 2
|
||||||
|
#define DISK_R 3
|
||||||
|
|
||||||
#define CYLINDER_R_H 1
|
#define CYLINDER_R_H 1
|
||||||
#define CYLINDER_PNT_VEC_R_H 2
|
#define CYLINDER_PNT_VEC_R_H 2
|
||||||
|
@ -109,7 +109,8 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeBoxTwoPnt
|
|||||||
*/
|
*/
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeFaceHW (CORBA::Double theH,
|
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;
|
GEOM::GEOM_Object_var aGEOMObject;
|
||||||
|
|
||||||
@ -120,7 +121,7 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeFaceHW (CORBA::Double theH,
|
|||||||
return aGEOMObject._retn();
|
return aGEOMObject._retn();
|
||||||
|
|
||||||
//Create the Face
|
//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())
|
if (!GetOperations()->IsDone() || anObject.IsNull())
|
||||||
return aGEOMObject._retn();
|
return aGEOMObject._retn();
|
||||||
|
|
||||||
@ -129,11 +130,11 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeFaceHW (CORBA::Double theH,
|
|||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
/*!
|
/*!
|
||||||
* MakeFacePlaneHW
|
* MakeFaceVecHW
|
||||||
*/
|
*/
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeFacePlaneHW
|
GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeFaceVecHW
|
||||||
(GEOM::GEOM_Object_ptr theFace,
|
(GEOM::GEOM_Object_ptr theVec,
|
||||||
CORBA::Double theH,
|
CORBA::Double theH,
|
||||||
CORBA::Double theW)
|
CORBA::Double theW)
|
||||||
{
|
{
|
||||||
@ -142,18 +143,18 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeFacePlaneHW
|
|||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
if (theFace == NULL || theH == 0 || theW == 0)
|
if (theVec == NULL || theH == 0 || theW == 0)
|
||||||
return aGEOMObject._retn();
|
return aGEOMObject._retn();
|
||||||
|
|
||||||
//Get the reference points
|
//Get the reference points
|
||||||
Handle(GEOM_Object) aFace = GetOperations()->GetEngine()->GetObject
|
Handle(GEOM_Object) aFace = GetOperations()->GetEngine()->GetObject
|
||||||
(theFace->GetStudyID(), theFace->GetEntry());
|
(theVec->GetStudyID(), theVec->GetEntry());
|
||||||
|
|
||||||
if (aFace.IsNull())
|
if (aFace.IsNull())
|
||||||
return aGEOMObject._retn();
|
return aGEOMObject._retn();
|
||||||
|
|
||||||
//Create the Face
|
//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())
|
if (!GetOperations()->IsDone() || anObject.IsNull())
|
||||||
return aGEOMObject._retn();
|
return aGEOMObject._retn();
|
||||||
|
|
||||||
@ -228,6 +229,30 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeDiskThreePnt
|
|||||||
return GetObject(anObject);
|
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
|
* MakeCylinderRH
|
||||||
|
@ -48,9 +48,10 @@ class GEOM_I_EXPORT GEOM_I3DPrimOperations_i :
|
|||||||
GEOM::GEOM_Object_ptr thePnt2);
|
GEOM::GEOM_Object_ptr thePnt2);
|
||||||
|
|
||||||
GEOM::GEOM_Object_ptr MakeFaceHW (CORBA::Double theH,
|
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 theH,
|
||||||
CORBA::Double theW);
|
CORBA::Double theW);
|
||||||
|
|
||||||
@ -62,6 +63,9 @@ class GEOM_I_EXPORT GEOM_I3DPrimOperations_i :
|
|||||||
GEOM::GEOM_Object_ptr thePnt2,
|
GEOM::GEOM_Object_ptr thePnt2,
|
||||||
GEOM::GEOM_Object_ptr thePnt3);
|
GEOM::GEOM_Object_ptr thePnt3);
|
||||||
|
|
||||||
|
GEOM::GEOM_Object_ptr MakeDiskR (CORBA::Double theR,
|
||||||
|
CORBA::Short theOrientation);
|
||||||
|
|
||||||
GEOM::GEOM_Object_ptr MakeCylinderRH (CORBA::Double theR,
|
GEOM::GEOM_Object_ptr MakeCylinderRH (CORBA::Double theR,
|
||||||
CORBA::Double theH);
|
CORBA::Double theH);
|
||||||
|
|
||||||
|
@ -775,28 +775,29 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeBoxTwoPnt (GEOM::GEOM_Object_ptr thePnt
|
|||||||
// MakeFaceHW:
|
// MakeFaceHW:
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFaceHW (CORBA::Double theH,
|
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" );
|
beginService( " GEOM_Superv_i::MakeFaceHW" );
|
||||||
MESSAGE("GEOM_Superv_i::MakeFaceHW");
|
MESSAGE("GEOM_Superv_i::MakeFaceHW");
|
||||||
get3DPrimOp();
|
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" );
|
endService( " GEOM_Superv_i::MakeFaceHW" );
|
||||||
return anObj;
|
return anObj;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
// MakeFaceTwoPlaneHW:
|
// MakeFaceVecHW:
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFacePlaneHW (GEOM::GEOM_Object_ptr theFace,
|
GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFaceVecHW (GEOM::GEOM_Object_ptr theVec,
|
||||||
CORBA::Double theH,
|
CORBA::Double theH,
|
||||||
CORBA::Double theW)
|
CORBA::Double theW)
|
||||||
{
|
{
|
||||||
beginService( " GEOM_Superv_i::MakeFacePlaneHW" );
|
beginService( " GEOM_Superv_i::MakeFaceVecHW" );
|
||||||
MESSAGE("GEOM_Superv_i::MakeFacePlaneHW");
|
MESSAGE("GEOM_Superv_i::MakeFaceVecHW");
|
||||||
get3DPrimOp();
|
get3DPrimOp();
|
||||||
GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeFacePlaneHW(theFace, theH, theW);
|
GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeFaceVecHW(theVec, theH, theW);
|
||||||
endService( " GEOM_Superv_i::MakeFacePlaneHW" );
|
endService( " GEOM_Superv_i::MakeFaceVecHW" );
|
||||||
return anObj;
|
return anObj;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -830,6 +831,20 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeDiskThreePnt (GEOM::GEOM_Object_ptr the
|
|||||||
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:
|
// MakeCylinderPntVecRH:
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
@ -188,16 +188,19 @@ public:
|
|||||||
GEOM::GEOM_Object_ptr MakeBoxTwoPnt (GEOM::GEOM_Object_ptr thePnt1,
|
GEOM::GEOM_Object_ptr MakeBoxTwoPnt (GEOM::GEOM_Object_ptr thePnt1,
|
||||||
GEOM::GEOM_Object_ptr thePnt2);
|
GEOM::GEOM_Object_ptr thePnt2);
|
||||||
GEOM::GEOM_Object_ptr MakeFaceHW (CORBA::Double theH,
|
GEOM::GEOM_Object_ptr MakeFaceHW (CORBA::Double theH,
|
||||||
CORBA::Double theW);
|
CORBA::Double theW,
|
||||||
GEOM::GEOM_Object_ptr MakeFacePlaneHW (GEOM::GEOM_Object_ptr theFace,
|
CORBA::Short theOrientation);
|
||||||
CORBA::Double theH,
|
GEOM::GEOM_Object_ptr MakeFaceVecHW (GEOM::GEOM_Object_ptr theFace,
|
||||||
CORBA::Double theW);
|
CORBA::Double theH,
|
||||||
|
CORBA::Double theW);
|
||||||
GEOM::GEOM_Object_ptr MakeDiskPntVecR (GEOM::GEOM_Object_ptr theCenter,
|
GEOM::GEOM_Object_ptr MakeDiskPntVecR (GEOM::GEOM_Object_ptr theCenter,
|
||||||
GEOM::GEOM_Object_ptr theVector,
|
GEOM::GEOM_Object_ptr theVector,
|
||||||
CORBA::Double theR);
|
CORBA::Double theR);
|
||||||
GEOM::GEOM_Object_ptr MakeDiskThreePnt (GEOM::GEOM_Object_ptr thePnt1,
|
GEOM::GEOM_Object_ptr MakeDiskThreePnt (GEOM::GEOM_Object_ptr thePnt1,
|
||||||
GEOM::GEOM_Object_ptr thePnt2,
|
GEOM::GEOM_Object_ptr thePnt2,
|
||||||
GEOM::GEOM_Object_ptr thePnt3);
|
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 MakeCylinderPntVecRH (GEOM::GEOM_Object_ptr thePnt,
|
||||||
GEOM::GEOM_Object_ptr theAxis,
|
GEOM::GEOM_Object_ptr theAxis,
|
||||||
CORBA::Double theRadius,
|
CORBA::Double theRadius,
|
||||||
|
@ -138,10 +138,11 @@ def TestAll (geompy, math):
|
|||||||
Face1 = geompy.MakeFaceWires([Wire, Sketcher],
|
Face1 = geompy.MakeFaceWires([Wire, Sketcher],
|
||||||
WantPlanarFace) #(List of GEOM_Object_ptr, Boolean)->GEOM_Object_ptr
|
WantPlanarFace) #(List of GEOM_Object_ptr, Boolean)->GEOM_Object_ptr
|
||||||
Face2 = geompy.MakeFace(Sketcher, WantPlanarFace)
|
Face2 = geompy.MakeFace(Sketcher, WantPlanarFace)
|
||||||
Face3 = geompy.MakeFaceHW (100., 200.) #(2 Doubles)->GEOM_Object_ptr
|
Face3 = geompy.MakeFaceHW (100., 200., 1) #(2 Doubles, 1 Int)->GEOM_Object_ptr
|
||||||
Face4 = geompy.MakeFacePlaneHW (Face, 200., 200.)#(1 GEOM_Object_ptr, 2 Doubles)->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
|
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
|
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
|
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
|
Prism1 = geompy.MakePrism(Face2, p0, pxyz) #(3 GEOM_Object_ptr)->GEOM_Object_ptr
|
||||||
@ -332,6 +333,7 @@ def TestAll (geompy, math):
|
|||||||
id_Face4 = geompy.addToStudy(Face4, "Face Plane_HW")
|
id_Face4 = geompy.addToStudy(Face4, "Face Plane_HW")
|
||||||
id_Disk = geompy.addToStudy(Disk, "Disk PntVecR")
|
id_Disk = geompy.addToStudy(Disk, "Disk PntVecR")
|
||||||
id_Disk2 = geompy.addToStudy(Disk2, "Disk Three Points")
|
id_Disk2 = geompy.addToStudy(Disk2, "Disk Three Points")
|
||||||
|
id_Disk3 = geompy.addToStudy(Disk3, "Disk OXY Radius")
|
||||||
id_Shell = geompy.addToStudy(Shell, "Shell")
|
id_Shell = geompy.addToStudy(Shell, "Shell")
|
||||||
|
|
||||||
id_p_on_face = geompy.addToStudy(p_on_face, "Vertex on Face (0.1, 0.8)")
|
id_p_on_face = geompy.addToStudy(p_on_face, "Vertex on Face (0.1, 0.8)")
|
||||||
|
@ -682,29 +682,30 @@ class geompyDC(GEOM._objref_GEOM_Gen):
|
|||||||
|
|
||||||
## Create a face with specified dimensions along OX-OY coordinate axes,
|
## Create a face with specified dimensions along OX-OY coordinate axes,
|
||||||
# with edges, parallel to this coordinate axes.
|
# with edges, parallel to this coordinate axes.
|
||||||
# @param theH length of Face edge, parallel to OX axis.
|
# @param theH height of Face.
|
||||||
# @param theW length of Face edge, parallel to OY axis.
|
# @param theW width of Face.
|
||||||
|
# @param theOrientation orientation belong axis OXY OYZ OZX
|
||||||
# @return New GEOM_Object, containing the created face.
|
# @return New GEOM_Object, containing the created face.
|
||||||
#
|
#
|
||||||
# @ref tui_creation_face "Example"
|
# @ref tui_creation_face "Example"
|
||||||
def MakeFaceHW(self,theH, theW):
|
def MakeFaceHW(self,theH, theW, theOrientation):
|
||||||
# Example: see GEOM_TestAll.py
|
# Example: see GEOM_TestAll.py
|
||||||
anObj = self.PrimOp.MakeFaceHW(theH, theW)
|
anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
|
||||||
RaiseIfFailed("MakeFaceHW", self.PrimOp)
|
RaiseIfFailed("MakeFaceHW", self.PrimOp)
|
||||||
return anObj
|
return anObj
|
||||||
|
|
||||||
## Create a face from another plane and two sizes,
|
## Create a face from another plane and two sizes,
|
||||||
# vertical size and horisontal size.
|
# 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 theH Height (vertical size).
|
||||||
# @param theW Width (horisontal size).
|
# @param theW Width (horisontal size).
|
||||||
# @return New GEOM_Object, containing the created face.
|
# @return New GEOM_Object, containing the created face.
|
||||||
#
|
#
|
||||||
# @ref tui_creation_face "Example"
|
# @ref tui_creation_face "Example"
|
||||||
def MakeFacePlaneHW(self, theFace, theH, theW):
|
def MakeFaceVecHW(self, theVec, theH, theW):
|
||||||
# Example: see GEOM_TestAll.py
|
# Example: see GEOM_TestAll.py
|
||||||
anObj = self.PrimOp.MakeFacePlaneHW(theFace, theH, theW)
|
anObj = self.PrimOp.MakeFaceVecHW(theVec, theH, theW)
|
||||||
RaiseIfFailed("MakeFacePlaneHW", self.PrimOp)
|
RaiseIfFailed("MakeFaceVecHW", self.PrimOp)
|
||||||
return anObj
|
return anObj
|
||||||
|
|
||||||
## Create a disk with given center, normal vector and radius.
|
## Create a disk with given center, normal vector and radius.
|
||||||
@ -731,6 +732,18 @@ class geompyDC(GEOM._objref_GEOM_Gen):
|
|||||||
RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
|
RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
|
||||||
return anObj
|
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.
|
## Create a cylinder with given base point, axis, radius and height.
|
||||||
# @param thePnt Central point of cylinder base.
|
# @param thePnt Central point of cylinder base.
|
||||||
# @param theAxis Cylinder axis.
|
# @param theAxis Cylinder axis.
|
||||||
|
@ -56,6 +56,7 @@ PrimitiveGUI_DiskDlg::PrimitiveGUI_DiskDlg( GeometryGUI* theGeometryGUI, QWidget
|
|||||||
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_DISK_PNT_VEC_R" ) ) );
|
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 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 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" ) );
|
setWindowTitle( tr( "GEOM_DISK_TITLE" ) );
|
||||||
|
|
||||||
@ -63,39 +64,46 @@ PrimitiveGUI_DiskDlg::PrimitiveGUI_DiskDlg( GeometryGUI* theGeometryGUI, QWidget
|
|||||||
mainFrame()->GroupConstructors->setTitle( tr( "GEOM_DISK" ) );
|
mainFrame()->GroupConstructors->setTitle( tr( "GEOM_DISK" ) );
|
||||||
mainFrame()->RadioButton1->setIcon( image0 );
|
mainFrame()->RadioButton1->setIcon( image0 );
|
||||||
mainFrame()->RadioButton2->setIcon( image2 );
|
mainFrame()->RadioButton2->setIcon( image2 );
|
||||||
mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
|
mainFrame()->RadioButton3->setIcon( image3 );
|
||||||
mainFrame()->RadioButton3->close();
|
|
||||||
|
|
||||||
GroupPntVecR = new DlgRef_2Sel1Spin( centralWidget() );
|
GroupPntVecR = new DlgRef_2Sel1Spin( centralWidget() );
|
||||||
|
|
||||||
GroupPntVecR->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
|
GroupPntVecR->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
|
||||||
GroupPntVecR->TextLabel1->setText( tr( "GEOM_CENTER_POINT" ) );
|
GroupPntVecR->TextLabel1->setText( tr( "GEOM_CENTER_POINT" ) );
|
||||||
GroupPntVecR->TextLabel2->setText( tr( "GEOM_VECTOR" ) );
|
GroupPntVecR->TextLabel2->setText( tr( "GEOM_VECTOR" ) );
|
||||||
GroupPntVecR->TextLabel3->setText( tr( "GEOM_RADIUS" ) );
|
GroupPntVecR->TextLabel3->setText( tr( "GEOM_RADIUS" ) );
|
||||||
GroupPntVecR->PushButton1->setIcon( image1 );
|
GroupPntVecR->PushButton1->setIcon( image1 );
|
||||||
GroupPntVecR->PushButton2->setIcon( image1 );
|
GroupPntVecR->PushButton2->setIcon( image1 );
|
||||||
|
|
||||||
GroupPntVecR->LineEdit1->setReadOnly( true );
|
GroupPntVecR->LineEdit1->setReadOnly( true );
|
||||||
GroupPntVecR->LineEdit2->setReadOnly( true );
|
GroupPntVecR->LineEdit2->setReadOnly( true );
|
||||||
|
|
||||||
Group3Pnts = new DlgRef_3Sel( centralWidget() );
|
Group3Pnts = new DlgRef_3Sel( centralWidget() );
|
||||||
|
Group3Pnts->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
|
||||||
Group3Pnts->GroupBox1->setTitle( tr( "GEOM_3_POINTS" ) );
|
|
||||||
Group3Pnts->TextLabel1->setText( tr( "GEOM_POINT1" ) );
|
Group3Pnts->TextLabel1->setText( tr( "GEOM_POINT1" ) );
|
||||||
Group3Pnts->TextLabel2->setText( tr( "GEOM_POINT2" ) );
|
Group3Pnts->TextLabel2->setText( tr( "GEOM_POINT2" ) );
|
||||||
Group3Pnts->TextLabel3->setText( tr( "GEOM_POINT3" ) );
|
Group3Pnts->TextLabel3->setText( tr( "GEOM_POINT3" ) );
|
||||||
Group3Pnts->PushButton1->setIcon( image1 );
|
Group3Pnts->PushButton1->setIcon( image1 );
|
||||||
Group3Pnts->PushButton2->setIcon( image1 );
|
Group3Pnts->PushButton2->setIcon( image1 );
|
||||||
Group3Pnts->PushButton3->setIcon( image1 );
|
Group3Pnts->PushButton3->setIcon( image1 );
|
||||||
|
|
||||||
Group3Pnts->LineEdit1->setReadOnly( true );
|
Group3Pnts->LineEdit1->setReadOnly( true );
|
||||||
Group3Pnts->LineEdit2->setReadOnly( true );
|
Group3Pnts->LineEdit2->setReadOnly( true );
|
||||||
Group3Pnts->LineEdit3->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() );
|
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
|
||||||
layout->setMargin( 0 ); layout->setSpacing( 6 );
|
layout->setMargin( 0 ); layout->setSpacing( 6 );
|
||||||
layout->addWidget( GroupPntVecR );
|
layout->addWidget( GroupPntVecR );
|
||||||
layout->addWidget( Group3Pnts );
|
layout->addWidget( Group3Pnts );
|
||||||
|
layout->addWidget( GroupDimensions );
|
||||||
|
layout->addWidget( GroupOrientation );
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|
||||||
setHelpFileName( "create_disk_page.html" );
|
setHelpFileName( "create_disk_page.html" );
|
||||||
@ -121,6 +129,7 @@ void PrimitiveGUI_DiskDlg::Init()
|
|||||||
{
|
{
|
||||||
/* init variables */
|
/* init variables */
|
||||||
myEditCurrentArgument = GroupPntVecR->LineEdit1;
|
myEditCurrentArgument = GroupPntVecR->LineEdit1;
|
||||||
|
myOrientationType = 1;
|
||||||
|
|
||||||
myPoint = myDir = myPoint1 = myPoint2 = myPoint3 = GEOM::GEOM_Object::_nil();
|
myPoint = myDir = myPoint1 = myPoint2 = myPoint3 = GEOM::GEOM_Object::_nil();
|
||||||
|
|
||||||
@ -131,6 +140,8 @@ void PrimitiveGUI_DiskDlg::Init()
|
|||||||
/* min, max, step and decimals for spin boxes & initial values */
|
/* 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
|
initSpinBox( GroupPntVecR->SpinBox_DX, 0.001, COORD_MAX, aStep, 3 ); // VSR:TODO : DBL_DIGITS_DISPLAY
|
||||||
GroupPntVecR->SpinBox_DX->setValue( 100 );
|
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 */
|
/* signals and slots connections */
|
||||||
connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) );
|
connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) );
|
||||||
@ -156,6 +167,11 @@ void PrimitiveGUI_DiskDlg::Init()
|
|||||||
connect( GroupPntVecR->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT(ValueChangedInSpinBox() ) );
|
connect( GroupPntVecR->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT(ValueChangedInSpinBox() ) );
|
||||||
connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), this, SLOT( SetDoubleSpinBoxStep( double ) ) );
|
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() ),
|
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
|
||||||
this, SLOT( SelectionIntoArgument() ) );
|
this, SLOT( SelectionIntoArgument() ) );
|
||||||
|
|
||||||
@ -173,6 +189,21 @@ void PrimitiveGUI_DiskDlg::SetDoubleSpinBoxStep( double step )
|
|||||||
GroupPntVecR->SpinBox_DX->setSingleStep(step);
|
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()
|
// function : ConstructorsClicked()
|
||||||
// purpose : Radio button management
|
// purpose : Radio button management
|
||||||
@ -188,7 +219,8 @@ void PrimitiveGUI_DiskDlg::ConstructorsClicked( int constructorId )
|
|||||||
{
|
{
|
||||||
Group3Pnts->hide();
|
Group3Pnts->hide();
|
||||||
GroupPntVecR->show();
|
GroupPntVecR->show();
|
||||||
|
GroupDimensions->hide();
|
||||||
|
GroupOrientation->hide();
|
||||||
myEditCurrentArgument = GroupPntVecR->LineEdit1;
|
myEditCurrentArgument = GroupPntVecR->LineEdit1;
|
||||||
GroupPntVecR->LineEdit1->setText( "" );
|
GroupPntVecR->LineEdit1->setText( "" );
|
||||||
GroupPntVecR->LineEdit2->setText( "" );
|
GroupPntVecR->LineEdit2->setText( "" );
|
||||||
@ -198,13 +230,23 @@ void PrimitiveGUI_DiskDlg::ConstructorsClicked( int constructorId )
|
|||||||
{
|
{
|
||||||
GroupPntVecR->hide();
|
GroupPntVecR->hide();
|
||||||
Group3Pnts->show();
|
Group3Pnts->show();
|
||||||
|
GroupDimensions->hide();
|
||||||
|
GroupOrientation->hide();
|
||||||
myEditCurrentArgument = Group3Pnts->LineEdit1;
|
myEditCurrentArgument = Group3Pnts->LineEdit1;
|
||||||
Group3Pnts->LineEdit1->setText( "" );
|
Group3Pnts->LineEdit1->setText( "" );
|
||||||
Group3Pnts->LineEdit2->setText( "" );
|
Group3Pnts->LineEdit2->setText( "" );
|
||||||
Group3Pnts->LineEdit3->setText( "" );
|
Group3Pnts->LineEdit3->setText( "" );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 2:
|
||||||
|
{
|
||||||
|
GroupPntVecR->hide();
|
||||||
|
Group3Pnts->hide();
|
||||||
|
GroupDimensions->show();
|
||||||
|
GroupOrientation->show();
|
||||||
|
GroupOrientation->RadioButton1->setChecked( true );
|
||||||
|
myOrientationType = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
qApp->processEvents();
|
qApp->processEvents();
|
||||||
@ -217,6 +259,7 @@ void PrimitiveGUI_DiskDlg::ConstructorsClicked( int constructorId )
|
|||||||
|
|
||||||
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged() ),
|
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged() ),
|
||||||
this, SLOT( SelectionIntoArgument() ) );
|
this, SLOT( SelectionIntoArgument() ) );
|
||||||
|
displayPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -249,6 +292,11 @@ bool PrimitiveGUI_DiskDlg::ClickOnApply()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void PrimitiveGUI_DiskDlg::SelectionIntoArgument()
|
void PrimitiveGUI_DiskDlg::SelectionIntoArgument()
|
||||||
{
|
{
|
||||||
|
if (getConstructorId() == 2) {
|
||||||
|
displayPreview();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
|
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
@ -420,6 +468,8 @@ double PrimitiveGUI_DiskDlg::getRadius() const
|
|||||||
switch ( getConstructorId() ) {
|
switch ( getConstructorId() ) {
|
||||||
case 0:
|
case 0:
|
||||||
r = GroupPntVecR->SpinBox_DX->value(); break;
|
r = GroupPntVecR->SpinBox_DX->value(); break;
|
||||||
|
case 2:
|
||||||
|
r = GroupDimensions->SpinBox_DX->value(); break;
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
@ -454,6 +504,8 @@ bool PrimitiveGUI_DiskDlg::isValid( QString& msg )
|
|||||||
else if ( id == 1 )
|
else if ( id == 1 )
|
||||||
return !myPoint1->_is_nil() && !myPoint2->_is_nil() && !myPoint3->_is_nil() &&
|
return !myPoint1->_is_nil() && !myPoint2->_is_nil() && !myPoint3->_is_nil() &&
|
||||||
!isEqual( myPoint1, myPoint2 ) && !isEqual( myPoint1, myPoint3 ) && !isEqual( myPoint2, myPoint3 );
|
!isEqual( myPoint1, myPoint2 ) && !isEqual( myPoint1, myPoint3 ) && !isEqual( myPoint2, myPoint3 );
|
||||||
|
else if ( id == 2 )
|
||||||
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -476,6 +528,10 @@ bool PrimitiveGUI_DiskDlg::execute( ObjectList& objects )
|
|||||||
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeDiskThreePnt( myPoint1, myPoint2, myPoint3 );
|
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeDiskThreePnt( myPoint1, myPoint2, myPoint3 );
|
||||||
res = true;
|
res = true;
|
||||||
break;
|
break;
|
||||||
|
case 2 :
|
||||||
|
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeDiskR( getRadius(), myOrientationType );
|
||||||
|
res = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !anObj->_is_nil() )
|
if ( !anObj->_is_nil() )
|
||||||
|
@ -30,6 +30,8 @@
|
|||||||
|
|
||||||
class DlgRef_3Sel;
|
class DlgRef_3Sel;
|
||||||
class DlgRef_2Sel1Spin;
|
class DlgRef_2Sel1Spin;
|
||||||
|
class DlgRef_1Spin;
|
||||||
|
class DlgRef_3Check;
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : PrimitiveGUI_DiskDlg
|
// class : PrimitiveGUI_DiskDlg
|
||||||
@ -55,12 +57,15 @@ private:
|
|||||||
void Init();
|
void Init();
|
||||||
void enterEvent( QEvent* );
|
void enterEvent( QEvent* );
|
||||||
double getRadius() const;
|
double getRadius() const;
|
||||||
|
int myOrientationType;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GEOM::GEOM_Object_var myPoint, myDir, myPoint1, myPoint2, myPoint3;
|
GEOM::GEOM_Object_var myPoint, myDir, myPoint1, myPoint2, myPoint3;
|
||||||
|
|
||||||
DlgRef_2Sel1Spin* GroupPntVecR;
|
DlgRef_2Sel1Spin* GroupPntVecR;
|
||||||
DlgRef_3Sel* Group3Pnts;
|
DlgRef_3Sel* Group3Pnts;
|
||||||
|
DlgRef_1Spin* GroupDimensions;
|
||||||
|
DlgRef_3Check* GroupOrientation;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void ClickOnOk();
|
void ClickOnOk();
|
||||||
@ -76,6 +81,7 @@ private slots:
|
|||||||
void SetEditCurrentArgument();
|
void SetEditCurrentArgument();
|
||||||
void ValueChangedInSpinBox();
|
void ValueChangedInSpinBox();
|
||||||
void SetDoubleSpinBoxStep( double );
|
void SetDoubleSpinBoxStep( double );
|
||||||
|
void RadioButtonClicked();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // BASICGUI_DISKDLG_H
|
#endif // BASICGUI_DISKDLG_H
|
||||||
|
@ -53,7 +53,7 @@ PrimitiveGUI_FaceDlg::PrimitiveGUI_FaceDlg( GeometryGUI* theGeometryGUI, QWidget
|
|||||||
bool modal, Qt::WindowFlags fl )
|
bool modal, Qt::WindowFlags fl )
|
||||||
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, 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 image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
|
||||||
QPixmap image2( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_FACE_HW" ) ) );
|
QPixmap image2( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_FACE_HW" ) ) );
|
||||||
|
|
||||||
@ -67,8 +67,8 @@ PrimitiveGUI_FaceDlg::PrimitiveGUI_FaceDlg( GeometryGUI* theGeometryGUI, QWidget
|
|||||||
mainFrame()->RadioButton3->close();
|
mainFrame()->RadioButton3->close();
|
||||||
|
|
||||||
GroupPlane = new DlgRef_1Sel2Spin( centralWidget() );
|
GroupPlane = new DlgRef_1Sel2Spin( centralWidget() );
|
||||||
GroupPlane->GroupBox1->setTitle( tr( "GEOM_FACES" ) );
|
GroupPlane->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
|
||||||
GroupPlane->TextLabel1->setText( tr( "GEOM_FACE" ) );
|
GroupPlane->TextLabel1->setText( tr( "GEOM_EDGE" ) );
|
||||||
GroupPlane->TextLabel2->setText( tr( "GEOM_HEIGHT" ) );
|
GroupPlane->TextLabel2->setText( tr( "GEOM_HEIGHT" ) );
|
||||||
GroupPlane->TextLabel3->setText( tr( "GEOM_WIDTH" ) );
|
GroupPlane->TextLabel3->setText( tr( "GEOM_WIDTH" ) );
|
||||||
GroupPlane->PushButton1->setIcon( image1 );
|
GroupPlane->PushButton1->setIcon( image1 );
|
||||||
@ -79,10 +79,18 @@ PrimitiveGUI_FaceDlg::PrimitiveGUI_FaceDlg( GeometryGUI* theGeometryGUI, QWidget
|
|||||||
GroupDimensions->TextLabel1->setText( tr( "GEOM_HEIGHT" ) );
|
GroupDimensions->TextLabel1->setText( tr( "GEOM_HEIGHT" ) );
|
||||||
GroupDimensions->TextLabel2->setText( tr( "GEOM_WIDTH" ) );
|
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() );
|
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
|
||||||
layout->setMargin( 0 ); layout->setSpacing( 6 );
|
layout->setMargin( 0 ); layout->setSpacing( 6 );
|
||||||
layout->addWidget( GroupPlane );
|
layout->addWidget( GroupPlane );
|
||||||
layout->addWidget( GroupDimensions );
|
layout->addWidget( GroupDimensions );
|
||||||
|
layout->addWidget( GroupOrientation );
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|
||||||
@ -109,9 +117,11 @@ void PrimitiveGUI_FaceDlg::Init()
|
|||||||
{
|
{
|
||||||
/* init variables */
|
/* init variables */
|
||||||
myEditCurrentArgument = GroupPlane->LineEdit1;
|
myEditCurrentArgument = GroupPlane->LineEdit1;
|
||||||
myFace = GEOM::GEOM_Object::_nil();
|
myEdge = GEOM::GEOM_Object::_nil();
|
||||||
globalSelection(); // close local contexts, if any
|
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 */
|
/* Get setting of step value from file configuration */
|
||||||
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
|
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
|
||||||
@ -148,6 +158,10 @@ void PrimitiveGUI_FaceDlg::Init()
|
|||||||
connect( GroupDimensions->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
|
connect( GroupDimensions->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
|
||||||
connect( GroupDimensions->SpinBox_DY, 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() ),
|
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
|
||||||
this, SLOT( SelectionIntoArgument() ) );
|
this, SLOT( SelectionIntoArgument() ) );
|
||||||
|
|
||||||
@ -175,6 +189,21 @@ void PrimitiveGUI_FaceDlg::ValueChangedInSpinBox( double newValue )
|
|||||||
displayPreview();
|
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()
|
// function : ClickOnOk()
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -212,12 +241,13 @@ void PrimitiveGUI_FaceDlg::ConstructorsClicked( int constructorId )
|
|||||||
case 0:
|
case 0:
|
||||||
{
|
{
|
||||||
globalSelection(); // close local contexts, if any
|
globalSelection(); // close local contexts, if any
|
||||||
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_FACE );
|
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
|
||||||
|
|
||||||
myEditCurrentArgument = GroupPlane->LineEdit1;
|
myEditCurrentArgument = GroupPlane->LineEdit1;
|
||||||
myEditCurrentArgument->setText("");
|
myEditCurrentArgument->setText("");
|
||||||
myFace = GEOM::GEOM_Object::_nil();
|
myEdge = GEOM::GEOM_Object::_nil();
|
||||||
GroupDimensions->hide();
|
GroupDimensions->hide();
|
||||||
|
GroupOrientation->hide();
|
||||||
GroupPlane->show();
|
GroupPlane->show();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -226,6 +256,9 @@ void PrimitiveGUI_FaceDlg::ConstructorsClicked( int constructorId )
|
|||||||
globalSelection(); // close local contexts, if any
|
globalSelection(); // close local contexts, if any
|
||||||
GroupPlane->hide();
|
GroupPlane->hide();
|
||||||
GroupDimensions->show();
|
GroupDimensions->show();
|
||||||
|
GroupOrientation->show();
|
||||||
|
GroupOrientation->RadioButton1->setChecked( true );
|
||||||
|
myOrientationType = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -234,6 +267,7 @@ void PrimitiveGUI_FaceDlg::ConstructorsClicked( int constructorId )
|
|||||||
updateGeometry();
|
updateGeometry();
|
||||||
resize( minimumSize() );
|
resize( minimumSize() );
|
||||||
SelectionIntoArgument();
|
SelectionIntoArgument();
|
||||||
|
displayPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -250,7 +284,7 @@ void PrimitiveGUI_FaceDlg::SelectionIntoArgument()
|
|||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
|
|
||||||
if ( IObjectCount() != 1 ) {
|
if ( IObjectCount() != 1 ) {
|
||||||
if ( myEditCurrentArgument == GroupPlane->LineEdit1 ) myFace = GEOM::GEOM_Object::_nil();
|
if ( myEditCurrentArgument == GroupPlane->LineEdit1 ) myEdge = GEOM::GEOM_Object::_nil();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -267,7 +301,7 @@ void PrimitiveGUI_FaceDlg::SelectionIntoArgument()
|
|||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes( firstIObject(), aMap );
|
||||||
if ( aMap.Extent() == 1 ) { // Local Selection
|
if ( aMap.Extent() == 1 ) { // Local Selection
|
||||||
int anIndex = aMap( 1 );
|
int anIndex = aMap( 1 );
|
||||||
aName += QString( ":face_%1" ).arg( anIndex );
|
aName += QString( ":edge_%1" ).arg( anIndex );
|
||||||
|
|
||||||
//Find SubShape Object in Father
|
//Find SubShape Object in Father
|
||||||
GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( aSelectedObject, aName );
|
GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( aSelectedObject, aName );
|
||||||
@ -280,7 +314,7 @@ void PrimitiveGUI_FaceDlg::SelectionIntoArgument()
|
|||||||
aSelectedObject = aFindedObject; // get Object from study
|
aSelectedObject = aFindedObject; // get Object from study
|
||||||
}
|
}
|
||||||
else { // Global Selection
|
else { // Global Selection
|
||||||
if ( aShape.ShapeType() != TopAbs_FACE ) {
|
if ( aShape.ShapeType() != TopAbs_EDGE ) {
|
||||||
aSelectedObject = GEOM::GEOM_Object::_nil();
|
aSelectedObject = GEOM::GEOM_Object::_nil();
|
||||||
aName = "";
|
aName = "";
|
||||||
}
|
}
|
||||||
@ -288,7 +322,7 @@ void PrimitiveGUI_FaceDlg::SelectionIntoArgument()
|
|||||||
}
|
}
|
||||||
|
|
||||||
myEditCurrentArgument->setText( aName );
|
myEditCurrentArgument->setText( aName );
|
||||||
if ( myEditCurrentArgument == GroupPlane->LineEdit1 ) myFace = aSelectedObject;
|
if ( myEditCurrentArgument == GroupPlane->LineEdit1 ) myEdge = aSelectedObject;
|
||||||
}
|
}
|
||||||
displayPreview();
|
displayPreview();
|
||||||
}
|
}
|
||||||
@ -305,7 +339,7 @@ void PrimitiveGUI_FaceDlg::SetEditCurrentArgument()
|
|||||||
globalSelection(); // close previous local contexts
|
globalSelection(); // close previous local contexts
|
||||||
if ( send == GroupPlane->PushButton1 ) {
|
if ( send == GroupPlane->PushButton1 ) {
|
||||||
myEditCurrentArgument = GroupPlane->LineEdit1;
|
myEditCurrentArgument = GroupPlane->LineEdit1;
|
||||||
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_FACE );
|
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
|
||||||
}
|
}
|
||||||
|
|
||||||
myEditCurrentArgument->setFocus();
|
myEditCurrentArgument->setFocus();
|
||||||
@ -375,7 +409,7 @@ bool PrimitiveGUI_FaceDlg::isValid( QString& msg )
|
|||||||
{
|
{
|
||||||
const int id = getConstructorId();
|
const int id = getConstructorId();
|
||||||
if ( id == 0 )
|
if ( id == 0 )
|
||||||
return !myFace->_is_nil();
|
return !myEdge->_is_nil();
|
||||||
else if ( id == 1 )
|
else if ( id == 1 )
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
@ -391,11 +425,11 @@ bool PrimitiveGUI_FaceDlg::execute( ObjectList& objects )
|
|||||||
GEOM::GEOM_Object_var anObj;
|
GEOM::GEOM_Object_var anObj;
|
||||||
switch ( getConstructorId() ) {
|
switch ( getConstructorId() ) {
|
||||||
case 0 :
|
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;
|
res = true;
|
||||||
break;
|
break;
|
||||||
case 1 :
|
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;
|
res = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -415,7 +449,7 @@ void PrimitiveGUI_FaceDlg::addSubshapesToStudy()
|
|||||||
QMap<QString, GEOM::GEOM_Object_var> objMap;
|
QMap<QString, GEOM::GEOM_Object_var> objMap;
|
||||||
switch ( getConstructorId() ) {
|
switch ( getConstructorId() ) {
|
||||||
case 0 :
|
case 0 :
|
||||||
objMap[GroupPlane->LineEdit1->text()] = myFace;
|
objMap[GroupPlane->LineEdit1->text()] = myEdge;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
addSubshapesToFather( objMap );
|
addSubshapesToFather( objMap );
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
class DlgRef_2Spin;
|
class DlgRef_2Spin;
|
||||||
class DlgRef_1Sel2Spin;
|
class DlgRef_1Sel2Spin;
|
||||||
|
class DlgRef_3Check;
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : PrimitiveGUI_FaceDlg
|
// class : PrimitiveGUI_FaceDlg
|
||||||
@ -58,10 +59,13 @@ private:
|
|||||||
GEOM::GEOM_Object_var myPoint1;
|
GEOM::GEOM_Object_var myPoint1;
|
||||||
GEOM::GEOM_Object_var myPoint2;
|
GEOM::GEOM_Object_var myPoint2;
|
||||||
GEOM::GEOM_Object_var myVector;
|
GEOM::GEOM_Object_var myVector;
|
||||||
GEOM::GEOM_Object_var myFace;
|
GEOM::GEOM_Object_var myEdge;
|
||||||
|
|
||||||
|
int myOrientationType;
|
||||||
|
|
||||||
DlgRef_2Spin* GroupDimensions;
|
DlgRef_2Spin* GroupDimensions;
|
||||||
DlgRef_1Sel2Spin* GroupPlane;
|
DlgRef_1Sel2Spin* GroupPlane;
|
||||||
|
DlgRef_3Check* GroupOrientation;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void ClickOnOk();
|
void ClickOnOk();
|
||||||
@ -76,6 +80,7 @@ private slots:
|
|||||||
void SetEditCurrentArgument();
|
void SetEditCurrentArgument();
|
||||||
void ValueChangedInSpinBox( double );
|
void ValueChangedInSpinBox( double );
|
||||||
void SetDoubleSpinBoxStep( double );
|
void SetDoubleSpinBoxStep( double );
|
||||||
|
void RadioButtonClicked();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // BASICGUI_FACEDLG_H
|
#endif // BASICGUI_FACEDLG_H
|
||||||
|
Loading…
Reference in New Issue
Block a user