<source>MEN_OPERATIONS</source>
<translation>Operations</translation>
</message>
+ <message>
+ <source>MEN_ORIGIN_AND_VECTORS</source>
+ <translation>Origin and Base Vectors</translation>
+ </message>
<message>
<source>MEN_PARTITION</source>
<translation>Partition</translation>
<source>GEOM_PREF_param_tol_precision</source>
<translation>Parametric tolerance precision</translation>
</message>
+ <message>
+ <source>PREF_AUTO_CREATE</source>
+ <translation>Auto create</translation>
+ </message>
<message>
<source>PREF_DISPLAY_MODE</source>
<translation>Default display mode</translation>
<translation>Color of free boundaries</translation>
</message>
<message>
- <source>PREF_GROUP_AUTO_CREATED_OBJECTS</source>
- <translation>Automatically created objects</translation>
+ <source>PREF_GROUP_ORIGIN_AND_BASE_VECTORS</source>
+ <translation>Origin and base vectors</translation>
</message>
<message>
<source>PREF_GROUP_GENERAL</source>
<translation>Type</translation>
</message>
<message>
- <source>PREF_VECTORS_LENGTH</source>
- <translation>Length of vectors</translation>
+ <source>PREF_BASE_VECTORS_LENGTH</source>
+ <translation>Length of base vectors</translation>
</message>
<message>
<source>PREF_WIREFRAME_COLOR</source>
<source>STB_OFFSET</source>
<translation>Offset surface</translation>
</message>
+ <message>
+ <source>STB_ORIGIN_AND_VECTORS</source>
+ <translation>Create an origin and base Vectors</translation>
+ </message>
<message>
<source>STB_PARTITION</source>
<translation>Make a partition</translation>
<source>TOP_OFFSET</source>
<translation>Offset surface</translation>
</message>
+ <message>
+ <source>TOP_ORIGIN_AND_VECTORS</source>
+ <translation>Create an origin and base Vectors</translation>
+ </message>
<message>
<source>TOP_PARTITION</source>
<translation>Partition</translation>
QString libName;
// find corresponding GUI library
switch ( id ) {
+ case GEOMOp::OpOriginAndVectors: // MENU BASIC - ORIGIN AND BASE VECTORS
+ createOriginAndBaseVectors(); // internal operation
+ return;
case GEOMOp::OpImport: // MENU FILE - IMPORT
case GEOMOp::OpExport: // MENU FILE - EXPORT
case GEOMOp::OpSelectVertex: // POPUP MENU - SELECT ONLY - VERTEX
case GEOMOp::OpVector: // MENU BASIC - VECTOR
case GEOMOp::OpPlane: // MENU BASIC - PLANE
case GEOMOp::OpCurve: // MENU BASIC - CURVE
- case GEOMOp::OpLCS: // MENU BASIC - REPAIR
+ case GEOMOp::OpLCS: // MENU BASIC - LOCAL COORDINATE SYSTEM
libName = "BasicGUI";
break;
case GEOMOp::OpBox: // MENU PRIMITIVE - BOX
this, SLOT( OnGUIEvent() ) );
}
-
+//=======================================================================
+// function : createGeomAction
+// purpose :
+//=======================================================================
+void GeometryGUI::createOriginAndBaseVectors()
+{
+ SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( application()->activeStudy() );
+ if( appStudy ) {
+ _PTR(Study) studyDS = appStudy->studyDS();
+ if( studyDS && !CORBA::is_nil( GetGeomGen() ) ) {
+ GEOM::GEOM_IBasicOperations_var aBasicOperations = GetGeomGen()->GetIBasicOperations( studyDS->StudyId() );
+ if( !aBasicOperations->_is_nil() ) {
+ SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
+ double aLength = aResourceMgr->doubleValue( "Geometry", "base_vectors_length", 1.0 );
+ GEOM::GEOM_Object_var anOrigin = aBasicOperations->MakePointXYZ( 0.0, 0.0, 0.0 );
+ GEOM::GEOM_Object_var anOX = aBasicOperations->MakeVectorDXDYDZ( aLength, 0.0, 0.0 );
+ GEOM::GEOM_Object_var anOY = aBasicOperations->MakeVectorDXDYDZ( 0.0, aLength, 0.0 );
+ GEOM::GEOM_Object_var anOZ = aBasicOperations->MakeVectorDXDYDZ( 0.0, 0.0, aLength );
+
+ SALOMEDS::Study_var aDSStudy = ClientStudyToStudy( studyDS );
+ GetGeomGen()->PublishInStudy( aDSStudy, SALOMEDS::SObject::_nil(), anOrigin, "O" );
+ GetGeomGen()->PublishInStudy( aDSStudy, SALOMEDS::SObject::_nil(), anOX, "OX" );
+ GetGeomGen()->PublishInStudy( aDSStudy, SALOMEDS::SObject::_nil(), anOY, "OY" );
+ GetGeomGen()->PublishInStudy( aDSStudy, SALOMEDS::SObject::_nil(), anOZ, "OZ" );
+
+ getApp()->updateObjectBrowser( false );
+ }
+ }
+ }
+}
//=======================================================================
// function : GeometryGUI::initialize()
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" );
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 );
createTool( GEOMOp::OpVector, basicTbId );
createTool( GEOMOp::OpPlane, basicTbId );
createTool( GEOMOp::OpLCS, basicTbId );
+ createTool( GEOMOp::OpOriginAndVectors, basicTbId );
int primTbId = createTool( tr( "TOOL_PRIMITIVES" ) );
createTool( GEOMOp::OpBox, primTbId );
// 0020836 (Basic vectors and origin)
SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
- bool isAutoCreatedObjects = aResourceMgr->booleanValue( "Geometry", "auto_created_objects", false );
- if( isAutoCreatedObjects && !CORBA::is_nil( GetGeomGen() ) ) {
+ if( aResourceMgr->booleanValue( "Geometry", "auto_create_base_objects", false ) ) {
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( application()->activeStudy() );
if( appStudy ) {
_PTR(Study) studyDS = appStudy->studyDS();
if( studyDS ) {
_PTR(SComponent) aSComponent = studyDS->FindComponent("GEOM");
- if( !aSComponent ) {
- GEOM::GEOM_IBasicOperations_var aBasicOperations = GetGeomGen()->GetIBasicOperations( studyDS->StudyId() );
- if( !aBasicOperations->_is_nil() ) {
- double aLength = aResourceMgr->doubleValue( "Geometry", "auto_vectors_length", 1.0 );
- GEOM::GEOM_Object_var anOrigin = aBasicOperations->MakePointXYZ( 0.0, 0.0, 0.0 );
- GEOM::GEOM_Object_var anOX = aBasicOperations->MakeVectorDXDYDZ( aLength, 0.0, 0.0 );
- GEOM::GEOM_Object_var anOY = aBasicOperations->MakeVectorDXDYDZ( 0.0, aLength, 0.0 );
- GEOM::GEOM_Object_var anOZ = aBasicOperations->MakeVectorDXDYDZ( 0.0, 0.0, aLength );
-
- SALOMEDS::Study_var aDSStudy = ClientStudyToStudy( studyDS );
- GetGeomGen()->PublishInStudy( aDSStudy, SALOMEDS::SObject::_nil(), anOrigin, "O" );
- GetGeomGen()->PublishInStudy( aDSStudy, SALOMEDS::SObject::_nil(), anOX, "OX" );
- GetGeomGen()->PublishInStudy( aDSStudy, SALOMEDS::SObject::_nil(), anOY, "OY" );
- GetGeomGen()->PublishInStudy( aDSStudy, SALOMEDS::SObject::_nil(), anOZ, "OZ" );
-
- getApp()->updateObjectBrowser( false );
- }
- }
+ if( !aSComponent ) // create objects automatically only if there is no GEOM component
+ createOriginAndBaseVectors();
}
}
}
int defl = addPreference( tr( "PREF_DEFLECTION" ), genGroup,
LightApp_Preferences::DblSpin, "Geometry", "deflection_coeff" );
- int autoGroup = addPreference( tr( "PREF_GROUP_AUTO_CREATED_OBJECTS" ), tabId,
- LightApp_Preferences::Auto, "Geometry", "auto_created_objects" );
- int autoVectorsLength = addPreference( tr( "PREF_VECTORS_LENGTH" ), autoGroup,
- LightApp_Preferences::DblSpin, "Geometry", "auto_vectors_length" );
- setPreferenceProperty( autoVectorsLength, "min", 0.01 );
- setPreferenceProperty( autoVectorsLength, "max", 1000 );
-
// Quantities with individual precision settings
int precGroup = addPreference( tr( "GEOM_PREF_GROUP_PRECISION" ), tabId );
setPreferenceProperty( precGroup, "columns", 2 );
setPreferenceProperty( markerScale, "strings", aMarkerScaleValuesList );
setPreferenceProperty( markerScale, "indexes", aMarkerScaleIndicesList );
+
+ int originGroup = addPreference( tr( "PREF_GROUP_ORIGIN_AND_BASE_VECTORS" ), tabId );
+ setPreferenceProperty( originGroup, "columns", 2 );
+
+ int baseVectorsLength = addPreference( tr( "PREF_BASE_VECTORS_LENGTH" ), originGroup,
+ LightApp_Preferences::DblSpin, "Geometry", "base_vectors_length" );
+ setPreferenceProperty( baseVectorsLength, "min", 0.01 );
+ setPreferenceProperty( baseVectorsLength, "max", 1000 );
+
+ addPreference( tr( "PREF_AUTO_CREATE" ), originGroup,
+ LightApp_Preferences::Bool, "Geometry", "auto_create_base_objects" );
+
}
void GeometryGUI::preferencesChanged( const QString& section, const QString& param )