CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=Debug"
CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT=ON"
CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=${ROOT_DIR}/install"
+CMAKE_ARGS="${CMAKE_ARGS} -DPYTHON_EXECUTABLE=${PYTHONHOME}/bin/python"
CMAKE_ARGS="${CMAKE_ARGS} ${SRC_DIR}"
cmake -G "Eclipse CDT4 - Unix Makefiles" ${CMAKE_ARGS}
-/misc/dn48/newgeom/common/eclipse-4.3.0/eclipse -Dosgi.locking=none &
\ No newline at end of file
+#/misc/dn48/newgeom/common/eclipse-4.3.0/eclipse&
+/misc/dn48/newgeom/common/eclipse-4.4.0/eclipse&
\ No newline at end of file
##
#------ boost ------
export BOOST_ROOT_DIR=${PDIR}/boost-1.52.0
-export LD_LIBRARY_PATH=${BOOST_ROOT_DIR}/lib
+export LD_LIBRARY_PATH=${BOOST_ROOT_DIR}/lib:${LD_LIBRARY_PATH}
##
#------ swig ------
export SWIG_ROOT_DIR=${PDIR}/swig-2.0.8
#------ NewGEOM ------
export INST_DIR=${ROOT_DIR}/install
export PATH=${INST_DIR}/bin:${INST_DIR}/plugins:${PATH}
-export LD_LIBRARY_PATH=${INST_DIR}/bin:${INST_DIR}/swig:${INST_DIR}/plugins:${PATH}${LD_LIBRARY_PATH}
+export PYTHONPATH=${INST_DIR}/swig:${PYTHONPATH}
+export LD_LIBRARY_PATH=${INST_DIR}/bin:${INST_DIR}/swig:${INST_DIR}/plugins:${LD_LIBRARY_PATH}
export NEW_GEOM_CONFIG_FILE=${INST_DIR}/plugins
#include <Events_Loop.h>
#include <Events_Error.h>
+
using namespace std;
Model_Data::Model_Data()
{
}
-void Model_Data::setLabel(TDF_Label& theLab)
+void Model_Data::setLabel(TDF_Label theLab)
{
myLab = theLab;
}
MODEL_EXPORT virtual void sendAttributeUpdated(ModelAPI_Attribute* theAttr);
/// Puts feature to the document data sub-structure
- MODEL_EXPORT void setLabel(TDF_Label& theLab);
+ MODEL_EXPORT void setLabel(TDF_Label theLab);
/// Sets the object of this data
MODEL_EXPORT virtual void setObject(ObjectPtr theObject)
#include <TDataStd_HLabelArray1.hxx>
#include <TDataStd_Name.hxx>
#include <TDF_Reference.hxx>
+#include <TDF_Label.hxx>
+
+#include <boost/shared_ptr.hpp>
#include <climits>
#ifndef WIN32
return FeaturePtr(); // not found
}
-ObjectPtr Model_Document::object(TDF_Label& theLabel)
+ObjectPtr Model_Document::object(TDF_Label theLabel)
{
// iterate all features, may be optimized later by keeping labels-map
std::vector<ObjectPtr>& aVec = myObjs[ModelAPI_Feature::group()];
theFeature->data()->setName(aName);
}
-void Model_Document::initData(ObjectPtr theObj, TDF_Label& theLab, const int theTag) {
+void Model_Document::initData(ObjectPtr theObj, TDF_Label theLab, const int theTag) {
boost::shared_ptr<ModelAPI_Document> aThis =
Model_Application::getApplication()->getDocument(myID);
boost::shared_ptr<Model_Data> aData(new Model_Data);
std::map<std::string, std::vector<ObjectPtr> >::reverse_iterator aGroupIter = myObjs.rbegin();
for(; aGroupIter != myObjs.rend(); aGroupIter++) {
std::vector<ObjectPtr>::iterator anObjIter = aGroupIter->second.begin();
- // and in parallel iterate labels of features
+ // and in parallel iterate labels of features+
const std::string& aGroupName = aGroupIter->first;
TDF_ChildIDIterator aLabIter(groupLabel(aGroupName), TDataStd_Comment::GetID());
while(anObjIter != aGroupIter->second.end() || aLabIter.More()) {
//! Returns the existing object: result or feature
//! \param theLabel base label of the object
- MODEL_EXPORT virtual ObjectPtr object(TDF_Label& theLabel);
+ MODEL_EXPORT virtual ObjectPtr object(TDF_Label theLabel);
//! Adds a new sub-document by the identifier, or returns existing one if it is already exist
MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_Document> subDocument(std::string theDocID);
void compactNested();
//! Initializes the data fields of the feature
- void Model_Document::initData(ObjectPtr theObj, TDF_Label& theLab, const int theTag);
+ void initData(ObjectPtr theObj, TDF_Label theLab, const int theTag);
//! Allows to store the result in the data tree of the document (attaches 'data' of result to tree)
MODEL_EXPORT virtual void storeResult(boost::shared_ptr<ModelAPI_Data> theFeatureData,
MODELAPI_EXPORT virtual int size() = 0;
/// Returns the list of features
- MODELAPI_EXPORT virtual std::list<ObjectPtr > list() = 0;
+ MODELAPI_EXPORT virtual std::list<ObjectPtr> list() = 0;
protected:
/// Objects are created for features automatically
#include "ModelAPI_Result.h"
#include <GeomAPI_Shape.h>
+#include <string>
+
/**\class ModelAPI_ResultBody
* \ingroup DataModel
* \brief The body (shape) result of a feature.
{
public:
/// Returns the group identifier of this result
- virtual std::string groupName()
- { return group(); }
+ virtual std::string groupName() {
+ return group();
+ }
/// Returns the group identifier of this result
static std::string group()
#include "ModelAPI_Result.h"
#include <GeomAPI_Shape.h>
+#include <string>
+
/**\class ModelAPI_ResultConstruction
* \ingroup DataModel
* \brief The construction element result of a feature.
#include "ModelAPI_Result.h"
+#include <string>
+
/**\class ModelAPI_ResultPart
* \ingroup DataModel
* \brief The Part document, result of a creation of new part feature.
#include <ModelAPI_Feature.h>
#include <ModelAPI_Data.h>
#include <ModelAPI_Document.h>
-#include <Model_Events.h>
+#include <ModelAPI_Events.h>
#include <Events_Loop.h>
#include <Config_WidgetAPI.h>
#include <Events_Loop.h>
-#include <Model_Events.h>
+#include <ModelAPI_Events.h>
#include <QWidget>
#include <QLayout>
#include <Config_WidgetAPI.h>
#include <Events_Loop.h>
-#include <Model_Events.h>
+#include <ModelAPI_Events.h>
#include <QWidget>
#include <QLayout>
#include <Config_WidgetAPI.h>
#include <Events_Loop.h>
-#include <Model_Events.h>
+#include <ModelAPI_Events.h>
#include <ModelAPI_Feature.h>
#include <ModelAPI_Data.h>
#include <Config_WidgetAPI.h>
#include <Events_Loop.h>
-#include <Model_Events.h>
+#include <ModelAPI_Events.h>
#include <ModelAPI_Feature.h>
#include <ModelAPI_Data.h>
#include <Config_WidgetAPI.h>
#include <Events_Loop.h>
-#include <Model_Events.h>
+#include <ModelAPI_Events.h>
#include <ModelAPI_Feature.h>
#include <ModelAPI_Data.h>
#include <Config_WidgetAPI.h>
#include <Events_Loop.h>
-#include <Model_Events.h>
+#include <ModelAPI_Events.h>
#include <ModelAPI_Feature.h>
#include <ModelAPI_Data.h>
#include "ModuleBase_Tools.h"
#include <Events_Loop.h>
-#include <Model_Events.h>
+#include <ModelAPI_Events.h>
#include <ModelAPI_Data.h>
#include <ModelAPI_Object.h>
#include <QEvent>
#include <QDockWidget>
+#include <stdexcept>
+
typedef QMap<QString, TopAbs_ShapeEnum> ShapeTypes;
static ShapeTypes MyShapeTypes;
QDockWidget* aTabWgt = (QDockWidget*) aParent;
aTabWgt->raise();
}
-}
\ No newline at end of file
+}
#include "SketchPlugin_ConstraintDistance.h"
#include <SketchPlugin_Point.h>
-#include <GeomAPI_Lin2D.h>
-#include <GeomAPI_Pnt2D.h>
+#include <GeomAPI_Lin2d.h>
+#include <GeomAPI_Pnt2d.h>
#include <GeomDataAPI_Point2D.h>
#include <ModelAPI_AttributeDouble.h>
#include <ModelAPI_AttributeRefList.h>
#include <ModelAPI_Data.h>
#include <ModelAPI_Events.h>
+#include <ModelAPI_Object.h>
#include <SketchPlugin_Constraint.h>
#include <SketchPlugin_Point.h>
#include <SketchPlugin_Sketch.h>
+#include <list>
+
// Initialization of constraint manager self pointer
SketchSolver_ConstraintManager* SketchSolver_ConstraintManager::_self = 0;
boost::shared_ptr<ModelAPI_AttributeRefList> aWPFeatures =
boost::dynamic_pointer_cast<ModelAPI_AttributeRefList>(aWP->data()->attribute(SketchPlugin_Sketch::FEATURES_ID()));
- std::list< ObjectPtr >& aFeaturesList = aWPFeatures->list();
- std::list< ObjectPtr >::const_iterator anIter;
+ std::list<ObjectPtr> aFeaturesList = aWPFeatures->list();
+ std::list<ObjectPtr>::const_iterator anIter;
for (anIter = aFeaturesList.begin(); anIter != aFeaturesList.end(); anIter++)
if (*anIter == theConstraint)
return aWP; // workplane is found
${PROJECT_SOURCE_DIR}/src/PyConsole
${PROJECT_SOURCE_DIR}/src/ModelAPI
${PROJECT_SOURCE_DIR}/src/GeomAPI
- ${PROJECT_SOURCE_DIR}/src/Model
${PROJECT_SOURCE_DIR}/src/ModuleBase
${PROJECT_SOURCE_DIR}/src/PartSetPlugin
${CAS_INCLUDE_DIRS})
#include <ModelAPI_Feature.h>
#include <ModelAPI_Data.h>
#include <ModelAPI_ResultPart.h>
-#include <Model_Events.h>
+#include <ModelAPI_Events.h>
#include <ModelAPI_Object.h>
#include <Events_Loop.h>
#include <QString>
#include <QBrush>
+#include <set>
#define ACTIVE_COLOR QColor(0,72,140)
#define PASSIVE_COLOR Qt::black
// Created object event *******************
if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_CREATED)) {
- const Model_ObjectUpdatedMessage* aUpdMsg = dynamic_cast<const Model_ObjectUpdatedMessage*>(theMessage);
+ const ModelAPI_ObjectUpdatedMessage* aUpdMsg = dynamic_cast<const ModelAPI_ObjectUpdatedMessage*>(theMessage);
std::set<ObjectPtr> aObjects = aUpdMsg->objects();
std::set<ObjectPtr>::const_iterator aIt;
}
// Deleted object event ***********************
} else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_DELETED)) {
- const Model_ObjectDeletedMessage* aUpdMsg = dynamic_cast<const Model_ObjectDeletedMessage*>(theMessage);
+ const ModelAPI_ObjectDeletedMessage* aUpdMsg = dynamic_cast<const ModelAPI_ObjectDeletedMessage*>(theMessage);
DocumentPtr aDoc = aUpdMsg->document();
std::set<std::string> aGroups = aUpdMsg->groups();
}
// Deleted object event ***********************
} else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_UPDATED)) {
- //const Model_ObjectUpdatedMessage* aUpdMsg = dynamic_cast<const Model_ObjectUpdatedMessage*>(theMessage);
+ //const ModelAPI_ObjectUpdatedMessage* aUpdMsg = dynamic_cast<const ModelAPI_ObjectUpdatedMessage*>(theMessage);
//ObjectPtr aFeature = aUpdMsg->feature();
//DocumentPtr aDoc = aFeature->document();
#include "XGUI_ContextMenuMgr.h"
#include "XGUI_ModuleConnector.h"
-#include <Model_Events.h>
+#include <ModelAPI_Events.h>
#include <ModelAPI_PluginManager.h>
#include <ModelAPI_Feature.h>
#include <ModelAPI_Data.h>
// Process creation of Part
if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_CREATED)) {
- const Model_ObjectUpdatedMessage* aUpdMsg = dynamic_cast<const Model_ObjectUpdatedMessage*>(theMessage);
+ const ModelAPI_ObjectUpdatedMessage* aUpdMsg = dynamic_cast<const ModelAPI_ObjectUpdatedMessage*>(theMessage);
onFeatureCreatedMsg(aUpdMsg);
return;
}
// Redisplay feature
if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY)) {
- const Model_ObjectUpdatedMessage* aUpdMsg = dynamic_cast<const Model_ObjectUpdatedMessage*>(theMessage);
+ const ModelAPI_ObjectUpdatedMessage* aUpdMsg = dynamic_cast<const ModelAPI_ObjectUpdatedMessage*>(theMessage);
onFeatureRedisplayMsg(aUpdMsg);
return;
}
//Update property panel on corresponding message. If there is no current operation (no
//property panel), or received message has different feature to the current - do nothing.
if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_UPDATED)) {
- const Model_ObjectUpdatedMessage* anUpdateMsg =
- dynamic_cast<const Model_ObjectUpdatedMessage*>(theMessage);
+ const ModelAPI_ObjectUpdatedMessage* anUpdateMsg =
+ dynamic_cast<const ModelAPI_ObjectUpdatedMessage*>(theMessage);
onFeatureUpdatedMsg(anUpdateMsg);
return;
}
if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_DELETED)) {
- const Model_ObjectDeletedMessage* aDelMsg =
- dynamic_cast<const Model_ObjectDeletedMessage*>(theMessage);
+ const ModelAPI_ObjectDeletedMessage* aDelMsg =
+ dynamic_cast<const ModelAPI_ObjectDeletedMessage*>(theMessage);
onObjectDeletedMsg(aDelMsg);
return;
}
}
//******************************************************
-void XGUI_Workshop::onFeatureUpdatedMsg(const Model_ObjectUpdatedMessage* theMsg)
+void XGUI_Workshop::onFeatureUpdatedMsg(const ModelAPI_ObjectUpdatedMessage* theMsg)
{
std::set<ObjectPtr> aFeatures = theMsg->objects();
if (myOperationMgr->hasOperation())
}
//******************************************************
-void XGUI_Workshop::onFeatureRedisplayMsg(const Model_ObjectUpdatedMessage* theMsg)
+void XGUI_Workshop::onFeatureRedisplayMsg(const ModelAPI_ObjectUpdatedMessage* theMsg)
{
std::set<ObjectPtr> aObjects = theMsg->objects();
std::set<ObjectPtr>::const_iterator aIt;
}
//******************************************************
-void XGUI_Workshop::onFeatureCreatedMsg(const Model_ObjectUpdatedMessage* theMsg)
+void XGUI_Workshop::onFeatureCreatedMsg(const ModelAPI_ObjectUpdatedMessage* theMsg)
{
std::set<ObjectPtr> aFeatures = theMsg->objects();
}
//******************************************************
-void XGUI_Workshop::onObjectDeletedMsg(const Model_ObjectDeletedMessage* theMsg)
+void XGUI_Workshop::onObjectDeletedMsg(const ModelAPI_ObjectDeletedMessage* theMsg)
{
//std::set<ObjectPtr> aFeatures = theMsg->objects();
}
class QWidget;
class QDockWidget;
-class Model_ObjectUpdatedMessage;
-class Model_ObjectDeletedMessage;
+class ModelAPI_ObjectUpdatedMessage;
+class ModelAPI_ObjectDeletedMessage;
class QAction;
/**\class XGUI_Workshop
void connectWithOperation(ModuleBase_Operation* theOperation);
void saveDocument(QString theName);
- void onFeatureUpdatedMsg(const Model_ObjectUpdatedMessage* theMsg);
- void onFeatureCreatedMsg(const Model_ObjectUpdatedMessage* theMsg);
- void onFeatureRedisplayMsg(const Model_ObjectUpdatedMessage* theMsg);
- void onObjectDeletedMsg(const Model_ObjectDeletedMessage* theMsg);
+ void onFeatureUpdatedMsg(const ModelAPI_ObjectUpdatedMessage* theMsg);
+ void onFeatureCreatedMsg(const ModelAPI_ObjectUpdatedMessage* theMsg);
+ void onFeatureRedisplayMsg(const ModelAPI_ObjectUpdatedMessage* theMsg);
+ void onObjectDeletedMsg(const ModelAPI_ObjectDeletedMessage* theMsg);
QList<QAction*> getModuleCommands() const;