}
-SMESH_ActorDef::SMESH_ActorDef(){
- if(MYDEBUG) MESSAGE("SMESH_ActorDef");
+SMESH_ActorDef::SMESH_ActorDef()
+{
+ if(MYDEBUG) MESSAGE("SMESH_ActorDef - "<<this);
myTimeStamp = vtkTimeStamp::New();
my2DActor = SMESH_DeviceActor::New();
my2DActor->SetUserMatrix(aMatrix);
- my2DActor->SetStoreMapping(true);
my2DActor->PickableOff();
my2DActor->SetProperty(mySurfaceProp);
my2DActor->SetBackfaceProperty(myBackSurfaceProp);
my3DActor = SMESH_DeviceActor::New();
my3DActor->SetUserMatrix(aMatrix);
- my3DActor->SetStoreMapping(true);
my3DActor->PickableOff();
my3DActor->SetProperty(mySurfaceProp);
my3DActor->SetBackfaceProperty(myBackSurfaceProp);
my1DActor = SMESH_DeviceActor::New();
my1DActor->SetUserMatrix(aMatrix);
- my1DActor->SetStoreMapping(true);
my1DActor->PickableOff();
my1DActor->SetHighlited(true);
my1DActor->SetProperty(myEdgeProp);
my1DExtActor = SMESH_DeviceActor::New();
my1DExtActor->SetUserMatrix(aMatrix);
- my1DExtActor->SetStoreMapping(true);
my1DExtActor->PickableOff();
my1DExtActor->SetHighlited(true);
my1DExtActor->SetVisibility(false);
myNodeActor = SMESH_DeviceActor::New();
myNodeActor->SetUserMatrix(aMatrix);
- myNodeActor->SetStoreMapping(true);
+ myNodeActor->SetStoreClippingMapping(true);
myNodeActor->PickableOff();
myNodeActor->SetVisibility(false);
myNodeActor->SetProperty(myNodeProp);
myBaseActor = SMESH_DeviceActor::New();
myBaseActor->SetUserMatrix(aMatrix);
- myBaseActor->SetStoreMapping(true);
+ myBaseActor->SetStoreGemetryMapping(true);
myBaseActor->GetProperty()->SetOpacity(0.0);
- myBaseActor->myGeomFilter->SetInside(true);
myPickableActor = myBaseActor;
myHighlitableActor = SMESH_DeviceActor::New();
myHighlitableActor->SetUserMatrix(aMatrix);
- myHighlitableActor->SetStoreMapping(false);
myHighlitableActor->PickableOff();
myHighlitableActor->SetRepresentation(SMESH_DeviceActor::eWireframe);
- myNodeHighlitableActor = SMESH_DeviceActor::New();
- myNodeHighlitableActor->SetUserMatrix(aMatrix);
- myNodeHighlitableActor->SetStoreMapping(false);
- myNodeHighlitableActor->PickableOff();
- myNodeHighlitableActor->SetRepresentation(SMESH_DeviceActor::ePoint);
- aFilter = myNodeHighlitableActor->GetExtractUnstructuredGrid();
- aFilter->SetModeOfExtraction(SALOME_ExtractUnstructuredGrid::ePoints);
-
-
SetShrinkFactor(SMESH::GetFloat("SMESH:SettingsShrinkCoeff", 75)/100.);
myName = "";
}
-SMESH_ActorDef::~SMESH_ActorDef(){
- if(MYDEBUG) MESSAGE("~SMESH_ActorDef");
+SMESH_ActorDef::~SMESH_ActorDef()
+{
+ if(MYDEBUG) MESSAGE("~SMESH_ActorDef - "<<this);
myScalarBarActor->Delete();
myLookupTable->Delete();
myBaseActor->Delete();
myHighlitableActor->Delete();
- myNodeHighlitableActor->Delete();
-
//Deleting of pints numbering pipeline
//---------------------------------------
}
-void SMESH_ActorDef::SetControlMode(eControl theMode){
+void
+SMESH_ActorDef::
+SetControlMode(eControl theMode)
+{
+ SetControlMode(theMode,true);
+}
+
+
+void
+SMESH_ActorDef::
+SetControlMode(eControl theMode,
+ bool theCheckEntityMode)
+{
myControlMode = eNone;
+ theCheckEntityMode &= QAD_CONFIG->getSetting("SMESH:DispayEntity") == "true";
my1DActor->GetMapper()->SetScalarVisibility(false);
my2DActor->GetMapper()->SetScalarVisibility(false);
switch(myControlMode){
case eFreeEdges:
case eFreeBorders:
- my1DExtActor->SetExtControlMode(aFunctor,myControlActor);
+ my1DExtActor->SetExtControlMode(aFunctor);
break;
case eLength2D:
case eMultiConnection2D:
- my1DExtActor->SetExtControlMode(aFunctor,myControlActor,myScalarBarActor,myLookupTable);
+ my1DExtActor->SetExtControlMode(aFunctor,myScalarBarActor,myLookupTable);
break;
default:
myControlActor->SetControlMode(aFunctor,myScalarBarActor,myLookupTable);
}
}
- if(QAD_CONFIG->getSetting("SMESH:DispayEntity") == "true"){
+ if(theCheckEntityMode){
if(myControlActor == my1DActor)
- myEntityMode = eEdges;
- else if(myControlActor == my2DActor)
- myEntityMode = eFaces;
- else if(myControlActor == my3DActor)
- myEntityMode = eVolumes;
+ SetEntityMode(eEdges);
+ else if(myControlActor == my2DActor){
+ switch(myControlMode){
+ case eLength2D:
+ case eFreeEdges:
+ case eMultiConnection2D:
+ //SetEntityMode(eEdges);
+ SetEntityMode(eFaces);
+ break;
+ default:
+ SetEntityMode(eFaces);
+ }
+ }else if(myControlActor == my3DActor)
+ SetEntityMode(eVolumes);
}
- }else if(QAD_CONFIG->getSetting("SMESH:DispayEntity") == "true"){
+ }else if(theCheckEntityMode){
myEntityMode = eAllEntity;
}
theRenderer->AddActor(my1DExtActor);
theRenderer->AddActor(myHighlitableActor);
- theRenderer->AddActor(myNodeHighlitableActor);
theRenderer->AddActor2D(myScalarBarActor);
theRenderer->RemoveActor(myBaseActor);
theRenderer->RemoveActor(myHighlitableActor);
- theRenderer->RemoveActor(myNodeHighlitableActor);
theRenderer->RemoveActor(my1DActor);
theRenderer->RemoveActor(my1DExtActor);
myBaseActor->Init(myVisualObj,myImplicitBoolean);
myHighlitableActor->Init(myVisualObj,myImplicitBoolean);
- myNodeHighlitableActor->Init(myVisualObj,myImplicitBoolean);
my1DActor->Init(myVisualObj,myImplicitBoolean);
my1DExtActor->Init(myVisualObj,myImplicitBoolean);
myBaseActor->SetTransform(theTransform);
myHighlitableActor->SetTransform(theTransform);
- myNodeHighlitableActor->SetTransform(theTransform);
my1DActor->SetTransform(theTransform);
my1DExtActor->SetTransform(theTransform);
void SMESH_ActorDef::SetEntityMode(unsigned int theMode){
- if(!myVisualObj->GetNbEntities(SMDSAbs_Edge))
+ myEntityState = eAllEntity;
+
+ if(!myVisualObj->GetNbEntities(SMDSAbs_Edge)){
+ myEntityState &= ~eEdges;
theMode &= ~eEdges;
+ }
- if(!myVisualObj->GetNbEntities(SMDSAbs_Face))
+ if(!myVisualObj->GetNbEntities(SMDSAbs_Face)){
+ myEntityState &= ~eFaces;
theMode &= ~eFaces;
+ }
- if(!myVisualObj->GetNbEntities(SMDSAbs_Volume))
+ if(!myVisualObj->GetNbEntities(SMDSAbs_Volume)){
+ myEntityState &= ~eVolumes;
theMode &= ~eVolumes;
+ }
if(!theMode){
if(myVisualObj->GetNbEntities(SMDSAbs_Edge))
theMode |= eVolumes;
}
+ myBaseActor->myGeomFilter->SetInside(myEntityMode != myEntityState);
+
myEntityMode = theMode;
SALOME_ExtractUnstructuredGrid* aFilter = NULL;
aFilter = myBaseActor->GetExtractUnstructuredGrid();
myHighlitableActor->SetVisibility(false);
myHighlitableActor->SetHighlited(false);
- myNodeHighlitableActor->SetVisibility(false);
- myNodeHighlitableActor->SetHighlited(false);
-
if(myIsHighlighted){
myHighlitableActor->SetProperty(myHighlightProp);
}else if(myIsPreselected){
myHighlitableActor->SetProperty(myPreselectProp);
}
- bool isVisible = GetVisibility();
+ bool anIsVisible = GetVisibility();
if(myIsHighlighted || myIsPreselected){
if(GetUnstructuredGrid()->GetNumberOfCells()){
+ myHighlitableActor->SetHighlited(anIsVisible);
+ myHighlitableActor->SetVisibility(anIsVisible);
+ myHighlitableActor->GetExtractUnstructuredGrid()->
+ SetModeOfExtraction(SALOME_ExtractUnstructuredGrid::eCells);
myHighlitableActor->SetRepresentation(SMESH_DeviceActor::eWireframe);
- myHighlitableActor->SetVisibility(isVisible);
- myHighlitableActor->SetHighlited(isVisible);
- }
- if(myRepresentation == ePoint || GetPointRepresentation()){
- myNodeHighlitableActor->SetProperty(myHighlitableActor->GetProperty());
- myNodeHighlitableActor->SetVisibility(isVisible);
- myNodeHighlitableActor->SetHighlited(isVisible);
+ }else if(myRepresentation == ePoint || GetPointRepresentation()){
+ myHighlitableActor->SetHighlited(anIsVisible);
+ myHighlitableActor->SetVisibility(anIsVisible);
+ myHighlitableActor->GetExtractUnstructuredGrid()->
+ SetModeOfExtraction(SALOME_ExtractUnstructuredGrid::ePoints);
+ myHighlitableActor->SetRepresentation(SMESH_DeviceActor::ePoint);
}
}
}
unsigned long aTime = myTimeStamp->GetMTime();
unsigned long anObjTime = myVisualObj->GetUnstructuredGrid()->GetMTime();
if (anObjTime > aTime)
- SetControlMode(GetControlMode());
+ SetControlMode(GetControlMode(),false);
}
if(myIsPointsLabeled){
SetPointsLabeled(myIsPointsLabeled);
myBaseActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
myHighlitableActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
- myNodeHighlitableActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
my1DActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
my1DExtActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);