aDocRef->setValue(aDoc);
}
}
- if (aDocRef->value())
+ if (aDocRef->value().get()) {
ModelAPI_Session::get()->setActiveDocument(aDocRef->value());
+ }
}
bool Model_ResultPart::isActivated()
ModelAPI_Feature.cpp
ModelAPI_Session.cpp
ModelAPI_Tools.cpp
+ ModelAPI_Object.cpp
+ ModelAPI_Result.cpp
+ ModelAPI_ResultPart.cpp
+ ModelAPI_ResultConstruction.cpp
)
SET(PROJECT_LIBRARIES
virtual const std::string& getKind() = 0;
/// Returns the group identifier of all features
- static std::string group()
+ inline static std::string group()
{
static std::string MY_GROUP = "Features";
return MY_GROUP;
#include "ModelAPI_Object.h"
-bool ModelAPI_Object::isInHistory() {
+bool ModelAPI_Object::isInHistory()
+{
return true;
}
-boost::shared_ptr<ModelAPI_Data> ModelAPI_Object::data() const {
+std::shared_ptr<ModelAPI_Data> ModelAPI_Object::data() const
+{
return myData;
}
-bool ModelAPI_Object::isSame(const boost::shared_ptr<ModelAPI_Object>& theObject) {
+bool ModelAPI_Object::isSame(const std::shared_ptr<ModelAPI_Object>& theObject)
+{
return theObject.get() == this;
}
-boost::shared_ptr<ModelAPI_Document> ModelAPI_Object::document() const {
+std::shared_ptr<ModelAPI_Document> ModelAPI_Object::document() const
+{
return myDoc;
}
-void ModelAPI_Object::attributeChanged() {
+void ModelAPI_Object::attributeChanged(const std::string& theID)
+{
}
-ModelAPI_Object::~ModelAPI_Object() {
+ModelAPI_Object::~ModelAPI_Object()
+{
}
-void ModelAPI_Object::setData(boost::shared_ptr<ModelAPI_Data> theData) {
+void ModelAPI_Object::setData(std::shared_ptr<ModelAPI_Data> theData)
+{
myData = theData;
}
-void ModelAPI_Object::setDoc(boost::shared_ptr<ModelAPI_Document> theDoc) {
+void ModelAPI_Object::setDoc(std::shared_ptr<ModelAPI_Document> theDoc)
+{
myDoc = theDoc;
}
-void ModelAPI_Object::erase() {
+void ModelAPI_Object::erase()
+{
if (myData) myData->erase();
setData(DataPtr());
}
std::shared_ptr<ModelAPI_Document> myDoc; ///< document this object belongs to
public:
/// By default object is displayed in the object browser.
- virtual bool isInHistory()
- {
- return true;
- }
+ MODELAPI_EXPORT virtual bool isInHistory();
/// Returns the data manager of this object: attributes
- virtual std::shared_ptr<ModelAPI_Data> data() const
- {
- return myData;
- }
+ MODELAPI_EXPORT virtual std::shared_ptr<ModelAPI_Data> data() const;
/// Returns true if object refers to the same data model instance
- virtual bool isSame(const std::shared_ptr<ModelAPI_Object>& theObject)
- {
- return theObject.get() == this;
- }
+ MODELAPI_EXPORT virtual bool isSame(const std::shared_ptr<ModelAPI_Object>& theObject);
/// Returns document this feature belongs to
- virtual std::shared_ptr<ModelAPI_Document> document() const
- {
- return myDoc;
- }
+ MODELAPI_EXPORT virtual std::shared_ptr<ModelAPI_Document> document() const;
/// Returns the group identifier of this object
virtual std::string groupName() = 0;
/// Called on change of any argument-attribute of this object
/// \param theID identifier of changed attribute
- MODELAPI_EXPORT virtual void attributeChanged(const std::string& theID)
- {}
+ // MODELAPI_EXPORT
+ MODELAPI_EXPORT virtual void attributeChanged(const std::string& theID);
/// To use virtuality for destructors
- virtual ~ModelAPI_Object() {}
+ MODELAPI_EXPORT virtual ~ModelAPI_Object();
protected:
/// Sets the data manager of an object (document does)
- virtual void setData(std::shared_ptr<ModelAPI_Data> theData)
- {
- myData = theData;
- }
+ MODELAPI_EXPORT virtual void setData(std::shared_ptr<ModelAPI_Data> theData);
/// Sets the data manager of an object (document does)
- virtual void setDoc(std::shared_ptr<ModelAPI_Document> theDoc)
- {
- myDoc = theDoc;
- }
+ MODELAPI_EXPORT virtual void setDoc(std::shared_ptr<ModelAPI_Document> theDoc);
/// removes all fields from this feature
- MODELAPI_EXPORT virtual void erase() {
- if (myData) myData->erase();
- setData(DataPtr());
- }
+ MODELAPI_EXPORT virtual void erase();
friend class Model_Document;
#include "ModelAPI_Result.h"
-bool ModelAPI_Result::isConcealed() {
- return myIsConcealed;
-}
-
-void ModelAPI_Result::setIsConcealed(const bool theValue) {
- myIsConcealed = theValue;
-}
+ModelAPI_Result::~ModelAPI_Result()
+{
-ModelAPI_Result::ModelAPI_Result() {
}
-ModelAPI_Result::~ModelAPI_Result() {
+std::shared_ptr<GeomAPI_Shape> ModelAPI_Result::shape()
+{
+ return std::shared_ptr<GeomAPI_Shape>();
}
bool myIsConcealed; ///< the result is concealed from the data tree (referenced by other objects)
public:
/// Returns true if the result is concealed from the data tree (referenced by other objects)
- inline bool isConcealed() {return myIsConcealed;}
+ inline bool isConcealed()
+ {
+ return myIsConcealed;
+ }
/// Returns true if the result is concealed from the data tree (referenced by other objects)
- inline void setIsConcealed(const bool theValue) {myIsConcealed = theValue;}
-
- /// To virtually destroy the fields of successors
- virtual ~ModelAPI_Result()
+ inline void setIsConcealed(const bool theValue)
{
+ myIsConcealed = theValue;
}
+ /// To virtually destroy the fields of successors
+ MODELAPI_EXPORT virtual ~ModelAPI_Result();
+
/// Returns the shape-result produced by this feature (or null if no shapes)
- virtual std::shared_ptr<GeomAPI_Shape> shape() {return std::shared_ptr<GeomAPI_Shape>();}
+ MODELAPI_EXPORT virtual std::shared_ptr<GeomAPI_Shape> shape();
};
//! Pointer on feature object
}
/// Returns the group identifier of this result
- static std::string group()
+ inline static std::string group()
{
static std::string MY_GROUP = "Bodies";
return MY_GROUP;
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File: ModelAPI_ResultConstruction.cpp
+// Created: 07 Jul 2014
+// Author: Mikhail PONIKAROV
+
+#include "ModelAPI_ResultConstruction.h"
+#include <string>
+
+std::string ModelAPI_ResultConstruction::groupName()
+{
+ return group();
+}
+
{
public:
/// Returns the group identifier of this result
- virtual std::string groupName()
- {
- return group();
- }
+ MODELAPI_EXPORT virtual std::string groupName();
/// Returns the group identifier of this result
- static std::string group()
+ inline static std::string group()
{
static std::string MY_GROUP = "Construction";
return MY_GROUP;
}
/// Returns the group identifier of this result
- static std::string group()
+ inline static std::string group()
{
static std::string MY_GROUP = "Groups";
return MY_GROUP;
}
/// Returns the group identifier of this result
- static std::string group()
+ inline static std::string group()
{
static std::string MY_GROUP = "Parameters";
return MY_GROUP;
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File: ModelAPI_ResultPart.cpp
+// Created: 12 Jan 2015
+// Author: Sergey BELASH
+
+#include <ModelAPI_ResultPart.h>
+
+#include <string>
+
+std::string ModelAPI_ResultPart::groupName()
+{
+ return ModelAPI_ResultPart::group();
+}
{
public:
/// Returns the group identifier of this result
- virtual std::string groupName()
- {
- return group();
- }
+ MODELAPI_EXPORT virtual std::string groupName();
/// Returns the group identifier of this result
- static std::string group()
+ inline static std::string group()
{
static std::string MY_GROUP = "Parts";
return MY_GROUP;