mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-02-04 04:20:33 +05:00
23034: EDF GEOM: Information after a transformation without copy
IPAL52713: Wrong creation info for ProjectionOnCylinder object
This commit is contained in:
parent
c5e0716722
commit
ee311dbb32
@ -226,6 +226,7 @@ module GEOM
|
|||||||
string operationName;
|
string operationName;
|
||||||
Parameters params;
|
Parameters params;
|
||||||
};
|
};
|
||||||
|
typedef sequence<CreationInformation> CreationInformationSeq;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Reporting on shape healing
|
* \brief Reporting on shape healing
|
||||||
@ -348,7 +349,7 @@ module GEOM
|
|||||||
/*!
|
/*!
|
||||||
* \brief Return name of operation and values of parameters used for object creation
|
* \brief Return name of operation and values of parameters used for object creation
|
||||||
*/
|
*/
|
||||||
CreationInformation GetCreationInformation();
|
CreationInformationSeq GetCreationInformation();
|
||||||
};
|
};
|
||||||
|
|
||||||
//# GEOM_Object
|
//# GEOM_Object
|
||||||
|
@ -493,18 +493,24 @@ Handle(TColStd_HSequenceOfTransient) GEOM_BaseObject::GetLastDependency()
|
|||||||
*/
|
*/
|
||||||
//================================================================================
|
//================================================================================
|
||||||
|
|
||||||
Handle(TFunction_Driver) GEOM_BaseObject::GetCreationDriver()
|
std::vector< Handle(TFunction_Driver)> GEOM_BaseObject::GetCreationDrivers()
|
||||||
{
|
{
|
||||||
Handle(TFunction_Driver) aDriver;
|
std::vector< Handle(TFunction_Driver)> aDriverVec;
|
||||||
|
|
||||||
Handle(GEOM_Function) function = GetFunction(1);
|
for ( int i = 1, nb = GetNbFunctions(); i <= nb; ++i )
|
||||||
if ( !function.IsNull() )
|
|
||||||
{
|
{
|
||||||
Standard_GUID aGUID = function->GetDriverGUID();
|
Handle(GEOM_Function) function = GetFunction(i);
|
||||||
if ( TFunction_DriverTable::Get()->FindDriver(aGUID, aDriver))
|
if ( !function.IsNull() )
|
||||||
aDriver->Init( function->GetEntry() );
|
{
|
||||||
|
Standard_GUID aGUID = function->GetDriverGUID();
|
||||||
|
aDriverVec.push_back( Handle(TFunction_Driver )() );
|
||||||
|
if ( TFunction_DriverTable::Get()->FindDriver(aGUID, aDriverVec.back() ))
|
||||||
|
aDriverVec.back()->Init( function->GetEntry() );
|
||||||
|
else
|
||||||
|
aDriverVec.pop_back();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return aDriver;
|
return aDriverVec;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
@ -31,6 +31,8 @@
|
|||||||
#include <TDF_Label.hxx>
|
#include <TDF_Label.hxx>
|
||||||
#include <TDataStd_TreeNode.hxx>
|
#include <TDataStd_TreeNode.hxx>
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
class GEOM_BaseObject;
|
class GEOM_BaseObject;
|
||||||
class Handle(TFunction_Driver);
|
class Handle(TFunction_Driver);
|
||||||
class GEOM_Engine;
|
class GEOM_Engine;
|
||||||
@ -146,8 +148,8 @@ public:
|
|||||||
//Returns the dependencies of the last function
|
//Returns the dependencies of the last function
|
||||||
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetLastDependency();
|
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetLastDependency();
|
||||||
|
|
||||||
//Returns a driver creator of this object
|
//Returns drivers creators of this object
|
||||||
Standard_EXPORT Handle(TFunction_Driver) GetCreationDriver();
|
Standard_EXPORT std::vector< Handle(TFunction_Driver)> GetCreationDrivers();
|
||||||
|
|
||||||
//###########################################################
|
//###########################################################
|
||||||
// Internal methods
|
// Internal methods
|
||||||
|
@ -21,9 +21,13 @@
|
|||||||
// Author : Edward AGAPOV (eap)
|
// Author : Edward AGAPOV (eap)
|
||||||
|
|
||||||
#include "GEOMGUI_CreationInfoWdg.h"
|
#include "GEOMGUI_CreationInfoWdg.h"
|
||||||
|
|
||||||
|
#include "GEOMImpl_Types.hxx"
|
||||||
|
|
||||||
#include <SalomeApp_Application.h>
|
|
||||||
#include <SUIT_Desktop.h>
|
#include <SUIT_Desktop.h>
|
||||||
|
#include <SUIT_ResourceMgr.h>
|
||||||
|
#include <SUIT_Session.h>
|
||||||
|
#include <SalomeApp_Application.h>
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
@ -38,33 +42,16 @@ GEOMGUI_CreationInfoWdg::GEOMGUI_CreationInfoWdg( SalomeApp_Application* app )
|
|||||||
//:QWidget( app->desktop() )
|
//:QWidget( app->desktop() )
|
||||||
{
|
{
|
||||||
setWindowTitle( tr( "CREATION_INFO_TITLE" ) );
|
setWindowTitle( tr( "CREATION_INFO_TITLE" ) );
|
||||||
setObjectName( "geomCreationInformation" );
|
|
||||||
|
|
||||||
QFrame* frame = new QFrame( this );
|
myParamsTreeWd = new QTreeWidget( this );
|
||||||
|
|
||||||
QVBoxLayout* myLayout = new QVBoxLayout( this );
|
|
||||||
myLayout->addWidget( frame );
|
|
||||||
myLayout->setMargin(0);
|
|
||||||
|
|
||||||
QGroupBox* operationGB = new QGroupBox( tr( "OPERATION" ), frame );
|
|
||||||
|
|
||||||
myIconLbl = new QLabel( operationGB );
|
|
||||||
myOperaionLnEd = new QLineEdit( operationGB );
|
|
||||||
myOperaionLnEd->setReadOnly( true );
|
|
||||||
myParamsTreeWd = new QTreeWidget( frame );
|
|
||||||
myParamsTreeWd->setColumnCount( 2 );
|
myParamsTreeWd->setColumnCount( 2 );
|
||||||
myParamsTreeWd->setHeaderLabels( QStringList() << tr( "PARAMETER" ) << tr( "VALUE" ) );
|
myParamsTreeWd->setHeaderLabels( QStringList() << tr( "PARAMETER" ) << tr( "VALUE" ) );
|
||||||
myParamsTreeWd->header()->setStretchLastSection( true );
|
myParamsTreeWd->header()->setStretchLastSection( true );
|
||||||
myParamsTreeWd->header()->setResizeMode( 0, QHeaderView::ResizeToContents );
|
myParamsTreeWd->header()->setResizeMode( 0, QHeaderView::ResizeToContents );
|
||||||
|
|
||||||
QHBoxLayout* operationLay = new QHBoxLayout( operationGB );
|
QVBoxLayout* aLayout = new QVBoxLayout( this );
|
||||||
operationLay->addWidget( myIconLbl );
|
|
||||||
operationLay->addWidget( myOperaionLnEd );
|
|
||||||
operationLay->setMargin(5);
|
|
||||||
|
|
||||||
QVBoxLayout* aLayout = new QVBoxLayout( frame );
|
|
||||||
aLayout->addWidget( operationGB );
|
|
||||||
aLayout->addWidget( myParamsTreeWd );
|
aLayout->addWidget( myParamsTreeWd );
|
||||||
|
aLayout->setMargin(11);
|
||||||
|
|
||||||
// get a free dockable window id
|
// get a free dockable window id
|
||||||
myWindowID = 10;
|
myWindowID = 10;
|
||||||
@ -73,19 +60,26 @@ GEOMGUI_CreationInfoWdg::GEOMGUI_CreationInfoWdg( SalomeApp_Application* app )
|
|||||||
++myWindowID; // pb when a GEOM is a sole module: CreationInfoWdg replaces Python console
|
++myWindowID; // pb when a GEOM is a sole module: CreationInfoWdg replaces Python console
|
||||||
}
|
}
|
||||||
|
|
||||||
void GEOMGUI_CreationInfoWdg::setOperation(const QPixmap& icon, const QString& name)
|
QTreeWidgetItem* GEOMGUI_CreationInfoWdg::addOperation(const QPixmap& icon, const QString& name)
|
||||||
{
|
|
||||||
myIconLbl->setPixmap( icon );
|
|
||||||
myOperaionLnEd->setText( name );
|
|
||||||
|
|
||||||
if ( name.isEmpty() )
|
|
||||||
myOperaionLnEd->setText( tr("NO_INFO"));
|
|
||||||
}
|
|
||||||
|
|
||||||
void GEOMGUI_CreationInfoWdg::addParam (const QString& name, const QString& value)
|
|
||||||
{
|
{
|
||||||
QTreeWidgetItem* item = new QTreeWidgetItem( myParamsTreeWd );
|
QTreeWidgetItem* item = new QTreeWidgetItem( myParamsTreeWd );
|
||||||
|
|
||||||
|
item->setIcon( 0, icon );
|
||||||
|
item->setText( 0, name );
|
||||||
|
if ( name.isEmpty() )
|
||||||
|
item->setText( 0, tr("NO_INFO"));
|
||||||
|
|
||||||
|
item->setExpanded( true );
|
||||||
|
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GEOMGUI_CreationInfoWdg::addParam (QTreeWidgetItem* operation,
|
||||||
|
const QString& name,
|
||||||
|
const QString& value)
|
||||||
|
{
|
||||||
|
QTreeWidgetItem* item = new QTreeWidgetItem( operation );
|
||||||
|
|
||||||
//item->setFlags( Qt::NoItemFlags );
|
//item->setFlags( Qt::NoItemFlags );
|
||||||
item->setExpanded( true );
|
item->setExpanded( true );
|
||||||
|
|
||||||
@ -95,8 +89,6 @@ void GEOMGUI_CreationInfoWdg::addParam (const QString& name, const QString& valu
|
|||||||
|
|
||||||
void GEOMGUI_CreationInfoWdg::clear()
|
void GEOMGUI_CreationInfoWdg::clear()
|
||||||
{
|
{
|
||||||
myIconLbl->setPixmap( QPixmap() );
|
|
||||||
myOperaionLnEd->setText( "" );
|
|
||||||
myParamsTreeWd->clear();
|
myParamsTreeWd->clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,3 +96,57 @@ GEOMGUI_CreationInfoWdg::~GEOMGUI_CreationInfoWdg()
|
|||||||
{
|
{
|
||||||
//std::cout<<"~GEOMGUI_CreationInfoWdg"<<std::endl;
|
//std::cout<<"~GEOMGUI_CreationInfoWdg"<<std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GEOMGUI_CreationInfoWdg::setInfo( GEOM::CreationInformationSeq& info )
|
||||||
|
{
|
||||||
|
clear();
|
||||||
|
|
||||||
|
QPixmap icon;
|
||||||
|
QString operationName;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if ( &info )
|
||||||
|
{
|
||||||
|
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
|
||||||
|
for ( int j = 0, nb = info.length(); j < nb; ++j )
|
||||||
|
{
|
||||||
|
QString name = info[j].operationName.in();
|
||||||
|
if ( !name.isEmpty() )
|
||||||
|
{
|
||||||
|
// get plugin_name if any
|
||||||
|
QString plugin_name;
|
||||||
|
for ( size_t i = 0; i < info[j].params.length(); ++i )
|
||||||
|
{
|
||||||
|
QString value = info[j].params[i].name.in();
|
||||||
|
if ( value == PLUGIN_NAME )
|
||||||
|
plugin_name = info[j].params[i].value.in();
|
||||||
|
}
|
||||||
|
// get icon
|
||||||
|
QString prefix = plugin_name.isEmpty() ? "GEOM" : plugin_name;
|
||||||
|
icon = resMgr->loadPixmap( prefix, tr( ("ICO_"+name).toLatin1().constData() ), false );
|
||||||
|
|
||||||
|
// translate operation name
|
||||||
|
operationName = tr( ("MEN_"+name).toLatin1().constData() );
|
||||||
|
if ( operationName.startsWith( "MEN_" ))
|
||||||
|
operationName = name; // no translation
|
||||||
|
|
||||||
|
QTreeWidgetItem* operation = addOperation( icon, operationName );
|
||||||
|
|
||||||
|
// add parameters
|
||||||
|
for ( size_t i = 0; i < info[j].params.length(); ++i )
|
||||||
|
addParam( operation,
|
||||||
|
info[j].params[i].name.in(),
|
||||||
|
info[j].params[i].value.in() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
addOperation( icon, operationName );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -22,12 +22,16 @@
|
|||||||
|
|
||||||
#include "GEOM_GEOMGUI.hxx"
|
#include "GEOM_GEOMGUI.hxx"
|
||||||
|
|
||||||
|
#include <SALOMEconfig.h>
|
||||||
|
#include CORBA_SERVER_HEADER(GEOM_Gen)
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
class QString;
|
|
||||||
class QLabel;
|
class QLabel;
|
||||||
class QLineEdit;
|
class QLineEdit;
|
||||||
|
class QString;
|
||||||
class QTreeWidget;
|
class QTreeWidget;
|
||||||
|
class QTreeWidgetItem;
|
||||||
class SalomeApp_Application;
|
class SalomeApp_Application;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -46,16 +50,18 @@ class GEOMGUI_EXPORT GEOMGUI_CreationInfoWdg : public QWidget
|
|||||||
GEOMGUI_CreationInfoWdg( SalomeApp_Application* app );
|
GEOMGUI_CreationInfoWdg( SalomeApp_Application* app );
|
||||||
~GEOMGUI_CreationInfoWdg();
|
~GEOMGUI_CreationInfoWdg();
|
||||||
|
|
||||||
int getWinID() { return myWindowID; }
|
void setInfo( GEOM::CreationInformationSeq& info );
|
||||||
|
|
||||||
void clear();
|
void clear();
|
||||||
void setOperation(const QPixmap& icon, const QString& name);
|
|
||||||
void addParam (const QString& name, const QString& value);
|
int getWinID() { return myWindowID; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
QLabel* myIconLbl;
|
QTreeWidgetItem* addOperation(const QPixmap& icon, const QString& name);
|
||||||
QLineEdit* myOperaionLnEd;
|
void addParam (QTreeWidgetItem* operation, const QString& name, const QString& value);
|
||||||
|
|
||||||
|
QLabel* myIconLbl;
|
||||||
|
//QLineEdit* myOperaionLnEd;
|
||||||
QTreeWidget* myParamsTreeWd;
|
QTreeWidget* myParamsTreeWd;
|
||||||
int myWindowID;
|
int myWindowID;
|
||||||
|
|
||||||
|
@ -1674,7 +1674,7 @@ void GeometryGUI::addPluginActions()
|
|||||||
// icon
|
// icon
|
||||||
QPixmap icon;
|
QPixmap icon;
|
||||||
if ( !adata.icon.empty() )
|
if ( !adata.icon.empty() )
|
||||||
icon = resMgr->loadPixmap( pdata.name.c_str(), adata.icon.c_str() );
|
icon = resMgr->loadPixmap( pdata.name.c_str(), adata.icon.c_str() );
|
||||||
// menu text (path)
|
// menu text (path)
|
||||||
QStringList smenus = QString( adata.menuText.c_str() ).split( "/" );
|
QStringList smenus = QString( adata.menuText.c_str() ).split( "/" );
|
||||||
QString actionName = smenus.last();
|
QString actionName = smenus.last();
|
||||||
@ -1691,30 +1691,30 @@ void GeometryGUI::addPluginActions()
|
|||||||
actionStat = actionStat.toUpper().prepend( "STB_" );
|
actionStat = actionStat.toUpper().prepend( "STB_" );
|
||||||
|
|
||||||
createAction( id, // ~ adata.label
|
createAction( id, // ~ adata.label
|
||||||
tr( actionTool.toLatin1().constData() ),
|
tr( actionTool.toLatin1().constData() ),
|
||||||
icon,
|
icon,
|
||||||
tr( actionName.toLatin1().constData() ),
|
tr( actionName.toLatin1().constData() ),
|
||||||
tr( actionStat.toLatin1().constData() ),
|
tr( actionStat.toLatin1().constData() ),
|
||||||
QKeySequence( tr( adata.accel.c_str() ) ),
|
QKeySequence( tr( adata.accel.c_str() ) ),
|
||||||
application()->desktop(),
|
application()->desktop(),
|
||||||
false /*toggle*/,
|
false /*toggle*/,
|
||||||
this, SLOT( OnGUIEvent() ),
|
this, SLOT( OnGUIEvent() ),
|
||||||
QString() /*shortcutAction*/ );
|
QString() /*shortcutAction*/ );
|
||||||
|
|
||||||
int menuId = -1;
|
int menuId = -1;
|
||||||
foreach ( QString subMenu, smenus ) {
|
foreach ( QString subMenu, smenus ) {
|
||||||
QStringList subMenuList = subMenu.split( ":" );
|
QStringList subMenuList = subMenu.split( ":" );
|
||||||
QString subMenuName = subMenuList[0].toUpper().prepend( "MEN_" );
|
QString subMenuName = subMenuList[0].toUpper().prepend( "MEN_" );
|
||||||
int subMenuGroup = subMenuList.size() > 1 ? subMenuList[1].toInt() : -1;
|
int subMenuGroup = subMenuList.size() > 1 ? subMenuList[1].toInt() : -1;
|
||||||
menuId = createMenu( tr( subMenuName.toLatin1().constData() ), menuId, -1, subMenuGroup );
|
menuId = createMenu( tr( subMenuName.toLatin1().constData() ), menuId, -1, subMenuGroup );
|
||||||
}
|
}
|
||||||
createMenu( id, menuId, -1 );
|
createMenu( id, menuId, -1 );
|
||||||
|
|
||||||
if ( !stools.isEmpty() ) {
|
if ( !stools.isEmpty() ) {
|
||||||
QString subTool = stools[0];
|
QString subTool = stools[0];
|
||||||
subTool = subTool.toUpper().prepend( "TOOL_" );
|
subTool = subTool.toUpper().prepend( "TOOL_" );
|
||||||
int toolId = createTool( tr( subTool.toLatin1().constData() ) );
|
int toolId = createTool( tr( subTool.toLatin1().constData() ) );
|
||||||
createTool(id, toolId);
|
createTool(id, toolId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// add action id to map
|
// add action id to map
|
||||||
@ -2015,38 +2015,15 @@ void GeometryGUI::updateCreationInfo()
|
|||||||
// pass creation info of geomObj to myCreationInfoWdg
|
// pass creation info of geomObj to myCreationInfoWdg
|
||||||
|
|
||||||
if ( myCreationInfoWdg ) {
|
if ( myCreationInfoWdg ) {
|
||||||
QPixmap icon;
|
|
||||||
QString operationName;
|
|
||||||
myCreationInfoWdg->setOperation( icon, operationName );
|
|
||||||
|
|
||||||
|
GEOM::CreationInformationSeq_var info;
|
||||||
try {
|
try {
|
||||||
OCC_CATCH_SIGNALS;
|
OCC_CATCH_SIGNALS;
|
||||||
GEOM::CreationInformation_var info = geomObj->GetCreationInformation();
|
info = geomObj->GetCreationInformation();
|
||||||
if ( &info.in() ) {
|
|
||||||
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
|
|
||||||
QString name = info->operationName.in();
|
|
||||||
if ( !name.isEmpty() ) {
|
|
||||||
|
|
||||||
QString plugin_name;
|
|
||||||
for ( size_t i = 0; i < info->params.length(); ++i ) {
|
|
||||||
myCreationInfoWdg->addParam( info->params[i].name.in(),
|
|
||||||
info->params[i].value.in() );
|
|
||||||
QString value = info->params[i].name.in();
|
|
||||||
if( value == PLUGIN_NAME ) {
|
|
||||||
plugin_name = info->params[i].value.in();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
QString prefix = plugin_name.isEmpty() ? "GEOM" : plugin_name;
|
|
||||||
icon = resMgr->loadPixmap( prefix, tr( ("ICO_"+name).toLatin1().constData() ), false );
|
|
||||||
operationName = tr( ("MEN_"+name).toLatin1().constData() );
|
|
||||||
if ( operationName.startsWith( "MEN_" ))
|
|
||||||
operationName = name; // no translation
|
|
||||||
myCreationInfoWdg->setOperation( icon, operationName );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (...) {
|
catch (...) {
|
||||||
}
|
}
|
||||||
|
myCreationInfoWdg->setInfo( info );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2276,7 +2253,7 @@ void GeometryGUI::createPreferences()
|
|||||||
LightApp_Preferences::Selector, "Geometry", "toplevel_dm" );
|
LightApp_Preferences::Selector, "Geometry", "toplevel_dm" );
|
||||||
|
|
||||||
int transparency = addPreference( tr( "PREF_TRANSPARENCY" ), genGroup,
|
int transparency = addPreference( tr( "PREF_TRANSPARENCY" ), genGroup,
|
||||||
LightApp_Preferences::IntSpin, "Geometry", "transparency" );
|
LightApp_Preferences::IntSpin, "Geometry", "transparency" );
|
||||||
|
|
||||||
int defl = addPreference( tr( "PREF_DEFLECTION" ), genGroup,
|
int defl = addPreference( tr( "PREF_DEFLECTION" ), genGroup,
|
||||||
LightApp_Preferences::DblSpin, "Geometry", "deflection_coeff" );
|
LightApp_Preferences::DblSpin, "Geometry", "deflection_coeff" );
|
||||||
|
@ -473,41 +473,43 @@ GetCreationInformation(std::string& theOperationName,
|
|||||||
|
|
||||||
switch ( aType ) {
|
switch ( aType ) {
|
||||||
case PROJECTION_COPY:
|
case PROJECTION_COPY:
|
||||||
{
|
{
|
||||||
GEOMImpl_IMirror aCI( function );
|
GEOMImpl_IMirror aCI( function );
|
||||||
|
|
||||||
AddParam( theParams, "Source object", aCI.GetOriginal() );
|
AddParam( theParams, "Source object", aCI.GetOriginal() );
|
||||||
AddParam( theParams, "Target face", aCI.GetPlane() );
|
AddParam( theParams, "Target face", aCI.GetPlane() );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PROJECTION_ON_WIRE:
|
case PROJECTION_ON_WIRE:
|
||||||
{
|
{
|
||||||
GEOMImpl_IProjection aProj (function);
|
GEOMImpl_IProjection aProj (function);
|
||||||
|
|
||||||
AddParam(theParams, "Point", aProj.GetPoint());
|
AddParam(theParams, "Point", aProj.GetPoint());
|
||||||
AddParam(theParams, "Shape", aProj.GetShape());
|
AddParam(theParams, "Shape", aProj.GetShape());
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PROJECTION_ON_CYLINDER:
|
case PROJECTION_ON_CYLINDER:
|
||||||
{
|
{
|
||||||
GEOMImpl_IProjOnCyl aProj (function);
|
theOperationName = "PROJ_ON_CYL";
|
||||||
const Standard_Real aLengthAngle = aProj.GetAngleLength();
|
|
||||||
|
|
||||||
AddParam(theParams, "Shape", aProj.GetShape());
|
GEOMImpl_IProjOnCyl aProj (function);
|
||||||
AddParam(theParams, "Radius", aProj.GetRadius());
|
const Standard_Real aLengthAngle = aProj.GetAngleLength();
|
||||||
AddParam(theParams, "Start angle", aProj.GetStartAngle());
|
|
||||||
|
|
||||||
if (aLengthAngle >= 0.) {
|
AddParam(theParams, "Shape", aProj.GetShape());
|
||||||
AddParam(theParams, "Length angle", aLengthAngle);
|
AddParam(theParams, "Radius", aProj.GetRadius());
|
||||||
}
|
AddParam(theParams, "Start angle", aProj.GetStartAngle());
|
||||||
|
|
||||||
break;
|
if (aLengthAngle >= 0.) {
|
||||||
|
AddParam(theParams, "Length angle", aLengthAngle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -661,7 +663,7 @@ TopoDS_Shape GEOMImpl_ProjectionDriver::projectOnCylinder
|
|||||||
GEOMUtils::Handle(HTrsfCurve2d) aTrsfCurve =
|
GEOMUtils::Handle(HTrsfCurve2d) aTrsfCurve =
|
||||||
new GEOMUtils::HTrsfCurve2d(aCurve, aPar[0], aPar[1], aTrsf2d);
|
new GEOMUtils::HTrsfCurve2d(aCurve, aPar[0], aPar[1], aTrsf2d);
|
||||||
Approx_Curve2d aConv (aTrsfCurve, aPar[0], aPar[1],
|
Approx_Curve2d aConv (aTrsfCurve, aPar[0], aPar[1],
|
||||||
aUResol, aVResol, GeomAbs_C1,
|
aUResol, aVResol, GeomAbs_C1,
|
||||||
9, 1000);
|
9, 1000);
|
||||||
|
|
||||||
if (!aConv.IsDone() && !aConv.HasResult()) {
|
if (!aConv.IsDone() && !aConv.HasResult()) {
|
||||||
|
@ -268,50 +268,58 @@ char* GEOM_BaseObject_i::GetParameters()
|
|||||||
*/
|
*/
|
||||||
//================================================================================
|
//================================================================================
|
||||||
|
|
||||||
GEOM::CreationInformation* GEOM_BaseObject_i::GetCreationInformation()
|
GEOM::CreationInformationSeq* GEOM_BaseObject_i::GetCreationInformation()
|
||||||
{
|
{
|
||||||
GEOM::CreationInformation_var info = new GEOM::CreationInformation;
|
GEOM::CreationInformationSeq_var info = new GEOM::CreationInformationSeq();
|
||||||
|
|
||||||
Handle(GEOM_BaseDriver) driver =
|
std::vector< Handle(TFunction_Driver)> drivers = _impl->GetCreationDrivers();
|
||||||
Handle(GEOM_BaseDriver)::DownCast( _impl->GetCreationDriver() );
|
info->length( drivers.size() );
|
||||||
if ( !driver.IsNull() )
|
int nbI = 0;
|
||||||
|
for ( size_t i = 0; i < drivers.size(); ++i )
|
||||||
{
|
{
|
||||||
std::vector<GEOM_Param> params;
|
Handle(GEOM_BaseDriver) driver = Handle(GEOM_BaseDriver)::DownCast( drivers[i] );
|
||||||
std::string operationName;
|
if ( !driver.IsNull() )
|
||||||
try
|
|
||||||
{
|
{
|
||||||
OCC_CATCH_SIGNALS;
|
std::vector<GEOM_Param> params;
|
||||||
if ( driver->GetCreationInformation( operationName, params ))
|
std::string operationName;
|
||||||
|
try
|
||||||
{
|
{
|
||||||
info->operationName = operationName.c_str();
|
OCC_CATCH_SIGNALS;
|
||||||
info->params.length( params.size() );
|
if ( driver->GetCreationInformation( operationName, params ))
|
||||||
for ( size_t i = 0; i < params.size(); ++i )
|
|
||||||
{
|
{
|
||||||
info->params[i].name = params[i].name.c_str();
|
info[nbI].operationName = operationName.c_str();
|
||||||
info->params[i].value = params[i].value.c_str();
|
info[nbI].params.length( params.size() );
|
||||||
|
for ( size_t i = 0; i < params.size(); ++i )
|
||||||
|
{
|
||||||
|
info[nbI].params[i].name = params[i].name.c_str();
|
||||||
|
info[nbI].params[i].value = params[i].value.c_str();
|
||||||
|
}
|
||||||
|
nbI++;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#ifdef _DEBUG_
|
#ifdef _DEBUG_
|
||||||
if ( operationName.empty() )
|
if ( operationName.empty() )
|
||||||
|
{
|
||||||
|
cout << endl << endl << endl << "Warning: " << endl << "Dear developer!!!" << endl
|
||||||
|
<< " Consider implementing "
|
||||||
|
<< typeid(*(driver.operator->())).name() << "::GetCreationInformation() " << endl
|
||||||
|
<< " for the case of operation which has created '" << GetName() << "' object" << endl
|
||||||
|
<< "PLEEEEEEEASE" << endl
|
||||||
|
<< "\tPLEEEEEEEASE" << endl
|
||||||
|
<< "\t\tPLEEEEEEEASE" << endl
|
||||||
|
<< "\t\t\tPLEEEEEEEASE" << endl
|
||||||
|
<< "\t\t\t\tPLEEEEEEEASE" << endl;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
catch(...)
|
||||||
{
|
{
|
||||||
cout << endl << endl << endl << "Warning: " << endl << "Dear developer!!!" << endl
|
|
||||||
<< " Consider implementing "
|
|
||||||
<< typeid(*(driver.operator->())).name() << "::GetCreationInformation() " << endl
|
|
||||||
<< " for the case of operation which has created '" << GetName() << "' object" << endl
|
|
||||||
<< "PLEEEEEEEASE" << endl
|
|
||||||
<< "\tPLEEEEEEEASE" << endl
|
|
||||||
<< "\t\tPLEEEEEEEASE" << endl
|
|
||||||
<< "\t\t\tPLEEEEEEEASE" << endl
|
|
||||||
<< "\t\t\t\tPLEEEEEEEASE" << endl;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
catch(...)
|
|
||||||
{
|
|
||||||
#ifdef _DEBUG_
|
#ifdef _DEBUG_
|
||||||
cout << "Ecxeption in GEOM_BaseObject_i::GetCreationInformation()" << endl;
|
cout << "Ecxeption in GEOM_BaseObject_i::GetCreationInformation()" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
info->length( nbI );
|
||||||
|
|
||||||
return info._retn();
|
return info._retn();
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ class GEOM_I_EXPORT GEOM_BaseObject_i : public virtual POA_GEOM::GEOM_BaseObject
|
|||||||
|
|
||||||
virtual char* GetParameters();
|
virtual char* GetParameters();
|
||||||
|
|
||||||
virtual GEOM::CreationInformation* GetCreationInformation();
|
virtual GEOM::CreationInformationSeq* GetCreationInformation();
|
||||||
|
|
||||||
Handle(GEOM_BaseObject) GetImpl() { return _impl; }
|
Handle(GEOM_BaseObject) GetImpl() { return _impl; }
|
||||||
|
|
||||||
|
@ -320,24 +320,25 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy,
|
|||||||
aResultSO->SetAttrString("AttributePixMap","ICON_OBJBROWSER_LCS");
|
aResultSO->SetAttrString("AttributePixMap","ICON_OBJBROWSER_LCS");
|
||||||
aNamePrefix = "LocalCS_";
|
aNamePrefix = "LocalCS_";
|
||||||
} else if ( mytype >= USER_TYPE_EX ) {
|
} else if ( mytype >= USER_TYPE_EX ) {
|
||||||
char buf[20];
|
char buf[20];
|
||||||
sprintf( buf, "%d", aBaseObj->GetType() );
|
sprintf( buf, "%d", aBaseObj->GetType() );
|
||||||
GEOM::CreationInformation_var info = aBaseObj->GetCreationInformation();
|
GEOM::CreationInformationSeq_var infoSeq = aBaseObj->GetCreationInformation();
|
||||||
std::string plgId;
|
std::string plgId;
|
||||||
for ( size_t i = 0; i < info->params.length(); ++i ) {
|
for ( size_t j = 0; j < infoSeq->length(); ++j )
|
||||||
std::string param_name = info->params[i].name.in();
|
for ( size_t i = 0; i < infoSeq[j].params.length(); ++i ) {
|
||||||
std::string param_value = info->params[i].value.in();
|
std::string param_name = infoSeq[j].params[i].name.in();
|
||||||
if( param_name == PLUGIN_NAME) {
|
std::string param_value = infoSeq[j].params[i].value.in();
|
||||||
plgId = param_value;
|
if( param_name == PLUGIN_NAME) {
|
||||||
break;
|
plgId = param_value;
|
||||||
}
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(plgId.length() > 0 ) {
|
if(plgId.length() > 0 ) {
|
||||||
plgId += "::";
|
plgId += "::";
|
||||||
}
|
}
|
||||||
plgId +="ICON_OBJBROWSER_";
|
plgId +="ICON_OBJBROWSER_";
|
||||||
plgId += buf;
|
plgId += buf;
|
||||||
aResultSO->SetAttrString("AttributePixMap",plgId.c_str());
|
aResultSO->SetAttrString("AttributePixMap",plgId.c_str());
|
||||||
} else if ( mytype > USER_TYPE ) {
|
} else if ( mytype > USER_TYPE ) {
|
||||||
char buf[20];
|
char buf[20];
|
||||||
sprintf( buf, "%d", aBaseObj->GetType() );
|
sprintf( buf, "%d", aBaseObj->GetType() );
|
||||||
|
@ -9161,7 +9161,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
|
|||||||
self._autoPublish(anObj, theName, "projection")
|
self._autoPublish(anObj, theName, "projection")
|
||||||
return anObj
|
return anObj
|
||||||
|
|
||||||
## Create a projection projection of the given point on a wire or an edge.
|
## Create a projection of the given point on a wire or an edge.
|
||||||
# If there are no solutions or there are 2 or more solutions It throws an
|
# If there are no solutions or there are 2 or more solutions It throws an
|
||||||
# exception.
|
# exception.
|
||||||
# @param thePoint the point to be projected.
|
# @param thePoint the point to be projected.
|
||||||
@ -9179,7 +9179,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
|
|||||||
@ManageTransactions("TrsfOp")
|
@ManageTransactions("TrsfOp")
|
||||||
def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
|
def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
|
||||||
"""
|
"""
|
||||||
Create a projection projection of the given point on a wire or an edge.
|
Create a projection of the given point on a wire or an edge.
|
||||||
If there are no solutions or there are 2 or more solutions It throws an
|
If there are no solutions or there are 2 or more solutions It throws an
|
||||||
exception.
|
exception.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user