The problem is still unclear, possible there will be new fixes needed later.
}
return aResult;
}
+
+bool GeomAPI_PlanarEdges::hasPlane() const {
+ return myOrigin && myNorm && myDirX && myDirY;
+}
+
+bool GeomAPI_PlanarEdges::isVertex() const {
+ return false;
+}
+
+bool GeomAPI_PlanarEdges::isEdge() const {
+ return false;
+}
+
+void GeomAPI_PlanarEdges::setOrigin(const boost::shared_ptr<GeomAPI_Pnt>& theOrigin)
+{
+ myOrigin = theOrigin;
+}
+boost::shared_ptr<GeomAPI_Pnt> GeomAPI_PlanarEdges::origin() const {
+ return myOrigin;
+}
+void GeomAPI_PlanarEdges::setDirX(const boost::shared_ptr<GeomAPI_Dir>& theDirX) {
+ myDirX = theDirX;
+}
+boost::shared_ptr<GeomAPI_Dir> GeomAPI_PlanarEdges::dirX() const {
+ return myDirX;
+}
+void GeomAPI_PlanarEdges::setDirY(const boost::shared_ptr<GeomAPI_Dir>& theDirY) {
+ myDirY = theDirY;
+}
+boost::shared_ptr<GeomAPI_Dir> GeomAPI_PlanarEdges::dirY() const {
+ return myDirY;
+}
+void GeomAPI_PlanarEdges::setNorm(const boost::shared_ptr<GeomAPI_Dir>& theNorm) {
+ myNorm = theNorm;
+}
+boost::shared_ptr<GeomAPI_Dir> GeomAPI_PlanarEdges::norm() const {
+ return myNorm;
+}
/// Creation of empty (null) shape
GEOMAPI_EXPORT GeomAPI_PlanarEdges();
- GEOMAPI_EXPORT virtual bool isVertex() const
- {
- return false;
- }
+ GEOMAPI_EXPORT virtual bool isVertex() const;
/// Returns whether the shape is an edge
- GEOMAPI_EXPORT virtual bool isEdge() const
- {
- return false;
- }
+ GEOMAPI_EXPORT virtual bool isEdge() const;
GEOMAPI_EXPORT void addEdge(boost::shared_ptr<GeomAPI_Shape> theEdge);
GEOMAPI_EXPORT std::list<boost::shared_ptr<GeomAPI_Shape> > getEdges();
/// Returns True if the wire is defined in a plane
- GEOMAPI_EXPORT bool hasPlane() const { return myOrigin && myNorm && myDirX && myDirY; }
+ GEOMAPI_EXPORT bool hasPlane() const;
/// Set/Get origin point
- GEOMAPI_EXPORT void setOrigin(const boost::shared_ptr<GeomAPI_Pnt>& theOrigin)
- { myOrigin = theOrigin; }
- GEOMAPI_EXPORT boost::shared_ptr<GeomAPI_Pnt> origin() const { return myOrigin; }
+ GEOMAPI_EXPORT void setOrigin(const boost::shared_ptr<GeomAPI_Pnt>& theOrigin);
+ GEOMAPI_EXPORT boost::shared_ptr<GeomAPI_Pnt> origin() const;
/// Set/Get X direction vector
- GEOMAPI_EXPORT void setDirX(const boost::shared_ptr<GeomAPI_Dir>& theDirX) { myDirX = theDirX; }
- GEOMAPI_EXPORT boost::shared_ptr<GeomAPI_Dir> dirX() const { return myDirX; }
+ GEOMAPI_EXPORT void setDirX(const boost::shared_ptr<GeomAPI_Dir>& theDirX);
+ GEOMAPI_EXPORT boost::shared_ptr<GeomAPI_Dir> dirX() const;
/// Set/Get Y direction vector
- GEOMAPI_EXPORT void setDirY(const boost::shared_ptr<GeomAPI_Dir>& theDirY) { myDirY = theDirY; }
- GEOMAPI_EXPORT boost::shared_ptr<GeomAPI_Dir> dirY() const { return myDirY; }
+ GEOMAPI_EXPORT void setDirY(const boost::shared_ptr<GeomAPI_Dir>& theDirY);
+ GEOMAPI_EXPORT boost::shared_ptr<GeomAPI_Dir> dirY() const;
/// Set/Get Normal direction vector
- GEOMAPI_EXPORT void setNorm(const boost::shared_ptr<GeomAPI_Dir>& theNorm) { myNorm = theNorm; }
- GEOMAPI_EXPORT boost::shared_ptr<GeomAPI_Dir> norm() const { return myNorm; }
+ GEOMAPI_EXPORT void setNorm(const boost::shared_ptr<GeomAPI_Dir>& theNorm);
+ GEOMAPI_EXPORT boost::shared_ptr<GeomAPI_Dir> norm() const;
private:
boost::shared_ptr<GeomAPI_Pnt> myOrigin;
myShape = theShape;
}
-boost::shared_ptr<GeomAPI_Shape>& Model_ResultConstruction::shape()
+boost::shared_ptr<GeomAPI_Shape> Model_ResultConstruction::shape()
{
return myShape;
}
/// Sets the result
MODEL_EXPORT virtual void setShape(boost::shared_ptr<GeomAPI_Shape> theShape);
/// Returns the shape-result produced by this feature
- MODEL_EXPORT virtual boost::shared_ptr<GeomAPI_Shape>& shape();
+ MODEL_EXPORT virtual boost::shared_ptr<GeomAPI_Shape> shape();
/// Sets the flag that it must be displayed in history (default is true)
MODEL_EXPORT virtual void setIsInHistory(const bool myIsInHistory);
myOwnerData = theOwnerData;
}
-boost::shared_ptr<GeomAPI_Shape> Model_ResultGroup::shape() const
+boost::shared_ptr<GeomAPI_Shape> Model_ResultGroup::shape()
{
boost::shared_ptr<GeomAPI_Shape> aResult;
if (myOwnerData) {
boost::shared_ptr<ModelAPI_Data> myOwnerData; ///< data of owner of this result
public:
/// Returns the compound of selected entities
- MODEL_EXPORT virtual boost::shared_ptr<GeomAPI_Shape> shape() const;
+ MODEL_EXPORT virtual boost::shared_ptr<GeomAPI_Shape> shape();
/// Removes the stored builders
MODEL_EXPORT virtual ~Model_ResultGroup() {}
#include <ModelAPI.h>
#include <ModelAPI_Object.h>
-#include <ModelAPI_AttributeBoolean.h>
-#include <ModelAPI_AttributeDocRef.h>
-#include <ModelAPI_AttributeDouble.h>
-#include <ModelAPI_AttributeInteger.h>
-#include <ModelAPI_AttributeRefAttr.h>
-#include <ModelAPI_AttributeReference.h>
-#include <ModelAPI_AttributeSelection.h>
-#include <ModelAPI_AttributeSelectionList.h>
-#include <ModelAPI_AttributeString.h>
-#include <ModelAPI_AttributeRefList.h>
#include <ModelAPI_Data.h>
#include <ModelAPI_Document.h>
-#include <ModelAPI_Result.h>
#include <boost/shared_ptr.hpp>
#include <list>
#include <string>
-class ModelAPI_Data;
-class ModelAPI_Document;
-class ModelAPI_Result;
-
/**\class ModelAPI_Feature
* \ingroup DataModel
* \brief Feature function that represents the particular functionality
--- /dev/null
+// File: ModelAPI_Object.cpp
+// Created: 19 May 2014
+// Author: Mikhail PONIKAROV
+
+#include "ModelAPI_Object.h"
+
+
+bool ModelAPI_Object::isInHistory() {
+ return true;
+}
+
+boost::shared_ptr<ModelAPI_Data> ModelAPI_Object::data() const {
+ return myData;
+}
+
+bool ModelAPI_Object::isSame(const boost::shared_ptr<ModelAPI_Object>& theObject) {
+ return theObject.get() == this;
+}
+
+boost::shared_ptr<ModelAPI_Document> ModelAPI_Object::document() const {
+ return myDoc;
+}
+
+void ModelAPI_Object::attributeChanged() {
+}
+
+ModelAPI_Object::~ModelAPI_Object() {
+}
+
+void ModelAPI_Object::setData(boost::shared_ptr<ModelAPI_Data> theData) {
+ myData = theData;
+}
+
+void ModelAPI_Object::setDoc(boost::shared_ptr<ModelAPI_Document> theDoc) {
+ myDoc = theDoc;
+}
+
+void ModelAPI_Object::erase() {
+ if (myData) myData->erase();
+ setData(DataPtr());
+}
--- /dev/null
+// File: ModelAPI_Result.cpp
+// Created: 07 Jul 2014
+// Author: Mikhail PONIKAROV
+
+#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() {
+}
#define ModelAPI_Result_H_
#include "ModelAPI_Object.h"
+#include "GeomAPI_Shape.h"
class ModelAPI_Feature;
{
}
+ /// Returns the shape-result produced by this feature (or null if no shapes)
+ virtual boost::shared_ptr<GeomAPI_Shape> shape() {return boost::shared_ptr<GeomAPI_Shape>();}
};
//! Pointer on feature object
virtual void storeModified(const boost::shared_ptr<GeomAPI_Shape>& theOldShape,
const boost::shared_ptr<GeomAPI_Shape>& theNewShape) = 0;
- /// Returns the shape-result produced by this feature
- virtual boost::shared_ptr<GeomAPI_Shape> shape() = 0;
-
/// Records the subshape newShape which was generated during a topological construction.
/// As an example, consider the case of a face generated in construction of a box.
virtual void generated(
return MY_GROUP;
}
- /// Returns the shape-result produced by this feature
- virtual boost::shared_ptr<GeomAPI_Shape>& shape() = 0;
-
/// Sets the result
virtual void setShape(boost::shared_ptr<GeomAPI_Shape> theShape) = 0;
return MY_GROUP;
}
- /// Returns the compound of selected entities
- virtual boost::shared_ptr<GeomAPI_Shape> shape() const = 0;
};
//! Pointer on feature object
boost::shared_ptr<GeomAPI_Shape> shape(const ResultPtr& theResult)
{
-
+/*
ResultBodyPtr aBody = boost::dynamic_pointer_cast<ModelAPI_ResultBody>(theResult);
if (aBody)
return aBody->shape();
if (aGroup)
return aGroup->shape();
return boost::shared_ptr<GeomAPI_Shape>();
+ */
+ return theResult->shape();
}
}
#include <QList>
#include <ModelAPI_Feature.h>
-#include <ModelAPI_Result.h>
typedef QList<int> QIntList; //!< list of int values
typedef QList<short> QShortList; //!< list of short int values
typedef QList<double> QDoubleList; //!< list of double values
typedef QList<FeaturePtr> QFeatureList; //!< List of features
-typedef QList<ResultPtr> QResultList; //!< List of results
#endif
${PROJECT_SOURCE_DIR}/src/Events
${PROJECT_SOURCE_DIR}/src/ModuleBase
${PROJECT_SOURCE_DIR}/src/ModelAPI
+ ${PROJECT_SOURCE_DIR}/src/GeomAPI
${PROJECT_SOURCE_DIR}/src/Config
${SALOME_GUI_INCLUDE}
${SALOME_KERNEL_INCLUDE}
INCLUDE_DIRECTORIES(
../ModelAPI
+ ../GeomAPI
)
SET(XML_RESOURCES
#include <GeomAPI_Shape.h>
#include <GeomAPI_AISObject.h>
#include <ModelAPI_Document.h>
+#include <ModelAPI_AttributeSelection.h>
class SketchPlugin_Sketch;
class GeomAPI_Pnt2d;
/// Returns true is sketch element is under the rigid constraint
SKETCHPLUGIN_EXPORT virtual bool isFixed() {return false;}
- bool isExternal() const
+ inline bool isExternal() const
{
AttributeSelectionPtr aAttr = data()->selection(EXTERNAL_ID());
if (aAttr)
#include "XGUI_Constants.h"
#include <Events_Listener.h>
#include <ModuleBase_Definitions.h>
-#include <ModelAPI_ResultPart.h>
#include <ModelAPI_Document.h>
#include <QObject>
class ModelAPI_ObjectUpdatedMessage;
class ModelAPI_ObjectDeletedMessage;
+class ModelAPI_ResultPart;
class QAction;
/**\class XGUI_Workshop
//! Activates or deactivates a part
//! If PartPtr is Null pointer then PartSet will be activated
- void activatePart(ResultPartPtr theFeature);
+ void activatePart(boost::shared_ptr<ModelAPI_ResultPart> theFeature);
//! Delete features
void deleteObjects(const QList<ObjectPtr>& theList);