]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
SketchSolver: porting to Linux
authorazv <artem.zhidkov@opencascade.com>
Tue, 20 May 2014 05:17:22 +0000 (09:17 +0400)
committerazv <artem.zhidkov@opencascade.com>
Tue, 20 May 2014 05:17:22 +0000 (09:17 +0400)
CMakeCommon/FindSolveSpace.cmake
linux_env.sh
src/Model/Model_Document.cpp
src/PartSet/PartSet_OperationSketchBase.cpp
src/SketchPlugin/SketchPlugin_Feature.cpp
src/SketchPlugin/SketchPlugin_Feature.h
src/SketchSolver/SketchSolver_Solver.h

index b373d2c407bdc94a52350e142c282171fcd3843e..c8d269f521cb9a4a642145438440b5087090dd2e 100644 (file)
@@ -3,4 +3,4 @@ SET(SLVS_ROOT_DIR $ENV{SOLVESPACE_ROOT_DIR})
 INCLUDE_DIRECTORIES(${SLVS_ROOT_DIR}/include)
 LINK_DIRECTORIES(${SLVS_ROOT_DIR}/lib)
 
-SET(SLVS_LIBRARIES ${SLVS_ROOT_DIR}/lib/slvs.lib)
+#SET(SLVS_LIBRARIES ${SLVS_ROOT_DIR}/lib/slvs.lib)
index 8fb9f33ff6c1dacff7fe498a82373748eebd3249..4466e33553acbf71c2c99283360fcc87b4ab907c 100644 (file)
@@ -27,8 +27,8 @@ export PATH=${QT4_ROOT_DIR}/bin:${PATH}
 export LD_LIBRARY_PATH=${QT4_ROOT_DIR}/lib:${LD_LIBRARY_PATH}
 ##
 #------ boost ------
-#export BOOST_ROOT_DIR=${PDIR}/boost-1.52.0
-#export LD_LIBRARY_PATH ${BOOST_ROOT_DIR}/lib
+export BOOST_ROOT_DIR=${PDIR}/boost-1.52.0
+export LD_LIBRARY_PATH ${BOOST_ROOT_DIR}/lib
 ##
 #------ swig ------
 export SWIG_ROOT_DIR=${PDIR}/swig-2.0.8
index 619e05c01804e7daa39317fc785b82f6894539fd..266622522498c4edf7359632df35d05102a8a126 100644 (file)
@@ -20,6 +20,9 @@
 #include <TDataStd_Name.hxx>
 
 #include <climits>
+#ifndef WIN32
+#include <sys/stat.h>
+#endif
 
 #ifdef WIN32
 # define _separator_ '\\'
@@ -325,7 +328,8 @@ void Model_Document::addFeature(const boost::shared_ptr<ModelAPI_Feature> theFea
   TDF_Label anObjLab = aGroupLab.NewChild();
   TCollection_ExtendedString aName(theFeature->data()->getName().c_str());
   TDataStd_Name::Set(anObjLab, aName);
-  AddToRefArray(aGroupLab.FindChild(1), anObjLab); // reference to names is on the first sub
+  TDF_Label aGrLabChild = aGroupLab.FindChild(1);
+  AddToRefArray(aGrLabChild, anObjLab); // reference to names is on the first sub
 
   // event: feature is added
   static Events_ID anEvent = Events_Loop::eventByName(EVENT_FEATURE_CREATED);
index 0dd6efc9010b01e96c3d97acbc3cdaa4dc20dc82..663c25d79e585459484f8a54555b8278ec4b0e45 100644 (file)
@@ -5,7 +5,7 @@
 #include <PartSet_OperationSketchBase.h>
 
 #include <SketchPlugin_Feature.h>
-#include <Model_Object.h>
+#include <ModelAPI_Object.h>
 
 #include <V3d_View.hxx>
 
@@ -31,8 +31,8 @@ boost::shared_ptr<GeomAPI_Shape> PartSet_OperationSketchBase::preview(
   boost::shared_ptr<SketchPlugin_Feature> aFeature = 
                               boost::dynamic_pointer_cast<SketchPlugin_Feature>(theFeature);
   if (!aFeature) { // if it is reference to a object feature
-    boost::shared_ptr<Model_Object> anObj = 
-      boost::dynamic_pointer_cast<Model_Object>(theFeature);
+    boost::shared_ptr<ModelAPI_Object> anObj = 
+      boost::dynamic_pointer_cast<ModelAPI_Object>(theFeature);
     if (anObj) 
       aFeature = boost::dynamic_pointer_cast<SketchPlugin_Feature>(anObj->featureRef());
   }
@@ -48,7 +48,8 @@ std::map<boost::shared_ptr<ModelAPI_Feature>, boost::shared_ptr<GeomAPI_Shape> >
 boost::shared_ptr<ModelAPI_Feature> PartSet_OperationSketchBase::createFeature()
 {
   boost::shared_ptr<ModelAPI_Feature> aFeature = ModuleBase_Operation::createFeature();
-  emit featureConstructed(aFeature, FM_Activation);
+  if (aFeature)
+    emit featureConstructed(aFeature, FM_Activation);
   return aFeature;
 }
 
index e75bc01e6aa72beb9741ee463d17bfe150e8c232..5363c251acd1aabe4c1537129cb4e8e31ad0b935 100644 (file)
@@ -9,28 +9,28 @@ SketchPlugin_Feature::SketchPlugin_Feature()
   mySketch = 0;
 }
 
-void SketchPlugin_Feature::setData(boost::shared_ptr<ModelAPI_Data> theData)
-{
-  ModelAPI_Feature::setData(theData);
-
-  // find sketch that references to this feature
-  int aSketches = document()->size("Construction");
-  for(int a = 0; a < aSketches && !mySketch; a++) {
-    boost::shared_ptr<SketchPlugin_Sketch> aSketch = 
-      boost::dynamic_pointer_cast<SketchPlugin_Sketch>(document()->feature("Construction", a));
-    if (aSketch) {
-      std::list<boost::shared_ptr<ModelAPI_Feature> > aList = 
-        aSketch->data()->reflist(SKETCH_ATTR_FEATURES)->list();
-      std::list<boost::shared_ptr<ModelAPI_Feature> >::iterator aSub = aList.begin();
-      for(; aSub != aList.end(); aSub++) {
-        if ((*aSub)->data()->isEqual(theData)) {
-          mySketch = aSketch.get();
-          break;
-        }
-      }
-    }
-  }
-}
+//void SketchPlugin_Feature::setData(boost::shared_ptr<ModelAPI_Data> theData)
+//{
+//  ModelAPI_Feature::setData(theData);
+//
+//  // find sketch that references to this feature
+//  int aSketches = document()->size("Construction");
+//  for(int a = 0; a < aSketches && !mySketch; a++) {
+//    boost::shared_ptr<SketchPlugin_Sketch> aSketch =
+//      boost::dynamic_pointer_cast<SketchPlugin_Sketch>(document()->feature("Construction", a));
+//    if (aSketch) {
+//      std::list<boost::shared_ptr<ModelAPI_Feature> > aList =
+//        aSketch->data()->reflist(SKETCH_ATTR_FEATURES)->list();
+//      std::list<boost::shared_ptr<ModelAPI_Feature> >::iterator aSub = aList.begin();
+//      for(; aSub != aList.end(); aSub++) {
+//        if ((*aSub)->data()->isEqual(theData)) {
+//          mySketch = aSketch.get();
+//          break;
+//        }
+//      }
+//    }
+//  }
+//}
 
 void SketchPlugin_Feature::setPreview(const boost::shared_ptr<GeomAPI_Shape>& theShape)
 {
index d83e21cceb25894ab2b64b1709dd815a6d6ba239..2121573295d13e5916eda4beeb8d547d6adb143f 100644 (file)
@@ -46,7 +46,8 @@ protected:
   /// initializes mySketch
   SketchPlugin_Feature();
   /// Sets the data manager of an object and here initializes mySketch field
-  SKETCHPLUGIN_EXPORT virtual void setData(boost::shared_ptr<ModelAPI_Data> theData);
+  SKETCHPLUGIN_EXPORT virtual void setData(boost::shared_ptr<ModelAPI_Data> theData)
+  {}
 
   friend class SketchPlugin_Sketch;
 
index aeb29ef5e44d5753a5febc9cad8baf999f8e97ea..944a58e69354102e1d694b7c6efbb314ea175a5f 100644 (file)
@@ -10,6 +10,8 @@
 // Need to be defined before including SolveSpace to avoid additional dependances on Windows platform
 #if defined(WIN32) && !defined(HAVE_C99_INTEGER_TYPES)
 typedef unsigned int UINT32;
+#else
+#include <stdint.h>
 #endif
 #include <string.h>
 #include <slvs.h>