mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-11-15 10:08:35 +05:00
Merge from BR_phase16 branch (09/12/09)
This commit is contained in:
parent
499b281dc4
commit
f697bd6392
@ -18,7 +18,7 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
|
||||
#include "GEOM_SelectionFilter.h"
|
||||
|
||||
#include "GEOM_Client.hxx"
|
||||
@ -65,6 +65,19 @@ bool GEOM_SelectionFilter::isOk( const SUIT_DataOwner* sOwner ) const
|
||||
if ( getShape( obj, shape ) )
|
||||
return contains( shape.ShapeType() ) && isShapeOk( shape );
|
||||
}
|
||||
|
||||
// IMP 0020435: fine local selection
|
||||
{
|
||||
const LightApp_DataOwner* owner = dynamic_cast<const LightApp_DataOwner*>(sOwner);
|
||||
if (owner) {
|
||||
QString entry = owner->entry();
|
||||
int index = entry.lastIndexOf("_");
|
||||
if (index > 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -72,7 +85,8 @@ bool GEOM_SelectionFilter::isOk( const SUIT_DataOwner* sOwner ) const
|
||||
// function : getObject
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
GEOM::GEOM_Object_ptr GEOM_SelectionFilter::getObject( const SUIT_DataOwner* sOwner, const bool extractReference ) const
|
||||
GEOM::GEOM_Object_ptr GEOM_SelectionFilter::getObject (const SUIT_DataOwner* sOwner,
|
||||
const bool extractReference) const
|
||||
{
|
||||
GEOM::GEOM_Object_var anObj;
|
||||
|
||||
@ -119,18 +133,18 @@ bool GEOM_SelectionFilter::getShape (const GEOM::GEOM_Object_ptr& theObject,
|
||||
SALOME_LifeCycleCORBA* ls = new SALOME_LifeCycleCORBA( app->namingService() );
|
||||
static GEOM::GEOM_Gen_var geomGen;
|
||||
if(CORBA::is_nil( geomGen )) {
|
||||
Engines::Component_var comp = ls->FindOrLoad_Component( "FactoryServer", "GEOM" );
|
||||
geomGen = GEOM::GEOM_Gen::_narrow( comp );
|
||||
Engines::Component_var comp = ls->FindOrLoad_Component( "FactoryServer", "GEOM" );
|
||||
geomGen = GEOM::GEOM_Gen::_narrow( comp );
|
||||
}
|
||||
if ( !CORBA::is_nil( geomGen ) )
|
||||
{
|
||||
TopoDS_Shape aTopoDSShape = GEOM_Client().GetShape( geomGen, theObject );
|
||||
TopoDS_Shape aTopoDSShape = GEOM_Client().GetShape( geomGen, theObject );
|
||||
|
||||
if ( !aTopoDSShape.IsNull() )
|
||||
{
|
||||
theShape = aTopoDSShape;
|
||||
return true;
|
||||
}
|
||||
if ( !aTopoDSShape.IsNull() )
|
||||
{
|
||||
theShape = aTopoDSShape;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1025,6 +1025,44 @@ SALOME_Prs* GEOM_Displayer::buildPresentation( const QString& entry,
|
||||
return prs;
|
||||
}
|
||||
|
||||
//=================================================================
|
||||
/*!
|
||||
* GEOM_Displayer::buildSubshapePresentation
|
||||
* Builds/finds object's presentation for the current viewer
|
||||
* Calls corresponding Update() method by means of double dispatch
|
||||
* For not published objects (for Mantis issue 0020435)
|
||||
*/
|
||||
//=================================================================
|
||||
SALOME_Prs* GEOM_Displayer::buildSubshapePresentation(const TopoDS_Shape& aShape,
|
||||
const QString& entry,
|
||||
SALOME_View* theViewFrame)
|
||||
{
|
||||
SALOME_Prs* prs = 0;
|
||||
internalReset();
|
||||
|
||||
myViewFrame = theViewFrame ? theViewFrame : GetActiveView();
|
||||
|
||||
if (myViewFrame)
|
||||
{
|
||||
prs = LightApp_Displayer::buildPresentation(entry, theViewFrame);
|
||||
if (prs)
|
||||
{
|
||||
Handle(SALOME_InteractiveObject) theIO = new SALOME_InteractiveObject();
|
||||
theIO->setEntry(entry.toLatin1().constData());
|
||||
if (!theIO.IsNull())
|
||||
{
|
||||
// set interactive object
|
||||
setIO(theIO);
|
||||
// finally set shape
|
||||
setShape(aShape);
|
||||
myType = GEOM_SUBSHAPE;
|
||||
}
|
||||
UpdatePrs(prs); // Update presentation by using of the double dispatch
|
||||
}
|
||||
}
|
||||
return prs;
|
||||
}
|
||||
|
||||
//=================================================================
|
||||
/*!
|
||||
* GEOM_Displayer::internalReset
|
||||
|
@ -155,9 +155,14 @@ public:
|
||||
|
||||
static SALOMEDS::Color getUniqueColor( const QList<SALOMEDS::Color>& );
|
||||
|
||||
/* 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 */
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -19,10 +19,10 @@
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
// GEOM GEOMGUI : GUI for Geometry component
|
||||
// File : GroupGUI_GroupDlg.h
|
||||
// Author : Sergey ANIKIN, Open CASCADE S.A.S. (sergey.anikin@opencascade.com)
|
||||
//
|
||||
// GEOM GEOMGUI : GUI for Geometry component
|
||||
// File : GroupGUI_GroupDlg.h
|
||||
// Author : Sergey ANIKIN, Open CASCADE S.A.S. (sergey.anikin@opencascade.com)
|
||||
|
||||
#ifndef GROUPGUI_GROUPDLG_H
|
||||
#define GROUPGUI_GROUPDLG_H
|
||||
|
||||
@ -30,6 +30,7 @@
|
||||
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
#include <TColStd_DataMapOfIntegerInteger.hxx>
|
||||
#include <TColStd_IndexedMapOfInteger.hxx>
|
||||
|
||||
class QGroupBox;
|
||||
class QLineEdit;
|
||||
@ -59,7 +60,7 @@ protected:
|
||||
virtual bool isValid( QString& );
|
||||
virtual bool execute( ObjectList& );
|
||||
virtual GEOM::GEOM_Object_ptr getFather( GEOM::GEOM_Object_ptr );
|
||||
|
||||
|
||||
void closeEvent( QCloseEvent* );
|
||||
|
||||
private slots:
|
||||
@ -70,23 +71,25 @@ private slots:
|
||||
void SelectionIntoArgument();
|
||||
void SetEditCurrentArgument();
|
||||
void ConstructorsClicked( int );
|
||||
|
||||
|
||||
void selectAllSubShapes();
|
||||
void add();
|
||||
void remove();
|
||||
void showOnlySelected();
|
||||
void selectionChanged();
|
||||
|
||||
|
||||
private:
|
||||
void Init();
|
||||
void enterEvent( QEvent* );
|
||||
int subSelectionWay() const;
|
||||
int subSelectionWay() const;
|
||||
TopAbs_ShapeEnum getShapeType() const;
|
||||
void setShapeType( const TopAbs_ShapeEnum );
|
||||
void activateSelection();
|
||||
void updateState();
|
||||
void updateState(bool isAdd = false);
|
||||
void highlightSubShapes();
|
||||
void onGetInPlace();
|
||||
void setInPlaceObj( GEOM::GEOM_Object_var, const bool isVisible=1);
|
||||
int getSelectedSubshapes (TColStd_IndexedMapOfInteger& theMapIndex);
|
||||
|
||||
private:
|
||||
Mode myMode;
|
||||
@ -102,11 +105,14 @@ private:
|
||||
QLineEdit* myMainName;
|
||||
QPushButton* mySelBtn2;
|
||||
QLineEdit* myShape2Name;
|
||||
QGroupBox* mySelectionWayGroupBox;
|
||||
QButtonGroup* mySelectionWayGroup;
|
||||
QGroupBox* myRestrictGroupBox;
|
||||
QButtonGroup* myRestrictGroup;
|
||||
QPushButton* mySelAllBtn;
|
||||
QPushButton* myAddBtn;
|
||||
QPushButton* myRemBtn;
|
||||
QPushButton* myShowOnlyBtn;
|
||||
QPushButton* myHideSelBtn;
|
||||
QPushButton* myShowAllBtn;
|
||||
QListWidget* myIdList;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user