#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
#include <GEOMImpl_Types.hxx>
+#include <Graphic3d_HArray1OfBytes.hxx>
using namespace std;
myShadingColor = SalomeApp_Tools::color( col );
myDisplayMode = resMgr->integerValue("Geometry", "display_mode", 0);
- myTypeOfMarker = (Aspect_TypeOfMarker)resMgr->integerValue("Geometry", "type_of_marker", Aspect_TOM_PLUS);
- myScaleOfMarker = resMgr->doubleValue("Geometry", "marker_scale", 1.);
- if(myScaleOfMarker < 1.0)
- myScaleOfMarker = 1.0;
- if(myScaleOfMarker > 7.)
- myScaleOfMarker = 7.;
-
+ int aType = resMgr->integerValue("Geometry", "type_of_marker", (int)Aspect_TOM_PLUS);
+ myTypeOfMarker = (Aspect_TypeOfMarker)(std::min((int)Aspect_TOM_RING3, std::max((int)Aspect_TOM_POINT, aType)));
+ myScaleOfMarker = (resMgr->integerValue("Geometry", "marker_scale", 1)-(int)GEOM::MS_10)*0.5 + 1.0;
+ myScaleOfMarker = std::min(7.0, std::max(1., myScaleOfMarker));
myColor = -1;
// This color is used for shape displaying. If it is equal -1 then
Quantity_Color aQuanColor = SalomeApp_Tools::color( aResMgr->colorValue( "Geometry", "point_color", QColor( 255, 255, 0 ) ) );
if ( hasColor ) aQuanColor = Quantity_Color( aSColor.R, aSColor.G, aSColor.B, Quantity_TOC_RGB );
Standard_Integer aWidth, aHeight;
- Handle(Graphic3d_HArray1OfBytes) aTexture = GeometryGUI::getTextureAspect( getStudy(), aTextureId, aWidth, aHeight );
+ Handle(Graphic3d_HArray1OfBytes) aTexture = GeometryGUI::getTexture( getStudy(), aTextureId, aWidth, aHeight );
if ( !aTexture.IsNull() ) {
static int TextureId = 0;
Handle(Prs3d_PointAspect) aTextureAspect = new Prs3d_PointAspect(aQuanColor,
<source>MEN_WORK_PLANE</source>
<translation>Working Plane</translation>
</message>
+ <message>
+ <source>MEN_POP_POINT_MARKER</source>
+ <translation>Point Marker</translation>
+ </message>
<message>
<source>NAME_LBL</source>
<translation>Name: </translation>
<source>STB_WORK_PLANE</source>
<translation>Create a working plane</translation>
</message>
+ <message>
+ <source>STB_POP_POINT_MARKER</source>
+ <translation>Set Point Marker</translation>
+ </message>
<message>
<source>SUPPRESS_RESULT</source>
<translation>Suppress Result</translation>
<source>TOP_WORK_PLANE</source>
<translation>Create a working plane</translation>
</message>
+ <message>
+ <source>TOP_POP_POINT_MARKER</source>
+ <translation>Point Marker</translation>
+ </message>
<message>
<source>WRN_NOT_IMPLEMENTED</source>
<translation>Sorry, this functionality is not yet implemented</translation>
<translation>Delete objects</translation>
</message>
</context>
+ <context>
+ <name>GEOMToolsGUI_MarkerDlg</name>
+ <message>
+ <source>SET_MARKER_TLT</source>
+ <translation>Set Point Marker</translation>
+ </message>
+ <message>
+ <source>STANDARD_MARKER</source>
+ <translation>Standard</translation>
+ </message>
+ <message>
+ <source>CUSTOM_MARKER</source>
+ <translation>Custom</translation>
+ </message>
+ <message>
+ <source>TYPE</source>
+ <translation>Type:</translation>
+ </message>
+ <message>
+ <source>SCALE</source>
+ <translation>Scale:</translation>
+ </message>
+ <message>
+ <source>CUSTOM</source>
+ <translation>Texture:</translation>
+ </message>
+ <message>
+ <source>BROWSE</source>
+ <translation>Browse...</translation>
+ </message>
+ <message>
+ <source>OK_BTN</source>
+ <translation>&OK</translation>
+ </message>
+ <message>
+ <source>CANCEL_BTN</source>
+ <translation>&Cancel</translation>
+ </message>
+ <message>
+ <source>HELP_BTN</source>
+ <translation>&Help</translation>
+ </message>
+ <message>
+ <source>LOAD_TEXTURE_TLT</source>
+ <translation>Load Texture</translation>
+ </message>
+ </context>
</TS>
id == 8036 || // POPUP VIEWER - DISABLE AUTO COLOR
id == 8037 || // POPUP VIEWER - SHOW CHILDREN
id == 8038 || // POPUP VIEWER - HIDE CHILDREN
+ id == 8039 || // POPUP VIEWER - POINT MARKER
id == 804 || // POPUP VIEWER - ADD IN STUDY
id == 901 || // OBJECT BROWSER - RENAME
id == 9024 ) { // OBJECT BROWSER - OPEN
createGeomAction( 8001, "POP_CREATE_GROUP" );
createGeomAction( 8037, "POP_SHOW_CHILDREN" );
createGeomAction( 8038, "POP_HIDE_CHILDREN" );
+ createGeomAction( 8039, "POP_POINT_MARKER" );
// make wireframe-shading items to be exclusive (only one at a time is selected)
//QActionGroup* dispModeGr = new QActionGroup( this, "", true );
mgr->setRule( action( 8033 ), clientOCCorVTK_AndSomeVisible, QtxPopupMgr::VisibleRule );
mgr->insert( action( 8034 ), -1, -1 ); // isos
mgr->setRule( action( 8034 ), clientOCCorVTK_AndSomeVisible + " and selcount>0 and isVisible", QtxPopupMgr::VisibleRule );
+ mgr->insert( action( 8039 ), -1, -1 ); // point marker
+ mgr->setRule( action( 8039 ), QString( "selcount>0 and $typeid in {%1}" ).arg( GEOM_POINT ), QtxPopupMgr::VisibleRule );
mgr->insert( separator(), -1, -1 ); // -----------
mgr->insert( action( 8035 ), -1, -1 ); // auto color
mgr->setRule( action( 8035 ), autoColorPrefix + " and isAutoColor=false", QtxPopupMgr::VisibleRule );
return "";
}
-Handle(Graphic3d_HArray1OfBytes) GeometryGUI::getTextureAspect( SalomeApp_Study* theStudy, int theId, int& theWidth, int& theHeight )
+Handle(Graphic3d_HArray1OfBytes) GeometryGUI::getTexture( SalomeApp_Study* theStudy, int theId, int& theWidth, int& theHeight )
{
theWidth = theHeight = 0;
Handle(Graphic3d_HArray1OfBytes) aTexture;
LightApp_Preferences::Selector, "Geometry", "type_of_marker" );
int markerScale = addPreference( tr( "PREF_MARKER_SCALE" ), VertexGroup,
- LightApp_Preferences::DblSpin, "Geometry", "marker_scale" );
+ LightApp_Preferences::Selector, "Geometry", "marker_scale" );
// Set property for default display mode
QStringList aModesList;
setPreferenceProperty( step, "max", 10000 );
setPreferenceProperty( step, "precision", 3 );
- // Set property for type of vertex marker
- QList<QVariant> anTypeOfMarkerIndexesList;
- QList<QVariant> anTypeOfMarkerIconsList;
-
- anTypeOfMarkerIndexesList.append(Aspect_TOM_PLUS);
- anTypeOfMarkerIndexesList.append(Aspect_TOM_POINT);
- anTypeOfMarkerIndexesList.append(Aspect_TOM_STAR);
- anTypeOfMarkerIndexesList.append(Aspect_TOM_O);
- anTypeOfMarkerIndexesList.append(Aspect_TOM_X);
- anTypeOfMarkerIndexesList.append(Aspect_TOM_O_POINT);
- anTypeOfMarkerIndexesList.append(Aspect_TOM_O_PLUS);
- anTypeOfMarkerIndexesList.append(Aspect_TOM_O_STAR);
- anTypeOfMarkerIndexesList.append(Aspect_TOM_O_X);
-
- // Create icons list
+ // Set property vertex marker type
+ QList<QVariant> aMarkerTypeIndicesList;
+ QList<QVariant> aMarkerTypeIconsList;
+
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
- for (int i = 1; i<=9; i++) {
- QString str = "ICON_VERTEX_MARKER_";
- str.append( QString::number(i) );
- QPixmap pixmap (resMgr->loadPixmap("GEOM", tr( str.toLatin1().data() )));
- anTypeOfMarkerIconsList.append(pixmap);
+ for ( int i = GEOM::MT_POINT; i < GEOM::MT_USER; i++ ) {
+ QString icoFile = QString( "ICON_VERTEX_MARKER_%1" ).arg( i );
+ QPixmap pixmap = resMgr->loadPixmap( "GEOM", tr( qPrintable( icoFile ) ) );
+ aMarkerTypeIndicesList << (i-1);
+ aMarkerTypeIconsList << pixmap;
}
- setPreferenceProperty( typeOfMarker, "indexes", anTypeOfMarkerIndexesList );
- setPreferenceProperty( typeOfMarker, "icons", anTypeOfMarkerIconsList );
+ setPreferenceProperty( typeOfMarker, "indexes", aMarkerTypeIndicesList );
+ setPreferenceProperty( typeOfMarker, "icons", aMarkerTypeIconsList );
+
+ // Set property for vertex marker scale
+ QList<QVariant> aMarkerScaleIndicesList;
+ QStringList aMarkerScaleValuesList;
- // Set property for Vertex Marker scale
- setPreferenceProperty( markerScale, "min", 1. );
- setPreferenceProperty( markerScale, "max", 7. );
- setPreferenceProperty( markerScale, "precision", 0.01 );
- setPreferenceProperty( markerScale, "step", 0.5 );
+ for ( int i = GEOM::MS_10; i <= GEOM::MS_70; i++ ) {
+ aMarkerScaleIndicesList << i;
+ aMarkerScaleValuesList << QString::number( (i-(int)GEOM::MS_10)*0.5 + 1.0 );
+ }
+ setPreferenceProperty( markerScale, "strings", aMarkerScaleValuesList );
+ setPreferenceProperty( markerScale, "indexes", aMarkerScaleIndicesList );
}
void GeometryGUI::preferencesChanged( const QString& section, const QString& param )