Mantis issue 0020908: EDF GEOM: Compound of vertices.

This commit is contained in:
jfa 2010-06-17 10:03:31 +00:00
parent 76715a1dc0
commit 4dfe2cd0b6
4 changed files with 277 additions and 240 deletions

View File

@ -129,7 +129,8 @@ int GEOMGUI_Selection::typeId( const int index ) const
int aType = -1; int aType = -1;
GEOM::GEOM_Object_var anObj = getObject( index ); GEOM::GEOM_Object_var anObj = getObject( index );
if ( !CORBA::is_nil( anObj ) ) if ( !CORBA::is_nil( anObj ) )
aType = anObj->GetType(); //aType = anObj->GetType();
aType = (int)anObj->GetShapeType();
return aType; return aType;
} }

View File

@ -1053,7 +1053,8 @@ void GeometryGUI::initialize( CAM_Application* app )
mgr->insert( action( GEOMOp::OpDeflection ), -1, -1 ); // deflection mgr->insert( action( GEOMOp::OpDeflection ), -1, -1 ); // deflection
mgr->setRule( action( GEOMOp::OpDeflection ), "selcount>0 and isVisible and client='OCCViewer'", QtxPopupMgr::VisibleRule ); mgr->setRule( action( GEOMOp::OpDeflection ), "selcount>0 and isVisible and client='OCCViewer'", QtxPopupMgr::VisibleRule );
mgr->insert( action( GEOMOp::OpPointMarker ), -1, -1 ); // point marker mgr->insert( action( GEOMOp::OpPointMarker ), -1, -1 ); // point marker
mgr->setRule( action( GEOMOp::OpPointMarker ), QString( "selcount>0 and $typeid in {%1}" ).arg( GEOM_POINT ), QtxPopupMgr::VisibleRule ); //mgr->setRule( action( GEOMOp::OpPointMarker ), QString( "selcount>0 and $typeid in {%1}" ).arg(GEOM_POINT ), QtxPopupMgr::VisibleRule );
mgr->setRule( action( GEOMOp::OpPointMarker ), QString( "selcount>0 and $typeid in {%1}" ).arg(GEOM::VERTEX), QtxPopupMgr::VisibleRule );
mgr->insert( separator(), -1, -1 ); // ----------- mgr->insert( separator(), -1, -1 ); // -----------
mgr->insert( action( GEOMOp::OpAutoColor ), -1, -1 ); // auto color mgr->insert( action( GEOMOp::OpAutoColor ), -1, -1 ); // auto color
mgr->setRule( action( GEOMOp::OpAutoColor ), autoColorPrefix + " and isAutoColor=false", QtxPopupMgr::VisibleRule ); mgr->setRule( action( GEOMOp::OpAutoColor ), autoColorPrefix + " and isAutoColor=false", QtxPopupMgr::VisibleRule );

View File

@ -3169,6 +3169,11 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace (Handle(GEOM_Object)
if( min_l < fabs(aYmax - aYmin) ) min_l = fabs(aYmax - aYmin); if( min_l < fabs(aYmax - aYmin) ) min_l = fabs(aYmax - aYmin);
if( min_l < fabs(aZmax - aZmin) ) min_l = fabs(aZmax - aZmin); if( min_l < fabs(aZmax - aZmin) ) min_l = fabs(aZmax - aZmin);
min_l /= dl_l; min_l /= dl_l;
// Mantis issue 0020908 BEGIN
if (!Exp_Edge.More()) {
min_l = Precision::Confusion();
}
// Mantis issue 0020908 END
for ( Standard_Integer nbEdge = 0; Exp_Edge.More(); Exp_Edge.Next(), nbEdge++ ) { for ( Standard_Integer nbEdge = 0; Exp_Edge.More(); Exp_Edge.Next(), nbEdge++ ) {
TopExp_Explorer Exp_Vertex( Exp_Edge.Current(), TopAbs_VERTEX); TopExp_Explorer Exp_Vertex( Exp_Edge.Current(), TopAbs_VERTEX);
for ( Standard_Integer nbVertex = 0; Exp_Vertex.More(); Exp_Vertex.Next(), nbVertex++ ) { for ( Standard_Integer nbVertex = 0; Exp_Vertex.More(); Exp_Vertex.Next(), nbVertex++ ) {

View File

@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifdef WNT #ifdef WNT
#pragma warning( disable:4786 ) #pragma warning( disable:4786 )
@ -916,6 +915,13 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy,
// set the color of the transformed shape to the color of initial shape // set the color of the transformed shape to the color of initial shape
theObject->SetColor(aList[0]->GetColor()); theObject->SetColor(aList[0]->GetColor());
// set the texture
if (theObject->GetShapeType() == GEOM::VERTEX) {
theObject->SetMarkerStd(aList[0]->GetMarkerType(), aList[0]->GetMarkerSize());
if (aList[0]->GetMarkerType() == GEOM::MT_USER)
theObject->SetMarkerTexture(aList[0]->GetMarkerTexture());
}
anArgSO->Destroy(); anArgSO->Destroy();
} }
else { else {
@ -1005,6 +1011,12 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy,
aSubSO = PublishInStudy(theStudy, aSubSO, aSubO, aSubName.ToCString()); aSubSO = PublishInStudy(theStudy, aSubSO, aSubO, aSubName.ToCString());
// Restore color // Restore color
aSubO->SetColor(anArgO->GetColor()); aSubO->SetColor(anArgO->GetColor());
// set the texture
if (aSubO->GetShapeType() == GEOM::VERTEX) {
aSubO->SetMarkerStd(anArgO->GetMarkerType(), anArgO->GetMarkerSize());
if (anArgO->GetMarkerType() == GEOM::MT_USER)
aSubO->SetMarkerTexture(anArgO->GetMarkerTexture());
}
} }
if (!CORBA::is_nil(anArgSO)) { if (!CORBA::is_nil(anArgSO)) {
@ -1056,6 +1068,12 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy,
aSubSO = PublishInStudy(theStudy, aSubSO, aSubO, aSubName.ToCString()); aSubSO = PublishInStudy(theStudy, aSubSO, aSubO, aSubName.ToCString());
// Restore color // Restore color
aSubO->SetColor(anArgO->GetColor()); aSubO->SetColor(anArgO->GetColor());
// set the texture
if (aSubO->GetShapeType() == GEOM::VERTEX) {
aSubO->SetMarkerStd(anArgO->GetMarkerType(), anArgO->GetMarkerSize());
if (anArgO->GetMarkerType() == GEOM::MT_USER)
aSubO->SetMarkerTexture(anArgO->GetMarkerTexture());
}
} }
} }
else if (!CORBA::is_nil(aSubSO)) { else if (!CORBA::is_nil(aSubSO)) {
@ -1244,6 +1262,12 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesOneLevel (SALOMEDS::Study_ptr th
aNewSubSO = PublishInStudy(theStudy, aNewSubSO, aNewSubO, aSubName.ToCString()); aNewSubSO = PublishInStudy(theStudy, aNewSubSO, aNewSubO, aSubName.ToCString());
// Restore color // Restore color
aNewSubO->SetColor(anOldSubO->GetColor()); aNewSubO->SetColor(anOldSubO->GetColor());
// set the texture
if (aNewSubO->GetShapeType() == GEOM::VERTEX) {
aNewSubO->SetMarkerStd(anOldSubO->GetMarkerType(), anOldSubO->GetMarkerSize());
if (anOldSubO->GetMarkerType() == GEOM::MT_USER)
aNewSubO->SetMarkerTexture(anOldSubO->GetMarkerTexture());
}
} }
// Restore published sub-shapes of the argument // Restore published sub-shapes of the argument
GEOM::ListOfGO_var aSubParts; GEOM::ListOfGO_var aSubParts;
@ -1296,6 +1320,12 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesOneLevel (SALOMEDS::Study_ptr th
aNewSubSO = PublishInStudy(theStudy, aNewSubSO, aNewSubO, aSubName.ToCString()); aNewSubSO = PublishInStudy(theStudy, aNewSubSO, aNewSubO, aSubName.ToCString());
// Restore color // Restore color
aNewSubO->SetColor(anOldSubO->GetColor()); aNewSubO->SetColor(anOldSubO->GetColor());
// set the texture
if (aNewSubO->GetShapeType() == GEOM::VERTEX) {
aNewSubO->SetMarkerStd(anOldSubO->GetMarkerType(), anOldSubO->GetMarkerSize());
if (anOldSubO->GetMarkerType() == GEOM::MT_USER)
aNewSubO->SetMarkerTexture(anOldSubO->GetMarkerTexture());
}
} }
} }
} }