X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FGEOMGUI%2FGEOM_Displayer.h;h=30337eaac4264c6b685fa714572b8a2f1f91bac2;hb=aa829b078e5ae308a86fe8c28de055a3e29131e6;hp=8c877c94f46304a24007480603dbc231e0c81061;hpb=239f8109c64fa0c5a2e1d87a420bad5529b57f48;p=modules%2Fgeom.git diff --git a/src/GEOMGUI/GEOM_Displayer.h b/src/GEOMGUI/GEOM_Displayer.h index 8c877c94f..30337eaac 100644 --- a/src/GEOMGUI/GEOM_Displayer.h +++ b/src/GEOMGUI/GEOM_Displayer.h @@ -1,47 +1,50 @@ -// GEOM GEOMGUI : GUI for Geometry component +// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE // -// Copyright (C) 2003 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 // + +// GEOM GEOMGUI : GUI for Geometry component +// File : GEOM_Displayer.h +// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) // -// -// File : GEOM_Displayer.h -// Author : Vadim SANDLER -// Module : GEOM -// $Header$ +#ifndef GEOM_DISPLAYER_H +#define GEOM_DISPLAYER_H -#if !defined (__GEOM_DISPLAYER_H) -#define __GEOM_DISPLAYER_H +#include "GEOM_GEOMGUI.hxx" -using namespace std; +#include -#include "GEOM_GEOMGUI.hxx" +class SALOME_ListIO; +class SALOME_View; +class SALOME_Prs; +class SALOME_OCCPrs; +class SALOME_VTKPrs; +class SALOME_OCCViewType; -#include "SALOME_Prs.h" -#include "SALOME_InteractiveObject.hxx" -#include "SALOME_ListIO.hxx" #include #include #include +#include #include -#include +#include #include @@ -76,12 +79,12 @@ public: /* Display/Erase object methods */ void Display ( const Handle(SALOME_InteractiveObject)& theIO, const bool updateViewer = true, - SALOME_View* theViewFrame = 0 ); + SALOME_View* theViewFrame = 0 ); // This overloaded Display() method can be useful for operations // not using dialog boxes. void Display ( GEOM::GEOM_Object_ptr theObj, - const bool updateViewer = true ); + const bool updateViewer = true ); void Redisplay ( const Handle(SALOME_InteractiveObject)& theIO, const bool updateViewer = true ); @@ -89,12 +92,15 @@ public: void Erase ( const Handle(SALOME_InteractiveObject)& theIO, const bool forced = false, const bool updateViewer = true, - SALOME_View* theViewFrame = 0 ); + SALOME_View* theViewFrame = 0 ); void Erase ( GEOM::GEOM_Object_ptr theObj, const bool forced = false, const bool updateViewer = true ); + void EraseWithChildren(const Handle(SALOME_InteractiveObject)& theIO, + const bool eraseOnlyChildren = false); + /* Display/Erase list of objects methods */ void Display ( const SALOME_ListIO& theIOList, @@ -117,6 +123,11 @@ public: void UnsetColor(); int GetColor () const; bool HasColor () const; + + /* Set texture for shape displaying. */ + void SetTexture ( const std::string& ); + bool HasTexture () const; + std::string GetTexture () const; /* Set width for shape displaying. If it is equal -1 then default width is used. */ void SetWidth ( const double ); @@ -137,8 +148,8 @@ public: /* Reimplemented from SALOME_Displayer */ virtual void Update( SALOME_OCCPrs* ); virtual void Update( SALOME_VTKPrs* ); - virtual void BeforeDisplay( SALOME_View*, const SALOME_OCCViewType& ); - virtual void AfterDisplay ( SALOME_View*, const SALOME_OCCViewType& ); + virtual void BeforeDisplay( SALOME_View*, const SALOME_OCCPrs* ); + virtual void AfterDisplay ( SALOME_View*, const SALOME_OCCPrs* ); /* This methos is used for activisation/deactivisation of objects to be displayed*/ void SetToActivate( const bool ); @@ -148,15 +159,34 @@ public: void LocalSelection( const Handle(SALOME_InteractiveObject)&, const int ); void LocalSelection( const SALOME_ListIO& theIOList, const int ); void GlobalSelection( const int = GEOM_ALLOBJECTS, const bool = false ); - void GlobalSelection( const TColStd_MapOfInteger&, const bool = false ); + void GlobalSelection( const TColStd_MapOfInteger&, const bool = false, const QList* = 0 ); SalomeApp_Study* getStudy() const; - static SALOMEDS::Color getUniqueColor( const QValueList& ); + static SALOMEDS::Color getUniqueColor( const QList& ); + + static PropMap getDefaultPropertyMap(const QString& viewer_type); + + static bool MergePropertyMaps(PropMap& theOrigin, PropMap& theDefault); + + /*Get color of the geom object*/ + static SALOMEDS::Color getColor(GEOM::GEOM_Object_var aGeomObject, bool& hasColor); + + /* Get minimum or maximum enclosed shape type */ + static int getMinMaxShapeType( const TopoDS_Shape& shape, bool ismin ); + + /* Check if the object is a vertex or a compound of vertices */ + static bool isCompoundOfVertices( const TopoDS_Shape& theShape ); + + + /* Builds presentation of not published object */ + virtual SALOME_Prs* buildSubshapePresentation(const TopoDS_Shape& aShape, + const QString&, + SALOME_View* = 0); protected: /* internal methods */ - /* Builds presentation accordint to the current viewer type */ + /* Builds presentation according to the current viewer type */ virtual SALOME_Prs* buildPresentation( const QString&, SALOME_View* = 0 ); /* Sets interactive object */ @@ -171,11 +201,13 @@ protected: void clearTemporary( LightApp_SelectionMgr* theSelMgr ); SUIT_SelectionFilter* getFilter( const int theMode ); + SUIT_SelectionFilter* getComplexFilter( const QList* ); protected: Handle(SALOME_InteractiveObject) myIO; TopoDS_Shape myShape; - string myName; + std::string myName; + std::string myTexture; int myType; SALOME_View* myViewFrame; @@ -192,5 +224,5 @@ private: SalomeApp_Application* myApp; }; -#endif // __GEOM_DISPLAYER_H +#endif // GEOM_DISPLAYER_H