X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_Tools.cpp;h=5672163dcf06273e50eaa790bec519328784fb9b;hb=0caee92b045249b15dd6df72d52b44335e05cc3f;hp=bc462b8000a58e9fc30ff3434adc5824b646a8ce;hpb=2a0dd5ede9110d423fbd6b038c0445cb819163a9;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_Tools.cpp b/src/XGUI/XGUI_Tools.cpp index bc462b800..5672163dc 100644 --- a/src/XGUI/XGUI_Tools.cpp +++ b/src/XGUI/XGUI_Tools.cpp @@ -1,38 +1,16 @@ #include "XGUI_Tools.h" -#include - -//****************************************************************** -QString library(const QString& str) -{ - QString path = dir(str, false); - QString name = file(str, false); - QString ext = extension(str); - -#ifndef WIN32 - if ( !name.startsWith( "lib" ) ) - name = QString( "lib" ) + name; -#endif - -#ifdef WIN32 - QString libExt("dll"); -#else - QString libExt( "so" ); -#endif - - if (ext.toLower() != QString("so") && ext.toLower() != QString("dll")) { - if (!name.isEmpty() && !ext.isEmpty()) - name += QString("."); - name += ext; - } - - ext = libExt; +#include +#include +#include - QString fileName = addSlash(path) + name + QString(".") + ext; +#include - return fileName; -} +#include +#include +namespace XGUI_Tools +{ //****************************************************************** QString dir(const QString& path, bool isAbs) { @@ -77,3 +55,32 @@ QRect makeRect(const int x1, const int y1, const int x2, const int y2) { return QRect(qMin(x1, x2), qMin(y1, y2), qAbs(x2 - x1), qAbs(y2 - y1)); } + +//****************************************************************** +bool isModelObject(FeaturePtr theFeature) +{ + return theFeature && !theFeature->data(); +} + +//****************************************************************** +std::string featureInfo(FeaturePtr theFeature) +{ + std::ostringstream aStream; + if (theFeature) + aStream << theFeature.get() << " " << theFeature->getKind(); + return QString(aStream.str().c_str()).toStdString(); +} + +//****************************************************************** +/*FeaturePtr realFeature(const FeaturePtr theFeature) +{ + if (theFeature->data()) { + return theFeature; + } else { + ObjectPtr aObject = boost::dynamic_pointer_cast(theFeature); + return aObject->featureRef(); + } +}*/ + + +}