- GEOM::PointStruct pstruct = myGeom->MakePointStruct(BasePoint.X(), BasePoint.Y(), BasePoint.Z());
- GEOM::PointStruct d = myGeom->MakePointStruct(aDir.X(), aDir.Y(), aDir.Z());
- GEOM::DirStruct dstruct = myGeom->MakeDirection(d);
-
- GEOM::GEOM_Shape_var result = myGeom->MakeCylinder(pstruct, dstruct, Radius, aHeight);
- if (result->_is_nil()) {
- QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
- return;
- }
- result->NameType(tr("GEOM_CYLINDER"));
- if(myGeomBase->Display(result))
- QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
- }
- catch(const SALOME::SALOME_Exception& S_ex) {
- QtCatchCorbaException(S_ex);
- }
- return;
-}
-
-
-//=====================================================================================
-// function : MakeSphere()
-// purpose :
-//=====================================================================================
-void PrimitiveGUI::MakeSphereAndDisplay(const gp_Pnt aCenterPoint, const double aRadius)
-{
- try {
- if(aRadius <= Precision::Confusion())
- return;
-
- GEOM::GEOM_Shape_ptr result = myGeom->MakeSphere(aCenterPoint.X(),aCenterPoint.Y(),aCenterPoint.Z(), aRadius);
- result->NameType(tr("GEOM_SPHERE"));
- if (myGeomBase->Display(result))
- QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
- }
- catch (const SALOME::SALOME_Exception& S_ex) {
- QtCatchCorbaException(S_ex);
- }
- return;
-}
-
-
-//=====================================================================================
-// function : MakeTorusAndDisplay()
-// purpose :
-//=====================================================================================
-void PrimitiveGUI::MakeTorusAndDisplay(const gp_Pnt BasePoint, const gp_Dir aDir,
- const double Radius1, const double Radius2)
-{
- try {
- if(Radius1 <= Precision::Confusion() || Radius2 <= Precision::Confusion())
- return;
-
- GEOM::PointStruct pstruct = myGeom->MakePointStruct(BasePoint.X(), BasePoint.Y(), BasePoint.Z());
- GEOM::PointStruct d = myGeom ->MakePointStruct(aDir.X(), aDir.Y(), aDir.Z());
- GEOM::DirStruct dstruct = myGeom->MakeDirection(d);
-
- GEOM::GEOM_Shape_var result = myGeom->MakeTorus(pstruct, dstruct, Radius1, Radius2);
- if(result->_is_nil()) {
- QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
- return;
- }
- result->NameType(tr("GEOM_TORUS"));
- if(myGeomBase->Display(result))
- QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
- }
- catch(const SALOME::SALOME_Exception& S_ex) {
- QtCatchCorbaException(S_ex);
- }
- return;
-}
-
-
-//=====================================================================================
-// function : MakeConeAndDisplay()
-// purpose :
-//=====================================================================================
-void PrimitiveGUI::MakeConeAndDisplay(const gp_Pnt BasePoint, const gp_Dir aDir,
- const double Radius1, const double Radius2, const double aHeight)
-{
- try {
- double myRadius2 = Radius2;
- if(myRadius2 < Precision::Confusion())
- myRadius2 = Precision::Confusion();
- if(Radius1 <= Precision::Confusion() || aHeight <= Precision::Confusion())
- return;
-
- GEOM::PointStruct pstruct = myGeom->MakePointStruct(BasePoint.X(), BasePoint.Y(), BasePoint.Z());
- GEOM::PointStruct d = myGeom->MakePointStruct(aDir.X(), aDir.Y(), aDir.Z());
- GEOM::DirStruct dstruct = myGeom->MakeDirection(d);
-
- GEOM::GEOM_Shape_var result = myGeom->MakeCone(pstruct, dstruct, Radius1, myRadius2, aHeight);
- if(result->_is_nil()) {
- QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
- return;
- }
- result->NameType(tr("GEOM_CONE"));
- if(myGeomBase->Display(result))
- QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
- }
- catch(const SALOME::SALOME_Exception& S_ex) {
- QtCatchCorbaException(S_ex);
- }
- return;