X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGEOMBase%2FGEOMBase_Helper.h;h=5d32fd26813b7932fe442e87fadc14865d586480;hb=bed71e55e89040080f5b0ca691d9654b59a26a0d;hp=d88621ea6f82612d1b3fddc7a416e93b9e7d09d3;hpb=e1706ff05c3b5a3d64c665bc2c0c2c6b5ecae150;p=modules%2Fgeom.git diff --git a/src/GEOMBase/GEOMBase_Helper.h b/src/GEOMBase/GEOMBase_Helper.h index d88621ea6..5d32fd268 100755 --- a/src/GEOMBase/GEOMBase_Helper.h +++ b/src/GEOMBase/GEOMBase_Helper.h @@ -1,24 +1,25 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE // -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// You should have received a copy of the GNU Lesser General Public +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + // GEOM GEOMGUI : GUI for Geometry component // File : GEOMBase_Helper.h // Author : Sergey ANIKIN, Open CASCADE S.A.S. (sergey.anikin@opencascade.com) @@ -27,6 +28,7 @@ #define GEOMBASE_HELPER_H #include "GEOM_GEOMBase.hxx" +#include "GEOM_GenericObjPtr.h" #include #include @@ -70,7 +72,8 @@ protected: void redisplay ( const ObjectList&, const bool = true, const bool = true ); void redisplay ( GEOM::GEOM_Object_ptr, const bool = true, const bool = true ); - virtual void displayPreview ( const bool activate = false, + virtual void displayPreview ( const bool display, + const bool activate = false, const bool update = true, const bool toRemoveFromEngine = true, const double lineWidth = -1, @@ -102,7 +105,7 @@ protected: void prepareSelection( const ObjectList&, const int ); void prepareSelection( GEOM::GEOM_Object_ptr, const int ); - void addInStudy ( GEOM::GEOM_Object_ptr, const char* theName ); + QString addInStudy ( GEOM::GEOM_Object_ptr, const char* theName ); bool openCommand (); bool abortCommand (); @@ -114,7 +117,7 @@ protected: SalomeApp_Study* getStudy () const; bool checkViewWindow (); - bool onAccept( const bool publish = true, const bool useTransaction = true ); + bool onAccept( const bool publish = true, const bool useTransaction = true, bool erasePreviewFlag = true); // This method should be called from "OK" button handler. // == true means that objects returned by execute() // should be published in a study. @@ -165,9 +168,13 @@ protected: virtual void addSubshapesToStudy(); GEOM::GEOM_Object_ptr findObjectInFather( GEOM::GEOM_Object_ptr theFather, const QString& theName ); - //This Metod to find SubObject in theFather Object by Name (theName) + GEOM::GEOM_Object_ptr findObjectInFather( GEOM::GEOM_Object_ptr theFather, int theIndex ); + // These methods are used to find published sub-object (sub-shape) in the parent object (main shape) - void addSubshapesToFather( QMap& theMap ); + GEOM::GeomObjPtr getSelected( TopAbs_ShapeEnum type ); + GEOM::GeomObjPtr getSelected( const QList& types ); + QList getSelected( TopAbs_ShapeEnum type, int count, bool strict = true ); + QList getSelected( const QList& types, int count, bool strict = true ); void SetIsPreview(const bool thePreview) {isPreview = thePreview;} bool IsPreview() {return isPreview;} @@ -175,8 +182,20 @@ protected: GEOM_Displayer* getDisplayer(); SUIT_Desktop* getDesktop() const; + virtual void setIsApplyAndClose( const bool theFlag ); + virtual bool isApplyAndClose() const; + + virtual void setIsOptimizedBrowsing( const bool theFlag ); + virtual bool isOptimizedBrowsing() const; + + virtual void setIsWaitCursorEnabled( const bool theFlag ) {myIsWaitCursorEnabled = theFlag;} + virtual bool isWaitCursorEnabled() const {return myIsWaitCursorEnabled ;} + virtual void setIsDisableBrowsing( const bool theFlag ) { myIsDisableBrowsing = theFlag; } + virtual bool isDisableBrowsing() const { return myIsDisableBrowsing; } + + private: - char* getEntry ( GEOM::GEOM_Object_ptr ) const; + QString getEntry( GEOM::GEOM_Object_ptr ) const; void clearShapeBuffer( GEOM::GEOM_Object_ptr ); private: @@ -191,6 +210,11 @@ private: bool isPreview; SALOME_ListIO mySelected; SUIT_Desktop* myDesktop; + bool myIsApplyAndClose; + bool myIsOptimizedBrowsing; + bool myIsWaitCursorEnabled; + bool myIsDisableBrowsing; //This flag enable/disable selection + //in the Object Browser newly created objects. };