if ( mgr && mgr->booleanValue( "SMESH", "use_precision", false ) )
myControlsPrecision = mgr->integerValue( "SMESH", "controls_precision", -1);
- vtkFloatingPointType aElem0DSize = SMESH::GetFloat("SMESH:elem0d_size",5);
- vtkFloatingPointType aLineWidth = SMESH::GetFloat("SMESH:element_width",1);
+ vtkFloatingPointType aElem0DSize = SMESH::GetFloat("SMESH:elem0d_size",5);
+ vtkFloatingPointType aBallElemSize = SMESH::GetFloat("SMESH:ball_elem_size",10);
+ vtkFloatingPointType aLineWidth = SMESH::GetFloat("SMESH:element_width",1);
vtkMatrix4x4 *aMatrix = vtkMatrix4x4::New();
VTKViewer_ExtractUnstructuredGrid* aFilter = NULL;
aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
aFilter->RegisterCellsWithType(VTK_VERTEX);
+ //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 ) );
+ myBallProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+ myBallProp->SetPointSize(aBallElemSize);
+
+ myBallActor = SMESH_CellLabelActor::New();
+ myBallActor->SetUserMatrix(aMatrix);
+ myBallActor->SetStoreGemetryMapping(true);
+ myBallActor->PickableOff();
+ myBallActor->SetVisibility(false);
+ 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();
//my0DExtProp->DeepCopy(my0DProp);
//anRGB[0] = 1 - anRGB[0];
my0DProp->Delete();
my0DActor->Delete();
+ myBallActor->Delete();
//my0DExtProp->Delete();
//my0DExtActor->Delete();
if(my0DActor)
my0DActor->SetCellsLabeled(theIsCellsLabeled);
+ if(myBallActor)
+ myBallActor->SetCellsLabeled(theIsCellsLabeled);
+
myTimeStamp->Modified();
}
if(my0DActor)
result = result || my0DActor->GetCellsLabeled();
+ if(myBallActor)
+ result = result || myBallActor->GetCellsLabeled();
+
return result;
}
my1DActor->GetMapper()->SetScalarVisibility(false);
my2DActor->GetMapper()->SetScalarVisibility(false);
my3DActor->GetMapper()->SetScalarVisibility(false);
+ myBallActor->GetMapper()->SetScalarVisibility(false);
myScalarBarActor->SetVisibility(false);
bool anIsScalarVisible = theMode > eNone;
theRenderer->AddActor(myNodeExtActor);
theRenderer->AddActor(my1DExtActor);
- my3DActor->AddToRender(theRenderer);
+ my3DActor ->AddToRender(theRenderer);
my3DExtActor->AddToRender(theRenderer);
- my2DActor->AddToRender(theRenderer);
+ my2DActor ->AddToRender(theRenderer);
my2DExtActor->AddToRender(theRenderer);
- myNodeActor->AddToRender(theRenderer);
- my1DActor->AddToRender(theRenderer);
- my0DActor->AddToRender(theRenderer);
+ myNodeActor ->AddToRender(theRenderer);
+ my1DActor ->AddToRender(theRenderer);
+ my0DActor ->AddToRender(theRenderer);
+ myBallActor ->AddToRender(theRenderer);
//theRenderer->AddActor(my0DExtActor);
theRenderer->AddActor(myHighlitableActor);
my3DExtActor->RemoveFromRender(theRenderer);
myNodeActor->RemoveFromRender(theRenderer);
my0DActor->RemoveFromRender(theRenderer);
+ myBallActor->RemoveFromRender(theRenderer);
my1DActor->RemoveFromRender(theRenderer);
theRenderer->RemoveActor(myScalarBarActor);
myNodeExtActor->Init(myVisualObj,myImplicitBoolean);
my0DActor->Init(myVisualObj,myImplicitBoolean);
+ myBallActor->Init(myVisualObj,myImplicitBoolean);
//my0DExtActor->Init(myVisualObj,myImplicitBoolean);
my1DActor->Init(myVisualObj,myImplicitBoolean);
my3DExtActor->Init(myVisualObj,myImplicitBoolean);
my0DActor->GetMapper()->SetLookupTable(myLookupTable);
+ myBallActor->GetMapper()->SetLookupTable(myLookupTable);
//my0DExtActor->GetMapper()->SetLookupTable(myLookupTable);
my1DActor->GetMapper()->SetLookupTable(myLookupTable);
myNodeExtActor->SetTransform(theTransform);
my0DActor->SetTransform(theTransform);
+ myBallActor->SetTransform(theTransform);
//my0DExtActor->SetTransform(theTransform);
my1DActor->SetTransform(theTransform);
myNodeExtActor->VisibilityOff();
my0DActor->VisibilityOff();
+ myBallActor->VisibilityOff();
//my0DExtActor->VisibilityOff();
my1DActor->VisibilityOff();
if(myEntityMode & e0DElements){
my0DActor->VisibilityOn();
}
+ if(myEntityMode & eBallElem){
+ myBallActor->VisibilityOn();
+ }
if(myEntityMode & eEdges && GetRepresentation() != ePoint){
my1DActor->VisibilityOn();
if(my0DActor)
my0DActor->UpdateLabels();
+ if(myBallActor)
+ myBallActor->UpdateLabels();
+
if(my1DActor)
my1DActor->UpdateLabels();
theMode &= ~e0DElements;
}
+ if(!myVisualObj->GetNbEntities(SMDSAbs_Ball)) {
+ myEntityState &= ~eBallElem;
+ theMode &= ~eBallElem;
+ }
+
if(!myVisualObj->GetNbEntities(SMDSAbs_Edge)) {
myEntityState &= ~eEdges;
theMode &= ~eEdges;
if(myVisualObj->GetNbEntities(SMDSAbs_0DElement))
theMode |= e0DElements;
+ if(myVisualObj->GetNbEntities(SMDSAbs_Ball))
+ theMode |= eBallElem;
+
if(myVisualObj->GetNbEntities(SMDSAbs_Edge))
theMode |= eEdges;
aHightFilter->RegisterCellsWithType(VTK_VERTEX);
}
+ if (myEntityMode & eBallElem) {
+ aFilter->RegisterCellsWithType(VTK_POLY_VERTEX);
+ aHightFilter->RegisterCellsWithType(VTK_POLY_VERTEX);
+ }
+
if (myEntityMode & eEdges) {
if (MYDEBUG) MESSAGE("EDGES");
aFilter->RegisterCellsWithType(VTK_LINE);
//my0DActor->SetProperty(aProp);
//my0DActor->SetBackfaceProperty(aBackProp);
my0DActor->SetRepresentation(aReperesent);
+ myBallActor->SetRepresentation(aReperesent);
//my0DExtActor->SetRepresentation(aReperesent);
switch(myControlMode){
if(my0DActor)
my0DActor->UpdateLabels();
+ if(myBallActor)
+ myBallActor->UpdateLabels();
+
if(my1DActor)
my1DActor->UpdateLabels();
::GetColor(my0DProp,r,g,b);
}
+void SMESH_ActorDef::SetBallColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b){
+ myBallProp->SetColor(r,g,b);
+ if( SMESH_GroupObj* aGroupObj = dynamic_cast<SMESH_GroupObj*>( myVisualObj.get() ) )
+ if( aGroupObj->GetElementType() == SMDSAbs_Ball )
+ myNameActor->SetBackgroundColor(r,g,b);
+ Modified();
+}
+
+void SMESH_ActorDef::GetBallColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b){
+ ::GetColor(myBallProp,r,g,b);
+}
+
void SMESH_ActorDef::SetHighlightColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b){
myHighlightProp->SetColor(r,g,b);
Modified();
return my0DProp->GetPointSize();
}
+void SMESH_ActorDef::SetBallSize(vtkFloatingPointType theVal){
+ myBallProp->SetPointSize(theVal);
+ Modified();
+}
+
+vtkFloatingPointType SMESH_ActorDef::GetBallSize(){
+ return myBallProp->GetPointSize();
+}
+
int SMESH_ActorDef::GetObjDimension( const int theObjId )
{
return myVisualObj->GetElemDimension( theObjId );
myNodeExtActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
my0DActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
+ myBallActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
//my0DExtActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
my1DActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);