#include "VTKViewer_ExtractUnstructuredGrid.h"
#include "VTKViewer_FramedTextActor.h"
#include "SALOME_InteractiveObject.hxx"
+#include "SMESH_SVTKActor.h"
#include "SUIT_Session.h"
#include "SUIT_ResourceMgr.h"
myIsPointsVisible = false;
myIsEntityModeCache = false;
+ myHighlightActor = SMESH_SVTKActor::New();
+ myHighlightActor->Initialize();
+
+ myPreHighlightActor = SMESH_SVTKActor::New();
+ myPreHighlightActor->Initialize();
+
myIsShrinkable = false;
myIsShrunk = false;
//Definition 0D device of the actor (ball elements)
//-----------------------------------------------
myBallProp = vtkProperty::New();
- SMESH::GetColor( "SMESH", "ball_elem_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 255, 0 ) );
+ SMESH::GetColor( "SMESH", "ball_elem_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 85, 255 ) );
myBallProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
myBallProp->SetPointSize(aBallElemSize);
myBallActor->SetProperty(myBallProp);
myBallActor->SetRepresentation(SMESH_DeviceActor::eSurface);
aFilter = myBallActor->GetExtractUnstructuredGrid();
- //aFilter->SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::ePoints);
aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
- aFilter->RegisterCellsWithType(VTK_VERTEX);
aFilter->RegisterCellsWithType(VTK_POLY_VERTEX);
//my0DExtProp = vtkProperty::New();
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);
myOutLineProp->SetSpecular(0.0);
SMESH::GetColor( "SMESH", "outline_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 70, 0 ) );
myOutLineProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
- myOutLineProp->SetPointSize(aElem0DSize); // ??
myOutLineProp->SetLineWidth(aLineWidth);
myOutLineProp->SetRepresentation(1);
myPreselectProp->SetLineWidth(aLineWidth);
myPreselectProp->SetRepresentation(1);
+ myBallPreselectProp = vtkProperty::New();
+ myBallPreselectProp->DeepCopy(myPreselectProp);
+ myBallPreselectProp->SetPointSize(aBallElemSize);
+
myHighlitableActor = SMESH_DeviceActor::New();
myHighlitableActor->SetUserMatrix(aMatrix);
myHighlitableActor->PickableOff();
my2dHistogram = 0;
#endif
+ SetBallSize(aBallElemSize);
+ Set0DSize(aElem0DSize);
}
myImplicitBoolean->Delete();
myTimeStamp->Delete();
+ myBallHighlightProp->Delete();
+ myBallPreselectProp->Delete();
+
}
void SMESH_ActorDef::Delete()
void SMESH_ActorDef::AddToRender(vtkRenderer* theRenderer){
+
+ //myHighlightActor->AddToRender(theRenderer);
+
theRenderer->AddActor(myBaseActor);
theRenderer->AddActor(myNodeExtActor);
theRenderer->AddActor(my1DExtActor);
myNodeActor->VisibilityOn();
}
- if(myEntityMode & e0DElements){
+ if(myEntityMode & e0DElements && GetRepresentation() != ePoint ){
my0DActor->VisibilityOn();
}
- if(myEntityMode & eBallElem){
+ if(myEntityMode & eBallElem && GetRepresentation() != ePoint ){
myBallActor->VisibilityOn();
}
int aNbEdges = myVisualObj->GetNbEntities(SMDSAbs_Edge);
int aNbFaces = myVisualObj->GetNbEntities(SMDSAbs_Face);
int aNbVolumes = myVisualObj->GetNbEntities(SMDSAbs_Volume);
+ int aNb0Ds = myVisualObj->GetNbEntities(SMDSAbs_0DElement);
+ int aNbBalls = myVisualObj->GetNbEntities(SMDSAbs_Ball);
if (theMode < 0) {
myRepresentation = eSurface;
} else {
switch (theMode) {
case eEdge:
- if (!aNbFaces && !aNbVolumes && !aNbEdges) return;
+ if (!aNbFaces && !aNbVolumes && !aNbEdges && !aNb0Ds && !aNbBalls) return;
break;
case eSurface:
- if (!aNbFaces && !aNbVolumes) return;
+ if (!aNbFaces && !aNbVolumes && !aNb0Ds && !aNbBalls) return;
break;
}
myRepresentation = theMode;
{
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);
}
myNodeProp->SetOpacity(theValue);
my1DProp->SetOpacity(theValue);
+ my0DProp->SetOpacity(theValue);
+ myBallProp->SetOpacity(theValue);
}
void SMESH_ActorDef::SetHighlightColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b){
myHighlightProp->SetColor(r,g,b);
+ myBallHighlightProp->SetColor(r,g,b);
Modified();
}
void SMESH_ActorDef::SetPreHighlightColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b){
myPreselectProp->SetColor(r,g,b);
+ myBallPreselectProp->SetColor(r,g,b);
Modified();
}
void SMESH_ActorDef::Set0DSize(vtkFloatingPointType theVal){
my0DProp->SetPointSize(theVal);
+ myHighlightProp->SetPointSize(theVal);
+ myPreselectProp->SetPointSize(theVal);
+
+ if(SMESH_SVTKActor* aCustom = SMESH_SVTKActor::SafeDownCast( myHighlightActor )) {
+ aCustom->Set0DSize(theVal);
+ }
+ if(SMESH_SVTKActor* aCustom = SMESH_SVTKActor::SafeDownCast( myPreHighlightActor )) {
+ aCustom->Set0DSize(theVal);
+ }
+
Modified();
}
void SMESH_ActorDef::SetBallSize(vtkFloatingPointType theVal){
myBallProp->SetPointSize(theVal);
+ myBallHighlightProp->SetPointSize(theVal);
+ myBallPreselectProp->SetPointSize(theVal);
+ if(SMESH_SVTKActor* aCustom = SMESH_SVTKActor::SafeDownCast( myHighlightActor )) {
+ aCustom->SetBallSize(theVal);
+ }
+ if(SMESH_SVTKActor* aCustom = SMESH_SVTKActor::SafeDownCast( myPreHighlightActor )) {
+ aCustom->SetBallSize(theVal);
+ }
+
Modified();
}