// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "GEOM_AssemblyBuilder.h"
#include "GEOM_Actor.h"
-#include "VTKViewer_RenderWindowInteractor.h"
-#include "VTKViewer_ViewModel.h"
-#include "VTKViewer_ViewWindow.h"
+#include "SVTK_RenderWindowInteractor.h"
+#include "SVTK_ViewModel.h"
+#include "SVTK_ViewWindow.h"
#include "OCCViewer_ViewPort3d.h"
#include "OCCViewer_ViewModel.h"
#include "OCCViewer_ViewWindow.h"
#include <qvaluelist.h>
#include <qstringlist.h>
+#include <set>
+
#include "GEOMImpl_Types.hxx"
using namespace std;
#include "SALOMEDSClient.hxx"
-//=======================================================================
-// function : GEOMBase()
-// purpose : Constructor
-//=======================================================================
-GEOMBase::GEOMBase()
-{
-}
-
-
-//=======================================================================
-// function : ~GEOMBase()
-// purpose : Destructor
-//=======================================================================
-GEOMBase::~GEOMBase()
-{
-}
-
//=====================================================================================
// function : GetShapeFromIOR()
// purpose : exist also as static method !
QPtrList<SUIT_ViewWindow> aViewWindowsList = SUIT_Session::session()->activeApplication()->desktop()->windows();
for ( QPtrListIterator<SUIT_ViewWindow> it( aViewWindowsList ); it.current(); ++it ) {
- if (it.current()->getViewManager()->getType() == VTKViewer_Viewer::Type()) {
- VTKViewer_ViewWindow* aVTKViewWindow = (VTKViewer_ViewWindow*)it.current();
+ if (it.current()->getViewManager()->getType() == SVTK_Viewer::Type()) {
+ SVTK_ViewWindow* aVTKViewWindow = dynamic_cast<SVTK_ViewWindow*>( it.current() );
+ if( !aVTKViewWindow )
+ continue;
vtkRenderer* Renderer = aVTKViewWindow->getRenderer();
vtkActorCollection* theActors = Renderer->GetActors();
theActors->InitTraversal();
{
QString aName = "";
- SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
+ // collect all object names of GEOM component
+ SalomeApp_Study* appStudy =
+ dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
if ( !appStudy ) return aName;
_PTR(Study) aStudy = appStudy->studyDS();
- int aNumber = 0;
- _PTR(SObject) obj;
- do
- {
- aName = theOperation+"_"+QString::number(++aNumber);
- obj = aStudy->FindObject(aName.latin1());
+ std::set<std::string> aSet;
+ _PTR(SComponent) aGeomCompo (aStudy->FindComponent("GEOM"));
+ if (aGeomCompo) {
+ _PTR(ChildIterator) it (aStudy->NewChildIterator(aGeomCompo));
+ _PTR(SObject) obj;
+ for (it->InitEx(true); it->More(); it->Next()) {
+ obj = it->Value();
+ aSet.insert(obj->GetName());
}
- while (obj);
+ }
+
+ // build a unique name
+ int aNumber = 0;
+ bool isUnique = false;
+ while (!isUnique) {
+ aName = theOperation + "_" + QString::number(++aNumber);
+ isUnique = (aSet.count(aName.latin1()) == 0);
+ }
return aName;
}
if ( appStudy )
{
- string anIOR = SalomeApp_Application::orb()->object_to_string( theObj );
- if ( anIOR != "" )
+ CORBA::String_var anIOR = SalomeApp_Application::orb()->object_to_string( theObj );
+ if ( strcmp(anIOR.in(), "") != 0 )
{
- _PTR(SObject) aSObj ( appStudy->studyDS()->FindObjectIOR( anIOR ) );
+ _PTR(SObject) aSObj ( appStudy->studyDS()->FindObjectIOR( string( anIOR ) ) );
_PTR(GenericAttribute) anAttr;