foreach ( SUIT_ViewWindow* view, views ) {
if ( view && view->getViewManager()->getType() == OCCViewer_Viewer::Type() ) {
- Handle(AIS_InteractiveContext) anIC = ((OCCViewer_Viewer*)view->getViewManager()->getViewModel())->getAISContext();
-
- AIS_ListOfInteractive displayed;
- anIC->DisplayedObjects( displayed );
- anIC->ObjectsInCollector( displayed );
-
- AIS_ListIteratorOfListOfInteractive it( displayed );
- while ( it.More() && aisObject.IsNull() ) {
- if ( onlyGeom && !it.Value()->IsInstance( STANDARD_TYPE(GEOM_AISShape) ) )
- continue;
-
- Handle(SALOME_InteractiveObject) obj =
- Handle(SALOME_InteractiveObject)::DownCast( it.Value()->GetOwner() );
-
- if ( !obj.IsNull() && obj->isSame( IO ) )
- aisObject = it.Value();
- }
+ Handle(AIS_InteractiveContext) anIC = ((OCCViewer_Viewer*)view->getViewManager()->getViewModel())->getAISContext();
+
+ AIS_ListOfInteractive displayed;
+ anIC->DisplayedObjects( displayed );
+ anIC->ObjectsInCollector( displayed );
+
+ AIS_ListIteratorOfListOfInteractive it( displayed );
+ for ( ; it.More(); it.Next() ){
+ if ( onlyGeom && !it.Value()->IsInstance( STANDARD_TYPE(GEOM_AISShape) ) )
+ continue;
+
+ Handle(SALOME_InteractiveObject) obj =
+ Handle(SALOME_InteractiveObject)::DownCast( it.Value()->GetOwner() );
+
+ if ( !obj.IsNull() && obj->isSame( IO ) )
+ {
+ aisObject = it.Value();
+ break;
+ }
+ }
}
if ( !aisObject.IsNull() ) break;
}
for ( ; it.More(); it.Next() ) {
GEOM::GEOM_Object_var geomObj = ConvertIOinGEOMObject( it.Value() );
if ( !CORBA::is_nil( geomObj ) )
- iors.append( GetIORFromObject( geomObj ) );
+ iors.append( GetIORFromObject( geomObj ) );
}
}
return iors;
_PTR(SObject) obj( studyDS->FindObjectID( IO->getEntry() ) );
if ( obj ) {
CORBA::Object_var corbaObj = GeometryGUI::ClientSObjectToObject( obj );
- if ( !CORBA::is_nil( corbaObj ) )
- object = GEOM::GEOM_Object::_narrow( corbaObj );
+ if ( !CORBA::is_nil( corbaObj ) )
+ object = GEOM::GEOM_Object::_narrow( corbaObj );
}
}
}
Standard_Real first, last;
Handle(Geom_Curve) curv = BRep_Tool::Curve( TopoDS::Edge( shape ), first, last );
if ( curv->IsCN(1) ) {
- const Standard_Real param = ( first+last ) / 2.0;
- gp_Pnt middleParamPoint;
- gp_Vec V1;
- curv->D1( param, middleParamPoint, V1 );
- if ( V1.Magnitude() > Precision::Confusion() ) {
- /* Topology orientation not geom orientation */
- if ( shape.Orientation() == TopAbs_REVERSED )
- V1 *= -1.0;
-
- gp_Ax2 anAxis( middleParamPoint, gp_Dir( V1 ) );
- const Standard_Real radius1 = aHeight / 5.0;
- if ( radius1 > 10.0 * Precision::Confusion() && aHeight > 10.0 * Precision::Confusion() )
- ArrowCone = BRepPrimAPI_MakeCone( anAxis, radius1, 0.0, aHeight ).Shape();
- }
+ const Standard_Real param = ( first+last ) / 2.0;
+ gp_Pnt middleParamPoint;
+ gp_Vec V1;
+ curv->D1( param, middleParamPoint, V1 );
+ if ( V1.Magnitude() > Precision::Confusion() ) {
+ /* Topology orientation not geom orientation */
+ if ( shape.Orientation() == TopAbs_REVERSED )
+ V1 *= -1.0;
+
+ gp_Ax2 anAxis( middleParamPoint, gp_Dir( V1 ) );
+ const Standard_Real radius1 = aHeight / 5.0;
+ if ( radius1 > 10.0 * Precision::Confusion() && aHeight > 10.0 * Precision::Confusion() )
+ ArrowCone = BRepPrimAPI_MakeCone( anAxis, radius1, 0.0, aHeight ).Shape();
+ }
}
}
catch ( Standard_Failure ) {
for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
aView->SetColor( It.Value(), c );
}
- GeometryGUI::Modified();
+ GeometryGUI::Modified();
}
} // if ( isVTK )
else if ( isOCC ) {
anObject->SetColor( aSColor );
anObject->SetAutoColor( false );
}
- GeometryGUI::Modified();
- }
+ } // for
+ GeometryGUI::Modified();
} // if c.isValid()
} // first IO is not null
} // if ( isOCC )
int newNbVIso = -1;
if ( actionType == SHOWDLG ) {
- GEOMToolsGUI_NbIsosDlg * NbIsosDlg =
- new GEOMToolsGUI_NbIsosDlg( SUIT_Session::session()->activeApplication()->desktop() );
+ GEOMToolsGUI_NbIsosDlg * NbIsosDlg =
+ new GEOMToolsGUI_NbIsosDlg( SUIT_Session::session()->activeApplication()->desktop() );
- NbIsosDlg->setU( UIso );
- NbIsosDlg->setV( VIso );
+ NbIsosDlg->setU( UIso );
+ NbIsosDlg->setV( VIso );
- if ( NbIsosDlg->exec() ) {
- SUIT_OverrideCursor();
-
- newNbUIso = NbIsosDlg->getU();
+ if ( NbIsosDlg->exec() ) {
+ SUIT_OverrideCursor();
+
+ newNbUIso = NbIsosDlg->getU();
newNbVIso = NbIsosDlg->getV();
- }
+ }
}
else if ( actionType == INCR || actionType == DECR ) {
- int delta = 1;
- if (actionType == DECR)
- delta = -1;
-
- newNbUIso = UIso + delta;
- newNbVIso = VIso + delta;
-
- if ( newNbUIso < 0 || newNbVIso < 0 || newNbUIso > 99 || newNbVIso > 99 )
- return;
+ int delta = 1;
+ if (actionType == DECR)
+ delta = -1;
+
+ newNbUIso = UIso + delta;
+ newNbVIso = VIso + delta;
+
+ if ( newNbUIso < 0 || newNbVIso < 0 || newNbUIso > 99 || newNbVIso > 99 )
+ return;
}
for(; ic->MoreCurrent(); ic->NextCurrent()) {
- CurObject = Handle(GEOM_AISShape)::DownCast(ic->Current());
- Handle(AIS_Drawer) CurDrawer = CurObject->Attributes();
-
- CurDrawer->SetUIsoAspect( new Prs3d_IsoAspect(Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 0.5 , newNbUIso) );
- CurDrawer->SetVIsoAspect( new Prs3d_IsoAspect(Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 0.5 , newNbVIso) );
-
- ic->SetLocalAttributes(CurObject, CurDrawer);
- ic->Redisplay(CurObject);
+ CurObject = Handle(GEOM_AISShape)::DownCast(ic->Current());
+ Handle(AIS_Drawer) CurDrawer = CurObject->Attributes();
+
+ CurDrawer->SetUIsoAspect( new Prs3d_IsoAspect(Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 0.5 , newNbUIso) );
+ CurDrawer->SetVIsoAspect( new Prs3d_IsoAspect(Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 0.5 , newNbVIso) );
+
+ ic->SetLocalAttributes(CurObject, CurDrawer);
+ ic->Redisplay(CurObject);
}
}
GeometryGUI::Modified();
if ( actionType == SHOWDLG ) {
GEOMToolsGUI_NbIsosDlg* NbIsosDlg =
- new GEOMToolsGUI_NbIsosDlg( SUIT_Session::session()->activeApplication()->desktop() );
+ new GEOMToolsGUI_NbIsosDlg( SUIT_Session::session()->activeApplication()->desktop() );
NbIsosDlg->setU( UIso );
NbIsosDlg->setV( VIso );
if ( NbIsosDlg->exec() ) {
- SUIT_OverrideCursor();
+ SUIT_OverrideCursor();
- newNbUIso = NbIsosDlg->getU();
- newNbVIso = NbIsosDlg->getV();
+ newNbUIso = NbIsosDlg->getU();
+ newNbVIso = NbIsosDlg->getV();
}
}
else if ( actionType == INCR || actionType == DECR ) {
int delta = 1;
if (actionType == DECR)
- delta = -1;
+ delta = -1;
newNbUIso = UIso + delta;
newNbVIso = VIso + delta;
if ( newNbUIso < 0 || newNbVIso < 0 || newNbUIso > 99 || newNbVIso > 99 )
- return;
+ return;
}
while( anAct!=NULL ) {
if(GEOM_Actor* anActor = GEOM_Actor::SafeDownCast(anAct)){
- // There are no casting to needed actor.
- int aIsos[2]={newNbUIso,newNbVIso};
- anActor->SetNbIsos(aIsos);
+ // There are no casting to needed actor.
+ int aIsos[2]={newNbUIso,newNbVIso};
+ anActor->SetNbIsos(aIsos);
}
anAct = aCollection->GetNextActor();
}