<ul>
<li>\subpage create_pipetshape_page</li>
+<li>\subpage create_divideddisk_page</li>
<!--@@ insert new functions before this line @@ do not remove this line @@-->
</ul>
\endcode
+\anchor tui_creation_divideddisk
+<br><h2>Creation of DividedDisk</h2>
+
+\code
+import geompy
+import salome
+gg = salome.ImportComponentGUI("GEOM")
+
+# create DividedDisk object
+divideddisk = geompy.MakeDividedDisk(100, 50)
+
+# add object in the study
+id_divideddisk = geompy.addToStudy(divideddisk,"DividedDisk")
+
+# display divideddisk
+gg.createAndDisplayGO(id_divideddisk)
+\endcode
+
<!--@@ insert new functions before this line @@ do not remove this line @@-->
*/
in double theR2, in double theW2, in double theL2,
in double theRF, in boolean theHexMesh,
in GEOM_Object theP1, in GEOM_Object theP2, in GEOM_Object theP3);
+ /*!
+ * This function allows to create a disk already divided into blocks. It
+ * can be use to create divided pipes for later meshing in hexaedra.
+ * \param theR Radius of the disk
+ * \param theRatio Relative size of the central square diagonal against the disk diameter
+ * \return New GEOM_Object, containing the created shape.
+ */
+ GEOM_Object MakeDividedDisk (in double theR, in double theRatio);
+
/*@@ insert new functions before this line @@ do not remove this line @@*/
};
in double theRF, in boolean theHexMesh,
in GEOM_Object theP1, in GEOM_Object theP2, in GEOM_Object theP3);
+ GEOM_Object MakeDividedDisk (in double theR, in double theRatio);
+
/*@@ insert new functions before this line @@ do not remove this line @@*/
};
};
</outParameter-list>
<DataStream-list></DataStream-list>
</component-service>
+ <component-service>
+ <service-name>MakeDividedDisk</service-name>
+ <service-author></service-author>
+ <service-version></service-version>
+ <service-comment>unknown</service-comment>
+ <service-by-default>0</service-by-default>
+ <inParameter-list>
+ <inParameter>
+ <inParameter-name>theR</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>Radius of the disk</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theRatio</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>Relative size of the central square diagonal against the disk diameter</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM_Object</outParameter-type>
+ <outParameter-comment>Result object</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
<!-- @@ insert new functions before this line @@ do not remove this line @@ -->
</component-service-list>
</component-interface-list>
ADVANCED_RESOURCES += dlg_pipetshapefilletl1.png dlg_pipetshapefilletr1.png dlg_pipetshapefilletw1.png
ADVANCED_RESOURCES += dlg_pipetshapefilletl2.png dlg_pipetshapefilletr2.png dlg_pipetshapefilletw2.png
ADVANCED_RESOURCES += dlg_pipetshapefilletrf.png
+#ADVANCED_RESOURCES += divideddisk.png divideddisk_r_ratio.png tree_divideddisk.png
##@@ insert new functions before this line @@ do not remove this line @@##
dist_salomeres_DATA += $(ADVANCED_RESOURCES)
#include <SalomeApp_Application.h>
#include "AdvancedGUI_PipeTShapeDlg.h"
+#include "AdvancedGUI_DividedDiskDlg.h"
//@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@//
#include <QDialog>
// case GEOMOp::OpPipeTShapeGroups:
// aDlg = new AdvancedGUI_PipeTShapeGroupsDlg( getGeometryGUI(), parent );
// break;
+ case GEOMOp::OpDividedDisk:
+ aDlg = new AdvancedGUI_DividedDiskDlg( getGeometryGUI(), parent );
+ break;
//@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@//
default:
app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) );
ADVANCED_INCLUDES =
ADVANCED_INCLUDES += AdvancedGUI_PipeTShapeDlg.h
+ADVANCED_INCLUDES += AdvancedGUI_DividedDiskDlg.h
##@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@ do not remove this line @@##
salomeinclude_HEADERS += $(ADVANCED_INCLUDES)
ADVANCED_SOURCES =
ADVANCED_SOURCES += AdvancedGUI_PipeTShapeDlg.h AdvancedGUI_PipeTShapeDlg.cxx
+ADVANCED_SOURCES += AdvancedGUI_DividedDiskDlg.h AdvancedGUI_DividedDiskDlg.cxx
##@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@ do not remove this line @@##
dist_libAdvancedGUI_la_SOURCES += $(ADVANCED_SOURCES)
ADVANCED_MOC_FILES =
ADVANCED_MOC_FILES += AdvancedGUI_PipeTShapeDlg_moc.cxx
+ADVANCED_MOC_FILES += AdvancedGUI_DividedDiskDlg_moc.cxx
##@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@ do not remove this line @@##
MOC_FILES += $(ADVANCED_MOC_FILES)
<translation>pipetshapegroups.png</translation>
</message>
-->
+ <message>
+ <source>ICON_DLG_DIVIDEDDISK_R_RATIO</source>
+ <translation>divideddisk_r_ratio.png</translation>
+ </message>
+ <message>
+ <source>ICO_DIVIDEDDISK</source>
+ <translation>divideddisk.png</translation>
+ </message>
+ <message>
+ <source>ICON_OBJBROWSER_ADVANCED_202</source>
+ <translation>tree_divideddisk.png</translation>
+ </message>
<!-- @@ insert new functions before this line @@ do not remove this line @@ -->
</context>
</TS>
case GEOMOp::OpAdvancedNoOp: // NO OPERATION (advanced operations base)
case GEOMOp::OpPipeTShape: // MENU NEW ENTITY - ADVANCED - PIPE TSHAPE
// case GEOMOp::OpPipeTShapeGroups: // MENU NEW ENTITY - ADVANCED - PIPE TSHAPE GROUPS
+ case GEOMOp::OpDividedDisk: // MENU NEW ENTITY - ADVANCED - DIVIDEDDISK
//@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@ do not remove this line @@ do not remove this line @@//
libName = "AdvancedGUI";
break;
"Geometry:Decrease number of isolines");
// createGeomAction( GEOMOp::OpPipeTShapeGroups, "PIPETSHAPEGROUPS" );
+ createGeomAction( GEOMOp::OpDividedDisk, "DIVIDEDDISK" );
//@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@ do not remove this line @@ do not remove this line @@//
// ---- create menus --------------------------
createMenu( GEOMOp::OpFilling, genId, -1 );
createMenu( GEOMOp::OpPipe, genId, -1 );
-// int advId = createMenu( tr( "MEN_ADVANCED" ), newEntId, -1 );
+ int advId = createMenu( tr( "MEN_ADVANCED" ), newEntId, -1 );
// createMenu( GEOMOp::OpPipeTShape, advId, -1 );
// createMenu( GEOMOp::OpPipeTShapeGroups, advId, -1 );
+ createMenu( GEOMOp::OpDividedDisk, advId, -1 );
//@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@ do not remove this line @@ do not remove this line @@//
createMenu( separator(), newEntId, -1 );
#ifdef WITH_OPENCV
createTool( GEOMOp::OpFeatureDetect, picturesTbId );
#endif
-
+
+ int advancedTbId = createTool( tr( "TOOL_ADVANCED" ) );
+ createTool( GEOMOp::OpDividedDisk, advancedTbId );
//@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@ do not remove this line @@ do not remove this line @@//
// ---- create popup menus --------------------------
OpAdvancedNoOp = 10000, // NO OPERATION (advanced operations base)
OpPipeTShape = 10001, // MENU NEW ENTITY - ADVANCED - PIPE TSHAPE
// OpPipeTShapeGroups = 10002, // MENU NEW ENTITY - ADVANCED - PIPE TSHAPE GROUPS
+ OpDividedDisk = 10003, // MENU NEW ENTITY - ADVANCED - DIVIDEDDISK
//@@ insert new functions before this line @@ do not remove this line @@//
};
}
#include <GEOMImpl_MeasureDriver.hxx>
// Advanced operations
#include <GEOMImpl_PipeTShapeDriver.hxx>
+#include <GEOMImpl_DividedDiskDriver.hxx>
/*@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@*/
//=============================================================================
// Advanced operations
TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PipeTShapeDriver::GetID(), new GEOMImpl_PipeTShapeDriver());
+ TFunction_DriverTable::Get()->AddDriver(GEOMImpl_DividedDiskDriver::GetID(), new GEOMImpl_DividedDiskDriver());
/*@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@*/
SetEngine(this);
#include "GEOMImpl_PipeTShapeDriver.hxx"
#include "GEOMImpl_IPipeTShape.hxx"
+#include <GEOMImpl_DividedDiskDriver.hxx>
+#include <GEOMImpl_IDividedDisk.hxx>
/*@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@*/
#include <TopExp.hxx>
return aSeq;
}
+//=============================================================================
+/*!
+ * This function allows to create a disk already divided into blocks. It can be
+ * use to create divided pipes for later meshing in hexaedra.
+ * \param theR Radius of the disk
+ * \param theRatio Relative size of the central square diagonal against the disk diameter
+ * \return New GEOM_Object, containing the created shape.
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_IAdvancedOperations::MakeDividedDisk (double theR, double theRatio)
+{
+ SetErrorCode(KO);
+
+ //Add a new object
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_DIVIDEDDISK);
+
+ //Add a new shape function with parameters
+ Handle(GEOM_Function) aFunction = aShape->AddFunction(GEOMImpl_DividedDiskDriver::GetID(), DIVIDEDDISK_R_RATIO);
+ if (aFunction.IsNull()) return NULL;
+
+ //Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != GEOMImpl_DividedDiskDriver::GetID()) return NULL;
+
+ GEOMImpl_IDividedDisk aData (aFunction);
+
+ aData.SetR(theR);
+ aData.SetRatio(theRatio);
+
+ //Compute the resulting value
+ try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+ OCC_CATCH_SIGNALS;
+#endif
+ if (!GetSolver()->ComputeFunction(aFunction)) {
+ SetErrorCode("DividedDisk 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) << aShape << " = geompy.MakeDividedDisk(" << theR << ", " << theRatio << ")";
+
+ SetErrorCode(OK);
+
+ return aShape;
+}
/*@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@*/
Handle(GEOM_Object) P1 = 0,
Handle(GEOM_Object) P2 = 0,
Handle(GEOM_Object) P3 = 0);
+ Standard_EXPORT Handle(GEOM_Object) MakeDividedDisk (double theR, double theRatio);
/*@@ insert new functions before this line @@ do not remove this line @@*/
};
#endif
// Advanced functions (base = 200)
#define ADVANCED_BASE 200 // NO OPERATION (advanced operations base)
#define GEOM_TSHAPE 201
+#define GEOM_DIVIDEDDISK 202
/*@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@*/
// Advanced functions sub-operations codes
#define TSHAPE_BASIC 1
#define TSHAPE_CHAMFER 2
#define TSHAPE_FILLET 3
+#define DIVIDEDDISK_R_RATIO 1
/*@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@*/
ADVANCED_INCLUDES =
ADVANCED_INCLUDES += GEOMImpl_IPipeTShape.hxx GEOMImpl_PipeTShapeDriver.hxx
+ADVANCED_INCLUDES += GEOMImpl_IDividedDisk.hxx GEOMImpl_DividedDiskDriver.hxx
##@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@##
salomeinclude_HEADERS += $(ADVANCED_INCLUDES)
ADVANCED_SOURCES =
ADVANCED_SOURCES += GEOMImpl_PipeTShapeDriver.cxx
+ADVANCED_SOURCES += GEOMImpl_DividedDiskDriver.cxx
##@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@##
dist_libGEOMimpl_la_SOURCES += $(ADVANCED_SOURCES)
return aSeq._retn();
}
+//=============================================================================
+/*!
+ * This function allows to create a disk already divided into blocks. It can be
+ * use to create divided pipes for later meshing in hexaedra.
+ * \param theR Radius of the disk
+ * \param theRatio Relative size of the central square diagonal against the disk diameter
+ * \return New GEOM_Object, containing the created shape.
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_IAdvancedOperations_i::MakeDividedDisk (CORBA::Double theR, CORBA::Double theRatio)
+{
+ GEOM::GEOM_Object_var aGEOMObject;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Create the DividedDisk
+ Handle(GEOM_Object) anObject = GetOperations()->MakeDividedDisk(theR, theRatio);
+ if (!GetOperations()->IsDone() || anObject.IsNull())
+ return aGEOMObject._retn();
+
+ return GetObject(anObject);
+}
+
/*@@ insert new functions before this line @@ do not remove this line @@*/
CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
CORBA::Double theRF, CORBA::Boolean theHexMesh,
GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3);
+ GEOM::GEOM_Object_ptr MakeDividedDisk (CORBA::Double theR, CORBA::Double theRatio);
/*@@ insert new functions before this line @@ do not remove this line @@*/
::GEOMImpl_IAdvancedOperations* GetOperations()
return aSeqPtr->_this();
}
+//=============================================================================
+// MakeDividedDisk
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeDividedDisk (CORBA::Double theR, CORBA::Double theRatio)
+{
+ beginService( " GEOM_Superv_i::MakeDividedDisk" );
+ MESSAGE("GEOM_Superv_i::MakeDividedDisk");
+ getAdvancedOp();
+ GEOM::GEOM_Object_ptr anObj = myAdvancedOp->MakeDividedDisk(theR, theRatio);
+ endService( " GEOM_Superv_i::MakeDividedDisk" );
+ return anObj;
+}
+
/*@@ insert new functions before this line @@ do not remove this line @@*/
//=====================================================================================
CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
CORBA::Double theRF, CORBA::Boolean theHexMesh,
GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3);
+ GEOM::GEOM_Object_ptr MakeDividedDisk (CORBA::Double theR, CORBA::Double theRatio);
/*@@ insert new functions before this line @@ do not remove this line @@*/
private:
if Parameters: anObj[0].SetParameters(Parameters)
return anObj
+ ## This function allows to create a disk already divided into blocks. It
+ # can be use to create divided pipes for later meshing in hexaedra.
+ # @param theR Radius of the disk
+ # @param theRatio Relative size of the central square diagonal against the disk diameter
+ # @return New GEOM_Object, containing the created shape.
+ #
+ # @ref tui_creation_divideddisk "Example"
+ def MakeDividedDisk(self, theR, theRatio):
+ theR, theRatio, Parameters = ParseParameters(theR, theRatio)
+ anObj = self.AdvOp.MakeDividedDisk(theR, theRatio)
+ RaiseIfFailed("MakeDividedDisk", self.AdvOp)
+ if Parameters: anObj.SetParameters(Parameters)
+ return anObj
+
#@@ insert new functions before this line @@ do not remove this line @@#
# end of l4_advanced