+//=======================================================================
+// function : GeometryGUI::initialize()
+// purpose : Called when GEOM module is created
+//=======================================================================
+void GeometryGUI::initialize( CAM_Application* app )
+{
+ SalomeApp_Module::initialize( app );
+
+ // ----- create actions --------------
+
+ createGeomAction( GEOMOp::OpImport, "IMPORT", "", Qt::ControlModifier + Qt::Key_I );
+ createGeomAction( GEOMOp::OpExport, "EXPORT", "", Qt::ControlModifier + Qt::Key_E );
+
+ createGeomAction( GEOMOp::OpDelete, "DELETE", "", Qt::Key_Delete );
+
+ createGeomAction( GEOMOp::OpPoint, "POINT" );
+ createGeomAction( GEOMOp::OpLine, "LINE" );
+ createGeomAction( GEOMOp::OpCircle, "CIRCLE" );
+ createGeomAction( GEOMOp::OpEllipse, "ELLIPSE" );
+ createGeomAction( GEOMOp::OpArc, "ARC" );
+ createGeomAction( GEOMOp::OpCurve, "CURVE" );
+ createGeomAction( GEOMOp::OpVector, "VECTOR" );
+ createGeomAction( GEOMOp::OpPlane, "PLANE" );
+ createGeomAction( GEOMOp::OpLCS, "LOCAL_CS" );
+ createGeomAction( GEOMOp::OpOriginAndVectors, "ORIGIN_AND_VECTORS" );
+
+ createGeomAction( GEOMOp::OpBox, "BOX" );
+ createGeomAction( GEOMOp::OpCylinder, "CYLINDER" );
+ createGeomAction( GEOMOp::OpSphere, "SPHERE" );
+ createGeomAction( GEOMOp::OpTorus, "TORUS" );
+ createGeomAction( GEOMOp::OpCone, "CONE" );
+ createGeomAction( GEOMOp::OpRectangle, "RECTANGLE" );
+ createGeomAction( GEOMOp::OpDisk, "DISK" );
+
+ createGeomAction( GEOMOp::OpPrism, "EXTRUSION" );
+ createGeomAction( GEOMOp::OpRevolution, "REVOLUTION" );
+ createGeomAction( GEOMOp::OpFilling, "FILLING" );
+ createGeomAction( GEOMOp::OpPipe, "PIPE" );
+
+ createGeomAction( GEOMOp::OpGroupCreate, "GROUP_CREATE" );
+ createGeomAction( GEOMOp::OpGroupEdit, "GROUP_EDIT" );
+
+ createGeomAction( GEOMOp::OpReimport, "RELOAD_IMPORTED" );
+
+ createGeomAction( GEOMOp::OpQuadFace, "Q_FACE" );
+ createGeomAction( GEOMOp::OpHexaSolid, "HEX_SOLID" );
+
+ createGeomAction( GEOMOp::Op2dSketcher, "SKETCH" );
+ createGeomAction( GEOMOp::Op3dSketcher, "3DSKETCH" );
+ createGeomAction( GEOMOp::OpExplode, "EXPLODE" );
+#ifdef WITH_OPENCV
+ createGeomAction( GEOMOp::OpFeatureDetect,"FEATURE_DETECTION" );
+#endif
+ createGeomAction( GEOMOp::OpPictureImport,"PICTURE_IMPORT" );
+
+ createGeomAction( GEOMOp::OpEdge, "EDGE" );
+ createGeomAction( GEOMOp::OpWire, "WIRE" );
+ createGeomAction( GEOMOp::OpFace, "FACE" );
+ createGeomAction( GEOMOp::OpShell, "SHELL" );
+ createGeomAction( GEOMOp::OpSolid, "SOLID" );
+ createGeomAction( GEOMOp::OpCompound, "COMPOUND" );
+
+ createGeomAction( GEOMOp::OpFuse, "FUSE" );
+ createGeomAction( GEOMOp::OpCommon, "COMMON" );
+ createGeomAction( GEOMOp::OpCut, "CUT" );
+ createGeomAction( GEOMOp::OpSection, "SECTION" );
+
+ createGeomAction( GEOMOp::OpTranslate, "TRANSLATION" );
+ createGeomAction( GEOMOp::OpRotate, "ROTATION" );
+ createGeomAction( GEOMOp::OpChangeLoc, "MODIFY_LOCATION" );
+ createGeomAction( GEOMOp::OpMirror, "MIRROR" );
+ createGeomAction( GEOMOp::OpScale, "SCALE" );
+ createGeomAction( GEOMOp::OpOffset, "OFFSET" );
+ createGeomAction( GEOMOp::OpProjection, "PROJECTION" );
+ createGeomAction( GEOMOp::OpMultiTranslate, "MUL_TRANSLATION" );
+ createGeomAction( GEOMOp::OpMultiRotate, "MUL_ROTATION" );
+
+ createGeomAction( GEOMOp::OpPartition, "PARTITION" );
+ createGeomAction( GEOMOp::OpArchimede, "ARCHIMEDE" );
+ createGeomAction( GEOMOp::OpFillet3d, "FILLET" );
+ createGeomAction( GEOMOp::OpChamfer, "CHAMFER" );
+ //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" );
+
+ createGeomAction( GEOMOp::OpMultiTransform, "MUL_TRANSFORM" );
+ createGeomAction( GEOMOp::OpExplodeBlock, "EXPLODE_BLOCKS" );
+ createGeomAction( GEOMOp::OpPropagate, "PROPAGATE" );
+
+ createGeomAction( GEOMOp::OpSewing, "SEWING" );
+ createGeomAction( GEOMOp::OpGlueFaces, "GLUE_FACES" );
+ createGeomAction( GEOMOp::OpGlueEdges, "GLUE_EDGES" );
+ createGeomAction( GEOMOp::OpLimitTolerance, "LIMIT_TOLERANCE" );
+ createGeomAction( GEOMOp::OpSuppressFaces, "SUPPRESS_FACES" );
+ createGeomAction( GEOMOp::OpSuppressHoles, "SUPPERSS_HOLES" );
+ createGeomAction( GEOMOp::OpShapeProcess, "SHAPE_PROCESS" );
+ createGeomAction( GEOMOp::OpCloseContour, "CLOSE_CONTOUR" );
+ createGeomAction( GEOMOp::OpRemoveIntWires, "SUPPRESS_INT_WIRES" );
+ createGeomAction( GEOMOp::OpAddPointOnEdge, "POINT_ON_EDGE" );
+ createGeomAction( GEOMOp::OpFreeBoundaries, "CHECK_FREE_BNDS" );
+ createGeomAction( GEOMOp::OpFreeFaces, "CHECK_FREE_FACES" );
+ createGeomAction( GEOMOp::OpOrientation, "CHANGE_ORIENTATION" );
+ createGeomAction( GEOMOp::OpRemoveExtraEdges, "REMOVE_EXTRA_EDGES" );
+
+ createGeomAction( GEOMOp::OpPointCoordinates, "POINT_COORDS" );
+ createGeomAction( GEOMOp::OpProperties, "BASIC_PROPS" );
+ createGeomAction( GEOMOp::OpCenterMass, "MASS_CENTER" );
+ createGeomAction( GEOMOp::OpInertia, "INERTIA" );
+ createGeomAction( GEOMOp::OpNormale, "NORMALE" );
+ createGeomAction( GEOMOp::OpBoundingBox, "BND_BOX" );
+ createGeomAction( GEOMOp::OpMinDistance, "MIN_DIST" );
+ createGeomAction( GEOMOp::OpAngle, "MEASURE_ANGLE" );
+
+ createGeomAction( GEOMOp::OpTolerance, "TOLERANCE" );
+ createGeomAction( GEOMOp::OpWhatIs, "WHAT_IS" );
+ createGeomAction( GEOMOp::OpCheckShape, "CHECK" );
+ createGeomAction( GEOMOp::OpCheckCompound, "CHECK_COMPOUND" );
+ createGeomAction( GEOMOp::OpCheckSelfInters, "CHECK_SELF_INTERSECTIONS" );
+
+#ifdef _DEBUG_ // PAL16821
+ createGeomAction( GEOMOp::OpCheckGeom, "CHECK_GEOMETRY" );
+#endif
+
+ createGeomAction( GEOMOp::OpDisplayMode, "SHADING" );
+ createGeomAction( GEOMOp::OpShowAll, "DISPLAY_ALL" );
+ createGeomAction( GEOMOp::OpHideAll, "ERASE_ALL" );
+ createGeomAction( GEOMOp::OpShow, "DISPLAY" );
+ createGeomAction( GEOMOp::OpSwitchVectors, "VECTOR_MODE");
+ createGeomAction( GEOMOp::OpSelectVertex, "VERTEX_SEL_ONLY" ,"", 0, true );
+ createGeomAction( GEOMOp::OpSelectEdge, "EDGE_SEL_ONLY", "", 0, true );
+ createGeomAction( GEOMOp::OpSelectWire, "WIRE_SEL_ONLY", "", 0, true );
+ createGeomAction( GEOMOp::OpSelectFace, "FACE_SEL_ONLY", "", 0, true );
+ createGeomAction( GEOMOp::OpSelectShell, "SHELL_SEL_ONLY", "", 0, true );
+ createGeomAction( GEOMOp::OpSelectSolid, "SOLID_SEL_ONLY", "", 0, true );
+ createGeomAction( GEOMOp::OpSelectCompound, "COMPOUND_SEL_ONLY", "", 0, true );
+ createGeomAction( GEOMOp::OpSelectAll, "ALL_SEL_ONLY", "", 0, true );
+ createGeomAction( GEOMOp::OpShowOnly, "DISPLAY_ONLY" );
+ createGeomAction( GEOMOp::OpHide, "ERASE" );
+
+ createGeomAction( GEOMOp::OpWireframe, "POP_WIREFRAME", "", 0, true );
+ createGeomAction( GEOMOp::OpShading, "POP_SHADING", "", 0, true );
+ createGeomAction( GEOMOp::OpShadingWithEdges, "POP_SHADING_WITH_EDGES", "", 0, true );
+ createGeomAction( GEOMOp::OpTexture, "POP_TEXTURE", "", 0, true );
+ createGeomAction( GEOMOp::OpEdgeWidth, "EDGE_WIDTH");
+ createGeomAction( GEOMOp::OpIsosWidth, "ISOS_WIDTH");
+ createGeomAction( GEOMOp::OpVectors, "POP_VECTORS", "", 0, true );
+ createGeomAction( GEOMOp::OpDeflection, "POP_DEFLECTION" );
+ createGeomAction( GEOMOp::OpColor, "POP_COLOR" );
+ createGeomAction( GEOMOp::OpSetTexture, "POP_SETTEXTURE" );
+ createGeomAction( GEOMOp::OpTransparency, "POP_TRANSPARENCY" );
+ createGeomAction( GEOMOp::OpIsos, "POP_ISOS" );
+ createGeomAction( GEOMOp::OpAutoColor, "POP_AUTO_COLOR" );
+ createGeomAction( GEOMOp::OpNoAutoColor, "POP_DISABLE_AUTO_COLOR" );
+ createGeomAction( GEOMOp::OpGroupCreatePopup, "POP_CREATE_GROUP" );
+ createGeomAction( GEOMOp::OpShowChildren, "POP_SHOW_CHILDREN" );
+ createGeomAction( GEOMOp::OpHideChildren, "POP_HIDE_CHILDREN" );
+ createGeomAction( GEOMOp::OpUnpublishObject, "POP_UNPUBLISH_OBJ" );
+ createGeomAction( GEOMOp::OpPublishObject, "POP_PUBLISH_OBJ" );
+ createGeomAction( GEOMOp::OpPointMarker, "POP_POINT_MARKER" );
+ createGeomAction( GEOMOp::OpMaterialProperties, "POP_MATERIAL_PROPERTIES" );
+
+ createGeomAction( GEOMOp::OpPipeTShape, "PIPETSHAPE" );
+
+ // Create actions for increase/decrease transparency shortcuts
+ createGeomAction( GEOMOp::OpIncrTransparency, "", "", 0, false,
+ "Geometry:Increase transparency");
+ createGeomAction( GEOMOp::OpDecrTransparency, "", "", 0, false,
+ "Geometry:Decrease transparency");
+
+ // Create actions for increase/decrease number of isolines
+ createGeomAction( GEOMOp::OpIncrNbIsos, "", "", 0, false,
+ "Geometry:Increase number of isolines");
+ createGeomAction( GEOMOp::OpDecrNbIsos, "", "", 0, false,
+ "Geometry:Decrease number of isolines");
+
+// createGeomAction( GEOMOp::OpPipeTShapeGroups, "PIPETSHAPEGROUPS" );
+ //@@ 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 --------------------------
+
+ int fileId = createMenu( tr( "MEN_FILE" ), -1, -1 );
+ createMenu( separator(), fileId, 10 );
+ createMenu( GEOMOp::OpImport, fileId, 10 );
+ createMenu( GEOMOp::OpExport, fileId, 10 );
+ createMenu( separator(), fileId, -1 );
+
+ int editId = createMenu( tr( "MEN_EDIT" ), -1, -1 );
+ createMenu( GEOMOp::OpDelete, editId, -1 );
+
+ int newEntId = createMenu( tr( "MEN_NEW_ENTITY" ), -1, -1, 10 );
+
+ int basicId = createMenu( tr( "MEN_BASIC" ), newEntId, -1 );
+ createMenu( GEOMOp::OpPoint, basicId, -1 );
+ createMenu( GEOMOp::OpLine, basicId, -1 );
+ createMenu( GEOMOp::OpCircle, basicId, -1 );
+ createMenu( GEOMOp::OpEllipse, basicId, -1 );
+ 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::OpOriginAndVectors, basicId, -1 );
+
+ int primId = createMenu( tr( "MEN_PRIMITIVES" ), newEntId, -1 );
+ createMenu( GEOMOp::OpBox, primId, -1 );
+ createMenu( GEOMOp::OpCylinder, primId, -1 );
+ createMenu( GEOMOp::OpSphere, primId, -1 );
+ createMenu( GEOMOp::OpTorus, primId, -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::OpRevolution, 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 );
+// 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 );
+
+ int groupId = createMenu( tr( "MEN_GROUP" ), newEntId, -1 );
+ createMenu( GEOMOp::OpGroupCreate, groupId, -1 );
+ createMenu( GEOMOp::OpGroupEdit, groupId, -1 );
+
+ createMenu( separator(), newEntId, -1 );
+
+ int blocksId = createMenu( tr( "MEN_BLOCKS" ), newEntId, -1 );
+ createMenu( GEOMOp::OpQuadFace, blocksId, -1 );
+ createMenu( GEOMOp::OpHexaSolid, blocksId, -1 );
+
+ createMenu( separator(), newEntId, -1 );
+
+ createMenu( GEOMOp::OpExplode, newEntId, -1 );
+
+ int buildId = createMenu( tr( "MEN_BUILD" ), newEntId, -1 );
+ createMenu( GEOMOp::OpEdge, buildId, -1 );
+ createMenu( GEOMOp::OpWire, buildId, -1 );
+ createMenu( GEOMOp::OpFace, buildId, -1 );
+ createMenu( GEOMOp::OpShell, buildId, -1 );
+ createMenu( GEOMOp::OpSolid, buildId, -1 );
+ createMenu( GEOMOp::OpCompound, buildId, -1 );
+
+ createMenu( separator(), newEntId, -1 );
+
+ createMenu( GEOMOp::OpPictureImport, newEntId, -1 );
+#ifdef WITH_OPENCV
+ createMenu( GEOMOp::OpFeatureDetect, newEntId, -1 );
+#endif
+
+ int operId = createMenu( tr( "MEN_OPERATIONS" ), -1, -1, 10 );
+
+ int boolId = createMenu( tr( "MEN_BOOLEAN" ), operId, -1 );
+ createMenu( GEOMOp::OpFuse, boolId, -1 );
+ createMenu( GEOMOp::OpCommon, boolId, -1 );
+ createMenu( GEOMOp::OpCut, boolId, -1 );
+ createMenu( GEOMOp::OpSection, boolId, -1 );
+
+ int transId = createMenu( tr( "MEN_TRANSFORMATION" ), operId, -1 );
+ createMenu( GEOMOp::OpTranslate, transId, -1 );
+ createMenu( GEOMOp::OpRotate, transId, -1 );
+ createMenu( GEOMOp::OpChangeLoc, transId, -1 );
+ createMenu( GEOMOp::OpMirror, transId, -1 );
+ createMenu( GEOMOp::OpScale, transId, -1 );
+ createMenu( GEOMOp::OpOffset, transId, -1 );
+ createMenu( GEOMOp::OpProjection, transId, -1 );
+ createMenu( separator(), transId, -1 );
+ createMenu( GEOMOp::OpMultiTranslate, transId, -1 );
+ createMenu( GEOMOp::OpMultiRotate, transId, -1 );
+
+ int blockId = createMenu( tr( "MEN_BLOCKS" ), operId, -1 );
+ createMenu( GEOMOp::OpMultiTransform, blockId, -1 );
+ createMenu( GEOMOp::OpExplodeBlock, blockId, -1 );
+ createMenu( GEOMOp::OpPropagate, blockId, -1 );
+
+ createMenu( separator(), operId, -1 );
+
+ createMenu( GEOMOp::OpPartition, operId, -1 );
+ createMenu( GEOMOp::OpArchimede, operId, -1 );
+ createMenu( GEOMOp::OpShapesOnShape, operId, -1 );
+ createMenu( GEOMOp::OpSharedShapes, operId, -1 );
+
+ createMenu( separator(), operId, -1 );
+
+ createMenu( GEOMOp::OpFillet1d, operId, -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 );
+ createMenu( GEOMOp::OpShapeProcess, repairId, -1 );
+ createMenu( GEOMOp::OpSuppressFaces, repairId, -1 );
+ createMenu( GEOMOp::OpCloseContour, repairId, -1 );
+ createMenu( GEOMOp::OpRemoveIntWires, repairId, -1 );
+ createMenu( GEOMOp::OpSuppressHoles, repairId, -1 );
+ createMenu( GEOMOp::OpSewing, repairId, -1 );
+ createMenu( GEOMOp::OpGlueFaces, repairId, -1 );
+ createMenu( GEOMOp::OpGlueEdges, repairId, -1 );
+ createMenu( GEOMOp::OpLimitTolerance, repairId, -1 );
+ createMenu( GEOMOp::OpAddPointOnEdge, repairId, -1 );
+ //createMenu( GEOMOp::OpFreeBoundaries, repairId, -1 );
+ //createMenu( GEOMOp::OpFreeFaces, repairId, -1 );
+ createMenu( GEOMOp::OpOrientation, repairId, -1 );
+ createMenu( GEOMOp::OpRemoveExtraEdges, repairId, -1 );
+
+ int measurId = createMenu( tr( "MEN_MEASURES" ), -1, -1, 10 );
+ createMenu( GEOMOp::OpPointCoordinates, measurId, -1 );
+ createMenu( GEOMOp::OpProperties, measurId, -1 );
+ createMenu( separator(), measurId, -1 );
+ createMenu( GEOMOp::OpCenterMass, measurId, -1 );
+ createMenu( GEOMOp::OpInertia, measurId, -1 );
+ createMenu( GEOMOp::OpNormale, measurId, -1 );
+ createMenu( separator(), measurId, -1 );
+ createMenu( GEOMOp::OpFreeBoundaries, measurId, -1 );
+ createMenu( GEOMOp::OpFreeFaces, measurId, -1 );
+ createMenu( separator(), measurId, -1 );
+
+ int dimId = createMenu( tr( "MEN_DIMENSIONS" ), measurId, -1 );
+ createMenu( GEOMOp::OpBoundingBox, dimId, -1 );
+ createMenu( GEOMOp::OpMinDistance, dimId, -1 );
+ createMenu( GEOMOp::OpAngle, dimId, -1 );
+
+ createMenu( separator(), measurId, -1 );
+ createMenu( GEOMOp::OpTolerance, measurId, -1 );
+ createMenu( separator(), measurId, -1 );
+ createMenu( GEOMOp::OpWhatIs, measurId, -1 );
+ createMenu( GEOMOp::OpCheckShape, measurId, -1 );
+ createMenu( GEOMOp::OpCheckCompound, measurId, -1 );
+ createMenu( GEOMOp::OpCheckSelfInters, measurId, -1 );
+
+#ifdef _DEBUG_ // PAL16821
+ int toolsId = createMenu( tr( "MEN_TOOLS" ), -1, -1, 50 );
+ createMenu( separator(), toolsId, -1 );
+ createMenu( GEOMOp::OpCheckGeom, toolsId, -1 );
+#endif
+
+ int viewId = createMenu( tr( "MEN_VIEW" ), -1, -1 );
+ createMenu( separator(), viewId, -1 );
+
+ int dispmodeId = createMenu( tr( "MEN_DISPLAY_MODE" ), viewId, -1 );
+ createMenu( GEOMOp::OpDisplayMode, dispmodeId, -1 );
+ createMenu( separator(), dispmodeId, -1 );
+ createMenu( GEOMOp::OpSwitchVectors, dispmodeId, -1 );
+
+ createMenu( separator(), viewId, -1 );
+ createMenu( GEOMOp::OpShowAll, viewId, -1 );
+ createMenu( GEOMOp::OpHideAll, viewId, -1 );
+ createMenu( separator(), viewId, -1 );
+ createMenu( GEOMOp::OpPublishObject, viewId, -1 );
+ createMenu( separator(), viewId, -1 );
+
+/*
+ PAL9111:
+ because of these items are accessible through object browser and viewers
+ we have removed they from main menu
+
+ createMenu( GEOMOp::OpShow, viewId, -1 );
+ createMenu( GEOMOp::OpShowOnly, viewId, -1 );
+ createMenu( GEOMOp::OpHide, viewId, -1 );
+*/
+
+ // ---- 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::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::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::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( GEOMOp::OpChangeLoc, transTbId );
+ createTool( GEOMOp::OpMirror, transTbId );
+ createTool( GEOMOp::OpScale, transTbId );
+ createTool( GEOMOp::OpOffset, transTbId );
+ createTool( GEOMOp::OpProjection, transTbId );
+ createTool( separator(), transTbId );
+ createTool( GEOMOp::OpMultiTranslate, transTbId );
+ createTool( GEOMOp::OpMultiRotate, transTbId );
+
+ int operTbId = createTool( tr( "TOOL_OPERATIONS" ) );
+ createTool( GEOMOp::OpExplode, operTbId );
+ createTool( GEOMOp::OpPartition, operTbId );
+ createTool( GEOMOp::OpArchimede, operTbId );
+ createTool( GEOMOp::OpShapesOnShape, operTbId );
+ createTool( GEOMOp::OpSharedShapes, 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::OpFace, buildTbId );
+ createTool( GEOMOp::OpShell, buildTbId );
+ createTool( GEOMOp::OpSolid, buildTbId );
+ createTool( GEOMOp::OpCompound, buildTbId );
+
+ int measureTbId = createTool( tr( "TOOL_MEASURES" ) );
+ createTool( GEOMOp::OpPointCoordinates, measureTbId );
+ createTool( GEOMOp::OpProperties, measureTbId );
+ createTool( GEOMOp::OpCenterMass, measureTbId );
+ createTool( GEOMOp::OpInertia, measureTbId );
+ createTool( GEOMOp::OpNormale, measureTbId );
+ createTool( separator(), measureTbId );
+ createTool( GEOMOp::OpBoundingBox, measureTbId );
+ createTool( GEOMOp::OpMinDistance, measureTbId );
+ createTool( GEOMOp::OpAngle, measureTbId );
+ createTool( GEOMOp::OpTolerance , measureTbId );
+ createTool( separator(), measureTbId );
+ createTool( GEOMOp::OpFreeBoundaries, measureTbId );
+ createTool( GEOMOp::OpFreeFaces, measureTbId );
+ createTool( separator(), measureTbId );
+ createTool( GEOMOp::OpWhatIs, measureTbId );
+ 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
+
+ //@@ 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 --------------------------
+
+ QString clientOCCorVTK = "(client='OCCViewer' or client='VTKViewer')";
+ QString clientOCC = "(client='OCCViewer')";
+ QString clientOCCorVTK_AndSomeVisible = clientOCCorVTK + " and selcount>0 and isVisible";
+ QString clientOCC_AndSomeVisible = clientOCC + " and selcount>0 and isVisible";
+
+ QString clientOCCorOB = "(client='ObjectBrowser' or client='OCCViewer')";
+ QString clientOCCorVTKorOB = "(client='ObjectBrowser' or client='OCCViewer' or client='VTKViewer')";
+ QString clientOCCorVTKorOB_AndSomeVisible = clientOCCorVTKorOB + " and selcount>0 and isVisible";
+ QString clientOCCorOB_AndSomeVisible = clientOCCorOB + " and selcount>0 and isVisible";
+
+ QString autoColorPrefix =
+ "(client='ObjectBrowser' or client='OCCViewer') and type='Shape' and selcount=1 and isOCC=true";
+
+ QtxPopupMgr* mgr = popupMgr();
+
+ mgr->insert( action( GEOMOp::OpDelete ), -1, -1 ); // delete
+ mgr->setRule( action( GEOMOp::OpDelete ), QString("$type in {'Shape' 'Group'} and selcount>0"), QtxPopupMgr::VisibleRule );
+ mgr->insert( action( GEOMOp::OpGroupCreatePopup ), -1, -1 ); // create group
+ mgr->setRule( action( GEOMOp::OpGroupCreatePopup ), QString("client='ObjectBrowser' and type='Shape' and selcount=1 and isOCC=true"), QtxPopupMgr::VisibleRule );
+ mgr->insert( action( GEOMOp::OpShowChildren ), -1, -1 ); // show children
+ mgr->setRule( action( GEOMOp::OpShowChildren ), QString("client='ObjectBrowser' and type='Shape' and selcount=1 and hasHiddenChildren=true"), QtxPopupMgr::VisibleRule );
+
+ mgr->insert( action( GEOMOp::OpHideChildren ), -1, -1 ); // hide children
+ mgr->setRule( action( GEOMOp::OpHideChildren ), QString("client='ObjectBrowser' and type='Shape' and selcount=1 and hasShownChildren=true"), QtxPopupMgr::VisibleRule );
+ mgr->insert( action( GEOMOp::OpGroupEdit ), -1, -1 ); // edit group
+ mgr->setRule( action( GEOMOp::OpGroupEdit ), QString("client='ObjectBrowser' and type='Group' and selcount=1 and isOCC=true"), QtxPopupMgr::VisibleRule );
+ mgr->insert( separator(), -1, -1 ); // -----------
+ dispmodeId = mgr->insert( tr( "MEN_DISPLAY_MODE" ), -1, -1 ); // display mode menu
+ mgr->insert( action( GEOMOp::OpWireframe ), dispmodeId, -1 ); // wireframe
+ mgr->setRule( action( GEOMOp::OpWireframe ), clientOCCorVTK_AndSomeVisible, QtxPopupMgr::VisibleRule );
+ mgr->setRule( action( GEOMOp::OpWireframe ), clientOCCorVTK + " and displaymode='Wireframe'", QtxPopupMgr::ToggleRule );
+ mgr->insert( action( GEOMOp::OpShading ), dispmodeId, -1 ); // shading
+ mgr->setRule( action( GEOMOp::OpShading ), clientOCCorVTK_AndSomeVisible, QtxPopupMgr::VisibleRule );
+ mgr->setRule( action( GEOMOp::OpShading ), clientOCCorVTK + " and displaymode='Shading'", QtxPopupMgr::ToggleRule );
+ mgr->insert( action( GEOMOp::OpShadingWithEdges ), dispmodeId, -1 ); // shading with edges
+ mgr->setRule( action( GEOMOp::OpShadingWithEdges ), clientOCCorVTK_AndSomeVisible, QtxPopupMgr::VisibleRule );
+ mgr->setRule( action( GEOMOp::OpShadingWithEdges ), clientOCCorVTK + " and displaymode='ShadingWithEdges'", QtxPopupMgr::ToggleRule );
+ mgr->insert( action( GEOMOp::OpTexture ), dispmodeId, -1 ); // wireframe
+ mgr->setRule( action( GEOMOp::OpTexture ), clientOCC_AndSomeVisible, QtxPopupMgr::VisibleRule );
+ mgr->setRule( action( GEOMOp::OpTexture), clientOCC + " and displaymode='Texture'", QtxPopupMgr::ToggleRule );
+ mgr->insert( separator(), dispmodeId, -1 );
+ mgr->insert( action( GEOMOp::OpVectors ), dispmodeId, -1 ); // vectors
+ mgr->setRule( action( GEOMOp::OpVectors ), clientOCCorVTK_AndSomeVisible, QtxPopupMgr::VisibleRule );
+ mgr->setRule( action( GEOMOp::OpVectors ), clientOCCorVTK + " and isVectorsMode", QtxPopupMgr::ToggleRule );
+ mgr->insert( separator(), -1, -1 ); // -----------
+ mgr->insert( action( GEOMOp::OpColor ), -1, -1 ); // color
+ mgr->setRule( action( GEOMOp::OpColor ), clientOCCorVTKorOB_AndSomeVisible + " and ($component={'GEOM'})", QtxPopupMgr::VisibleRule );
+ mgr->insert( action( GEOMOp::OpTransparency ), -1, -1 ); // transparency
+ mgr->setRule( action( GEOMOp::OpTransparency ), clientOCCorVTK_AndSomeVisible, QtxPopupMgr::VisibleRule );
+ mgr->insert( action( GEOMOp::OpIsos ), -1, -1 ); // isos
+ mgr->setRule( action( GEOMOp::OpIsos ), clientOCCorVTK_AndSomeVisible + " and selcount>0 and isVisible", QtxPopupMgr::VisibleRule );
+ mgr->insert( action( GEOMOp::OpDeflection ), -1, -1 ); // deflection
+ mgr->setRule( action( GEOMOp::OpDeflection ), clientOCCorVTK_AndSomeVisible + " and selcount>0 and isVisible", QtxPopupMgr::VisibleRule );
+ mgr->insert( action( GEOMOp::OpPointMarker ), -1, -1 ); // point marker
+ //mgr->setRule( action( GEOMOp::OpPointMarker ), QString( "selcount>0 and $typeid in {%1}" ).arg(GEOM_POINT ), QtxPopupMgr::VisibleRule );
+ mgr->setRule( action( GEOMOp::OpPointMarker ), QString( "selcount>0 and ( $typeid in {%1} or compoundOfVertices=true ) " ).arg(GEOM::VERTEX).arg(GEOM::COMPOUND), QtxPopupMgr::VisibleRule );
+ mgr->insert( action( GEOMOp::OpMaterialProperties ), -1, -1 ); // material properties
+ mgr->setRule( action( GEOMOp::OpMaterialProperties ), clientOCCorVTK_AndSomeVisible + " and ($component={'GEOM'}) and selcount>0 and isVisible", QtxPopupMgr::VisibleRule );
+ mgr->insert( action( GEOMOp::OpSetTexture ), -1, -1 ); // texture
+ mgr->setRule( action( GEOMOp::OpSetTexture ), clientOCCorOB_AndSomeVisible + " and ($component={'GEOM'})", QtxPopupMgr::VisibleRule );
+
+ int lineW = mgr->insert( tr( "MEN_LINE_WIDTH" ), -1, -1 ); // line width menu
+ mgr->insert( action( GEOMOp::OpEdgeWidth ), lineW, -1 ); // edge width
+ mgr->setRule( action( GEOMOp::OpEdgeWidth ), clientOCCorVTK_AndSomeVisible, QtxPopupMgr::VisibleRule );
+
+ mgr->insert( action( GEOMOp::OpIsosWidth ), lineW, -1 ); // isos width
+ mgr->setRule( action( GEOMOp::OpIsosWidth ), clientOCCorVTK_AndSomeVisible, QtxPopupMgr::VisibleRule );
+
+ mgr->insert( separator(), -1, -1 ); // -----------
+ mgr->insert( action( GEOMOp::OpAutoColor ), -1, -1 ); // auto color
+ mgr->setRule( action( GEOMOp::OpAutoColor ), autoColorPrefix + " and isAutoColor=false", QtxPopupMgr::VisibleRule );
+ mgr->insert( action( GEOMOp::OpNoAutoColor ), -1, -1 ); // disable auto color
+ mgr->setRule( action( GEOMOp::OpNoAutoColor ), autoColorPrefix + " and isAutoColor=true", QtxPopupMgr::VisibleRule );
+ mgr->insert( separator(), -1, -1 ); // -----------
+
+ QString canDisplay = "($component={'GEOM'}) and (selcount>0) and ({true} in $canBeDisplayed) ",
+ onlyComponent = "((type='Component') and selcount=1)",
+ rule = canDisplay + "and ((($type in {%1}) and( %2 )) or " + onlyComponent + ")",
+ types = "'Shape' 'Group'";
+
+ mgr->insert( action( GEOMOp::OpShow ), -1, -1 ); // display
+ mgr->setRule( action( GEOMOp::OpShow ), rule.arg( types ).arg( "not isVisible" ), QtxPopupMgr::VisibleRule );
+
+ mgr->insert( action( GEOMOp::OpHide ), -1, -1 ); // erase
+ mgr->setRule( action( GEOMOp::OpHide ), rule.arg( types ).arg( "isVisible" ), QtxPopupMgr::VisibleRule );
+
+ mgr->insert( action( GEOMOp::OpHideAll ), -1, -1 ); // erase All
+ mgr->setRule( action( GEOMOp::OpHideAll ), clientOCCorVTK, QtxPopupMgr::VisibleRule );
+
+ QString selectOnly = "(client='OCCViewer' or client='VTKViewer') and (selcount=0)";
+
+ int selectonlyId = mgr->insert( tr("MEN_SELECT_ONLY"), -1, -1); //select only menu
+ mgr->insert( action(GEOMOp::OpSelectVertex), selectonlyId, -1); //Vertex
+ mgr->setRule(action(GEOMOp::OpSelectVertex), selectOnly, QtxPopupMgr::VisibleRule);
+ mgr->setRule(action(GEOMOp::OpSelectVertex), selectOnly + " and selectionmode='VERTEX'", QtxPopupMgr::ToggleRule);
+ mgr->insert( action(GEOMOp::OpSelectEdge), selectonlyId, -1); //Edge
+ mgr->setRule(action(GEOMOp::OpSelectEdge), selectOnly, QtxPopupMgr::VisibleRule);
+ mgr->setRule(action(GEOMOp::OpSelectEdge), selectOnly + " and selectionmode='EDGE'", QtxPopupMgr::ToggleRule);
+ mgr->insert( action(GEOMOp::OpSelectWire), selectonlyId, -1); //Wire
+ mgr->setRule(action(GEOMOp::OpSelectWire), selectOnly, QtxPopupMgr::VisibleRule);
+ mgr->setRule(action(GEOMOp::OpSelectWire), selectOnly + " and selectionmode='WIRE'", QtxPopupMgr::ToggleRule);
+ mgr->insert( action(GEOMOp::OpSelectFace), selectonlyId, -1); //Face
+ mgr->setRule(action(GEOMOp::OpSelectFace), selectOnly, QtxPopupMgr::VisibleRule);
+ mgr->setRule(action(GEOMOp::OpSelectFace), selectOnly + " and selectionmode='FACE'", QtxPopupMgr::ToggleRule);
+ mgr->insert( action(GEOMOp::OpSelectShell), selectonlyId, -1); //Shell
+ mgr->setRule(action(GEOMOp::OpSelectShell), selectOnly, QtxPopupMgr::VisibleRule);
+ mgr->setRule(action(GEOMOp::OpSelectShell), selectOnly + " and selectionmode='SHELL'", QtxPopupMgr::ToggleRule);
+ mgr->insert( action(GEOMOp::OpSelectSolid), selectonlyId, -1); //Solid
+ mgr->setRule(action(GEOMOp::OpSelectSolid), selectOnly, QtxPopupMgr::VisibleRule);
+ mgr->setRule(action(GEOMOp::OpSelectSolid), selectOnly + " and selectionmode='SOLID'", QtxPopupMgr::ToggleRule);
+ mgr->insert( action(GEOMOp::OpSelectCompound), selectonlyId, -1); //Compound
+ mgr->setRule(action(GEOMOp::OpSelectCompound), selectOnly, QtxPopupMgr::VisibleRule);
+ mgr->setRule(action(GEOMOp::OpSelectCompound), selectOnly + " and selectionmode='COMPOUND'", QtxPopupMgr::ToggleRule);
+ mgr->insert( separator(), selectonlyId, -1);
+ mgr->insert( action(GEOMOp::OpSelectAll), selectonlyId, -1); //Clear selection filter
+ mgr->setRule(action(GEOMOp::OpSelectAll), selectOnly, QtxPopupMgr::VisibleRule);
+ mgr->setRule(action(GEOMOp::OpSelectAll), selectOnly + " and selectionmode='ALL'", QtxPopupMgr::ToggleRule);
+ mgr->insert( action(GEOMOp::OpShowOnly ), -1, -1 ); // display only
+ mgr->setRule(action(GEOMOp::OpShowOnly ), rule.arg( types ).arg( "true" ), QtxPopupMgr::VisibleRule );
+ mgr->insert( separator(), -1, -1 );
+
+ mgr->insert( separator(), -1, -1 ); // -----------
+ mgr->insert( action( GEOMOp::OpUnpublishObject ), -1, -1 ); // Unpublish object
+ mgr->setRule( action( GEOMOp::OpUnpublishObject ), QString("client='ObjectBrowser' and $type in {'Shape' 'Group'} and selcount>0"), QtxPopupMgr::VisibleRule );
+
+
+ mgr->insert( action( GEOMOp::OpPublishObject ), -1, -1 ); // Publish object
+ mgr->setRule( action( GEOMOp::OpPublishObject ), QString("client='ObjectBrowser' and isComponent=true"), QtxPopupMgr::VisibleRule );
+
+ mgr->insert( action( GEOMOp::OpReimport ), -1, -1 ); // delete
+ mgr->setRule( action( GEOMOp::OpReimport ), QString("$imported in {'true'} and selcount>0"), QtxPopupMgr::VisibleRule );
+
+ mgr->hide( mgr->actionId( action( myEraseAll ) ) );