CMAKE_MINIMUM_REQUIRED(VERSION 2.8.10)
-
IF(WIN32)
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
- SET(PYTHON_LIBRARY_DLL "python27_d.lib")
+ SET(PYTHON_LIBRARY_FILE "python27_d.lib")
ElSE()
- SET(PYTHON_LIBRARY_DLL "python27.lib")
+ SET(PYTHON_LIBRARY_FILE "python27.lib")
ENDIF()
ElSE()
- SET(PYTHON_LIBRARY_DLL "libpython27.so")
+ SET(PYTHON_LIBRARY_FILE "libpython2.7.so")
ENDIF()
-FILE(TO_CMAKE_PATH "$ENV{PYTHON_LIB_DIR}/${PYTHON_LIBRARY_DLL}" PYTHON_LIBRARY)
+FILE(TO_CMAKE_PATH "$ENV{PYTHON_LIB_DIR}/${PYTHON_LIBRARY_FILE}" PYTHON_LIBRARY)
FILE(TO_CMAKE_PATH $ENV{PYTHON_INC_DIR} PYTHON_INCLUDE_DIR)
-
FIND_PACKAGE(PythonLibs)
-INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_DIRS})
+INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_DIR})
+MESSAGE(STATUS "PYTHON_LIBRARIES: " ${PYTHON_LIBRARIES})
+MESSAGE(STATUS "PYTHON_INCLUDE_DIR: " ${PYTHON_INCLUDE_DIR})
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.10)
SET(LIBXMLDIR $ENV{LIBXML2_ROOT_DIR})
-INCLUDE_DIRECTORIES(${LIBXMLDIR}/include/libxml2)
-LINK_DIRECTORIES (${LIBXMLDIR}/lib)
IF(WIN32)
SET(LIBXML2_LIBRARIES ${LIBXMLDIR}/lib/libxml2.lib)
+ INCLUDE_DIRECTORIES(${LIBXMLDIR}/include/libxml2)
ELSE()
SET(LIBXML2_LIBRARIES ${LIBXMLDIR}/lib/libxml2.so)
+ SET(LIBXML2_INCLUDE_DIR ${LIBXMLDIR}/include/libxml2)
+ FIND_PACKAGE(LibXml2 REQUIRED)
+ if(LIBXML2_FOUND)
+ message(STATUS "Found libxml2 ver. " ${LIBXML2_VERSION_STRING})
+ message(STATUS "LIBXML2_LIBRARIES " ${LIBXML2_LIBRARIES})
+ message(STATUS "LIBXML2_INCLUDE_DIR " ${LIBXML2_INCLUDE_DIR})
+ endif(LIBXML2_FOUND)
+
+ INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
+ ADD_DEFINITIONS(${LIBXML2_DEFINITIONS})
ENDIF()
+LINK_DIRECTORIES (${LIBXMLDIR}/lib)
-
-#set(PROJECT_LIBRARIES ${PROJECT_LIBRARIES} ${LIBXMLDIR}/lib/libxml2.lib)
-
-#FILE(TO_CMAKE_PATH $ENV{PC_LIBXML_INCLUDEDIR} PC_LIBXML_INCLUDEDIR)
-#FILE(TO_CMAKE_PATH $ENV{PC_LIBXML_INCLUDEDIR} PC_LIBXML_INCLUDEDIR)
-#FILE(TO_CMAKE_PATH $ENV{PC_LIBXML_LIBDIR} PC_LIBXML_LIBDIR)
-#message(STATUS "PC_LIBXML_INCLUDEDIR " ${PC_LIBXML_INCLUDEDIR})
-#message(STATUS "PC_LIBXML_LIBDIR " ${PC_LIBXML_LIBDIR})
-
-#FIND_PACKAGE(LibXml2 REQUIRED)
-#if(LIBXML2_FOUND)
-# message(STATUS "Found libxml2 ver. " ${LIBXML2_VERSION_STRING})
-# message(STATUS "LIBXML2_LIBRARIES " ${LIBXML2_LIBRARIES})
-# message(STATUS "LIBXML2_INCLUDE_DIR " ${LIBXML2_INCLUDE_DIR})
-#endif(LIBXML2_FOUND)
-
-#INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
-#ADD_DEFINITIONS(${LIBXML2_DEFINITIONS})
INCLUDE(FindQt)
INCLUDE(FindPython)
+IF(UNIX)
+ IF(CMAKE_COMPILER_IS_GNUCC)
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
+ MESSAGE(STATUS "Setting -std=c++0x flag for the gcc...")
+ MESSAGE(STATUS "Now gcc flags are: " ${CMAKE_CXX_FLAGS})
+
+ ENDIF(CMAKE_COMPILER_IS_GNUCC)
+ENDIF(UNIX)
+
+
ADD_SUBDIRECTORY (src/Config)
ADD_SUBDIRECTORY (src/Event)
ADD_SUBDIRECTORY (src/Model)
export PATH=${CAS_ROOT_DIR}:${CAS_ROOT_DIR}/bin:${PATH}
export LD_LIBRARY_PATH=${CAS_ROOT_DIR}:${CAS_ROOT_DIR}/lib:${LD_LIBRARY_PATH}
+export CSF_GraphicShr=${CAS_ROOT_DIR}/lib/libTKOpenGl.so
# Variable for Foundation Classes :
export CSF_UnitsLexicon=${CAS_ROOT_DIR}/src/UnitsAPI/Lexi_Expr.dat
export CSF_UnitsDefinition=${CAS_ROOT_DIR}/src/UnitsAPI/Units.dat
##
export LIB=${LD_LIBRARY_PATH}
-
+export PATH=${INST_ROOT}/../install/bin:${PATH}
+export LD_LIBRARY_PATH=${INST_ROOT}/../install/bin:${INST_ROOT}/../install/swig:${LD_LIBRARY_PATH}
#include <Event_Message.h>
#include <Event_Loop.h>
-#include <libxml\parser.h>
-#include <libxml\tree.h>
-#include <libxml\xmlstring.h>
+#include <libxml/parser.h>
+#include <libxml/tree.h>
+#include <libxml/xmlstring.h>
#include <string>
#include <Config_ModuleReader.h>
#include <Config_FeatureReader.h>
-#include <libxml\parser.h>
-#include <libxml\tree.h>
+#include <libxml/parser.h>
+#include <libxml/tree.h>
#ifdef _DEBUG
#include <iostream>
#include <Config_WidgetAPI.h>
-#include <libxml\parser.h>
-#include <libxml\tree.h>
+#include <libxml/parser.h>
+#include <libxml/tree.h>
Config_WidgetAPI::Config_WidgetAPI(std::string theRawXml)
#include <Config_WidgetReader.h>
#include <Config_Keywords.h>
-#include <libxml\parser.h>
-#include <libxml\tree.h>
-#include <libxml\xpath.h>
-#include <libxml\xmlstring.h>
+#include <libxml/parser.h>
+#include <libxml/tree.h>
+#include <libxml/xpath.h>
+#include <libxml/xmlstring.h>
#ifdef _DEBUG
#include <iostream>
#include <Config_XMLReader.h>
#include <Event_Loop.h>
-#include <libxml\parser.h>
-#include <libxml\tree.h>
+#include <libxml/parser.h>
+#include <libxml/tree.h>
/*
#ifdef WIN32
// Author: Mikhail PONIKAROV
#include <Event_Loop.h>
+
#include <string>
+#include <cstring>
using namespace std;
#include <TDataStd_Comment.hxx>
#include <TDF_ChildIDIterator.hxx>
+#include <climits>
+
static const int UNDO_LIMIT = 10; // number of possible undo operations
static const int TAG_GENERAL = 1; // general properties tag
TDF_ChildIDIterator aFLabIter(
aGroupsIter.Value()->Label(), TDataStd_Comment::GetID(), Standard_False);
while(aFIter != aFeatures.end() || aFLabIter.More()) {
- static const int INFINITE_TAG = MAXINT; // no label means that it exists somwhere in infinite
+ static const int INFINITE_TAG = INT_MAX; // no label means that it exists somwhere in infinite
int aFeatureTag = INFINITE_TAG;
if (aFIter != aFeatures.end()) { // existing tag for feature
shared_ptr<Model_Data> aData = dynamic_pointer_cast<Model_Data>((*aFIter)->data());
return aResult;
}
-bool Model_Iterator::is(std::shared_ptr<ModelAPI_Feature> theFeature)
+bool Model_Iterator::isEqual(std::shared_ptr<ModelAPI_Feature> theFeature)
{
return (myIter.Value()->Label() ==
dynamic_pointer_cast<Model_Data>(theFeature->data())->label()) == Standard_True;
/// Compares the current feature with the given one
/// \returns true if given feature equals to the current one
- MODEL_EXPORT virtual bool is(std::shared_ptr<ModelAPI_Feature> theFeature);
+ MODEL_EXPORT virtual bool isEqual(std::shared_ptr<ModelAPI_Feature> theFeature);
protected:
/// Creates an empty iterator that alway returns More false
virtual int numIterationsLeft() = 0;
/// Compares the current feature with the given one
/// \returns true if given feature equals to the current one
- virtual bool is(std::shared_ptr<ModelAPI_Feature> theFeature) = 0;
+ virtual bool isEqual(std::shared_ptr<ModelAPI_Feature> theFeature) = 0;
/// To virtually destroy the fields of successors
virtual ~ModelAPI_Iterator() {}
#ifndef WIN32
static string aLibExt( ".so" );
if (aLibName.size() < 3 || aLibName.substr(0, 3) !="lib")
- aLibName = ".lib" + aLibName;
+ aLibName = "lib" + aLibName;
#else
static string aLibExt( ".dll" );
#endif
virtual void setCurrentDocument(std::shared_ptr<ModelAPI_Document> theDoc) = 0;
/// loads the library with specific name, appends "lib*.dll" or "*.so" depending on the platform
- static void ModelAPI_PluginManager::loadLibrary(const std::string theLibName);
+ static void loadLibrary(const std::string theLibName);
/// Is needed for python wrapping by swig, call Get to get an instance
ModelAPI_PluginManager();
SET(PROJECT_LIBRARIES
PyInterp
${QT_LIBRARIES}
+ ${PYTHON_LIBRARIES}
)
QT4_ADD_TRANSLATION(QM_RESOURCES ${TEXT_RESOURCES})
SET(PROJECT_LIBRARIES
PyEvent
${QT_LIBRARIES}
+ ${PYTHON_LIBRARIES}
)
SOURCE_GROUP ("Generated Files" FILES ${PROJECT_AUTOMOC})
#)
SET(PROJECT_LIBRARIES
- opengl32
Event
Config
${QT_LIBRARIES}
ModuleBase
)
+IF(WIN32)
+ SET(PROJECT_LIBRARIES ${PROJECT_LIBRARIES} opengl32)
+ELSE()
+ SET(PROJECT_LIBRARIES ${PROJECT_LIBRARIES} GL)
+ENDIF()
+
QT4_ADD_RESOURCES(PROJECT_COMPILED_RESOURCES ${PROJECT_RESOURCES})
#QT5_ADD_TRANSLATION(QM_RESOURCES ${TEXT_RESOURCES})
if (!theParent.isValid()) {
switch (theRow) {
case 0:
- return createIndex(theRow, theColumn, (quintptr) ParamsFolder);
+ return createIndex(theRow, theColumn, (qint32) ParamsFolder);
case 1:
- return createIndex(theRow, theColumn, (quintptr) ConstructFolder);
+ return createIndex(theRow, theColumn, (qint32) ConstructFolder);
}
} else {
if (theParent.internalId() == ParamsFolder)
- return createIndex(theRow, theColumn, (quintptr) ParamObject);
+ return createIndex(theRow, theColumn, (qint32) ParamObject);
if (theParent.internalId() == ConstructFolder)
- return createIndex(theRow, theColumn, (quintptr) ConstructObject);
+ return createIndex(theRow, theColumn, (qint32) ConstructObject);
}
return QModelIndex();
}
case ConstructFolder:
return QModelIndex();
case ParamObject:
- return createIndex(0, 0, (quintptr) ParamsFolder);
+ return createIndex(0, 0, (qint32) ParamsFolder);
case ConstructObject:
- return createIndex(1, 0, (quintptr) ConstructFolder);
+ return createIndex(1, 0, (qint32) ConstructFolder);
}
return QModelIndex();
}
switch (theIndex.internalId()) {
case ParamsFolder:
case ConstructFolder:
- return 0;
+ return FeaturePtr();
case ParamObject:
return myDocument->feature(PARAMETERS_GROUP, theIndex.row());
case ConstructObject:
return myDocument->feature(CONSTRUCTIONS_GROUP, theIndex.row());
}
- return 0;
+ return FeaturePtr();
}
QModelIndex XGUI_PartDataModel::index(int theRow, int theColumn, const QModelIndex &theParent) const
{
if (!theParent.isValid())
- return createIndex(theRow, 0, (quintptr) MyRoot);
+ return createIndex(theRow, 0, (qint32) MyRoot);
int aId = (int)theParent.internalId();
switch (aId) {
case MyRoot:
switch (theRow) {
case 0:
- return createIndex(0, 0, (quintptr) ParamsFolder);
+ return createIndex(0, 0, (qint32) ParamsFolder);
case 1:
- return createIndex(1, 0, (quintptr) ConstructFolder);
+ return createIndex(1, 0, (qint32) ConstructFolder);
}
case ParamsFolder:
- return createIndex(theRow, 0, (quintptr) ParamObject);
+ return createIndex(theRow, 0, (qint32) ParamObject);
case ConstructFolder:
- return createIndex(theRow, 0, (quintptr) ConstructObject);
+ return createIndex(theRow, 0, (qint32) ConstructObject);
}
return QModelIndex();
}
return QModelIndex();
case ParamsFolder:
case ConstructFolder:
- return createIndex(0, 0, (quintptr) MyRoot);
+ return createIndex(0, 0, (qint32) MyRoot);
case ParamObject:
- return createIndex(0, 0, (quintptr) ParamsFolder);
+ return createIndex(0, 0, (qint32) ParamsFolder);
case ConstructObject:
- return createIndex(1, 0, (quintptr) ConstructFolder);
+ return createIndex(1, 0, (qint32) ConstructFolder);
}
return QModelIndex();
}
return myDocument->feature(PARTS_GROUP, myId);
case ParamsFolder:
case ConstructFolder:
- return 0;
+ return FeaturePtr();
case ParamObject:
return featureDocument()->feature(PARAMETERS_GROUP, theIndex.row());
case ConstructObject:
return featureDocument()->feature(CONSTRUCTIONS_GROUP, theIndex.row());
}
- return 0;
+ return FeaturePtr();
}
QFeatureList mySelectedData;
};
-#endif;
\ No newline at end of file
+#endif
-#ifndef WIN32
-# ifndef GLX_GLXEXT_LEGACY
-# define GLX_GLXEXT_LEGACY
-# endif
-# include <GL/glx.h>
-# include <dlfcn.h>
-#else
+#ifdef WIN32
# include <windows.h>
# include <wingdi.h>
#endif
#include <V3d_OrthographicView.hxx>
#include <V3d_PerspectiveView.hxx>
#include <Visual3d_View.hxx>
+#include <Graphic3d_GraphicDriver.hxx>
#ifdef WIN32
#include <WNT_Window.hxx>
#endif
#include <GL/gl.h>
+//qmetatype.h must be included before any header file that defines Bool
+//see /QtCore/qmetatype.h:53 for more info
+#ifndef WIN32
+# ifndef GLX_GLXEXT_LEGACY
+# define GLX_GLXEXT_LEGACY
+# endif
+# include <GL/glx.h>
+# include <dlfcn.h>
+#endif
static double rx = 0.;
static double ry = 0.;
myClosable(true),
myStartX(0), myStartY(0), myCurrX(0), myCurrY(0), myCurScale(0.0), myCurSketch(0),
myDrawRect(false), myEnableDrawMode(false), myCursorIsHand(false), myEventStarted(false),
- myLastState(NormalState), myOperation(NOTHING)
+ myLastState(WindowNormalState), myOperation(NOTHING)
{
mySelectedPoint = gp_Pnt(0., 0., 0.);
setFrameStyle(QFrame::Raised);
int aNewH = int(aH / aR);
myPicture->setPixmap(aPMap.scaled(100, aNewH));
- myLastState = isMaximized() ? MaximizedState : NormalState;
+ myLastState = isMaximized() ? MaximizedState : WindowNormalState;
showMinimized();
parentWidget()->setGeometry(parentWidget()->x(), parentWidget()->y(),
100, aNewH);
Handle(Visual3d_View) a3dView = myViewPort->getView()->View();
if (aFmt == "PS")
- a3dView->Export(_strdup(qPrintable(aFileName)), Graphic3d_EF_PostScript);
+ a3dView->Export(strdup(qPrintable(aFileName)), Graphic3d_EF_PostScript);
else if (aFmt == "EPS")
- a3dView->Export(_strdup(qPrintable(aFileName)), Graphic3d_EF_EnhPostScript);
+ a3dView->Export(strdup(qPrintable(aFileName)), Graphic3d_EF_EnhPostScript);
else
aPicture.save( aFileName, aFmt.toLatin1() );
QApplication::restoreOverrideCursor();
private:
enum WindowState
{
- MinimizedState, MaximizedState, NormalState
+ MinimizedState,
+ MaximizedState,
+ WindowNormalState
};
bool processWindowControls(QObject *theObj, QEvent *theEvent);
QPushButton* myLeftButton;
};
-#endif;
+#endif
err = QString( "Can not load library %1. %2" ).arg( libName ).arg( dlerror() );
else
{
- crtInst = (CREATE_FUNC)dlsym( modLib, GET_MODULE_NAME );
+ crtInst = (CREATE_FUNC)dlsym( modLib, CREATE_MODULE );
if ( !crtInst )
err = QString( "Failed to find function %1. %2" ).arg( CREATE_MODULE ).arg( dlerror() );
}