case GEOMOp::OpFillet2d: // MENU OPERATION - FILLET 2D
case GEOMOp::OpFillet1d: // MENU OPERATION - FILLET 1D
case GEOMOp::OpSharedShapes: // MENU OPERATION - GET SHARED SHAPES
+ case GEOMOp::OpExtrudedBoss: // MENU OPERATION - EXTRUDED BOSS
+ case GEOMOp::OpExtrudedCut: // MENU OPERATION - EXTRUDED CUT
libName = "OperationGUI";
break;
case GEOMOp::OpSewing: // MENU REPAIR - SEWING
//createGeomAction( GEOMOp::OpClipping, "CLIPPING" );
createGeomAction( GEOMOp::OpShapesOnShape, "GET_SHAPES_ON_SHAPE" );
createGeomAction( GEOMOp::OpSharedShapes, "GET_SHARED_SHAPES" );
+ createGeomAction( GEOMOp::OpExtrudedCut, "EXTRUDED_CUT" );
+ createGeomAction( GEOMOp::OpExtrudedBoss, "EXTRUDED_BOSS" );
createGeomAction( GEOMOp::OpFillet1d, "FILLET_1D" );
createGeomAction( GEOMOp::OpFillet2d, "FILLET_2D" );
createMenu( GEOMOp::OpArc, basicId, -1 );
createMenu( GEOMOp::OpCurve, basicId, -1 );
createMenu( separator(), basicId, -1 );
+ createMenu( GEOMOp::Op2dSketcher, basicId, -1 );
+ createMenu( GEOMOp::Op3dSketcher, basicId, -1 );
createMenu( GEOMOp::OpVector, basicId, -1 );
createMenu( GEOMOp::OpPlane, basicId, -1 );
createMenu( GEOMOp::OpLCS, basicId, -1 );
createMenu( GEOMOp::OpCone, primId, -1 );
createMenu( GEOMOp::OpRectangle, primId, -1 );
createMenu( GEOMOp::OpDisk, primId, -1 );
+ createMenu( GEOMOp::OpPipeTShape,primId, -1 );
int genId = createMenu( tr( "MEN_GENERATION" ), newEntId, -1 );
createMenu( GEOMOp::OpPrism, genId, -1 );
createMenu( GEOMOp::OpFilling, genId, -1 );
createMenu( GEOMOp::OpPipe, genId, -1 );
- int advId = createMenu( tr( "MEN_ADVANCED" ), newEntId, -1 );
- createMenu( GEOMOp::OpPipeTShape, advId, -1 );
+// int advId = createMenu( tr( "MEN_ADVANCED" ), newEntId, -1 );
+// createMenu( GEOMOp::OpPipeTShape, advId, -1 );
// createMenu( GEOMOp::OpPipeTShapeGroups, 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 );
- createMenu( GEOMOp::Op2dSketcher, newEntId, -1 );
- createMenu( GEOMOp::Op3dSketcher, newEntId, -1 );
-
- createMenu( separator(), newEntId, -1 );
-
createMenu( GEOMOp::OpExplode, newEntId, -1 );
int buildId = createMenu( tr( "MEN_BUILD" ), newEntId, -1 );
createMenu( GEOMOp::OpFillet2d, operId, -1 );
createMenu( GEOMOp::OpFillet3d, operId, -1 );
createMenu( GEOMOp::OpChamfer, operId, -1 );
+ createMenu( GEOMOp::OpExtrudedBoss, operId, -1 );
+ createMenu( GEOMOp::OpExtrudedCut, operId, -1 );
//createMenu( GEOMOp::OpClipping, operId, -1 );
int repairId = createMenu( tr( "MEN_REPAIR" ), -1, -1, 10 );
*/
// ---- create toolbars --------------------------
-
+
int basicTbId = createTool( tr( "TOOL_BASIC" ) );
- createTool( GEOMOp::OpPoint, basicTbId );
- createTool( GEOMOp::OpLine, basicTbId );
- createTool( GEOMOp::OpCircle, basicTbId );
- createTool( GEOMOp::OpEllipse, basicTbId );
- createTool( GEOMOp::OpArc, basicTbId );
- createTool( GEOMOp::OpCurve, basicTbId );
- createTool( GEOMOp::OpVector, basicTbId );
- createTool( GEOMOp::OpPlane, basicTbId );
- createTool( GEOMOp::OpLCS, basicTbId );
+ createTool( GEOMOp::OpPoint, basicTbId );
+ createTool( GEOMOp::OpLine, basicTbId );
+ createTool( GEOMOp::OpCircle, basicTbId );
+ createTool( GEOMOp::OpEllipse, basicTbId );
+ createTool( GEOMOp::OpArc, basicTbId );
+ createTool( GEOMOp::OpCurve, basicTbId );
+ createTool( GEOMOp::OpVector, basicTbId );
+ createTool( GEOMOp::Op2dSketcher, basicTbId ); //rnc
+ createTool( GEOMOp::Op3dSketcher, basicTbId ); //rnc
+ createTool( GEOMOp::OpPlane, basicTbId );
+ createTool( GEOMOp::OpLCS, basicTbId );
createTool( GEOMOp::OpOriginAndVectors, basicTbId );
-
+
+// int sketchTbId = createTool( tr( "TOOL_SKETCH" ) );
+// createTool( GEOMOp::Op2dSketcher, sketchTbId );
+// createTool( GEOMOp::Op3dSketcher, sketchTbId );
+
int primTbId = createTool( tr( "TOOL_PRIMITIVES" ) );
- createTool( GEOMOp::OpBox, primTbId );
- createTool( GEOMOp::OpCylinder, primTbId );
- createTool( GEOMOp::OpSphere, primTbId );
- createTool( GEOMOp::OpTorus, primTbId );
- createTool( GEOMOp::OpCone, primTbId );
- createTool( GEOMOp::OpRectangle, primTbId );
- createTool( GEOMOp::OpDisk, primTbId );
-
+ createTool( GEOMOp::OpBox, primTbId );
+ createTool( GEOMOp::OpCylinder, primTbId );
+ createTool( GEOMOp::OpSphere, primTbId );
+ createTool( GEOMOp::OpTorus, primTbId );
+ createTool( GEOMOp::OpCone, primTbId );
+ createTool( GEOMOp::OpRectangle, primTbId );
+ createTool( GEOMOp::OpDisk, primTbId );
+ createTool( GEOMOp::OpPipeTShape, primTbId ); //rnc
+
+// int advancedTbId = createTool( tr( "TOOL_ADVANCED" ) ); //rnc
+// createTool( GEOMOp::OpPipeTShape, advancedTbId );
+
int boolTbId = createTool( tr( "TOOL_BOOLEAN" ) );
- createTool( GEOMOp::OpFuse, boolTbId );
- createTool( GEOMOp::OpCommon, boolTbId );
- createTool( GEOMOp::OpCut, boolTbId );
- createTool( GEOMOp::OpSection, boolTbId );
-
- int genTbId = createTool( tr( "TOOL_GENERATION" ) );
+ createTool( GEOMOp::OpFuse, boolTbId );
+ createTool( GEOMOp::OpCommon, boolTbId );
+ createTool( GEOMOp::OpCut, boolTbId );
+ createTool( GEOMOp::OpSection, boolTbId );
+
+ int genTbId = createTool( tr( "TOOL_GENERATION" ) );
createTool( GEOMOp::OpPrism, genTbId );
createTool( GEOMOp::OpRevolution, genTbId );
createTool( GEOMOp::OpFilling, genTbId );
createTool( GEOMOp::OpPipe, genTbId );
-
+
int transTbId = createTool( tr( "TOOL_TRANSFORMATION" ) );
createTool( GEOMOp::OpTranslate, transTbId );
createTool( GEOMOp::OpRotate, transTbId );
createTool( separator(), transTbId );
createTool( GEOMOp::OpMultiTranslate, transTbId );
createTool( GEOMOp::OpMultiRotate, transTbId );
-
+
int operTbId = createTool( tr( "TOOL_OPERATIONS" ) );
- createTool( GEOMOp::Op2dSketcher, operTbId );
- createTool( GEOMOp::Op3dSketcher, operTbId );
- createTool( separator(), operTbId );
createTool( GEOMOp::OpExplode, operTbId );
- createTool( separator(), operTbId );
-#ifdef WITH_OPENCV
- createTool( GEOMOp::OpFeatureDetect, operTbId );
-#endif
- createTool( GEOMOp::OpPictureImport, operTbId );
- createTool( separator(), operTbId );
-
createTool( GEOMOp::OpPartition, operTbId );
createTool( GEOMOp::OpArchimede, operTbId );
createTool( GEOMOp::OpShapesOnShape, operTbId );
createTool( GEOMOp::OpSharedShapes, operTbId );
- createTool( separator(), operTbId );
- createTool( GEOMOp::OpFillet1d, operTbId );
- createTool( GEOMOp::OpFillet2d, operTbId );
- createTool( GEOMOp::OpFillet3d, operTbId );
- createTool( GEOMOp::OpChamfer, operTbId );
-
+
+ int featTbId = createTool( tr( "TOOL_FEATURES" ) );
+ createTool( GEOMOp::OpFillet1d, featTbId );
+ createTool( GEOMOp::OpFillet2d, featTbId );
+ createTool( GEOMOp::OpFillet3d, featTbId );
+ createTool( GEOMOp::OpChamfer, featTbId );
+ createTool( GEOMOp::OpExtrudedBoss, featTbId );
+ createTool( GEOMOp::OpExtrudedCut, featTbId );
+
int buildTbId = createTool( tr( "TOOL_BUILD" ) );
createTool( GEOMOp::OpEdge, buildTbId );
createTool( GEOMOp::OpWire, buildTbId );
createTool( GEOMOp::OpCheckShape, measureTbId );
createTool( GEOMOp::OpCheckCompound, measureTbId );
createTool( GEOMOp::OpCheckSelfInters, measureTbId );
+
+ int picturesTbId = createTool( tr( "TOOL_PICTURES" ) );
+ createTool( GEOMOp::OpPictureImport, picturesTbId );
+ #ifdef WITH_OPENCV
+ createTool( GEOMOp::OpFeatureDetect, picturesTbId );
+ #endif
- int advancedTbId = createTool( tr( "TOOL_ADVANCED" ) );
- createTool( GEOMOp::OpPipeTShape, 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 --------------------------
}
}
+/*!
+ \brief Check if this object is can't be renamed in place
+
+ This method can be re-implemented in the subclasses.
+ Return true in case if object isn't reference or component (module root).
+
+ \param id column id
+ \return \c true if the item can be renamed by the user in place (e.g. in the Object browser)
+*/
+bool GeometryGUI::renameAllowed( const QString& entry) const {
+
+ SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
+ SalomeApp_Study* appStudy = app ? dynamic_cast<SalomeApp_Study*>( app->activeStudy() ) : 0;
+ SalomeApp_DataObject* obj = appStudy ? dynamic_cast<SalomeApp_DataObject*>(appStudy->findObjectByEntry(entry)) : 0;
+
+ return (app && appStudy && obj && !appStudy->isComponent(entry) && !obj->isReference());
+}
+
+
/*!
Rename object by entry.
\param entry entry of the object
\brief Return \c true if rename operation finished successfully, \c false otherwise.
*/
bool GeometryGUI::renameObject( const QString& entry, const QString& name) {
-
- bool appRes = SalomeApp_Module::renameObject(entry,name);
- if( !appRes )
- return false;
-
+
bool result = false;
-
+
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication());
SalomeApp_Study* appStudy = app ? dynamic_cast<SalomeApp_Study*>( app->activeStudy() ) : 0;
-
+
if(!appStudy)
return result;
-
+
_PTR(Study) aStudy = appStudy->studyDS();
-
+
if(!aStudy)
return result;
+ bool aLocked = (_PTR(AttributeStudyProperties)(appStudy->studyDS()->GetProperties()))->IsLocked();
+ if ( aLocked ) {
+ SUIT_MessageBox::warning ( app->desktop(), QObject::tr("WRN_WARNING"), QObject::tr("WRN_STUDY_LOCKED") );
+ return result;
+ }
+
_PTR(SObject) obj ( aStudy->FindObjectID(qPrintable(entry)) );
_PTR(GenericAttribute) anAttr;
if ( obj ) {
}
return result;
}
+