borders.
- <b>Wireframe color</b> - allows to select the color of borders of
elements in the wireframe mode.
+ - <b>Preview color</b> - allows to select the preview color of the elements.
- <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).
<parameter name="node_color" value="255, 0, 0"/>
<parameter name="fill_color" value="#00aaff|100"/>
<parameter name="volume_color" value="255, 0, 170|-100"/>
+ <parameter name="preview_color" value="0, 255, 0|-100"/>
<parameter name="wireframe_color" value="0, 170, 255"/>
<parameter name="outline_color" value="#004600"/>
<parameter name="elem0d_color" value="0, 255, 0"/>
my0DActor->SetProperty(my0DProp);
my0DActor->SetRepresentation(SMESH_DeviceActor::eSurface);
aFilter = my0DActor->GetExtractUnstructuredGrid();
- //aFilter->SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::ePoints);
aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
aFilter->RegisterCellsWithType(VTK_VERTEX);
myBallActor->SetVisibility(false);
myBallActor->SetProperty(myBallProp);
myBallActor->SetRepresentation(SMESH_DeviceActor::eSurface);
+ myBallActor->SetBallEnabled(true);
aFilter = myBallActor->GetExtractUnstructuredGrid();
aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
aFilter->RegisterCellsWithType(VTK_POLY_VERTEX);
myHighlightProp->SetLineWidth(aLineWidth);
myHighlightProp->SetRepresentation(1);
- myBallHighlightProp = vtkProperty::New();
- myBallHighlightProp->DeepCopy(myHighlightProp);
- myBallHighlightProp->SetPointSize(aBallElemSize);
-
-
myOutLineProp = vtkProperty::New();
myOutLineProp->SetAmbient(1.0);
myOutLineProp->SetDiffuse(0.0);
myPreselectProp->SetLineWidth(aLineWidth);
myPreselectProp->SetRepresentation(1);
- myBallPreselectProp = vtkProperty::New();
- myBallPreselectProp->DeepCopy(myPreselectProp);
- myBallPreselectProp->SetPointSize(aBallElemSize);
-
myHighlitableActor = SMESH_DeviceActor::New();
myHighlitableActor->SetUserMatrix(aMatrix);
myHighlitableActor->PickableOff();
myOutLineProp->Delete();
myPreselectProp->Delete();
- myBallHighlightProp->Delete();
- myBallPreselectProp->Delete();
-
myHighlitableActor->Delete();
my2DExtProp->Delete();
{
if(my3DActor) {
my3DActor->SetFontProperties( theFamily, theSize, theBold, theItalic, theShadow, r, g, b );
- SetRepresentation( GetRepresentation() );
- myTimeStamp->Modified();
}
if(my2DActor) {
my2DActor->SetFontProperties( theFamily, theSize, theBold, theItalic, theShadow, r, g, b );
void SMESH_ActorDef::AddToRender(vtkRenderer* theRenderer){
- //myHighlightActor->AddToRender(theRenderer);
-
theRenderer->AddActor(myBaseActor);
theRenderer->AddActor(myNodeExtActor);
theRenderer->AddActor(my1DExtActor);
my1DActor ->AddToRender(theRenderer);
my0DActor ->AddToRender(theRenderer);
myBallActor ->AddToRender(theRenderer);
- //theRenderer->AddActor(my0DExtActor);
theRenderer->AddActor(myHighlitableActor);
myVisualObj = theVisualObj;
myVisualObj->Update(theIsClear);
+ SMESH_SVTKActor::SafeDownCast(myHighlightActor)->SetVisualObject(myVisualObj);
+ SMESH_SVTKActor::SafeDownCast(myPreHighlightActor)->SetVisualObject(myVisualObj);
+
myNodeActor->Init(myVisualObj,myImplicitBoolean);
myBaseActor->Init(myVisualObj,myImplicitBoolean);
if (myEntityMode & eBallElem) {
aFilter->RegisterCellsWithType(VTK_POLY_VERTEX);
- aHightFilter->RegisterCellsWithType(VTK_POLY_VERTEX);
}
if (myEntityMode & eEdges) {
if (theMode < 0) {
myRepresentation = eSurface;
- if (!aNbFaces && !aNbVolumes && aNbEdges) {
+ if (!aNbFaces && !aNbVolumes && !aNbBalls && aNbEdges) {
myRepresentation = eEdge;
- } else if (!aNbFaces && !aNbVolumes && !aNbEdges) {
+ } else if (!aNbFaces && !aNbVolumes && !aNbEdges && !aNbBalls) {
myRepresentation = ePoint;
}
} else {
my3DActor->SetBackfaceProperty(aPropVR);
my3DActor->SetRepresentation(aReperesent);
- //my0DExtActor->SetVisibility(false);
+
my1DExtActor->SetVisibility(false);
my2DExtActor->SetVisibility(false);
my3DExtActor->SetVisibility(false);
- // ???
- //my0DActor->SetProperty(aProp);
- //my0DActor->SetBackfaceProperty(aBackProp);
my0DActor->SetRepresentation(aReperesent);
myBallActor->SetRepresentation(aReperesent);
- //my0DExtActor->SetRepresentation(aReperesent);
switch(myControlMode){
case eLength:
void SMESH_ActorDef::UpdateHighlight(){
myHighlitableActor->SetHighlited(false);
myHighlitableActor->SetVisibility(false);
-
bool anIsVisible = GetVisibility();
switch(myRepresentation){
{
if(myIsHighlighted) {
myHighlitableActor->SetProperty(myHighlightProp);
- myBallActor->SetProperty(myBallHighlightProp);
}else if(myIsPreselected){
myHighlitableActor->SetProperty(myPreselectProp);
- myBallActor->SetProperty(myBallPreselectProp);
} else if(anIsVisible){
- myBallActor->SetProperty(myBallProp);
(myRepresentation == eSurface) ?
myHighlitableActor->SetProperty(myOutLineProp) : myHighlitableActor->SetProperty(myEdgeProp);
}
void SMESH_ActorDef::SetHighlightColor(double r,double g,double b){
myHighlightProp->SetColor(r,g,b);
- myBallHighlightProp->SetColor(r,g,b);
Modified();
}
void SMESH_ActorDef::SetPreHighlightColor(double r,double g,double b){
myPreselectProp->SetColor(r,g,b);
- myBallPreselectProp->SetColor(r,g,b);
Modified();
}
void SMESH_ActorDef::SetBallSize(double theVal){
myBallProp->SetPointSize(theVal);
- myBallHighlightProp->SetPointSize(theVal);
- myBallPreselectProp->SetPointSize(theVal);
+
if(SMESH_SVTKActor* aCustom = SMESH_SVTKActor::SafeDownCast( myHighlightActor )) {
aCustom->SetBallSize(theVal);
}
vtkProperty* myOutLineProp;
vtkProperty* myPreselectProp;
- vtkProperty* myBallHighlightProp;
- vtkProperty* myBallPreselectProp;
-
SMESH_DeviceActor* myHighlitableActor;
eControl myControlMode;
#include <VTKViewer_TransformFilter.h>
#include <VTKViewer_CellCenters.h>
+#include <VTKViewer_ExtractUnstructuredGrid.h>
#include <vtkObjectFactory.h>
#include <vtkCallbackCommand.h>
vtkIntArray *anArray = vtkIntArray::New();
anArray->SetNumberOfValues(aNbElem);
for(int anId = 0; anId < aNbElem; anId++){
- int aSMDSId = myVisualObj->GetElemObjId(anId);
+ vtkIdType id = myExtractUnstructuredGrid->GetInputId(anId);
+ id = (id >=0) ? id : anId;
+ int aSMDSId = myVisualObj->GetElemObjId(id);
anArray->SetValue(anId,aSMDSId);
}
aDataSet->GetCellData()->SetScalars(anArray);
myExtractUnstructuredGrid->SetInputData(theGrid);
myMergeFilter->SetGeometryConnection(myExtractUnstructuredGrid->GetOutputPort());
+
+ //Pass diameters of the balls
+ if(myMapper->GetBallEnabled()) {
+ myMergeFilter->SetScalarsConnection(myExtractUnstructuredGrid->GetOutputPort());
+ }
myExtractGeometry->SetInputConnection(myMergeFilter->GetOutputPort());
myMapper->SetMarkerEnabled( theMarkerEnabled );
}
+/*!
+ * Set point marker enabled
+ * \param theBallEnabled flag to enable/disable ball drawing
+ */
+void SMESH_DeviceActor::SetBallEnabled( bool theBallEnabled ) {
+ myMapper->SetBallEnabled( theBallEnabled );
+}
+
/*!
* Set standard point marker
* \param theMarkerType type of the marker
bool IsImplicitFunctionUsed() const{ return myIsImplicitFunctionUsed;}
void SetMarkerEnabled( bool );
+ void SetBallEnabled( bool );
void SetMarkerStd( VTK::MarkerType, VTK::MarkerScale );
void SetMarkerTexture( int, VTK::MarkerTexture );
VTK::MarkerType GetMarkerType();
#include "SMDS_Mesh.hxx"
#include "SMDS_PolyhedralVolumeOfNodes.hxx"
+#include "SMDS_BallElement.hxx"
#include "SMESH_Actor.h"
#include "SMESH_ControlsDef.hxx"
#include "SalomeApp_Application.h"
#include <vtkIdList.h>
#include <vtkCellArray.h>
#include <vtkUnsignedCharArray.h>
-
+#include <vtkCellData.h>
#include <vtkUnstructuredGrid.h>
#include <memory>
//MESSAGE(myGrid->GetReferenceCount());
//MESSAGE( "Update - myGrid->GetNumberOfCells() = "<<myGrid->GetNumberOfCells() );
//MESSAGE( "Update - myGrid->GetNumberOfPoints() = "<<myGrid->GetNumberOfPoints() );
- if( MYDEBUGWITHFILES ) SMESH::WriteUnstructuredGrid( myGrid,"buildPrs.vtu" );
+ if( MYDEBUGWITHFILES ) {
+ SMESH::WriteUnstructuredGrid( myGrid,"myPrs.vtu" );
+ }
}
}
aConnect.reserve(VTK_CELL_SIZE);
SMDS_Mesh::CheckMemory(); // PAL16631
-
+ bool hasBalls = nbEnts[ SMDSAbs_Ball ] > 0;
+ vtkDataArray* aScalars = 0;
+ if(hasBalls) {
+ aScalars = vtkDataArray::CreateDataArray(VTK_DOUBLE);
+ aScalars->SetNumberOfComponents(1);
+ aScalars->SetNumberOfTuples(aNbCells);
+ }
for ( int i = 0; i < nbTypes; i++ ) // iterate through all types of elements
{
if ( nbEnts[ aTypes[ i ] ] > 0 ) {
}
}
}
- aConnectivity->InsertNextCell( anIdList );
+ vtkIdType aCurId = aConnectivity->InsertNextCell( anIdList );
aCellTypesArray->InsertNextValue( vtkElemType );
+
+ //Store diameters of the balls
+ if(aScalars) {
+ double aDiam = 0;
+ if(aType == SMDSAbs_Ball) {
+ if (const SMDS_BallElement* ball = dynamic_cast<const SMDS_BallElement*>(anElem) ) {
+ aDiam = ball->GetDiameter();
+ }
+ }
+ aScalars->SetTuple(aCurId,&aDiam);
+ }
iElem++;
}
aCellLocationsArray->SetValue( idType, aConnectivity->GetTraversalLocation( npts ) );
myGrid->SetCells( aCellTypesArray, aCellLocationsArray,aConnectivity );
+ myGrid->GetCellData()->SetScalars(aScalars);
aCellLocationsArray->Delete();
aCellTypesArray->Delete();
#include <vtkCell.h>
#include <vtkDataSetMapper.h>
#include <vtkPolyhedron.h>
+#include <vtkCellData.h>
#include <Utils_SALOME_Exception.hxx>
{
my0DActor = SVTK_DeviceActor::New();
myBallActor = SVTK_DeviceActor::New();
+ myBallActor->SetBallEnabled(true);
myBallActor->SetResolveCoincidentTopology(false);
myBallActor->SetCoincident3DAllowed(true);
SVTK::CopyPoints( GetSource(), aSourceDataSet );
SVTK::CopyPoints( myBallGrid, aSourceDataSet );
SVTK::CopyPoints( my0DGrid, aSourceDataSet );
+
int aNbOfParts = theMapIndex.Extent();
+
+ vtkCellData* cd = 0;
+ vtkCellData* outputCD = 0;
+ //Copy deamaters of the balls
+ if(myVisualObj) {
+ outputCD = myBallGrid->GetCellData();
+ cd = aSourceDataSet->GetCellData();
+ }
+ outputCD->CopyAllocate(cd,aNbOfParts,aNbOfParts/2);
for(int ind = 1; ind <= aNbOfParts; ind++){
int aPartId = theMapIndex( ind );
if(vtkCell* aCell = theMapActor->GetElemCell(aPartId))
if(aCell->GetCellType() == VTK_VERTEX ) {
my0DGrid->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds());
} else if(aCell->GetCellType() == VTK_POLY_VERTEX ) {
- myBallGrid->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds());
+ vtkIdType newCellId = myBallGrid->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds());
+ if(myVisualObj) {
+ outputCD->CopyData(cd, myVisualObj->GetElemVTKId(aPartId), newCellId);
+ }
} else {
myUnstructuredGrid->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds());
}
myBallActor->GetProperty()->SetPointSize(theSize);
}
+void SMESH_SVTKActor::SetVisualObject(TVisualObjPtr theVisualObj) {
+ myVisualObj = theVisualObj;
+}
+
void
RemoveFromRender(vtkRenderer* theRendere);
+ void SetVisualObject(TVisualObjPtr theVisualObj);
+
protected:
SVTK_DeviceActor* my0DActor;
SVTK_DeviceActor* myBallActor;
vtkUnstructuredGrid* my0DGrid;
vtkUnstructuredGrid* myBallGrid;
+ TVisualObjPtr myVisualObj;
SMESH_SVTKActor();
virtual ~SMESH_SVTKActor();
addPreference( tr( "PREF_BALL_COLOR" ), elemGroup, LightApp_Preferences::Color, "SMESH", "ball_elem_color" );
addPreference( tr( "PREF_OUTLINE" ), elemGroup, LightApp_Preferences::Color, "SMESH", "outline_color" );
addPreference( tr( "PREF_WIREFRAME" ), elemGroup, LightApp_Preferences::Color, "SMESH", "wireframe_color" );
+ addPreference( tr( "PREF_PREVIEW_COLOR" ), elemGroup, LightApp_Preferences::BiColor, "SMESH", "preview_color" );
int grpGroup = addPreference( tr( "PREF_GROUP_GROUPS" ), meshTab );
#include <SalomeApp_Application.h>
#include <SVTK_ViewModel.h>
#include <SVTK_ViewWindow.h>
+#include <VTKViewer_PolyDataMapper.h>
+#include <SVTK_Renderer.h>
+#include <Qtx.h>
+
// IDL incldues
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
#include <vtkDataSetMapper.h>
#include <vtkPolyDataMapper.h>
#include <vtkProperty.h>
+#include <vtkCellData.h>
// Qt includes
#include <QComboBox>
SALOME_Actor* myPreviewActor;
vtkDataSetMapper* myMapper;
vtkUnstructuredGrid* myGrid;
+
+ SALOME_Actor* myBallActor;
+ VTKViewer_PolyDataMapper* myBallMapper;
+ vtkPolyData* myBallPolyData;
SALOME_Actor* myFaceOrientation;
vtkPolyDataMapper* myFaceOrientationDataMapper;
myPreviewActor->VisibilityOff();
myPreviewActor->SetMapper(myMapper);
- double anRGB[3];
+ QColor ffc, bfc;
+ int delta;
+
vtkProperty* aProp = vtkProperty::New();
- GetColor( "SMESH", "fill_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 170, 255 ) );
- aProp->SetColor( anRGB[0], anRGB[1], anRGB[2] );
+ SMESH::GetColor( "SMESH", "preview_color", ffc, delta, "0, 255, 0|-100" ) ;
+ aProp->SetColor( ffc.red() / 255. , ffc.green() / 255. , ffc.blue() / 255. );
myPreviewActor->SetProperty( aProp );
aProp->Delete();
vtkProperty* aBackProp = vtkProperty::New();
- GetColor( "SMESH", "backface_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 0, 255 ) );
- aBackProp->SetColor( anRGB[0], anRGB[1], anRGB[2] );
+ bfc = Qtx::mainColorToSecondary(ffc, delta);
+ aBackProp->SetColor( bfc.red() / 255. , bfc.green() / 255. , bfc.blue() / 255. );
myPreviewActor->SetBackfaceProperty( aBackProp );
aBackProp->Delete();
myFaceOrientation->SetMapper(myFaceOrientationDataMapper);
vtkProperty* anOrientationProp = vtkProperty::New();
+ double anRGB[3];
GetColor( "SMESH", "orientation_color", anRGB[0], anRGB[1], anRGB[2], QColor( 255, 255, 255 ) );
anOrientationProp->SetColor( anRGB[0], anRGB[1], anRGB[2] );
myFaceOrientation->SetProperty( anOrientationProp );
anOrientationProp->Delete();
-
myVTKViewWindow->AddActor(myFaceOrientation);
+
+ // Preview for the balls
+ vtkProperty* aBallProp = vtkProperty::New();
+ aBallProp->SetColor(ffc.red() / 255. , ffc.green() / 255. , ffc.blue() / 255.);
+ double aBallElemSize = SMESH::GetFloat("SMESH:ball_elem_size",10);
+ aBallProp->SetPointSize(aBallElemSize);
+
+ myBallPolyData = vtkPolyData::New();
+ myBallPolyData->Allocate();
+
+ myBallMapper = VTKViewer_PolyDataMapper::New();
+ myBallMapper->SetInputData(myBallPolyData);
+ myBallMapper->SetBallEnabled(true);
+
+ myBallActor = SALOME_Actor::New();
+ myBallActor->PickableOff();
+ myBallActor->SetVisibility(false);
+ myBallActor->SetProperty(aBallProp);
+ myBallActor->SetMapper(myBallMapper);
+ aBallProp->Delete();
+
+ myVTKViewWindow->AddActor(myBallActor);
}
typedef std::vector<vtkIdType> TVTKIds;
{
vtkUnstructuredGrid *aGrid = theActor->GetUnstructuredGrid();
myGrid->SetPoints(aGrid->GetPoints());
- myGrid->Reset();
+ myGrid->Reset();
const std::vector<int>& interlace = SMDS_MeshCell::toVtkOrder( VTKCellType( theType ));
SMDS_MeshCell::applyInterlace( interlace, theIds );
myGrid->Modified();
- SetVisibility(true, theActor->GetFacesOriented());
+ SetVisibility(true, theActor->GetFacesOriented(), false);
}
+ void SetBallPosition(SMESH_Actor* theActor,TVTKIds& theIds, double theDiameter) {
+ vtkUnstructuredGrid *aGrid = theActor->GetUnstructuredGrid();
+ myBallPolyData->Reset();
+ myBallPolyData->DeleteCells();
+ myBallPolyData->SetPoints(aGrid->GetPoints());
+
+ vtkDataArray* aScalars = vtkDataArray::CreateDataArray(VTK_DOUBLE);
+ aScalars->SetNumberOfComponents(1);
+ aScalars->SetNumberOfTuples(theIds.size());
+ myBallPolyData->GetCellData()->SetScalars(aScalars);
+ aScalars->Delete();
+
+ vtkIdList *anIds = vtkIdList::New();
+ anIds->SetNumberOfIds(1);
+ 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;
+ aScalars->SetTuple(anId,&d);
+ anIds->Reset();
+ }
+
+ anIds->Delete();
+ myBallPolyData->Modified();
+ SetVisibility (false, false, true);
+ }
- void SetVisibility (bool theVisibility, bool theShowOrientation = false)
+ void SetVisibility (bool theVisibility, bool theShowOrientation = false, bool theShowBalls = false)
{
myPreviewActor->SetVisibility(theVisibility);
myFaceOrientation->SetVisibility(theShowOrientation);
+ myBallActor->SetVisibility(theShowBalls);
RepaintCurrentView();
}
~TElementSimulation()
{
+ myMapper->RemoveAllInputs();
+ myFaceOrientationDataMapper->RemoveAllInputs();
+ myBallMapper->RemoveAllInputs();
+
if (FindVtkViewWindow(myApplication->activeViewManager(), myViewWindow)) {
- myVTKViewWindow->RemoveActor(myPreviewActor);
- myVTKViewWindow->RemoveActor(myFaceOrientation);
+ myVTKViewWindow->RemoveActor(myPreviewActor,false,false);
+ myVTKViewWindow->RemoveActor(myFaceOrientation,false,false);
+ myVTKViewWindow->RemoveActor(myBallActor,false,false);
}
- myPreviewActor->Delete();
- myFaceOrientation->Delete();
- myMapper->RemoveAllInputs();
myMapper->Delete();
-
- myFaceOrientationFilter->Delete();
-
- myFaceOrientationDataMapper->RemoveAllInputs();
+ myGrid->Delete();
+ myPreviewActor->Delete();
+
+ myFaceOrientationFilter->Delete();
myFaceOrientationDataMapper->Delete();
+ myFaceOrientation->Delete();
- myGrid->Delete();
+ myBallMapper->Delete();
+ myBallPolyData->Delete();
+ myBallActor->Delete();
}
};
}
DiameterSpinBox->RangeStepAndValidator( 1e-7, 1e+9, 0.1 );
DiameterSpinBox->SetValue( 1. );
+ connect( DiameterSpinBox, SIGNAL( valueChanged ( double ) ), this, SLOT( onDiameterChanged( ) ) );
}
/* Add to group ************************************************/
GroupGroups = new QGroupBox( tr( "SMESH_ADD_TO_GROUP" ), this );
mySelector->ClearIndex();
mySelectionMgr->setSelectedObjects( aList, false );
- SMESH::UpdateView();
mySimulation->SetVisibility(false);
-
+ SMESH::UpdateView();
+
buttonOk->setEnabled(false);
buttonApply->setEnabled(false);
//=================================================================================
void SMESHGUI_AddMeshElementDlg::reject()
{
- //mySelectionMgr->clearSelected();
mySimulation->SetVisibility(false);
SMESH::SetPointRepresentation(false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
}
vtkIdType aType = SMDS_MeshCell::toVtkType( myGeomType );
- mySimulation->SetPosition(myActor,aType,anIds);
+ if(aType == VTK_POLY_VERTEX) {
+ mySimulation->SetBallPosition(myActor,anIds,DiameterSpinBox->GetValue());
+ } else {
+ mySimulation->SetPosition(myActor,aType,anIds);
+ }
SMESH::UpdateView();
}
}
}
}
+//=================================================================================
+// function : isValid
+// purpose :
+//=================================================================================
+void SMESHGUI_AddMeshElementDlg::onDiameterChanged(){
+ displaySimulation();
+}
+
//=================================================================================
// function : isValid
// purpose :
class SMESHGUI_EXPORT SMESHGUI_AddMeshElementDlg : public QDialog
{
Q_OBJECT
-
public:
SMESHGUI_AddMeshElementDlg( SMESHGUI*, SMDSAbs_EntityType = SMDSEntity_Edge );
~SMESHGUI_AddMeshElementDlg();
protected slots:
virtual void reject();
+ void onDiameterChanged();
private slots:
void ClickOnOk();
#include <SalomeApp_Application.h>
+#include <Qtx.h>
+
// IDL includes
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
myPreviewActor->PickableOff();
myPreviewActor->VisibilityOff();
myPreviewActor->SetMapper(myMapper);
-
+
+ QColor ffc, bfc;
+ int delta;
vtkProperty* myProp = vtkProperty::New();
- double aRGB[3], aBackRGB[3];
- GetColor( "SMESH", "fill_color", aRGB[0], aRGB[1], aRGB[2], QColor( 0, 170, 255 ) );
- myProp->SetColor( aRGB[0], aRGB[1], aRGB[2] );
+ SMESH::GetColor( "SMESH", "preview_color", ffc, delta, "0, 255, 0|-100" ) ;
+
+ myProp->SetColor( ffc.red() / 255. , ffc.green() / 255. , ffc.blue() / 255. );
myPreviewActor->SetProperty( myProp );
myProp->Delete();
vtkProperty* myBackProp = vtkProperty::New();
- GetColor( "SMESH", "backface_color", aBackRGB[0], aBackRGB[1], aBackRGB[2], QColor( 0, 0, 255 ) );
- myBackProp->SetColor( aBackRGB[0], aBackRGB[1], aBackRGB[2] );
+ bfc = Qtx::mainColorToSecondary(ffc, delta);
+ myBackProp->SetColor( bfc.red() / 255. , bfc.green() / 255. , bfc.blue() / 255. );
myPreviewActor->SetBackfaceProperty( myBackProp );
myBackProp->Delete();
myFaceOrientation->SetMapper(myFaceOrientationDataMapper);
vtkProperty* anOrientationProp = vtkProperty::New();
+ double aRGB[3];
GetColor( "SMESH", "orientation_color", aRGB[0], aRGB[1], aRGB[2], QColor( 255, 255, 255 ) );
anOrientationProp->SetColor( aRGB[0], aRGB[1], aRGB[2] );
myFaceOrientation->SetProperty( anOrientationProp );
myActor->SetInfinitive(true);
myActor->SetMapper(myMapper);
- double anRGB[3];
+ QColor ffc, bfc;
+ int delta;
+ SMESH::GetColor( "SMESH", "fill_color", ffc, delta, "255, 170, 0|-100" ) ;
+
vtkProperty* aProp = vtkProperty::New();
- SMESH::GetColor( "SMESH", "fill_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 170, 255 ) );
- aProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+ SMESH::GetColor( "SMESH", "fill_color", ffc, delta, "255, 170, 0|-100" ) ;
+ aProp->SetColor(ffc.red() / 255. , ffc.green() / 255. , ffc.blue() / 255.);
aProp->SetOpacity(0.75);
myActor->SetProperty(aProp);
aProp->Delete();
vtkProperty* aBackProp = vtkProperty::New();
- SMESH::GetColor( "SMESH", "backface_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 0, 255 ) );
- aBackProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+ bfc = Qtx::mainColorToSecondary(ffc, delta);
+ aBackProp->SetColor( bfc.red() / 255. , bfc.green() / 255. , bfc.blue() / 255.);
aBackProp->SetOpacity(0.75);
myActor->SetBackfaceProperty(aBackProp);
aBackProp->Delete();
<source>PREF_FILL</source>
<translation>Surface color</translation>
</message>
+ <message>
+ <source>PREF_PREVIEW_COLOR</source>
+ <translation>Preview color</translation>
+ </message>
<message>
<source>PREF_NOTIFY_MODE</source>
<translation>Show a computation result notification</translation>