\code
void ConstructionPlugin_Point::initAttributes()
{
- data()->addAttribute("DoubleCounterData", ModelAPI_AttributeDouble::type());
+ data()->addAttribute("DoubleCounterData", ModelAPI_AttributeDouble::typeId());
}
\endcode
Python:
\code
def initAttributes(self):
- self.data().addAttribute("DoubleCounterData", ModelAPI.ModelAPI_AttributeDouble.type())
+ self.data().addAttribute("DoubleCounterData", ModelAPI.ModelAPI_AttributeDouble.typeId())
\endcode
As you may notice, this method defines that feature has a widget with "DoubleCounterData" id, which has Double type. Therefore, if your feature uses, in example, three widgets, the `initAttributes()` method should 'init' three attributes.
\n
#ifndef WIN32
anErrorMsg += ": " + std::string(dlerror());
#endif
+ std::cerr << anErrorMsg << std::endl;
Events_Error::send(anErrorMsg);
}
}
void ConstructionPlugin_Axis::initAttributes()
{
- data()->addAttribute(POINT_ATTR_FIRST, ModelAPI_AttributeSelection::type());
- data()->addAttribute(POINT_ATTR_SECOND, ModelAPI_AttributeSelection::type());
+ data()->addAttribute(POINT_ATTR_FIRST, ModelAPI_AttributeSelection::typeId());
+ data()->addAttribute(POINT_ATTR_SECOND, ModelAPI_AttributeSelection::typeId());
}
void ConstructionPlugin_Axis::execute()
void ConstructionPlugin_Plane::initAttributes()
{
- data()->addAttribute(FACE_ATTR, ModelAPI_AttributeSelection::type());
- data()->addAttribute(DISTANCE_ATTR, ModelAPI_AttributeDouble::type());
+ data()->addAttribute(FACE_ATTR, ModelAPI_AttributeSelection::typeId());
+ data()->addAttribute(DISTANCE_ATTR, ModelAPI_AttributeDouble::typeId());
}
void ConstructionPlugin_Plane::execute()
void ConstructionPlugin_Point::initAttributes()
{
- data()->addAttribute(POINT_ATTR_X, ModelAPI_AttributeDouble::type());
- data()->addAttribute(POINT_ATTR_Y, ModelAPI_AttributeDouble::type());
- data()->addAttribute(POINT_ATTR_Z, ModelAPI_AttributeDouble::type());
+ data()->addAttribute(POINT_ATTR_X, ModelAPI_AttributeDouble::typeId());
+ data()->addAttribute(POINT_ATTR_Y, ModelAPI_AttributeDouble::typeId());
+ data()->addAttribute(POINT_ATTR_Z, ModelAPI_AttributeDouble::typeId());
}
void ConstructionPlugin_Point::execute()
*/
void ExchangePlugin_ImportFeature::initAttributes()
{
- data()->addAttribute(ExchangePlugin_ImportFeature::FILE_PATH_ID(), ModelAPI_AttributeString::type());
+ data()->addAttribute(ExchangePlugin_ImportFeature::FILE_PATH_ID(), ModelAPI_AttributeString::typeId());
}
/*
void FeaturesPlugin_Boolean::initAttributes()
{
- data()->addAttribute(FeaturesPlugin_Boolean::TYPE_ID(), ModelAPI_AttributeInteger::type());
- data()->addAttribute(FeaturesPlugin_Boolean::OBJECT_ID(), ModelAPI_AttributeReference::type());
- data()->addAttribute(FeaturesPlugin_Boolean::TOOL_ID(), ModelAPI_AttributeReference::type());
+ data()->addAttribute(FeaturesPlugin_Boolean::TYPE_ID(), ModelAPI_AttributeInteger::typeId());
+ data()->addAttribute(FeaturesPlugin_Boolean::OBJECT_ID(), ModelAPI_AttributeReference::typeId());
+ data()->addAttribute(FeaturesPlugin_Boolean::TOOL_ID(), ModelAPI_AttributeReference::typeId());
}
std::shared_ptr<GeomAPI_Shape> FeaturesPlugin_Boolean::getShape(const std::string& theAttrName)
void FeaturesPlugin_Extrusion::initAttributes()
{
- data()->addAttribute(FeaturesPlugin_Extrusion::FACE_ID(), ModelAPI_AttributeSelection::type());
- data()->addAttribute(FeaturesPlugin_Extrusion::SIZE_ID(), ModelAPI_AttributeDouble::type());
- data()->addAttribute(FeaturesPlugin_Extrusion::REVERSE_ID(), ModelAPI_AttributeBoolean::type());
+ data()->addAttribute(FeaturesPlugin_Extrusion::FACE_ID(), ModelAPI_AttributeSelection::typeId());
+ data()->addAttribute(FeaturesPlugin_Extrusion::SIZE_ID(), ModelAPI_AttributeDouble::typeId());
+ data()->addAttribute(FeaturesPlugin_Extrusion::REVERSE_ID(), ModelAPI_AttributeBoolean::typeId());
}
void FeaturesPlugin_Extrusion::execute()
void FeaturesPlugin_Group::initAttributes()
{
- //data()->addAttribute(FeaturesPlugin_Group::NAME_ID(), ModelAPI_AttributeString::type());
- data()->addAttribute(FeaturesPlugin_Group::LIST_ID(), ModelAPI_AttributeSelectionList::type());
+ //data()->addAttribute(FeaturesPlugin_Group::NAME_ID(), ModelAPI_AttributeString::typeId());
+ data()->addAttribute(FeaturesPlugin_Group::LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
}
void FeaturesPlugin_Group::execute()
void FeaturesPlugin_Placement::initAttributes()
{
- data()->addAttribute(FeaturesPlugin_Placement::BASE_FACE_ID(), ModelAPI_AttributeSelection::type());
- data()->addAttribute(FeaturesPlugin_Placement::ATTRACT_FACE_ID(), ModelAPI_AttributeSelection::type());
+ data()->addAttribute(FeaturesPlugin_Placement::BASE_FACE_ID(), ModelAPI_AttributeSelection::typeId());
+ data()->addAttribute(FeaturesPlugin_Placement::ATTRACT_FACE_ID(), ModelAPI_AttributeSelection::typeId());
}
void FeaturesPlugin_Placement::execute()
static const std::string MY_TOOL_ID("tool_object");
static const std::string MY_TYPE_ID("bool_type");
- data()->addAttribute(FeaturesPlugin_Boolean::OBJECT_ID(), ModelAPI_AttributeReference::type());
- data()->addAttribute(FeaturesPlugin_Boolean::TOOL_ID(), ModelAPI_AttributeReference::type());
- data()->addAttribute(FeaturesPlugin_Boolean::TYPE_ID(), ModelAPI_AttributeInteger::type());
+ data()->addAttribute(FeaturesPlugin_Boolean::OBJECT_ID(), ModelAPI_AttributeReference::typeId());
+ data()->addAttribute(FeaturesPlugin_Boolean::TOOL_ID(), ModelAPI_AttributeReference::typeId());
+ data()->addAttribute(FeaturesPlugin_Boolean::TYPE_ID(), ModelAPI_AttributeInteger::typeId());
"""
#=========================================================================
# Initialization of the test
static const std::string MY_SIZE_ID("extrusion_size");
static const std::string MY_REVERSE_ID("extrusion_reverse");
- data()->addAttribute(FeaturesPlugin_Extrusion::FACE_ID(), ModelAPI_AttributeSelection::type());
- data()->addAttribute(FeaturesPlugin_Extrusion::SIZE_ID(), ModelAPI_AttributeDouble::type());
- data()->addAttribute(FeaturesPlugin_Extrusion::REVERSE_ID(), ModelAPI_AttributeBoolean::type());
+ data()->addAttribute(FeaturesPlugin_Extrusion::FACE_ID(), ModelAPI_AttributeSelection::typeId());
+ data()->addAttribute(FeaturesPlugin_Extrusion::SIZE_ID(), ModelAPI_AttributeDouble::typeId());
+ data()->addAttribute(FeaturesPlugin_Extrusion::REVERSE_ID(), ModelAPI_AttributeBoolean::typeId());
"""
#=========================================================================
# Initialization of the test
static const std::string MY_GROUP_ID("Group");
static const std::string MY_GROUP_LIST_ID("group_list");
- data()->addAttribute(FeaturesPlugin_Group::LIST_ID(), ModelAPI_AttributeSelectionList::type());
+ data()->addAttribute(FeaturesPlugin_Group::LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
"""
#=========================================================================
# Initialization of the test
#define GeomAlgoAPI_Boolean_H_
#include <GeomAlgoAPI.h>
-#include <GeomAPI_Shape.h>
#include <GeomAlgoAPI_MakeShape.h>
+
+#include <GeomAPI_Shape.h>
+#include <GeomAPI_Interface.h>
#include <GeomAPI_DataMapOfShapeShape.h>
+
#include <memory>
/**\class GeomAlgoAPI_Boolean
)
SET(PROJECT_LIBRARIES
+ GeomDataAPI
ModelAPI
GeomAPI
Events
GeomDataAPI_Point2D.h
)
-SET(CMAKE_SWIG_FLAGS "-Wall")
+SET(PROJECT_SOURCES
+ GeomDataAPI_Point.cpp
+ GeomDataAPI_Dir.cpp
+ GeomDataAPI_Point2D.cpp
+)
-SET_SOURCE_FILES_PROPERTIES(GeomDataAPI.i PROPERTIES CPLUSPLUS ON)
-SET_SOURCE_FILES_PROPERTIES(GeomDataAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
+SET(PROJECT_LIBRARIES
+ ModelAPI
+)
-INCLUDE_DIRECTORIES(
+INCLUDE_DIRECTORIES(
../ModelAPI
)
+ADD_DEFINITIONS(-DGEOMDATAAPI_EXPORTS)
+ADD_LIBRARY(GeomDataAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
+SET_TARGET_PROPERTIES(GeomDataAPI PROPERTIES LINKER_LANGUAGE CXX)
+TARGET_LINK_LIBRARIES(GeomDataAPI ${PROJECT_LIBRARIES})
+
+SET(CMAKE_SWIG_FLAGS "-Wall")
+
+SET_SOURCE_FILES_PROPERTIES(GeomDataAPI.i PROPERTIES CPLUSPLUS ON)
+SET_SOURCE_FILES_PROPERTIES(GeomDataAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
+
SET(SWIG_SCRIPTS
${CMAKE_CURRENT_BINARY_DIR}/GeomDataAPI.py
)
SET(SWIG_LINK_LIBRARIES
- ModelAPI
+ GeomDataAPI
${PYTHON_LIBRARIES}
)
ENDIF(WIN32)
INSTALL(TARGETS _GeomDataAPI DESTINATION swig)
+INSTALL(TARGETS GeomDataAPI DESTINATION swig)
INSTALL(FILES ${SWIG_SCRIPTS} DESTINATION swig)
ADD_UNIT_TESTS(TestConstants.py)
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File: GeomDataAPI_Dir.cpp
+// Created: 24 Apr 2014
+// Author: Mikhail PONIKAROV
+
+
+#include <GeomDataAPI_Dir.h>
+
+std::string GeomDataAPI_Dir::attributeType()
+{
+ return typeId();
+}
+
+GeomDataAPI_Dir::GeomDataAPI_Dir()
+{
+}
+
+GeomDataAPI_Dir::~GeomDataAPI_Dir()
+{
+
+}
virtual std::shared_ptr<GeomAPI_Dir> dir() = 0;
/// Returns the type of this class of attributes
- static inline std::string type()
+ static std::string typeId()
{
return std::string("Dir");
}
/// Returns the type of this class of attributes, not static method
- virtual std::string attributeType()
- {
- return type();
- }
+ GEOMDATAAPI_EXPORT virtual std::string attributeType();
protected:
/// Objects are created for features automatically
- GeomDataAPI_Dir()
- {
- }
+ GEOMDATAAPI_EXPORT GeomDataAPI_Dir();
+ GEOMDATAAPI_EXPORT virtual ~GeomDataAPI_Dir();
};
#endif
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File: GeomDataAPI_Point.cpp
+// Created: 24 Apr 2014
+// Author: Mikhail PONIKAROV
+
+#include <GeomDataAPI_Point.h>
+
+std::string GeomDataAPI_Point::attributeType()
+{
+ return typeId();
+}
+
+GeomDataAPI_Point::GeomDataAPI_Point()
+{
+}
+
+GeomDataAPI_Point::~GeomDataAPI_Point()
+{
+}
virtual std::shared_ptr<GeomAPI_Pnt> pnt() = 0;
/// Returns the type of this class of attributes
- static inline std::string type()
+ static std::string typeId()
{
return std::string("Point");
}
/// Returns the type of this class of attributes, not static method
- virtual std::string attributeType()
- {
- return type();
- }
+ GEOMDATAAPI_EXPORT virtual std::string attributeType();
protected:
/// Objects are created for features automatically
- GeomDataAPI_Point()
- {
- }
+ GEOMDATAAPI_EXPORT GeomDataAPI_Point();
+ GEOMDATAAPI_EXPORT virtual ~GeomDataAPI_Point();
};
#endif
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File: GeomDataAPI_Point2D.cpp
+// Created: 24 Apr 2014
+// Author: Mikhail PONIKAROV
+
+
+#include <GeomDataAPI_Point2D.h>
+
+void GeomDataAPI_Point2D::move(const double theDeltaX, const double theDeltaY)
+{
+ setValue(x() + theDeltaX, y() + theDeltaY);
+}
+
+std::string GeomDataAPI_Point2D::attributeType()
+{
+ return typeId();
+}
+
+GeomDataAPI_Point2D::GeomDataAPI_Point2D()
+{
+}
+
+GeomDataAPI_Point2D::~GeomDataAPI_Point2D()
+{
+}
#ifndef GeomDataAPI_Point2D_H_
#define GeomDataAPI_Point2D_H_
-#include "GeomDataAPI.h"
+#include <GeomDataAPI.h>
#include <ModelAPI_Attribute.h>
class GeomAPI_Pnt2d;
virtual std::shared_ptr<GeomAPI_Pnt2d> pnt() = 0;
/// Appends the delta values to point
- void move(const double theDeltaX, const double theDeltaY)
- {
- setValue(x() + theDeltaX, y() + theDeltaY);
- }
-
+ GEOMDATAAPI_EXPORT void move(const double theDeltaX, const double theDeltaY);
/// Returns the type of this class of attributes
- static inline std::string type()
+ static std::string typeId()
{
return std::string("Point2D");
}
/// Returns the type of this class of attributes, not static method
- virtual std::string attributeType()
- {
- return type();
- }
+ GEOMDATAAPI_EXPORT virtual std::string attributeType();
protected:
/// Objects are created for features automatically
- GeomDataAPI_Point2D()
- {
- }
+ GEOMDATAAPI_EXPORT GeomDataAPI_Point2D();
+ GEOMDATAAPI_EXPORT virtual ~GeomDataAPI_Point2D();
};
#endif
# Test GeomDataAPI static methods
#===============================================================================
from GeomDataAPI import *
-assert (GeomDataAPI_Point.type() == "Point")
-assert (GeomDataAPI_Dir.type() == "Dir")
-assert (GeomDataAPI_Point2D.type() == "Point2D")
\ No newline at end of file
+assert (GeomDataAPI_Point.typeId() == "Point")
+assert (GeomDataAPI_Dir.typeId() == "Dir")
+assert (GeomDataAPI_Point2D.typeId() == "Point2D")
\ No newline at end of file
{
TDF_Label anAttrLab = myLab.FindChild(myAttrs.size() + 1);
ModelAPI_Attribute* anAttr = 0;
- if (theAttrType == ModelAPI_AttributeDocRef::type()) {
+ if (theAttrType == ModelAPI_AttributeDocRef::typeId()) {
anAttr = new Model_AttributeDocRef(anAttrLab);
- } else if (theAttrType == Model_AttributeInteger::type()) {
+ } else if (theAttrType == Model_AttributeInteger::typeId()) {
anAttr = new Model_AttributeInteger(anAttrLab);
- } else if (theAttrType == ModelAPI_AttributeDouble::type()) {
+ } else if (theAttrType == ModelAPI_AttributeDouble::typeId()) {
anAttr = new Model_AttributeDouble(anAttrLab);
- } else if (theAttrType == Model_AttributeBoolean::type()) {
+ } else if (theAttrType == Model_AttributeBoolean::typeId()) {
anAttr = new Model_AttributeBoolean(anAttrLab);
- } else if (theAttrType == Model_AttributeString::type()) {
+ } else if (theAttrType == Model_AttributeString::typeId()) {
anAttr = new Model_AttributeString(anAttrLab);
- } else if (theAttrType == ModelAPI_AttributeReference::type()) {
+ } else if (theAttrType == ModelAPI_AttributeReference::typeId()) {
anAttr = new Model_AttributeReference(anAttrLab);
- } else if (theAttrType == ModelAPI_AttributeSelection::type()) {
+ } else if (theAttrType == ModelAPI_AttributeSelection::typeId()) {
anAttr = new Model_AttributeSelection(anAttrLab);
- } else if (theAttrType == ModelAPI_AttributeSelectionList::type()) {
+ } else if (theAttrType == ModelAPI_AttributeSelectionList::typeId()) {
anAttr = new Model_AttributeSelectionList(anAttrLab);
- } else if (theAttrType == ModelAPI_AttributeRefAttr::type()) {
+ } else if (theAttrType == ModelAPI_AttributeRefAttr::typeId()) {
anAttr = new Model_AttributeRefAttr(anAttrLab);
- } else if (theAttrType == ModelAPI_AttributeRefList::type()) {
+ } else if (theAttrType == ModelAPI_AttributeRefList::typeId()) {
anAttr = new Model_AttributeRefList(anAttrLab);
}
// create also GeomData attributes here because only here the OCAF strucure is known
- else if (theAttrType == GeomData_Point::type()) {
+ else if (theAttrType == GeomData_Point::typeId()) {
anAttr = new GeomData_Point(anAttrLab);
- } else if (theAttrType == GeomData_Dir::type()) {
+ } else if (theAttrType == GeomData_Dir::typeId()) {
anAttr = new GeomData_Dir(anAttrLab);
- } else if (theAttrType == GeomData_Point2D::type()) {
+ } else if (theAttrType == GeomData_Point2D::typeId()) {
anAttr = new GeomData_Point2D(anAttrLab);
}
if (anAttr) {
std::list<ObjectPtr> aReferenced; // not inside of cycle to avoid excess memory menagement
for(; anAttr != myAttrs.end(); anAttr++) {
std::string aType = anAttr->second->attributeType();
- if (aType == ModelAPI_AttributeReference::type()) { // reference to object
+ if (aType == ModelAPI_AttributeReference::typeId()) { // reference to object
std::shared_ptr<ModelAPI_AttributeReference> aRef = std::dynamic_pointer_cast<
ModelAPI_AttributeReference>(anAttr->second);
aReferenced.push_back(aRef->value());
- } else if (aType == ModelAPI_AttributeRefAttr::type()) { // reference to attribute or object
+ } else if (aType == ModelAPI_AttributeRefAttr::typeId()) { // reference to attribute or object
std::shared_ptr<ModelAPI_AttributeRefAttr> aRef = std::dynamic_pointer_cast<
ModelAPI_AttributeRefAttr>(anAttr->second);
aReferenced.push_back(aRef->isObject() ? aRef->object() : aRef->attr()->owner());
- } else if (aType == ModelAPI_AttributeRefList::type()) { // list of references
+ } else if (aType == ModelAPI_AttributeRefList::typeId()) { // list of references
aReferenced = std::dynamic_pointer_cast<ModelAPI_AttributeRefList>(anAttr->second)->list();
- } else if (aType == ModelAPI_AttributeSelection::type()) { // selection attribute
+ } else if (aType == ModelAPI_AttributeSelection::typeId()) { // selection attribute
std::shared_ptr<ModelAPI_AttributeSelection> aRef = std::dynamic_pointer_cast<
ModelAPI_AttributeSelection>(anAttr->second);
aReferenced.push_back(aRef->context());
- } else if (aType == ModelAPI_AttributeSelectionList::type()) { // list of selection attributes
+ } else if (aType == ModelAPI_AttributeSelectionList::typeId()) { // list of selection attributes
std::shared_ptr<ModelAPI_AttributeSelectionList> aRef = std::dynamic_pointer_cast<
ModelAPI_AttributeSelectionList>(anAttr->second);
for(int a = aRef->size() - 1; a >= 0; a--) {
{
ModelAPI_Result::setData(theData);
if (theData) {
- data()->addAttribute(DOC_REF(), ModelAPI_AttributeDocRef::type());
+ data()->addAttribute(DOC_REF(), ModelAPI_AttributeDocRef::typeId());
}
}
//std::cout<<"Execute feature "<<theFeature->getKind()<<std::endl;
// before execution update the selection attributes if any
list<AttributePtr> aRefs =
- theFeature->data()->attributes(ModelAPI_AttributeSelection::type());
+ theFeature->data()->attributes(ModelAPI_AttributeSelection::typeId());
list<AttributePtr>::iterator aRefsIter = aRefs.begin();
for (; aRefsIter != aRefs.end(); aRefsIter++) {
std::shared_ptr<ModelAPI_AttributeSelection> aSel =
aState = ModelAPI_StateInvalidArgument;
}
}
- aRefs = theFeature->data()->attributes(ModelAPI_AttributeSelectionList::type());
+ aRefs = theFeature->data()->attributes(ModelAPI_AttributeSelectionList::typeId());
for (aRefsIter = aRefs.begin(); aRefsIter != aRefs.end(); aRefsIter++) {
std::shared_ptr<ModelAPI_AttributeSelectionList> aSel =
std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(*aRefsIter);
std::string ModelAPI_AttributeBoolean::attributeType()
{
- return type();
+ return typeId();
}
/// To virtually destroy the fields of successors
MODELAPI_EXPORT virtual bool value() = 0;
/// Returns the type of this class of attributes
- MODELAPI_EXPORT static std::string type()
+ MODELAPI_EXPORT static std::string typeId()
{
return "Boolean";
}
std::string ModelAPI_AttributeDocRef::attributeType()
{
- return type();
+ return typeId();
}
ModelAPI_AttributeDocRef::~ModelAPI_AttributeDocRef()
MODELAPI_EXPORT virtual std::shared_ptr<ModelAPI_Document> value() = 0;
/// Returns the type of this class of attributes
- MODELAPI_EXPORT static std::string type()
+ MODELAPI_EXPORT static std::string typeId()
{
return "DocRef";
}
std::string ModelAPI_AttributeDouble::attributeType()
{
- return type();
+ return typeId();
}
ModelAPI_AttributeDouble::~ModelAPI_AttributeDouble()
MODELAPI_EXPORT virtual double value() = 0;
/// Returns the type of this class of attributes
- MODELAPI_EXPORT static std::string type()
+ MODELAPI_EXPORT static std::string typeId()
{
return "Double";
}
std::string ModelAPI_AttributeInteger::attributeType()
{
- return type();
+ return typeId();
}
/// To virtually destroy the fields of successors
MODELAPI_EXPORT virtual int value() = 0;
/// Returns the type of this class of attributes
- MODELAPI_EXPORT static std::string type()
+ MODELAPI_EXPORT static std::string typeId()
{
return "Integer";
}
std::string ModelAPI_AttributeRefAttr::attributeType()
{
- return type();
+ return typeId();
}
ModelAPI_AttributeRefAttr::~ModelAPI_AttributeRefAttr()
MODELAPI_EXPORT virtual ObjectPtr object() = 0;
/// Returns the type of this class of attributes
- MODELAPI_EXPORT static std::string type()
+ MODELAPI_EXPORT static std::string typeId()
{
return "RefAttr";
}
std::string ModelAPI_AttributeRefList::attributeType()
{
- return type();
+ return typeId();
}
ModelAPI_AttributeRefList::~ModelAPI_AttributeRefList()
{
public:
/// Returns the type of this class of attributes
- MODELAPI_EXPORT static std::string type()
+ MODELAPI_EXPORT static std::string typeId()
{
return "RefList";
}
std::string ModelAPI_AttributeReference::attributeType()
{
- return type();
+ return typeId();
}
ModelAPI_AttributeReference::~ModelAPI_AttributeReference()
MODELAPI_EXPORT virtual ObjectPtr value() = 0;
/// Returns the type of this class of attributes
- MODELAPI_EXPORT static std::string type()
+ MODELAPI_EXPORT static std::string typeId()
{
return "Reference";
}
std::string ModelAPI_AttributeSelection::attributeType()
{
- return type();
+ return typeId();
}
ModelAPI_AttributeSelection::~ModelAPI_AttributeSelection()
virtual bool update() = 0;
/// Returns the type of this class of attributes
- static std::string type()
+ static std::string typeId()
{
return "Selection";
}
std::string ModelAPI_AttributeSelectionList::attributeType()
{
- return type();
+ return typeId();
}
ModelAPI_AttributeSelectionList::~ModelAPI_AttributeSelectionList()
virtual void clear() = 0;
/// Returns the type of this class of attributes
- static std::string type()
+ static std::string typeId()
{
return "SelectionList";
}
std::string ModelAPI_AttributeString::attributeType()
{
- return type();
+ return typeId();
}
ModelAPI_AttributeString::~ModelAPI_AttributeString()
MODELAPI_EXPORT virtual std::string value() = 0;
/// Returns the type of this class of attributes
- MODELAPI_EXPORT static std::string type()
+ MODELAPI_EXPORT static std::string typeId()
{
return "String";
}
std::string aCurrentAttributeId = theAttribute->id();
// get all feature attributes
std::list<AttributePtr> anAttrs =
- theFeature->data()->attributes(ModelAPI_AttributeSelection::type());
+ theFeature->data()->attributes(ModelAPI_AttributeSelection::typeId());
if (anAttrs.size() > 0 && theShape.get() != NULL) {
std::list<AttributePtr>::iterator anAttr = anAttrs.begin();
for(; anAttr != anAttrs.end(); anAttr++) {
#===============================================================================
from ModelAPI import *
assert (ModelAPI_Feature.group() == "Features")
-assert (ModelAPI_AttributeDocRef.type() == "DocRef")
-assert (ModelAPI_AttributeDouble.type() == "Double")
-assert (ModelAPI_AttributeReference.type() == "Reference")
-assert (ModelAPI_AttributeRefAttr.type() == "RefAttr")
-assert (ModelAPI_AttributeRefList.type() == "RefList")
\ No newline at end of file
+assert (ModelAPI_AttributeDocRef.typeId() == "DocRef")
+assert (ModelAPI_AttributeDouble.typeId() == "Double")
+assert (ModelAPI_AttributeReference.typeId() == "Reference")
+assert (ModelAPI_AttributeRefAttr.typeId() == "RefAttr")
+assert (ModelAPI_AttributeRefList.typeId() == "RefList")
\ No newline at end of file
ModuleBase
Config
GeomAPI
+ GeomDataAPI
${QT_LIBRARIES}
${CAS_KERNEL}
${CAS_SHAPE}
std::shared_ptr<GeomAPI_Pnt2d> aClickedPoint = std::shared_ptr<GeomAPI_Pnt2d>(
new GeomAPI_Pnt2d(theX, theY));
std::list<std::shared_ptr<ModelAPI_Attribute> > anAttiributes =
- theFeature->data()->attributes(GeomDataAPI_Point2D::type());
+ theFeature->data()->attributes(GeomDataAPI_Point2D::typeId());
std::list<std::shared_ptr<ModelAPI_Attribute> >::const_iterator anIt = anAttiributes.begin(),
aLast = anAttiributes.end();
std::shared_ptr<GeomDataAPI_Point2D> aFPoint;
for (int i = 0; i < theSketch->numberOfSubs(); i++) {
FeaturePtr aFeature = theSketch->subFeature(i);
if (!theIgnore.contains(aFeature)) {
- anAttiributes = aFeature->data()->attributes(GeomDataAPI_Point2D::type());
+ anAttiributes = aFeature->data()->attributes(GeomDataAPI_Point2D::typeId());
std::list<std::shared_ptr<ModelAPI_Attribute> >::const_iterator anIt;
for (anIt = anAttiributes.cbegin(); anIt != anAttiributes.cend(); ++anIt) {
for (; anIt != aLast; anIt++) {
FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(*anIt);
// find the given point in the feature attributes
- anAttiributes = aFeature->data()->attributes(GeomDataAPI_Point2D::type());
+ anAttiributes = aFeature->data()->attributes(GeomDataAPI_Point2D::typeId());
std::list<std::shared_ptr<ModelAPI_Attribute> >::const_iterator anIt = anAttiributes.begin(),
aLast = anAttiributes.end();
std::shared_ptr<GeomDataAPI_Point2D> aFPoint;
// find the given point in the feature attributes
std::list<AttributePtr> anAttiributes =
- aFeature->data()->attributes(GeomDataAPI_Point2D::type());
+ aFeature->data()->attributes(GeomDataAPI_Point2D::typeId());
std::list<AttributePtr>::const_iterator anIt = anAttiributes.begin(),
aLast = anAttiributes.end();
for (; anIt != aLast && !anAttribute; anIt++) {
{
// Check RefAttr attributes
std::list<std::shared_ptr<ModelAPI_Attribute> > anAttrs =
- theFeature->data()->attributes(ModelAPI_AttributeRefAttr::type());
+ theFeature->data()->attributes(ModelAPI_AttributeRefAttr::typeId());
if (anAttrs.size() > 0) {
std::list<std::shared_ptr<ModelAPI_Attribute> >::iterator anAttr = anAttrs.begin();
for(; anAttr != anAttrs.end(); anAttr++) {
}
}
// Check selection attributes
- anAttrs = theFeature->data()->attributes(ModelAPI_AttributeSelection::type());
+ anAttrs = theFeature->data()->attributes(ModelAPI_AttributeSelection::typeId());
if (anAttrs.size() > 0) {
std::list<std::shared_ptr<ModelAPI_Attribute> >::iterator anAttr = anAttrs.begin();
for(; anAttr != anAttrs.end(); anAttr++) {
}
}
// Check selection attributes
- anAttrs = theFeature->data()->attributes(ModelAPI_AttributeReference::type());
+ anAttrs = theFeature->data()->attributes(ModelAPI_AttributeReference::typeId());
if (anAttrs.size() > 0) {
std::list<std::shared_ptr<ModelAPI_Attribute> >::iterator anAttr = anAttrs.begin();
for(; anAttr != anAttrs.end(); anAttr++) {
GeomAPI
GeomAlgoAPI
ModelAPI
+ GeomDataAPI
${CAS_KERNEL}
${CAS_SHAPE}
)
void SketchPlugin_Arc::initAttributes()
{
- data()->addAttribute(CENTER_ID(), GeomDataAPI_Point2D::type());
- data()->addAttribute(START_ID(), GeomDataAPI_Point2D::type());
- data()->addAttribute(END_ID(), GeomDataAPI_Point2D::type());
- data()->addAttribute(EXTERNAL_ID(), ModelAPI_AttributeSelection::type());
+ data()->addAttribute(CENTER_ID(), GeomDataAPI_Point2D::typeId());
+ data()->addAttribute(START_ID(), GeomDataAPI_Point2D::typeId());
+ data()->addAttribute(END_ID(), GeomDataAPI_Point2D::typeId());
+ data()->addAttribute(EXTERNAL_ID(), ModelAPI_AttributeSelection::typeId());
ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), EXTERNAL_ID());
}
void SketchPlugin_Circle::initAttributes()
{
- data()->addAttribute(CENTER_ID(), GeomDataAPI_Point2D::type());
- data()->addAttribute(RADIUS_ID(), ModelAPI_AttributeDouble::type());
- data()->addAttribute(EXTERNAL_ID(), ModelAPI_AttributeSelection::type());
+ data()->addAttribute(CENTER_ID(), GeomDataAPI_Point2D::typeId());
+ data()->addAttribute(RADIUS_ID(), ModelAPI_AttributeDouble::typeId());
+ data()->addAttribute(EXTERNAL_ID(), ModelAPI_AttributeSelection::typeId());
ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), EXTERNAL_ID());
}
void SketchPlugin_ConstraintCoincidence::initAttributes()
{
- data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::type());
- data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::type());
+ data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId());
+ data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::typeId());
}
void SketchPlugin_ConstraintCoincidence::execute()
//*************************************************************************************
void SketchPlugin_ConstraintDistance::initAttributes()
{
- data()->addAttribute(SketchPlugin_Constraint::VALUE(), ModelAPI_AttributeDouble::type());
- data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::type());
- data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::type());
- data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::type());
+ data()->addAttribute(SketchPlugin_Constraint::VALUE(), ModelAPI_AttributeDouble::typeId());
+ data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::typeId());
+ data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId());
+ data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::typeId());
}
//*************************************************************************************
void SketchPlugin_ConstraintLength::initAttributes()
{
- data()->addAttribute(SketchPlugin_Constraint::VALUE(), ModelAPI_AttributeDouble::type());
- data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::type());
- data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::type());
+ data()->addAttribute(SketchPlugin_Constraint::VALUE(), ModelAPI_AttributeDouble::typeId());
+ data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::typeId());
+ data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId());
}
void SketchPlugin_ConstraintLength::execute()
void SketchPlugin_ConstraintParallel::initAttributes()
{
- data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::type());
- data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::type());
- data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::type());
+ data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId());
+ data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::typeId());
+ data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::typeId());
}
void SketchPlugin_ConstraintParallel::execute()
void SketchPlugin_ConstraintPerpendicular::initAttributes()
{
- data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::type());
- data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::type());
+ data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId());
+ data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::typeId());
}
void SketchPlugin_ConstraintPerpendicular::execute()
void SketchPlugin_ConstraintRadius::initAttributes()
{
- data()->addAttribute(SketchPlugin_Constraint::VALUE(), ModelAPI_AttributeDouble::type());
- data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::type());
- data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::type());
+ data()->addAttribute(SketchPlugin_Constraint::VALUE(), ModelAPI_AttributeDouble::typeId());
+ data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId());
+ data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::typeId());
}
void SketchPlugin_ConstraintRadius::execute()
void SketchPlugin_ConstraintRigid::initAttributes()
{
- data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::type());
+ data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId());
}
void SketchPlugin_ConstraintRigid::execute()
void SketchPlugin_Line::initAttributes()
{
- data()->addAttribute(START_ID(), GeomDataAPI_Point2D::type());
- data()->addAttribute(END_ID(), GeomDataAPI_Point2D::type());
- data()->addAttribute(EXTERNAL_ID(), ModelAPI_AttributeSelection::type());
+ data()->addAttribute(START_ID(), GeomDataAPI_Point2D::typeId());
+ data()->addAttribute(END_ID(), GeomDataAPI_Point2D::typeId());
+ data()->addAttribute(EXTERNAL_ID(), ModelAPI_AttributeSelection::typeId());
ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), EXTERNAL_ID());
}
void SketchPlugin_Point::initAttributes()
{
- data()->addAttribute(SketchPlugin_Point::COORD_ID(), GeomDataAPI_Point2D::type());
- data()->addAttribute(EXTERNAL_ID(), ModelAPI_AttributeSelection::type());
+ data()->addAttribute(SketchPlugin_Point::COORD_ID(), GeomDataAPI_Point2D::typeId());
+ data()->addAttribute(EXTERNAL_ID(), ModelAPI_AttributeSelection::typeId());
ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), EXTERNAL_ID());
}
void SketchPlugin_Sketch::initAttributes()
{
- data()->addAttribute(SketchPlugin_Sketch::ORIGIN_ID(), GeomDataAPI_Point::type());
- data()->addAttribute(SketchPlugin_Sketch::DIRX_ID(), GeomDataAPI_Dir::type());
- data()->addAttribute(SketchPlugin_Sketch::DIRY_ID(), GeomDataAPI_Dir::type());
- data()->addAttribute(SketchPlugin_Sketch::NORM_ID(), GeomDataAPI_Dir::type());
- data()->addAttribute(SketchPlugin_Sketch::FEATURES_ID(), ModelAPI_AttributeRefList::type());
+ data()->addAttribute(SketchPlugin_Sketch::ORIGIN_ID(), GeomDataAPI_Point::typeId());
+ data()->addAttribute(SketchPlugin_Sketch::DIRX_ID(), GeomDataAPI_Dir::typeId());
+ data()->addAttribute(SketchPlugin_Sketch::DIRY_ID(), GeomDataAPI_Dir::typeId());
+ data()->addAttribute(SketchPlugin_Sketch::NORM_ID(), GeomDataAPI_Dir::typeId());
+ data()->addAttribute(SketchPlugin_Sketch::FEATURES_ID(), ModelAPI_AttributeRefList::typeId());
// the selected face, base for the sketcher plane, not obligatory
- data()->addAttribute(SketchPlugin_Feature::EXTERNAL_ID(), ModelAPI_AttributeSelection::type());
+ data()->addAttribute(SketchPlugin_Feature::EXTERNAL_ID(), ModelAPI_AttributeSelection::typeId());
ModelAPI_Session::get()->validators()->registerNotObligatory(
getKind(), SketchPlugin_Feature::EXTERNAL_ID());
}
const ObjectPtr& theObject) const
{
std::list<std::shared_ptr<ModelAPI_Attribute> > anAttrs =
- theFeature->data()->attributes(ModelAPI_AttributeRefAttr::type());
+ theFeature->data()->attributes(ModelAPI_AttributeRefAttr::typeId());
std::list<std::shared_ptr<ModelAPI_Attribute> >::iterator anAttr = anAttrs.begin();
for(; anAttr != anAttrs.end(); anAttr++) {
if (*anAttr) {
const FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(anObj);
std::list<std::shared_ptr<ModelAPI_Attribute> > anAttrs =
- aFeature->data()->attributes(ModelAPI_AttributeRefAttr::type());
+ aFeature->data()->attributes(ModelAPI_AttributeRefAttr::typeId());
std::list<std::shared_ptr<ModelAPI_Attribute> >::iterator anAttr = anAttrs.begin();
for(; anAttr != anAttrs.end(); anAttr++) {
if (*anAttr && *anAttr != theAttribute) {
const std::list<std::string>& theArguments, const AttributePtr& theAttribute) const
{
std::list<std::shared_ptr<ModelAPI_Attribute> > anAttrs =
- theFeature->data()->attributes(ModelAPI_AttributeRefAttr::type());
+ theFeature->data()->attributes(ModelAPI_AttributeRefAttr::typeId());
std::list<std::shared_ptr<ModelAPI_Attribute> >::iterator anAttr = anAttrs.begin();
for(; anAttr != anAttrs.end(); anAttr++) {
if (*anAttr) {
SketchPlugin_ConstraintCoincidence
static const std::string MY_CONSTRAINT_COINCIDENCE_ID("SketchConstraintCoincidence");
- data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::type());
- data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::type());
+ data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId());
+ data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::typeId());
"""
from GeomDataAPI import *
SketchPlugin_ConstraintDistance
static const std::string MY_CONSTRAINT_DISTANCE_ID("SketchConstraintDistance");
- data()->addAttribute(SketchPlugin_Constraint::VALUE(), ModelAPI_AttributeDouble::type());
- data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::type());
- data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::type());
- data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::type());
+ data()->addAttribute(SketchPlugin_Constraint::VALUE(), ModelAPI_AttributeDouble::typeId());
+ data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::typeId());
+ data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId());
+ data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::typeId());
"""
SketchPlugin_ConstraintLength
static const std::string MY_CONSTRAINT_LENGTH_ID("SketchConstraintLength");
- data()->addAttribute(SketchPlugin_Constraint::VALUE(), ModelAPI_AttributeDouble::type());
- data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::type());
- data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::type());
+ data()->addAttribute(SketchPlugin_Constraint::VALUE(), ModelAPI_AttributeDouble::typeId());
+ data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::typeId());
+ data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId());
"""
from GeomDataAPI import *
SketchPlugin_ConstraintParallel
static const std::string MY_CONSTRAINT_PARALLEL_ID("SketchConstraintParallel");
- data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::type());
- data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::type());
- data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::type());
+ data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId());
+ data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::typeId());
+ data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::typeId());
"""
from GeomDataAPI import *
SketchPlugin_ConstraintPerpendicular
static const std::string MY_CONSTRAINT_PERPENDICULAR_ID("SketchConstraintPerpendicular");
- data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::type());
- data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::type());
- data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::type());
+ data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId());
+ data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::typeId());
+ data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::typeId());
"""
from GeomDataAPI import *
from ModelAPI import *
SketchPlugin_ConstraintRadius
static const std::string MY_CONSTRAINT_RADIUS_ID("SketchConstraintRadius");
- data()->addAttribute(SketchPlugin_Constraint::VALUE(), ModelAPI_AttributeDouble::type());
- data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::type());
- data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::type());
+ data()->addAttribute(SketchPlugin_Constraint::VALUE(), ModelAPI_AttributeDouble::typeId());
+ data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId());
+ data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::typeId());
"""
from GeomDataAPI import *
SketchPlugin_ConstraintRigid
static const std::string MY_CONSTRAINT_RIGID_ID("SketchConstraintRigid");
- data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::type());
+ data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId());
"""
from GeomDataAPI import *
static const std::string MY_CENTER_ID = "ArcCenter";
static const std::string MY_START_ID = "ArcStartPoint";
static const std::string MY_END_ID = "ArcEndPoint";
- data()->addAttribute(SketchPlugin_Arc::CENTER_ID(), GeomDataAPI_Point2D::type());
- data()->addAttribute(SketchPlugin_Arc::START_ID(), GeomDataAPI_Point2D::type());
- data()->addAttribute(SketchPlugin_Arc::END_ID(), GeomDataAPI_Point2D::type());
+ data()->addAttribute(SketchPlugin_Arc::CENTER_ID(), GeomDataAPI_Point2D::typeId());
+ data()->addAttribute(SketchPlugin_Arc::START_ID(), GeomDataAPI_Point2D::typeId());
+ data()->addAttribute(SketchPlugin_Arc::END_ID(), GeomDataAPI_Point2D::typeId());
static const std::string MY_CIRCLE_ID("SketchCircle");
static const std::string MY_CIRCLE_CENTER_ID("CircleCenter");
static const std::string MY_CIRCLE_RADIUS_ID("CircleRadius");
- data()->addAttribute(SketchPlugin_Circle::CENTER_ID(), GeomDataAPI_Point2D::type());
- data()->addAttribute(SketchPlugin_Circle::RADIUS_ID(), ModelAPI_AttributeDouble::type());
+ data()->addAttribute(SketchPlugin_Circle::CENTER_ID(), GeomDataAPI_Point2D::typeId());
+ data()->addAttribute(SketchPlugin_Circle::RADIUS_ID(), ModelAPI_AttributeDouble::typeId());
"""
#=========================================================================
assert (not anCircleCentr.isInitialized())
aCircleRadius = aSketchCircle.real("CircleRadius")
assert (type(aCircleRadius) == ModelAPI_AttributeDouble)
-# ModelAPI_AttributeDouble.type() is checked in ModelAPI_TestConstants
-assert (aCircleRadius.attributeType() == ModelAPI_AttributeDouble.type())
+# ModelAPI_AttributeDouble.typeId() is checked in ModelAPI_TestConstants
+assert (aCircleRadius.attributeType() == ModelAPI_AttributeDouble.typeId())
assert (aCircleRadius.value() == 0)
anCircleCentr.setValue(-25., -25)
aCircleRadius.setValue(25.)
} else {
if (anAttrRef->attr().get() != NULL) {
const std::string aType = anAttrRef->attr()->attributeType();
- if (aType == GeomDataAPI_Point2D::type())
+ if (aType == GeomDataAPI_Point2D::typeId())
return POINT2D;
- if (aType == GeomDataAPI_Point2D::type())
+ if (aType == GeomDataAPI_Point2D::typeId())
return POINT2D;
}
}