my1DProp->DeepCopy(myEdgeProp);
my1DProp->SetLineWidth(aLineWidth + aLineWidthInc);
my1DProp->SetPointSize(aPointSize);
-
+
my1DExtProp = vtkProperty::New();
my1DExtProp->DeepCopy(myEdgeProp);
anRGB[0] = 1 - anRGB[0];
myNodeActor->SetRepresentation(SMESH_DeviceActor::ePoint);
aFilter = myNodeActor->GetExtractUnstructuredGrid();
aFilter->SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::ePoints);
-
+
+ myNodeExtProp = vtkProperty::New();
+ myNodeExtProp->DeepCopy(myNodeProp);
+ anRGB[0] = 1 - anRGB[0];
+ anRGB[1] = 1 - anRGB[1];
+ anRGB[2] = 1 - anRGB[2];
+ myNodeExtProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+ myNodeExtProp->SetPointSize(aPointSize);
+
+ myNodeExtActor = SMESH_DeviceActor::New();
+ myNodeExtActor->SetUserMatrix(aMatrix);
+ myNodeExtActor->SetStoreClippingMapping(true);
+ myNodeExtActor->PickableOff();
+ myNodeExtActor->SetHighlited(true);
+ myNodeExtActor->SetVisibility(false);
+ myNodeExtActor->SetProperty(myNodeExtProp);
+ myNodeExtActor->SetRepresentation(SMESH_DeviceActor::ePoint);
+ aFilter = myNodeExtActor->GetExtractUnstructuredGrid();
+ aFilter->SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::ePoints);
+ aFilter->RegisterCellsWithType(VTK_VERTEX);
//Definition of Pickable and Highlitable engines
//----------------------------------------------
myPreselectProp->Delete();
myNodeProp->Delete();
-
+ myNodeExtProp->Delete();
+
my1DProp->Delete();
my1DActor->Delete();
myNodeActor->Delete();
myBaseActor->Delete();
+ myNodeExtActor->Delete();
+
myHighlitableActor->Delete();
//Deleting of pints numbering pipeline
aFunctor.reset(new SMESH::Controls::FreeEdges());
myControlActor = my2DActor;
break;
+ case eFreeNodes:
+ aFunctor.reset(new SMESH::Controls::FreeNodes());
+ myControlActor = myNodeActor;
+ break;
case eMultiConnection:
aFunctor.reset(new SMESH::Controls::MultiConnection());
myControlActor = my1DActor;
if(aNbCells){
myControlMode = theMode;
switch(myControlMode){
+ case eFreeNodes:
+ myNodeExtActor->SetExtControlMode(aFunctor);
+ break;
case eFreeEdges:
case eFreeBorders:
my1DExtActor->SetExtControlMode(aFunctor);
theRenderer->AddActor(myNodeActor);
theRenderer->AddActor(myBaseActor);
+
+ theRenderer->AddActor(myNodeExtActor);
my3DActor->AddToRender(theRenderer);
my2DActor->AddToRender(theRenderer);
theRenderer->AddActor(my1DExtActor);
theRenderer->AddActor(myHighlitableActor);
-
+
theRenderer->AddActor2D(myScalarBarActor);
myPtsSelectVisiblePoints->SetRenderer(theRenderer);
theRenderer->RemoveActor(myNodeActor);
theRenderer->RemoveActor(myBaseActor);
+ theRenderer->RemoveActor(myNodeExtActor);
+
theRenderer->RemoveActor(myHighlitableActor);
theRenderer->RemoveActor(my1DActor);
myNodeActor->Init(myVisualObj,myImplicitBoolean);
myBaseActor->Init(myVisualObj,myImplicitBoolean);
-
+
myHighlitableActor->Init(myVisualObj,myImplicitBoolean);
+
+ myNodeExtActor->Init(myVisualObj,myImplicitBoolean);
my1DActor->Init(myVisualObj,myImplicitBoolean);
my1DExtActor->Init(myVisualObj,myImplicitBoolean);
myNodeActor->SetTransform(theTransform);
myBaseActor->SetTransform(theTransform);
-
+
myHighlitableActor->SetTransform(theTransform);
+ myNodeExtActor->SetTransform(theTransform);
+
my1DActor->SetTransform(theTransform);
my1DExtActor->SetTransform(theTransform);
myNodeActor->VisibilityOff();
myBaseActor->VisibilityOff();
+ myNodeExtActor->VisibilityOff();
+
my1DActor->VisibilityOff();
my1DExtActor->VisibilityOff();
if(GetVisibility()){
if(theIsUpdateRepersentation)
SetRepresentation(GetRepresentation());
-
+
if(myControlMode != eNone){
switch(myControlMode){
+ case eFreeNodes:
+ myNodeExtActor->VisibilityOn();
+ break;
case eFreeEdges:
case eFreeBorders:
my1DExtActor->VisibilityOn();
myPickableActor = myBaseActor;
myNodeActor->SetVisibility(false);
+ myNodeExtActor->SetVisibility(false);
vtkProperty *aProp = NULL, *aBackProp = NULL;
SMESH_DeviceActor::EReperesent aReperesent = SMESH_DeviceActor::EReperesent(-1);
switch(myRepresentation){
void SMESH_ActorDef::SetNodeColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b){
myNodeProp->SetColor(r,g,b);
+ myNodeExtProp->SetColor(1.0-r,1.0-g,1.0-b);
Modified();
}
void SMESH_ActorDef::SetNodeSize(vtkFloatingPointType theVal){
myNodeProp->SetPointSize(theVal);
+ myNodeExtProp->SetPointSize(theVal);
myHighlightProp->SetPointSize(theVal);
myPreselectProp->SetPointSize(theVal);
myBaseActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
myHighlitableActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
+
+ myNodeExtActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
my1DActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
my1DExtActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
virtual void SetFacesOriented(bool theIsFacesOriented) = 0;
virtual bool GetFacesOriented() = 0;
- enum eControl{eNone, eLength, eLength2D, eFreeBorders, eFreeEdges, eMultiConnection,
- eArea, eTaper, eAspectRatio, eMinimumAngle, eWarping, eSkew,
- eAspectRatio3D, eMultiConnection2D, eVolume3D};
+ enum eControl{eNone, eLength, eLength2D, eFreeBorders, eFreeEdges, eFreeNodes,
+ eMultiConnection, eArea, eTaper, eAspectRatio, eMinimumAngle, eWarping,
+ eSkew, eAspectRatio3D, eMultiConnection2D, eVolume3D};
virtual void SetControlMode(eControl theMode) = 0;
virtual eControl GetControlMode() = 0;
SMESH_DeviceActor* my3DActor;
SMESH_DeviceActor* myControlActor;
+ vtkProperty* myNodeExtProp;
+ SMESH_DeviceActor* myNodeExtActor;
+
vtkProperty* my1DProp;
SMESH_DeviceActor* my1DActor;
vtkProperty* my1DExtProp;
SetUnstructuredGrid(aDataSet);
aDataSet->Delete();
}
+ else if(FreeNodes* aFreeNodes = dynamic_cast<FreeNodes*>(theFunctor.get())){
+ myExtractUnstructuredGrid->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
+ vtkUnstructuredGrid* aGrid = myVisualObj->GetUnstructuredGrid();
+ vtkIdType aNbCells = aGrid->GetNumberOfCells();
+ for( vtkIdType i = 0; i < aNbCells; i++ ){
+ vtkIdType anObjId = myVisualObj->GetNodeObjId(i);
+ if(aFreeNodes->IsSatisfy(anObjId))
+ myExtractUnstructuredGrid->RegisterCell(i);
+ }
+ if(!myExtractUnstructuredGrid->IsCellsRegistered())
+ myExtractUnstructuredGrid->RegisterCell(-1);
+ SetUnstructuredGrid(myVisualObj->GetUnstructuredGrid());
+ }
}
aTitle = QObject::tr( "MULTI_BORDERS" );
aControl = SMESH_Actor::eMultiConnection;
break;
+ case 6005:
+ aTitle = QObject::tr( "FREE_NODES" );
+ aControl = SMESH_Actor::eFreeNodes;
+ break;
case 6019:
aTitle = QObject::tr( "MULTI2D_BORDERS" );
aControl = SMESH_Actor::eMultiConnection2D;
case 6002:
case 6003:
case 6004:
+ case 6005:
case 6009:
if ( vtkwnd ) {
createSMESHAction( 6002, "FREE_EDGE", "ICON_FREE_EDGE", 0, true );
createSMESHAction( 6003, "FREE_BORDER", "ICON_FREE_EDGE_2D", 0, true );
createSMESHAction( 6004, "CONNECTION", "ICON_CONNECTION", 0, true );
+ createSMESHAction( 6005, "FREE_NODE", "ICON_FREE_NODE", 0, true );
createSMESHAction( 6011, "AREA", "ICON_AREA", 0, true );
createSMESHAction( 6012, "TAPER", "ICON_TAPER", 0, true );
createSMESHAction( 6013, "ASPECT", "ICON_ASPECT", 0, true );
createMenu( 6001, ctrlId, -1 );
createMenu( 6004, ctrlId, -1 );
createMenu( separator(), ctrlId, -1 );
+ createMenu( 6005, ctrlId, -1 );
createMenu( 6002, ctrlId, -1 );
createMenu( 6018, ctrlId, -1 );
createMenu( 6019, ctrlId, -1 );
createTool( 6003, ctrlTb );
createTool( 6004, ctrlTb );
createTool( separator(), ctrlTb );
+ createTool( 6005, ctrlTb );
createTool( 6002, ctrlTb );
createTool( 6018, ctrlTb );
createTool( 6019, ctrlTb );
// Controls
//-------------------------------------------------
QString
+ aMeshInVtkHasNodes = aMeshInVTK + "&&" + hasNodes,
aMeshInVtkHasEdges = aMeshInVTK + "&&" + hasEdges,
aMeshInVtkHasFaces = aMeshInVTK + "&&" + hasFaces,
aMeshInVtkHasVolumes = aMeshInVTK + "&&" + hasVolumes;
popupMgr()->insert( separator(), anId, -1 );
+ popupMgr()->insert( action( 6005 ), anId, -1 ); // FREE_NODE
+ popupMgr()->setRule( action( 6005 ), aMeshInVtkHasNodes, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6005 ), "controlMode = 'eFreeNodes'", QtxPopupMgr::ToggleRule );
+
popupMgr()->insert( action( 6002 ), anId, -1 ); // FREE_EDGE
- popupMgr()->setRule( action( 6002 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6002 ), aMeshInVtkHasEdges, QtxPopupMgr::VisibleRule );
popupMgr()->setRule( action( 6002 ), "controlMode = 'eFreeEdges'", QtxPopupMgr::ToggleRule );
popupMgr()->insert( action( 6018 ), anId, -1 ); // LENGTH_2D
theCriterion.Type != SMESH::FT_LyingOnGeom &&
theCriterion.Type != SMESH::FT_FreeBorders &&
theCriterion.Type != SMESH::FT_FreeEdges &&
+ theCriterion.Type != SMESH::FT_FreeNodes &&
theCriterion.Type != SMESH::FT_BadOrientedVolume)
aTable->item( theRow, 2 )->setText(QString("%1").arg(theCriterion.Threshold, 0, 'g', 15));
else
int aCriterionType = GetCriterionType(row);
- if (aType == SMESH::EDGE && aCriterionType == SMESH::FT_FreeBorders ||
+ if ( aType == SMESH::NODE && aCriterionType == SMESH::FT_FreeNodes ||
+ aType == SMESH::EDGE && aCriterionType == SMESH::FT_FreeBorders ||
aType == SMESH::FACE && aCriterionType == SMESH::FT_FreeEdges ||
aType == SMESH::VOLUME && aCriterionType == SMESH::FT_BadOrientedVolume)
{
aCriteria[ SMESH::FT_BelongToCylinder ] = tr("BELONG_TO_CYLINDER");
aCriteria[ SMESH::FT_BelongToGenSurface ] = tr("BELONG_TO_GENSURFACE");
aCriteria[ SMESH::FT_LyingOnGeom ] = tr("LYING_ON_GEOM");
+ aCriteria[ SMESH::FT_FreeNodes ] = tr("FREE_NODES");
}
return aCriteria;
}
<source>ICON_FREE_EDGE</source>
<translation>mesh_free_edges.png</translation>
</message>
- <message>
+ <message>
<source>ICON_FREE_EDGE_2D</source>
<translation>mesh_free_edges_2d.png</translation>
</message>
+ <message>
+ <source>ICON_FREE_NODE</source>
+ <translation>mesh_free_nodes.png</translation>
+ </message>
<message>
<source>ICON_HYPO</source>
<translation>mesh_hypo_length.png</translation>
<source>MEN_FREE_EDGE</source>
<translation>Free Edges</translation>
</message>
+ <message>
+ <source>MEN_FREE_NODE</source>
+ <translation>Free Nodes</translation>
+ </message>
<message>
<source>MEN_GLOBAL_HYPO</source>
<translation>Global Hypothesis</translation>
<source>STB_FREE_EDGE</source>
<translation>Free Edges</translation>
</message>
+ <message>
+ <source>STB_FREE_NODE</source>
+ <translation>Free Nodes</translation>
+ </message>
+
+
<message>
<source>STB_GLOBAL_HYPO</source>
<translation>Global Hypothesis</translation>
<source>TOP_FREE_EDGE</source>
<translation>Free Edges</translation>
</message>
+ <message>
+ <source>TOP_FREE_NODE</source>
+ <translation>Free Nodes</translation>
+ </message>
+
+
<message>
<source>TOP_GLOBAL_HYPO</source>
<translation>Global Hypothesis</translation>
<source>FREE_EDGES</source>
<translation>Free edges</translation>
</message>
+ <message>
+ <source>FREE_NODES</source>
+ <translation>Free nodes</translation>
+ </message>
+
+
<message>
<source>ID</source>
<translation>ID</translation>
else:
print "Error: The treshold should be a string."
return None
- elif CritType in [FT_FreeBorders, FT_FreeEdges, FT_BadOrientedVolume]:
+ elif CritType in [FT_FreeBorders, FT_FreeEdges, FT_BadOrientedVolume, FT_FreeNodes]:
# At this point the treshold is unnecessary
if aTreshold == FT_LogicalNOT:
aCriterion.UnaryOp = self.EnumToLong(FT_LogicalNOT)