mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-13 02:00:34 +05:00
Implementation of the "0022102: EDF 1496 SMESH : Displaying of discrete elements in SMESH relating to their attribute (diameter)" issue.
This commit is contained in:
parent
535d13a0f8
commit
519f45e495
Binary file not shown.
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 30 KiB |
@ -156,6 +156,7 @@ later sessions with this module.
|
|||||||
borders.
|
borders.
|
||||||
- <b>Wireframe color</b> - allows to select the color of borders of
|
- <b>Wireframe color</b> - allows to select the color of borders of
|
||||||
elements in the wireframe mode.
|
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 0D elements</b> - specifies default size of 0D elements.
|
||||||
- <b>Size of ball elements</b> - specifies default size of discrete
|
- <b>Size of ball elements</b> - specifies default size of discrete
|
||||||
elements (balls).
|
elements (balls).
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
<parameter name="node_color" value="255, 0, 0"/>
|
<parameter name="node_color" value="255, 0, 0"/>
|
||||||
<parameter name="fill_color" value="#00aaff|100"/>
|
<parameter name="fill_color" value="#00aaff|100"/>
|
||||||
<parameter name="volume_color" value="255, 0, 170|-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="wireframe_color" value="0, 170, 255"/>
|
||||||
<parameter name="outline_color" value="#004600"/>
|
<parameter name="outline_color" value="#004600"/>
|
||||||
<parameter name="elem0d_color" value="0, 255, 0"/>
|
<parameter name="elem0d_color" value="0, 255, 0"/>
|
||||||
|
@ -375,7 +375,6 @@ SMESH_ActorDef::SMESH_ActorDef()
|
|||||||
my0DActor->SetProperty(my0DProp);
|
my0DActor->SetProperty(my0DProp);
|
||||||
my0DActor->SetRepresentation(SMESH_DeviceActor::eSurface);
|
my0DActor->SetRepresentation(SMESH_DeviceActor::eSurface);
|
||||||
aFilter = my0DActor->GetExtractUnstructuredGrid();
|
aFilter = my0DActor->GetExtractUnstructuredGrid();
|
||||||
//aFilter->SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::ePoints);
|
|
||||||
aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
|
aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
|
||||||
aFilter->RegisterCellsWithType(VTK_VERTEX);
|
aFilter->RegisterCellsWithType(VTK_VERTEX);
|
||||||
|
|
||||||
@ -394,6 +393,7 @@ SMESH_ActorDef::SMESH_ActorDef()
|
|||||||
myBallActor->SetVisibility(false);
|
myBallActor->SetVisibility(false);
|
||||||
myBallActor->SetProperty(myBallProp);
|
myBallActor->SetProperty(myBallProp);
|
||||||
myBallActor->SetRepresentation(SMESH_DeviceActor::eSurface);
|
myBallActor->SetRepresentation(SMESH_DeviceActor::eSurface);
|
||||||
|
myBallActor->SetBallEnabled(true);
|
||||||
aFilter = myBallActor->GetExtractUnstructuredGrid();
|
aFilter = myBallActor->GetExtractUnstructuredGrid();
|
||||||
aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
|
aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
|
||||||
aFilter->RegisterCellsWithType(VTK_POLY_VERTEX);
|
aFilter->RegisterCellsWithType(VTK_POLY_VERTEX);
|
||||||
@ -474,11 +474,6 @@ SMESH_ActorDef::SMESH_ActorDef()
|
|||||||
myHighlightProp->SetLineWidth(aLineWidth);
|
myHighlightProp->SetLineWidth(aLineWidth);
|
||||||
myHighlightProp->SetRepresentation(1);
|
myHighlightProp->SetRepresentation(1);
|
||||||
|
|
||||||
myBallHighlightProp = vtkProperty::New();
|
|
||||||
myBallHighlightProp->DeepCopy(myHighlightProp);
|
|
||||||
myBallHighlightProp->SetPointSize(aBallElemSize);
|
|
||||||
|
|
||||||
|
|
||||||
myOutLineProp = vtkProperty::New();
|
myOutLineProp = vtkProperty::New();
|
||||||
myOutLineProp->SetAmbient(1.0);
|
myOutLineProp->SetAmbient(1.0);
|
||||||
myOutLineProp->SetDiffuse(0.0);
|
myOutLineProp->SetDiffuse(0.0);
|
||||||
@ -498,10 +493,6 @@ SMESH_ActorDef::SMESH_ActorDef()
|
|||||||
myPreselectProp->SetLineWidth(aLineWidth);
|
myPreselectProp->SetLineWidth(aLineWidth);
|
||||||
myPreselectProp->SetRepresentation(1);
|
myPreselectProp->SetRepresentation(1);
|
||||||
|
|
||||||
myBallPreselectProp = vtkProperty::New();
|
|
||||||
myBallPreselectProp->DeepCopy(myPreselectProp);
|
|
||||||
myBallPreselectProp->SetPointSize(aBallElemSize);
|
|
||||||
|
|
||||||
myHighlitableActor = SMESH_DeviceActor::New();
|
myHighlitableActor = SMESH_DeviceActor::New();
|
||||||
myHighlitableActor->SetUserMatrix(aMatrix);
|
myHighlitableActor->SetUserMatrix(aMatrix);
|
||||||
myHighlitableActor->PickableOff();
|
myHighlitableActor->PickableOff();
|
||||||
@ -602,9 +593,6 @@ SMESH_ActorDef::~SMESH_ActorDef()
|
|||||||
myOutLineProp->Delete();
|
myOutLineProp->Delete();
|
||||||
myPreselectProp->Delete();
|
myPreselectProp->Delete();
|
||||||
|
|
||||||
myBallHighlightProp->Delete();
|
|
||||||
myBallPreselectProp->Delete();
|
|
||||||
|
|
||||||
myHighlitableActor->Delete();
|
myHighlitableActor->Delete();
|
||||||
|
|
||||||
my2DExtProp->Delete();
|
my2DExtProp->Delete();
|
||||||
@ -678,8 +666,6 @@ void SMESH_ActorDef::SetCellsFontProperties( SMESH::LabelFont theFamily, int the
|
|||||||
{
|
{
|
||||||
if(my3DActor) {
|
if(my3DActor) {
|
||||||
my3DActor->SetFontProperties( theFamily, theSize, theBold, theItalic, theShadow, r, g, b );
|
my3DActor->SetFontProperties( theFamily, theSize, theBold, theItalic, theShadow, r, g, b );
|
||||||
SetRepresentation( GetRepresentation() );
|
|
||||||
myTimeStamp->Modified();
|
|
||||||
}
|
}
|
||||||
if(my2DActor) {
|
if(my2DActor) {
|
||||||
my2DActor->SetFontProperties( theFamily, theSize, theBold, theItalic, theShadow, r, g, b );
|
my2DActor->SetFontProperties( theFamily, theSize, theBold, theItalic, theShadow, r, g, b );
|
||||||
@ -1094,8 +1080,6 @@ SetControlMode(eControl theMode,
|
|||||||
|
|
||||||
void SMESH_ActorDef::AddToRender(vtkRenderer* theRenderer){
|
void SMESH_ActorDef::AddToRender(vtkRenderer* theRenderer){
|
||||||
|
|
||||||
//myHighlightActor->AddToRender(theRenderer);
|
|
||||||
|
|
||||||
theRenderer->AddActor(myBaseActor);
|
theRenderer->AddActor(myBaseActor);
|
||||||
theRenderer->AddActor(myNodeExtActor);
|
theRenderer->AddActor(myNodeExtActor);
|
||||||
theRenderer->AddActor(my1DExtActor);
|
theRenderer->AddActor(my1DExtActor);
|
||||||
@ -1108,7 +1092,6 @@ void SMESH_ActorDef::AddToRender(vtkRenderer* theRenderer){
|
|||||||
my1DActor ->AddToRender(theRenderer);
|
my1DActor ->AddToRender(theRenderer);
|
||||||
my0DActor ->AddToRender(theRenderer);
|
my0DActor ->AddToRender(theRenderer);
|
||||||
myBallActor ->AddToRender(theRenderer);
|
myBallActor ->AddToRender(theRenderer);
|
||||||
//theRenderer->AddActor(my0DExtActor);
|
|
||||||
|
|
||||||
theRenderer->AddActor(myHighlitableActor);
|
theRenderer->AddActor(myHighlitableActor);
|
||||||
|
|
||||||
@ -1157,6 +1140,9 @@ bool SMESH_ActorDef::Init(TVisualObjPtr theVisualObj,
|
|||||||
myVisualObj = theVisualObj;
|
myVisualObj = theVisualObj;
|
||||||
myVisualObj->Update(theIsClear);
|
myVisualObj->Update(theIsClear);
|
||||||
|
|
||||||
|
SMESH_SVTKActor::SafeDownCast(myHighlightActor)->SetVisualObject(myVisualObj);
|
||||||
|
SMESH_SVTKActor::SafeDownCast(myPreHighlightActor)->SetVisualObject(myVisualObj);
|
||||||
|
|
||||||
myNodeActor->Init(myVisualObj,myImplicitBoolean);
|
myNodeActor->Init(myVisualObj,myImplicitBoolean);
|
||||||
myBaseActor->Init(myVisualObj,myImplicitBoolean);
|
myBaseActor->Init(myVisualObj,myImplicitBoolean);
|
||||||
|
|
||||||
@ -1559,7 +1545,6 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode)
|
|||||||
|
|
||||||
if (myEntityMode & eBallElem) {
|
if (myEntityMode & eBallElem) {
|
||||||
aFilter->RegisterCellsWithType(VTK_POLY_VERTEX);
|
aFilter->RegisterCellsWithType(VTK_POLY_VERTEX);
|
||||||
aHightFilter->RegisterCellsWithType(VTK_POLY_VERTEX);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (myEntityMode & eEdges) {
|
if (myEntityMode & eEdges) {
|
||||||
@ -1638,9 +1623,9 @@ void SMESH_ActorDef::SetRepresentation (int theMode)
|
|||||||
|
|
||||||
if (theMode < 0) {
|
if (theMode < 0) {
|
||||||
myRepresentation = eSurface;
|
myRepresentation = eSurface;
|
||||||
if (!aNbFaces && !aNbVolumes && aNbEdges) {
|
if (!aNbFaces && !aNbVolumes && !aNbBalls && aNbEdges) {
|
||||||
myRepresentation = eEdge;
|
myRepresentation = eEdge;
|
||||||
} else if (!aNbFaces && !aNbVolumes && !aNbEdges) {
|
} else if (!aNbFaces && !aNbVolumes && !aNbEdges && !aNbBalls) {
|
||||||
myRepresentation = ePoint;
|
myRepresentation = ePoint;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -1710,17 +1695,13 @@ void SMESH_ActorDef::SetRepresentation (int theMode)
|
|||||||
my3DActor->SetBackfaceProperty(aPropVR);
|
my3DActor->SetBackfaceProperty(aPropVR);
|
||||||
my3DActor->SetRepresentation(aReperesent);
|
my3DActor->SetRepresentation(aReperesent);
|
||||||
|
|
||||||
//my0DExtActor->SetVisibility(false);
|
|
||||||
my1DExtActor->SetVisibility(false);
|
my1DExtActor->SetVisibility(false);
|
||||||
my2DExtActor->SetVisibility(false);
|
my2DExtActor->SetVisibility(false);
|
||||||
my3DExtActor->SetVisibility(false);
|
my3DExtActor->SetVisibility(false);
|
||||||
|
|
||||||
// ???
|
|
||||||
//my0DActor->SetProperty(aProp);
|
|
||||||
//my0DActor->SetBackfaceProperty(aBackProp);
|
|
||||||
my0DActor->SetRepresentation(aReperesent);
|
my0DActor->SetRepresentation(aReperesent);
|
||||||
myBallActor->SetRepresentation(aReperesent);
|
myBallActor->SetRepresentation(aReperesent);
|
||||||
//my0DExtActor->SetRepresentation(aReperesent);
|
|
||||||
|
|
||||||
switch(myControlMode){
|
switch(myControlMode){
|
||||||
case eLength:
|
case eLength:
|
||||||
@ -1770,7 +1751,6 @@ bool SMESH_ActorDef::GetPointRepresentation(){
|
|||||||
void SMESH_ActorDef::UpdateHighlight(){
|
void SMESH_ActorDef::UpdateHighlight(){
|
||||||
myHighlitableActor->SetHighlited(false);
|
myHighlitableActor->SetHighlited(false);
|
||||||
myHighlitableActor->SetVisibility(false);
|
myHighlitableActor->SetVisibility(false);
|
||||||
|
|
||||||
bool anIsVisible = GetVisibility();
|
bool anIsVisible = GetVisibility();
|
||||||
|
|
||||||
switch(myRepresentation){
|
switch(myRepresentation){
|
||||||
@ -1779,12 +1759,9 @@ void SMESH_ActorDef::UpdateHighlight(){
|
|||||||
{
|
{
|
||||||
if(myIsHighlighted) {
|
if(myIsHighlighted) {
|
||||||
myHighlitableActor->SetProperty(myHighlightProp);
|
myHighlitableActor->SetProperty(myHighlightProp);
|
||||||
myBallActor->SetProperty(myBallHighlightProp);
|
|
||||||
}else if(myIsPreselected){
|
}else if(myIsPreselected){
|
||||||
myHighlitableActor->SetProperty(myPreselectProp);
|
myHighlitableActor->SetProperty(myPreselectProp);
|
||||||
myBallActor->SetProperty(myBallPreselectProp);
|
|
||||||
} else if(anIsVisible){
|
} else if(anIsVisible){
|
||||||
myBallActor->SetProperty(myBallProp);
|
|
||||||
(myRepresentation == eSurface) ?
|
(myRepresentation == eSurface) ?
|
||||||
myHighlitableActor->SetProperty(myOutLineProp) : myHighlitableActor->SetProperty(myEdgeProp);
|
myHighlitableActor->SetProperty(myOutLineProp) : myHighlitableActor->SetProperty(myEdgeProp);
|
||||||
}
|
}
|
||||||
@ -2042,7 +2019,6 @@ void SMESH_ActorDef::GetBallColor(double& r,double& g,double& b){
|
|||||||
|
|
||||||
void SMESH_ActorDef::SetHighlightColor(double r,double g,double b){
|
void SMESH_ActorDef::SetHighlightColor(double r,double g,double b){
|
||||||
myHighlightProp->SetColor(r,g,b);
|
myHighlightProp->SetColor(r,g,b);
|
||||||
myBallHighlightProp->SetColor(r,g,b);
|
|
||||||
Modified();
|
Modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2052,7 +2028,6 @@ void SMESH_ActorDef::GetHighlightColor(double& r,double& g,double& b){
|
|||||||
|
|
||||||
void SMESH_ActorDef::SetPreHighlightColor(double r,double g,double b){
|
void SMESH_ActorDef::SetPreHighlightColor(double r,double g,double b){
|
||||||
myPreselectProp->SetColor(r,g,b);
|
myPreselectProp->SetColor(r,g,b);
|
||||||
myBallPreselectProp->SetColor(r,g,b);
|
|
||||||
Modified();
|
Modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2111,8 +2086,7 @@ double SMESH_ActorDef::Get0DSize(){
|
|||||||
|
|
||||||
void SMESH_ActorDef::SetBallSize(double theVal){
|
void SMESH_ActorDef::SetBallSize(double theVal){
|
||||||
myBallProp->SetPointSize(theVal);
|
myBallProp->SetPointSize(theVal);
|
||||||
myBallHighlightProp->SetPointSize(theVal);
|
|
||||||
myBallPreselectProp->SetPointSize(theVal);
|
|
||||||
if(SMESH_SVTKActor* aCustom = SMESH_SVTKActor::SafeDownCast( myHighlightActor )) {
|
if(SMESH_SVTKActor* aCustom = SMESH_SVTKActor::SafeDownCast( myHighlightActor )) {
|
||||||
aCustom->SetBallSize(theVal);
|
aCustom->SetBallSize(theVal);
|
||||||
}
|
}
|
||||||
|
@ -259,9 +259,6 @@ class SMESH_ActorDef : public SMESH_Actor
|
|||||||
vtkProperty* myOutLineProp;
|
vtkProperty* myOutLineProp;
|
||||||
vtkProperty* myPreselectProp;
|
vtkProperty* myPreselectProp;
|
||||||
|
|
||||||
vtkProperty* myBallHighlightProp;
|
|
||||||
vtkProperty* myBallPreselectProp;
|
|
||||||
|
|
||||||
SMESH_DeviceActor* myHighlitableActor;
|
SMESH_DeviceActor* myHighlitableActor;
|
||||||
|
|
||||||
eControl myControlMode;
|
eControl myControlMode;
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
#include <VTKViewer_TransformFilter.h>
|
#include <VTKViewer_TransformFilter.h>
|
||||||
#include <VTKViewer_CellCenters.h>
|
#include <VTKViewer_CellCenters.h>
|
||||||
|
#include <VTKViewer_ExtractUnstructuredGrid.h>
|
||||||
|
|
||||||
#include <vtkObjectFactory.h>
|
#include <vtkObjectFactory.h>
|
||||||
#include <vtkCallbackCommand.h>
|
#include <vtkCallbackCommand.h>
|
||||||
@ -152,7 +153,9 @@ void SMESH_CellLabelActor::SetCellsLabeled(bool theIsCellsLabeled) {
|
|||||||
vtkIntArray *anArray = vtkIntArray::New();
|
vtkIntArray *anArray = vtkIntArray::New();
|
||||||
anArray->SetNumberOfValues(aNbElem);
|
anArray->SetNumberOfValues(aNbElem);
|
||||||
for(int anId = 0; anId < aNbElem; anId++){
|
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);
|
anArray->SetValue(anId,aSMDSId);
|
||||||
}
|
}
|
||||||
aDataSet->GetCellData()->SetScalars(anArray);
|
aDataSet->GetCellData()->SetScalars(anArray);
|
||||||
|
@ -228,6 +228,11 @@ SMESH_DeviceActor
|
|||||||
myExtractUnstructuredGrid->SetInputData(theGrid);
|
myExtractUnstructuredGrid->SetInputData(theGrid);
|
||||||
|
|
||||||
myMergeFilter->SetGeometryConnection(myExtractUnstructuredGrid->GetOutputPort());
|
myMergeFilter->SetGeometryConnection(myExtractUnstructuredGrid->GetOutputPort());
|
||||||
|
|
||||||
|
//Pass diameters of the balls
|
||||||
|
if(myMapper->GetBallEnabled()) {
|
||||||
|
myMergeFilter->SetScalarsConnection(myExtractUnstructuredGrid->GetOutputPort());
|
||||||
|
}
|
||||||
|
|
||||||
myExtractGeometry->SetInputConnection(myMergeFilter->GetOutputPort());
|
myExtractGeometry->SetInputConnection(myMergeFilter->GetOutputPort());
|
||||||
|
|
||||||
@ -935,6 +940,14 @@ void SMESH_DeviceActor::SetMarkerEnabled( bool theMarkerEnabled )
|
|||||||
myMapper->SetMarkerEnabled( theMarkerEnabled );
|
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
|
* Set standard point marker
|
||||||
* \param theMarkerType type of the marker
|
* \param theMarkerType type of the marker
|
||||||
|
@ -144,6 +144,7 @@ class SMESHOBJECT_EXPORT SMESH_DeviceActor: public vtkLODActor{
|
|||||||
bool IsImplicitFunctionUsed() const{ return myIsImplicitFunctionUsed;}
|
bool IsImplicitFunctionUsed() const{ return myIsImplicitFunctionUsed;}
|
||||||
|
|
||||||
void SetMarkerEnabled( bool );
|
void SetMarkerEnabled( bool );
|
||||||
|
void SetBallEnabled( bool );
|
||||||
void SetMarkerStd( VTK::MarkerType, VTK::MarkerScale );
|
void SetMarkerStd( VTK::MarkerType, VTK::MarkerScale );
|
||||||
void SetMarkerTexture( int, VTK::MarkerTexture );
|
void SetMarkerTexture( int, VTK::MarkerTexture );
|
||||||
VTK::MarkerType GetMarkerType();
|
VTK::MarkerType GetMarkerType();
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
#include "SMDS_Mesh.hxx"
|
#include "SMDS_Mesh.hxx"
|
||||||
#include "SMDS_PolyhedralVolumeOfNodes.hxx"
|
#include "SMDS_PolyhedralVolumeOfNodes.hxx"
|
||||||
|
#include "SMDS_BallElement.hxx"
|
||||||
#include "SMESH_Actor.h"
|
#include "SMESH_Actor.h"
|
||||||
#include "SMESH_ControlsDef.hxx"
|
#include "SMESH_ControlsDef.hxx"
|
||||||
#include "SalomeApp_Application.h"
|
#include "SalomeApp_Application.h"
|
||||||
@ -43,7 +44,7 @@
|
|||||||
#include <vtkIdList.h>
|
#include <vtkIdList.h>
|
||||||
#include <vtkCellArray.h>
|
#include <vtkCellArray.h>
|
||||||
#include <vtkUnsignedCharArray.h>
|
#include <vtkUnsignedCharArray.h>
|
||||||
|
#include <vtkCellData.h>
|
||||||
#include <vtkUnstructuredGrid.h>
|
#include <vtkUnstructuredGrid.h>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@ -279,7 +280,9 @@ void SMESH_VisualObjDef::buildPrs(bool buildGrid)
|
|||||||
//MESSAGE(myGrid->GetReferenceCount());
|
//MESSAGE(myGrid->GetReferenceCount());
|
||||||
//MESSAGE( "Update - myGrid->GetNumberOfCells() = "<<myGrid->GetNumberOfCells() );
|
//MESSAGE( "Update - myGrid->GetNumberOfCells() = "<<myGrid->GetNumberOfCells() );
|
||||||
//MESSAGE( "Update - myGrid->GetNumberOfPoints() = "<<myGrid->GetNumberOfPoints() );
|
//MESSAGE( "Update - myGrid->GetNumberOfPoints() = "<<myGrid->GetNumberOfPoints() );
|
||||||
if( MYDEBUGWITHFILES ) SMESH::WriteUnstructuredGrid( myGrid,"buildPrs.vtu" );
|
if( MYDEBUGWITHFILES ) {
|
||||||
|
SMESH::WriteUnstructuredGrid( myGrid,"myPrs.vtu" );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -417,7 +420,13 @@ void SMESH_VisualObjDef::buildElemPrs()
|
|||||||
aConnect.reserve(VTK_CELL_SIZE);
|
aConnect.reserve(VTK_CELL_SIZE);
|
||||||
|
|
||||||
SMDS_Mesh::CheckMemory(); // PAL16631
|
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
|
for ( int i = 0; i < nbTypes; i++ ) // iterate through all types of elements
|
||||||
{
|
{
|
||||||
if ( nbEnts[ aTypes[ i ] ] > 0 ) {
|
if ( nbEnts[ aTypes[ i ] ] > 0 ) {
|
||||||
@ -475,8 +484,19 @@ void SMESH_VisualObjDef::buildElemPrs()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
aConnectivity->InsertNextCell( anIdList );
|
vtkIdType aCurId = aConnectivity->InsertNextCell( anIdList );
|
||||||
aCellTypesArray->InsertNextValue( vtkElemType );
|
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++;
|
iElem++;
|
||||||
}
|
}
|
||||||
@ -497,6 +517,7 @@ void SMESH_VisualObjDef::buildElemPrs()
|
|||||||
aCellLocationsArray->SetValue( idType, aConnectivity->GetTraversalLocation( npts ) );
|
aCellLocationsArray->SetValue( idType, aConnectivity->GetTraversalLocation( npts ) );
|
||||||
|
|
||||||
myGrid->SetCells( aCellTypesArray, aCellLocationsArray,aConnectivity );
|
myGrid->SetCells( aCellTypesArray, aCellLocationsArray,aConnectivity );
|
||||||
|
myGrid->GetCellData()->SetScalars(aScalars);
|
||||||
|
|
||||||
aCellLocationsArray->Delete();
|
aCellLocationsArray->Delete();
|
||||||
aCellTypesArray->Delete();
|
aCellTypesArray->Delete();
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
#include <vtkCell.h>
|
#include <vtkCell.h>
|
||||||
#include <vtkDataSetMapper.h>
|
#include <vtkDataSetMapper.h>
|
||||||
#include <vtkPolyhedron.h>
|
#include <vtkPolyhedron.h>
|
||||||
|
#include <vtkCellData.h>
|
||||||
|
|
||||||
#include <Utils_SALOME_Exception.hxx>
|
#include <Utils_SALOME_Exception.hxx>
|
||||||
|
|
||||||
@ -53,6 +54,7 @@ SMESH_SVTKActor::SMESH_SVTKActor():
|
|||||||
{
|
{
|
||||||
my0DActor = SVTK_DeviceActor::New();
|
my0DActor = SVTK_DeviceActor::New();
|
||||||
myBallActor = SVTK_DeviceActor::New();
|
myBallActor = SVTK_DeviceActor::New();
|
||||||
|
myBallActor->SetBallEnabled(true);
|
||||||
|
|
||||||
myBallActor->SetResolveCoincidentTopology(false);
|
myBallActor->SetResolveCoincidentTopology(false);
|
||||||
myBallActor->SetCoincident3DAllowed(true);
|
myBallActor->SetCoincident3DAllowed(true);
|
||||||
@ -121,8 +123,18 @@ SMESH_SVTKActor
|
|||||||
SVTK::CopyPoints( GetSource(), aSourceDataSet );
|
SVTK::CopyPoints( GetSource(), aSourceDataSet );
|
||||||
SVTK::CopyPoints( myBallGrid, aSourceDataSet );
|
SVTK::CopyPoints( myBallGrid, aSourceDataSet );
|
||||||
SVTK::CopyPoints( my0DGrid, aSourceDataSet );
|
SVTK::CopyPoints( my0DGrid, aSourceDataSet );
|
||||||
|
|
||||||
|
|
||||||
int aNbOfParts = theMapIndex.Extent();
|
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++){
|
for(int ind = 1; ind <= aNbOfParts; ind++){
|
||||||
int aPartId = theMapIndex( ind );
|
int aPartId = theMapIndex( ind );
|
||||||
if(vtkCell* aCell = theMapActor->GetElemCell(aPartId))
|
if(vtkCell* aCell = theMapActor->GetElemCell(aPartId))
|
||||||
@ -132,7 +144,10 @@ SMESH_SVTKActor
|
|||||||
if(aCell->GetCellType() == VTK_VERTEX ) {
|
if(aCell->GetCellType() == VTK_VERTEX ) {
|
||||||
my0DGrid->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds());
|
my0DGrid->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds());
|
||||||
} else if(aCell->GetCellType() == VTK_POLY_VERTEX ) {
|
} 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 {
|
} else {
|
||||||
myUnstructuredGrid->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds());
|
myUnstructuredGrid->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds());
|
||||||
}
|
}
|
||||||
@ -182,3 +197,7 @@ void SMESH_SVTKActor::SetBallSize(float theSize) {
|
|||||||
myBallActor->GetProperty()->SetPointSize(theSize);
|
myBallActor->GetProperty()->SetPointSize(theSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SMESH_SVTKActor::SetVisualObject(TVisualObjPtr theVisualObj) {
|
||||||
|
myVisualObj = theVisualObj;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -68,12 +68,15 @@ public:
|
|||||||
void
|
void
|
||||||
RemoveFromRender(vtkRenderer* theRendere);
|
RemoveFromRender(vtkRenderer* theRendere);
|
||||||
|
|
||||||
|
void SetVisualObject(TVisualObjPtr theVisualObj);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
SVTK_DeviceActor* my0DActor;
|
SVTK_DeviceActor* my0DActor;
|
||||||
SVTK_DeviceActor* myBallActor;
|
SVTK_DeviceActor* myBallActor;
|
||||||
|
|
||||||
vtkUnstructuredGrid* my0DGrid;
|
vtkUnstructuredGrid* my0DGrid;
|
||||||
vtkUnstructuredGrid* myBallGrid;
|
vtkUnstructuredGrid* myBallGrid;
|
||||||
|
TVisualObjPtr myVisualObj;
|
||||||
|
|
||||||
SMESH_SVTKActor();
|
SMESH_SVTKActor();
|
||||||
virtual ~SMESH_SVTKActor();
|
virtual ~SMESH_SVTKActor();
|
||||||
|
@ -4994,6 +4994,7 @@ void SMESHGUI::createPreferences()
|
|||||||
addPreference( tr( "PREF_BALL_COLOR" ), elemGroup, LightApp_Preferences::Color, "SMESH", "ball_elem_color" );
|
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_OUTLINE" ), elemGroup, LightApp_Preferences::Color, "SMESH", "outline_color" );
|
||||||
addPreference( tr( "PREF_WIREFRAME" ), elemGroup, LightApp_Preferences::Color, "SMESH", "wireframe_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 );
|
int grpGroup = addPreference( tr( "PREF_GROUP_GROUPS" ), meshTab );
|
||||||
|
@ -51,6 +51,10 @@
|
|||||||
#include <SalomeApp_Application.h>
|
#include <SalomeApp_Application.h>
|
||||||
#include <SVTK_ViewModel.h>
|
#include <SVTK_ViewModel.h>
|
||||||
#include <SVTK_ViewWindow.h>
|
#include <SVTK_ViewWindow.h>
|
||||||
|
#include <VTKViewer_PolyDataMapper.h>
|
||||||
|
#include <SVTK_Renderer.h>
|
||||||
|
#include <Qtx.h>
|
||||||
|
|
||||||
|
|
||||||
// IDL incldues
|
// IDL incldues
|
||||||
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
|
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
|
||||||
@ -65,6 +69,7 @@
|
|||||||
#include <vtkDataSetMapper.h>
|
#include <vtkDataSetMapper.h>
|
||||||
#include <vtkPolyDataMapper.h>
|
#include <vtkPolyDataMapper.h>
|
||||||
#include <vtkProperty.h>
|
#include <vtkProperty.h>
|
||||||
|
#include <vtkCellData.h>
|
||||||
|
|
||||||
// Qt includes
|
// Qt includes
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
@ -95,6 +100,10 @@ namespace SMESH
|
|||||||
SALOME_Actor* myPreviewActor;
|
SALOME_Actor* myPreviewActor;
|
||||||
vtkDataSetMapper* myMapper;
|
vtkDataSetMapper* myMapper;
|
||||||
vtkUnstructuredGrid* myGrid;
|
vtkUnstructuredGrid* myGrid;
|
||||||
|
|
||||||
|
SALOME_Actor* myBallActor;
|
||||||
|
VTKViewer_PolyDataMapper* myBallMapper;
|
||||||
|
vtkPolyData* myBallPolyData;
|
||||||
|
|
||||||
SALOME_Actor* myFaceOrientation;
|
SALOME_Actor* myFaceOrientation;
|
||||||
vtkPolyDataMapper* myFaceOrientationDataMapper;
|
vtkPolyDataMapper* myFaceOrientationDataMapper;
|
||||||
@ -120,16 +129,18 @@ namespace SMESH
|
|||||||
myPreviewActor->VisibilityOff();
|
myPreviewActor->VisibilityOff();
|
||||||
myPreviewActor->SetMapper(myMapper);
|
myPreviewActor->SetMapper(myMapper);
|
||||||
|
|
||||||
double anRGB[3];
|
QColor ffc, bfc;
|
||||||
|
int delta;
|
||||||
|
|
||||||
vtkProperty* aProp = vtkProperty::New();
|
vtkProperty* aProp = vtkProperty::New();
|
||||||
GetColor( "SMESH", "fill_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 170, 255 ) );
|
SMESH::GetColor( "SMESH", "preview_color", ffc, delta, "0, 255, 0|-100" ) ;
|
||||||
aProp->SetColor( anRGB[0], anRGB[1], anRGB[2] );
|
aProp->SetColor( ffc.red() / 255. , ffc.green() / 255. , ffc.blue() / 255. );
|
||||||
myPreviewActor->SetProperty( aProp );
|
myPreviewActor->SetProperty( aProp );
|
||||||
aProp->Delete();
|
aProp->Delete();
|
||||||
|
|
||||||
vtkProperty* aBackProp = vtkProperty::New();
|
vtkProperty* aBackProp = vtkProperty::New();
|
||||||
GetColor( "SMESH", "backface_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 0, 255 ) );
|
bfc = Qtx::mainColorToSecondary(ffc, delta);
|
||||||
aBackProp->SetColor( anRGB[0], anRGB[1], anRGB[2] );
|
aBackProp->SetColor( bfc.red() / 255. , bfc.green() / 255. , bfc.blue() / 255. );
|
||||||
myPreviewActor->SetBackfaceProperty( aBackProp );
|
myPreviewActor->SetBackfaceProperty( aBackProp );
|
||||||
aBackProp->Delete();
|
aBackProp->Delete();
|
||||||
|
|
||||||
@ -148,12 +159,34 @@ namespace SMESH
|
|||||||
myFaceOrientation->SetMapper(myFaceOrientationDataMapper);
|
myFaceOrientation->SetMapper(myFaceOrientationDataMapper);
|
||||||
|
|
||||||
vtkProperty* anOrientationProp = vtkProperty::New();
|
vtkProperty* anOrientationProp = vtkProperty::New();
|
||||||
|
double anRGB[3];
|
||||||
GetColor( "SMESH", "orientation_color", anRGB[0], anRGB[1], anRGB[2], QColor( 255, 255, 255 ) );
|
GetColor( "SMESH", "orientation_color", anRGB[0], anRGB[1], anRGB[2], QColor( 255, 255, 255 ) );
|
||||||
anOrientationProp->SetColor( anRGB[0], anRGB[1], anRGB[2] );
|
anOrientationProp->SetColor( anRGB[0], anRGB[1], anRGB[2] );
|
||||||
myFaceOrientation->SetProperty( anOrientationProp );
|
myFaceOrientation->SetProperty( anOrientationProp );
|
||||||
anOrientationProp->Delete();
|
anOrientationProp->Delete();
|
||||||
|
|
||||||
myVTKViewWindow->AddActor(myFaceOrientation);
|
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;
|
typedef std::vector<vtkIdType> TVTKIds;
|
||||||
@ -163,7 +196,7 @@ namespace SMESH
|
|||||||
{
|
{
|
||||||
vtkUnstructuredGrid *aGrid = theActor->GetUnstructuredGrid();
|
vtkUnstructuredGrid *aGrid = theActor->GetUnstructuredGrid();
|
||||||
myGrid->SetPoints(aGrid->GetPoints());
|
myGrid->SetPoints(aGrid->GetPoints());
|
||||||
myGrid->Reset();
|
myGrid->Reset();
|
||||||
|
|
||||||
const std::vector<int>& interlace = SMDS_MeshCell::toVtkOrder( VTKCellType( theType ));
|
const std::vector<int>& interlace = SMDS_MeshCell::toVtkOrder( VTKCellType( theType ));
|
||||||
SMDS_MeshCell::applyInterlace( interlace, theIds );
|
SMDS_MeshCell::applyInterlace( interlace, theIds );
|
||||||
@ -177,36 +210,68 @@ namespace SMESH
|
|||||||
|
|
||||||
myGrid->Modified();
|
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();
|
||||||
|
|
||||||
void SetVisibility (bool theVisibility, bool theShowOrientation = false)
|
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, bool theShowBalls = false)
|
||||||
{
|
{
|
||||||
myPreviewActor->SetVisibility(theVisibility);
|
myPreviewActor->SetVisibility(theVisibility);
|
||||||
myFaceOrientation->SetVisibility(theShowOrientation);
|
myFaceOrientation->SetVisibility(theShowOrientation);
|
||||||
|
myBallActor->SetVisibility(theShowBalls);
|
||||||
RepaintCurrentView();
|
RepaintCurrentView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
~TElementSimulation()
|
~TElementSimulation()
|
||||||
{
|
{
|
||||||
|
myMapper->RemoveAllInputs();
|
||||||
|
myFaceOrientationDataMapper->RemoveAllInputs();
|
||||||
|
myBallMapper->RemoveAllInputs();
|
||||||
|
|
||||||
if (FindVtkViewWindow(myApplication->activeViewManager(), myViewWindow)) {
|
if (FindVtkViewWindow(myApplication->activeViewManager(), myViewWindow)) {
|
||||||
myVTKViewWindow->RemoveActor(myPreviewActor);
|
myVTKViewWindow->RemoveActor(myPreviewActor,false,false);
|
||||||
myVTKViewWindow->RemoveActor(myFaceOrientation);
|
myVTKViewWindow->RemoveActor(myFaceOrientation,false,false);
|
||||||
|
myVTKViewWindow->RemoveActor(myBallActor,false,false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
myMapper->Delete();
|
||||||
|
myGrid->Delete();
|
||||||
myPreviewActor->Delete();
|
myPreviewActor->Delete();
|
||||||
|
|
||||||
|
myFaceOrientationFilter->Delete();
|
||||||
|
myFaceOrientationDataMapper->Delete();
|
||||||
myFaceOrientation->Delete();
|
myFaceOrientation->Delete();
|
||||||
|
|
||||||
myMapper->RemoveAllInputs();
|
myBallMapper->Delete();
|
||||||
myMapper->Delete();
|
myBallPolyData->Delete();
|
||||||
|
myBallActor->Delete();
|
||||||
myFaceOrientationFilter->Delete();
|
|
||||||
|
|
||||||
myFaceOrientationDataMapper->RemoveAllInputs();
|
|
||||||
myFaceOrientationDataMapper->Delete();
|
|
||||||
|
|
||||||
myGrid->Delete();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -363,6 +428,7 @@ SMESHGUI_AddMeshElementDlg::SMESHGUI_AddMeshElementDlg( SMESHGUI* theMo
|
|||||||
|
|
||||||
DiameterSpinBox->RangeStepAndValidator( 1e-7, 1e+9, 0.1 );
|
DiameterSpinBox->RangeStepAndValidator( 1e-7, 1e+9, 0.1 );
|
||||||
DiameterSpinBox->SetValue( 1. );
|
DiameterSpinBox->SetValue( 1. );
|
||||||
|
connect( DiameterSpinBox, SIGNAL( valueChanged ( double ) ), this, SLOT( onDiameterChanged( ) ) );
|
||||||
}
|
}
|
||||||
/* Add to group ************************************************/
|
/* Add to group ************************************************/
|
||||||
GroupGroups = new QGroupBox( tr( "SMESH_ADD_TO_GROUP" ), this );
|
GroupGroups = new QGroupBox( tr( "SMESH_ADD_TO_GROUP" ), this );
|
||||||
@ -578,9 +644,9 @@ void SMESHGUI_AddMeshElementDlg::ClickOnApply()
|
|||||||
mySelector->ClearIndex();
|
mySelector->ClearIndex();
|
||||||
mySelectionMgr->setSelectedObjects( aList, false );
|
mySelectionMgr->setSelectedObjects( aList, false );
|
||||||
|
|
||||||
SMESH::UpdateView();
|
|
||||||
mySimulation->SetVisibility(false);
|
mySimulation->SetVisibility(false);
|
||||||
|
SMESH::UpdateView();
|
||||||
|
|
||||||
buttonOk->setEnabled(false);
|
buttonOk->setEnabled(false);
|
||||||
buttonApply->setEnabled(false);
|
buttonApply->setEnabled(false);
|
||||||
|
|
||||||
@ -608,7 +674,6 @@ void SMESHGUI_AddMeshElementDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void SMESHGUI_AddMeshElementDlg::reject()
|
void SMESHGUI_AddMeshElementDlg::reject()
|
||||||
{
|
{
|
||||||
//mySelectionMgr->clearSelected();
|
|
||||||
mySimulation->SetVisibility(false);
|
mySimulation->SetVisibility(false);
|
||||||
SMESH::SetPointRepresentation(false);
|
SMESH::SetPointRepresentation(false);
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
@ -808,7 +873,11 @@ void SMESHGUI_AddMeshElementDlg::displaySimulation()
|
|||||||
}
|
}
|
||||||
|
|
||||||
vtkIdType aType = SMDS_MeshCell::toVtkType( myGeomType );
|
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();
|
SMESH::UpdateView();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -905,6 +974,14 @@ void SMESHGUI_AddMeshElementDlg::keyPressEvent( QKeyEvent* e )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : isValid
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void SMESHGUI_AddMeshElementDlg::onDiameterChanged(){
|
||||||
|
displaySimulation();
|
||||||
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : isValid
|
// function : isValid
|
||||||
// purpose :
|
// purpose :
|
||||||
|
@ -64,7 +64,6 @@ namespace SMESH
|
|||||||
class SMESHGUI_EXPORT SMESHGUI_AddMeshElementDlg : public QDialog
|
class SMESHGUI_EXPORT SMESHGUI_AddMeshElementDlg : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SMESHGUI_AddMeshElementDlg( SMESHGUI*, SMDSAbs_EntityType = SMDSEntity_Edge );
|
SMESHGUI_AddMeshElementDlg( SMESHGUI*, SMDSAbs_EntityType = SMDSEntity_Edge );
|
||||||
~SMESHGUI_AddMeshElementDlg();
|
~SMESHGUI_AddMeshElementDlg();
|
||||||
@ -119,6 +118,7 @@ private:
|
|||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
virtual void reject();
|
virtual void reject();
|
||||||
|
void onDiameterChanged();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void ClickOnOk();
|
void ClickOnOk();
|
||||||
|
@ -55,6 +55,8 @@
|
|||||||
|
|
||||||
#include <SalomeApp_Application.h>
|
#include <SalomeApp_Application.h>
|
||||||
|
|
||||||
|
#include <Qtx.h>
|
||||||
|
|
||||||
// IDL includes
|
// IDL includes
|
||||||
#include <SALOMEconfig.h>
|
#include <SALOMEconfig.h>
|
||||||
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
|
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
|
||||||
@ -146,17 +148,19 @@ namespace SMESH
|
|||||||
myPreviewActor->PickableOff();
|
myPreviewActor->PickableOff();
|
||||||
myPreviewActor->VisibilityOff();
|
myPreviewActor->VisibilityOff();
|
||||||
myPreviewActor->SetMapper(myMapper);
|
myPreviewActor->SetMapper(myMapper);
|
||||||
|
|
||||||
|
QColor ffc, bfc;
|
||||||
|
int delta;
|
||||||
vtkProperty* myProp = vtkProperty::New();
|
vtkProperty* myProp = vtkProperty::New();
|
||||||
double aRGB[3], aBackRGB[3];
|
SMESH::GetColor( "SMESH", "preview_color", ffc, delta, "0, 255, 0|-100" ) ;
|
||||||
GetColor( "SMESH", "fill_color", aRGB[0], aRGB[1], aRGB[2], QColor( 0, 170, 255 ) );
|
|
||||||
myProp->SetColor( aRGB[0], aRGB[1], aRGB[2] );
|
myProp->SetColor( ffc.red() / 255. , ffc.green() / 255. , ffc.blue() / 255. );
|
||||||
myPreviewActor->SetProperty( myProp );
|
myPreviewActor->SetProperty( myProp );
|
||||||
myProp->Delete();
|
myProp->Delete();
|
||||||
|
|
||||||
vtkProperty* myBackProp = vtkProperty::New();
|
vtkProperty* myBackProp = vtkProperty::New();
|
||||||
GetColor( "SMESH", "backface_color", aBackRGB[0], aBackRGB[1], aBackRGB[2], QColor( 0, 0, 255 ) );
|
bfc = Qtx::mainColorToSecondary(ffc, delta);
|
||||||
myBackProp->SetColor( aBackRGB[0], aBackRGB[1], aBackRGB[2] );
|
myBackProp->SetColor( bfc.red() / 255. , bfc.green() / 255. , bfc.blue() / 255. );
|
||||||
myPreviewActor->SetBackfaceProperty( myBackProp );
|
myPreviewActor->SetBackfaceProperty( myBackProp );
|
||||||
myBackProp->Delete();
|
myBackProp->Delete();
|
||||||
|
|
||||||
@ -175,6 +179,7 @@ namespace SMESH
|
|||||||
myFaceOrientation->SetMapper(myFaceOrientationDataMapper);
|
myFaceOrientation->SetMapper(myFaceOrientationDataMapper);
|
||||||
|
|
||||||
vtkProperty* anOrientationProp = vtkProperty::New();
|
vtkProperty* anOrientationProp = vtkProperty::New();
|
||||||
|
double aRGB[3];
|
||||||
GetColor( "SMESH", "orientation_color", aRGB[0], aRGB[1], aRGB[2], QColor( 255, 255, 255 ) );
|
GetColor( "SMESH", "orientation_color", aRGB[0], aRGB[1], aRGB[2], QColor( 255, 255, 255 ) );
|
||||||
anOrientationProp->SetColor( aRGB[0], aRGB[1], aRGB[2] );
|
anOrientationProp->SetColor( aRGB[0], aRGB[1], aRGB[2] );
|
||||||
myFaceOrientation->SetProperty( anOrientationProp );
|
myFaceOrientation->SetProperty( anOrientationProp );
|
||||||
|
@ -141,17 +141,20 @@ void SMESH::OrientedPlane::Init()
|
|||||||
myActor->SetInfinitive(true);
|
myActor->SetInfinitive(true);
|
||||||
myActor->SetMapper(myMapper);
|
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();
|
vtkProperty* aProp = vtkProperty::New();
|
||||||
SMESH::GetColor( "SMESH", "fill_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 170, 255 ) );
|
SMESH::GetColor( "SMESH", "fill_color", ffc, delta, "255, 170, 0|-100" ) ;
|
||||||
aProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
|
aProp->SetColor(ffc.red() / 255. , ffc.green() / 255. , ffc.blue() / 255.);
|
||||||
aProp->SetOpacity(0.75);
|
aProp->SetOpacity(0.75);
|
||||||
myActor->SetProperty(aProp);
|
myActor->SetProperty(aProp);
|
||||||
aProp->Delete();
|
aProp->Delete();
|
||||||
|
|
||||||
vtkProperty* aBackProp = vtkProperty::New();
|
vtkProperty* aBackProp = vtkProperty::New();
|
||||||
SMESH::GetColor( "SMESH", "backface_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 0, 255 ) );
|
bfc = Qtx::mainColorToSecondary(ffc, delta);
|
||||||
aBackProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
|
aBackProp->SetColor( bfc.red() / 255. , bfc.green() / 255. , bfc.blue() / 255.);
|
||||||
aBackProp->SetOpacity(0.75);
|
aBackProp->SetOpacity(0.75);
|
||||||
myActor->SetBackfaceProperty(aBackProp);
|
myActor->SetBackfaceProperty(aBackProp);
|
||||||
aBackProp->Delete();
|
aBackProp->Delete();
|
||||||
|
@ -4302,6 +4302,10 @@ Please, create VTK viewer and try again</translation>
|
|||||||
<source>PREF_FILL</source>
|
<source>PREF_FILL</source>
|
||||||
<translation>Surface color</translation>
|
<translation>Surface color</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>PREF_PREVIEW_COLOR</source>
|
||||||
|
<translation>Preview color</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>PREF_NOTIFY_MODE</source>
|
<source>PREF_NOTIFY_MODE</source>
|
||||||
<translation>Show a computation result notification</translation>
|
<translation>Show a computation result notification</translation>
|
||||||
|
Loading…
Reference in New Issue
Block a user