- \b Balls:
- \b Color - color of discrete ball elements.
- \b Size - size of discrete ball elements.
+ - \b Scale - scale factor of discrete ball elements.
- <b>Orientation vectors</b>:
- \b Color - color of orientation vectors.
- \b Scale - size of orientation vectors.
- <b>Size of 0D elements</b> - specifies default size of 0D elements.
- <b>Size of ball elements</b> - specifies default size of discrete
elements (balls).
+ - <b>Scale factor of ball elements</b> - specifies default scale factor of discrete
+ elements (balls).
- <b>Line width</b> - allows to define the width of 1D elements (edges).
- <b>Outline width</b> - allows to define the width of borders of
2D and 3D elements (shown in the Shading mode).
<parameter name="marker_scale" value="9" />
<parameter name="elem0d_size" value="5" />
<parameter name="ball_elem_size" value="10" />
+ <parameter name="ball_elem_scale" value="1" />
<parameter name="element_width" value="1" />
<parameter name="outline_width" value="1" />
<parameter name="shrink_coeff" value="75"/>
if ( mgr && mgr->booleanValue( "SMESH", "use_precision", false ) )
myControlsPrecision = mgr->integerValue( "SMESH", "controls_precision", -1);
- double aElem0DSize = SMESH::GetFloat("SMESH:elem0d_size",5);
- double aBallElemSize = SMESH::GetFloat("SMESH:ball_elem_size",10);
- double aLineWidth = SMESH::GetFloat("SMESH:element_width",1);
- double aOutlineWidth = SMESH::GetFloat("SMESH:outline_width",1);
+ double aElem0DSize = SMESH::GetFloat("SMESH:elem0d_size",5);
+ double aBallElemSize = SMESH::GetFloat("SMESH:ball_elem_size",10);
+ double aBallElemScale = SMESH::GetFloat("SMESH:ball_elem_scale",1);
+ double aLineWidth = SMESH::GetFloat("SMESH:element_width",1);
+ double aOutlineWidth = SMESH::GetFloat("SMESH:outline_width",1);
SMESH::LabelFont aFamilyNd = SMESH::FntTimes;
bool aBoldNd = true;
#endif
SetBallSize(aBallElemSize);
+ SetBallScale(aBallElemScale);
Set0DSize(aElem0DSize);
}
return myBallProp->GetPointSize();
}
+int SMESH_ActorDef::GetBallScale()
+{
+ return myBallActor->GetBallScale();
+}
+
+void SMESH_ActorDef::SetBallScale( int theVal )
+{
+ myBallActor->SetBallScale( theVal );
+}
+
int SMESH_ActorDef::GetObjDimension( const int theObjId )
{
return myVisualObj->GetElemDimension( theObjId );
virtual void SetBallSize(double size) = 0;
virtual double GetBallSize() = 0;
+ virtual void SetBallScale(int size) = 0;
+ virtual int GetBallScale() = 0;
+
enum EReperesent { ePoint, eEdge, eSurface};
enum EEntityMode { e0DElements = 0x01, eEdges = 0x02, eFaces = 0x04, eVolumes = 0x08, eBallElem = 0x10, eAllEntity = 0x1f};
virtual void SetBallSize(double size);
virtual double GetBallSize();
+ virtual void SetBallScale(int size);
+ virtual int GetBallScale();
+
virtual int GetNodeObjId(int theVtkID);
virtual double* GetNodeCoord(int theObjID);
myMapper->SetBallEnabled( theBallEnabled );
}
+/*!
+ * Set point marker scale factor
+ * \param theBallScale integer value which specifies a scale factor of ball element
+ */
+void SMESH_DeviceActor::SetBallScale( int theBallScale )
+{
+ myMapper->SetBallScale( theBallScale );
+ myMapper->Modified();
+}
+
/*!
* Set standard point marker
* \param theMarkerType type of the marker
return myMapper->GetMarkerTexture();
}
+/*!
+ * Get scale factor of ball element
+ * \return scale factor of ball element
+ */
+int SMESH_DeviceActor::GetBallScale()
+{
+ return myMapper->GetBallScale();
+}
+
void SMESH_DeviceActor::SetCoincident3DAllowed(bool theFlag) {
myGeomFilter->SetAppendCoincident3D(theFlag);
}
void SetMarkerEnabled( bool );
void SetBallEnabled( bool );
+ void SetBallScale( int );
void SetMarkerStd( VTK::MarkerType, VTK::MarkerScale );
void SetMarkerTexture( int, VTK::MarkerTexture );
VTK::MarkerType GetMarkerType();
VTK::MarkerScale GetMarkerScale();
int GetMarkerTexture();
+ int GetBallScale();
protected:
void Init(TVisualObjPtr theVisualObj, vtkImplicitBoolean* theImplicitBoolean);
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 );
for (int i = 0, iEnd = theIds.size(); i < iEnd; i++){
anIds->InsertId(0,theIds[i]);
vtkIdType anId = myBallPolyData->InsertNextCell(VTK_POLY_VERTEX,anIds);
- double d = theDiameter;
+ double d = theDiameter * theActor->GetBallScale();
aScalars->SetTuple(anId,&d);
anIds->Reset();
}
myBallColor = new QtxColorButton( myBallGrp );
QLabel* ballSizeLab = new QLabel( tr( "SIZE" ), myBallGrp );
myBallSize = new QtxIntSpinBox( myBallGrp );
+ QLabel* ballScaleLab = new QLabel( tr( "SCALE_FACTOR" ), myBallGrp );
+ myBallScale = new QtxIntSpinBox( myBallGrp );
hl = new QHBoxLayout( myBallGrp );
hl->setMargin( MARGIN );
hl->setSpacing( SPACING );
hl->addWidget( myBallColor );
hl->addWidget( ballSizeLab );
hl->addWidget( myBallSize );
+ hl->addWidget( ballScaleLab );
+ hl->addWidget( myBallScale );
widthLab1 = qMax( widthLab1, ballColorLab->minimumSizeHint().width() );
widthLab2 = qMax( widthLab2, ballSizeLab->minimumSizeHint().width() );
myOrientationGrp = new QGroupBox( tr( "ORIENTATIONS" ), mainFrame() );
QLabel* orientationColorLab = new QLabel( tr( "COLOR" ), myOrientationGrp );
myOrientationColor = new QtxColorButton( myOrientationGrp );
- QLabel* orientationScaleLab = new QLabel( tr( "ORIENTATION_SCALE" ), myOrientationGrp );
+ QLabel* orientationScaleLab = new QLabel( tr( "SCALE_FACTOR" ), myOrientationGrp );
myOrientationSize = new QtxIntSpinBox( myOrientationGrp );
myOrientationSize->setSuffix( "% ");
myOrientation3d = new QCheckBox( tr("ORIENTATION_3D"), myOrientationGrp );
myOutlineWidth->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
myElem0dSize->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
myBallSize->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ myBallScale->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
myOrientationSize->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
myShrinkSize->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
myNodeMarker->setCustomMarkers( customMarkers );
myElem0dSize->setRange( 1, 10 );
myBallSize->setRange( 1, 10 );
+ myBallScale->setRange( 1, 10 );
myEdgeWidth->setRange( 1, 5 );
myOutlineWidth->setRange( 1, 5 );
myShrinkSize->setRange( 20, 100 );
return myBallSize->value();
}
+/*!
+ \brief Set discrete elements (balls) scale factor
+ \param size discrete elements (balls) scale factor
+*/
+void SMESHGUI_PropertiesDlg::setBallScale( int size )
+{
+ myBallScale->setValue( size );
+}
+
+/*!
+ \brief Get discrete elements (balls) scale factor
+ \return current discrete elements (balls) scale factor
+*/
+int SMESHGUI_PropertiesDlg::ballScale() const
+{
+ return myBallScale->value();
+}
+
/*!
\brief Set orientation vectors color
\param color orientation vectors color
QColor ballColor() const;
void setBallSize( int );
int ballSize() const;
+ void setBallScale( int );
+ int ballScale() const;
void setOrientationColor( const QColor& );
QColor orientationColor() const;
// - balls
QtxColorButton* myBallColor;
QtxIntSpinBox* myBallSize;
+ QtxIntSpinBox* myBallScale;
// - orientation vectors
QtxColorButton* myOrientationColor;
QtxIntSpinBox* myOrientationSize;
<source>PREF_BALL_SIZE</source>
<translation>Size of ball elements</translation>
</message>
+ <message>
+ <source>PREF_BALL_SCALE</source>
+ <translation>Scale factor of ball elements</translation>
+ </message>
<message>
<source>PREF_WIDTH</source>
<translation>Line width</translation>
<translation>Size:</translation>
</message>
<message>
- <source>ORIENTATION_SCALE</source>
+ <source>SCALE_FACTOR</source>
<translation>Scale:</translation>
</message>
<message>
<source>PREF_BALL_SIZE</source>
<translation>Taille des éléments particulaires</translation>
</message>
+ <message>
+ <source>PREF_BALL_SCALE</source>
+ <translation>Facteur d'échelle des éléments particulaires</translation>
+ </message>
<message>
<source>PREF_WIDTH</source>
<translation>Epaisseur de ligne</translation>
<translation>Taille:</translation>
</message>
<message>
- <source>ORIENTATION_SCALE</source>
+ <source>SCALE_FACTOR</source>
<translation>Echelle:</translation>
</message>
<message>
<translation>サイズ</translation>
</message>
<message>
- <source>ORIENTATION_SCALE</source>
+ <source>SCALE_FACTOR</source>
<translation>スケール:</translation>
</message>
<message>