int deltaF = 0, deltaV = 0;
int elem0dSize = 1;
int ballSize = 1;
+ int ballScale = 1;
int edgeWidth = 1;
int outlineWidth = 1;
double shrinkCoef = 0.0;
anActor->GetBallColor( color[0], color[1], color[2] );
ballColor.setRgbF( color[0], color[1], color[2] );
ballSize = qMax( (int)anActor->GetBallSize(), 1 ); // minimum allowed size is 1
+ ballScale = qMax( (int)anActor->GetBallScale(), 1 ); // minimum allowed size is 1
// outlines: color
anActor->GetOutlineColor( color[0], color[1], color[2] );
outlineColor.setRgbF( color[0], color[1], color[2] );
// balls: color, size
dlg.setBallColor( ballColor );
dlg.setBallSize( ballSize );
+ dlg.setBallScale( ballScale );
// orientation: color, scale, 3d flag
dlg.setOrientationColor( orientationColor );
dlg.setOrientationSize( int( orientationScale * 100. ) );
elem0dSize = dlg.elem0dSize();
ballColor = dlg.ballColor();
ballSize = dlg.ballSize();
+ ballScale = dlg.ballScale();
orientationColor = dlg.orientationColor();
orientationScale = dlg.orientationSize() / 100.;
orientation3d = dlg.orientation3d();
// balls: color, size
anActor->SetBallColor( ballColor.redF(), ballColor.greenF(), ballColor.blueF() );
anActor->SetBallSize( ballSize );
+ anActor->SetBallScale( ballScale );
// orientation: color, scale, 3d flag
anActor->SetFacesOrientationColor( orientationColor.redF(), orientationColor.greenF(), orientationColor.blueF() );
anActor->SetFacesOrientationScale( orientationScale );
LightApp_Preferences::IntSpin, "SMESH", "elem0d_size");
int ballSize = addPreference(tr("PREF_BALL_SIZE"), elemGroup,
LightApp_Preferences::IntSpin, "SMESH", "ball_elem_size");
+ int ballScale = addPreference(tr("PREF_BALL_SCALE"), elemGroup,
+ LightApp_Preferences::IntSpin, "SMESH", "ball_elem_scale");
int elemW = addPreference(tr("PREF_WIDTH"), elemGroup,
LightApp_Preferences::IntSpin, "SMESH", "element_width");
int outW = addPreference(tr("PREF_OUTLINE_WIDTH"), elemGroup,
setPreferenceProperty( ballSize, "min", 1 );
setPreferenceProperty( ballSize, "max", 10 );
+ setPreferenceProperty( ballScale, "min", 1 );
+ setPreferenceProperty( ballScale, "max", 10 );
+
setPreferenceProperty( elemW, "min", 1 );
setPreferenceProperty( elemW, "max", 5 );
sizeStr << QString::number((int)aSmeshActor->Get0DSize());
sizeStr << "ball";
sizeStr << QString::number((int)aSmeshActor->GetBallSize());
+ sizeStr << QString::number((int)aSmeshActor->GetBallScale());
sizeStr << "shrink";
sizeStr << QString::number(aSmeshActor->GetShrinkFactor());
sizeStr << "orientation";
int outlineWidth = -1;
int elem0dSize = -1;
int ballSize = -1;
+ int ballScale = -1;
double shrinkSize = -1;
double orientationSize = -1;
bool orientation3d = false;
i++;
}
else if ( type == "ball" ) {
- // ball size is given as single integer value
+ // balls are specified by two values: size:scale, where
+ // - size - is a integer value specifying size
+ // - scale - is a integer value specifying scale factor
if ( i+1 >= sizes.count() ) break; // format error
- int v = sizes[i+1].toInt( &bOk ); if ( !bOk ) break; // format error
- ballSize = v;
- i++;
+ int v1 = sizes[i+1].toInt( &bOk ); if ( !bOk ) break; // format error
+ if ( i+2 >= sizes.count() ) break; // format error
+ int v2 = sizes[i+2].toInt( &bOk ); if ( !bOk ) break; // format error
+ ballSize = v1;
+ ballScale = v2;
+ i += 2;
}
else if ( type == "shrink" ) {
// shrink factor is given as single floating point value
// ball size
if ( ballSize > 0 )
aSmeshActor->SetBallSize( ballSize );
+ // ball scale
+ if ( ballScale > 0 )
+ aSmeshActor->SetBallScale( ballScale );
// shrink factor
if ( shrinkSize > 0 )
aSmeshActor->SetShrinkFactor( shrinkSize );