Revert "part deletion handling"
This reverts commit 6ab2002021ac1df26ebe77f488f5cd94e1df0b26.
This commit is contained in:
committed by
Stefan Tröger
parent
e26c6174ac
commit
ade1dec103
@@ -2053,20 +2053,13 @@ void Document::_addObject(DocumentObject* pcObject, const char* pObjectName)
|
||||
}
|
||||
|
||||
/// Remove an object out of the document
|
||||
void Document::remObject(const char* sName, bool forceIfUndeletable)
|
||||
void Document::remObject(const char* sName)
|
||||
{
|
||||
std::map<std::string,DocumentObject*>::iterator pos = d->objectMap.find(sName);
|
||||
|
||||
// name not found?
|
||||
if (pos == d->objectMap.end())
|
||||
return;
|
||||
|
||||
// undeletable?
|
||||
if (pos->second->testStatus(ObjectStatus::Undeletable) && !forceIfUndeletable) {
|
||||
std::stringstream str;
|
||||
str << "Document object '" << pos->second->getNameInDocument() << "' is undeletable";
|
||||
throw Base::Exception(str.str());
|
||||
}
|
||||
|
||||
_checkTransaction(pos->second);
|
||||
|
||||
@@ -2130,7 +2123,7 @@ void Document::_remObject(DocumentObject* pcObject)
|
||||
_checkTransaction(pcObject);
|
||||
|
||||
std::map<std::string,DocumentObject*>::iterator pos = d->objectMap.find(pcObject->getNameInDocument());
|
||||
|
||||
|
||||
if (d->activeObject == pcObject)
|
||||
d->activeObject = 0;
|
||||
|
||||
|
||||
@@ -170,6 +170,8 @@ public:
|
||||
* Unicode names are set through the Label property.
|
||||
*/
|
||||
DocumentObject *addObject(const char* sType, const char* pObjectName=0);
|
||||
/// Remove a feature out of the document
|
||||
void remObject(const char* sName);
|
||||
/** Add an existing feature with sName (ASCII) to this document and set it active.
|
||||
* Unicode names are set through the Label property.
|
||||
* This is an overloaded function of the function above and can be used to create
|
||||
@@ -179,11 +181,6 @@ public:
|
||||
*/
|
||||
void addObject(DocumentObject*, const char* pObjectName=0);
|
||||
|
||||
/** Remove a feature out of the document.
|
||||
* If i is marked as undeletable an exeption is thrown. If you want to delete in nonetheless set
|
||||
* the function parameter \a forceIfUndeletable to true
|
||||
*/
|
||||
void remObject(const char* sName, bool forceIfUndeletable = false);
|
||||
|
||||
/** Copy an object from another document to this document
|
||||
* If \a recursive is true then all objects this object depends on
|
||||
|
||||
@@ -170,7 +170,7 @@ public:
|
||||
* Unicode names are set through the Label property.
|
||||
*/
|
||||
DocumentObject *addObject(const char* sType, const char* pObjectName=0);
|
||||
<<<<<<< 985ebdc55b761ed8ae81d7e610ccd5b9f1378473
|
||||
<<<<<<< dd080ca693c9af42b6b87ee453f71fccb227b951
|
||||
/** Add an existing feature with sName (ASCII) to this document and set it active.
|
||||
* Unicode names are set through the Label property.
|
||||
* This is an overloaded function of the function above and can be used to create
|
||||
@@ -179,15 +179,17 @@ public:
|
||||
* is raisedd.
|
||||
*/
|
||||
void addObject(DocumentObject*, const char* pObjectName=0);
|
||||
/// Remove a feature out of the document
|
||||
void remObject(const char* sName);
|
||||
=======
|
||||
/** Remove a feature out of the document.
|
||||
|
||||
/** Remove a feature out of the document.
|
||||
* If i is marked as undeletable an exeption is thrown. If you want to delete in nonetheless set
|
||||
* the function parameter \a forceIfUndeletable to true
|
||||
*/
|
||||
void remObject(const char* sName, bool forceIfUndeletable = false);
|
||||
>>>>>>> part deletion handling
|
||||
|
||||
=======
|
||||
/// Remove a feature out of the document
|
||||
void remObject(const char* sName);
|
||||
>>>>>>> Revert "part deletion handling"
|
||||
/** Copy an object from another document to this document
|
||||
* If \a recursive is true then all objects this object depends on
|
||||
* are copied as well. By default \a recursive is false.
|
||||
|
||||
@@ -47,7 +47,6 @@ enum ObjectStatus {
|
||||
New = 2,
|
||||
Recompute = 3,
|
||||
Restore = 4,
|
||||
Undeletable = 5,
|
||||
Expand = 16
|
||||
};
|
||||
|
||||
@@ -195,7 +194,7 @@ protected:
|
||||
* 2 - object is marked as 'new'
|
||||
* 3 - object is marked as 'recompute', i.e. the object gets recomputed now
|
||||
* 4 - object is marked as 'restoring', i.e. the object gets loaded at the moment
|
||||
* 5 - object is marked as 'undeletable', i.e. the user is not allowed to delete this object from the document
|
||||
* 5 - reserved
|
||||
* 6 - reserved
|
||||
* 7 - reserved
|
||||
* 16 - object is marked as 'expanded' in the tree view
|
||||
|
||||
@@ -42,10 +42,7 @@ PROPERTY_SOURCE(App::Line, App::GeoFeature)
|
||||
Line::Line(void)
|
||||
{
|
||||
ADD_PROPERTY(LineType,(""));
|
||||
//placement can't be changed
|
||||
Placement.StatusBits.set(3, true);
|
||||
//line can not be deleted by user
|
||||
StatusBits.set(ObjectStatus::Undeletable, true);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace App
|
||||
|
||||
|
||||
/** Line Object
|
||||
* Used to define linear support for all kind of operations in the document space
|
||||
* Used to define planar support for all kind of operations in the document space
|
||||
*/
|
||||
class AppExport Line: public App::GeoFeature
|
||||
{
|
||||
|
||||
@@ -45,10 +45,7 @@ PROPERTY_SOURCE(App::Origin, App::GeoFeatureGroup)
|
||||
|
||||
Origin::Origin(void)
|
||||
{
|
||||
//placement can't be changed
|
||||
Placement.StatusBits.set(3, true);
|
||||
//origin can not be deleted by user
|
||||
StatusBits.set(ObjectStatus::Undeletable, true);
|
||||
}
|
||||
|
||||
Origin::~Origin(void)
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace App
|
||||
{
|
||||
|
||||
|
||||
/** Describe a origin of a local coordinate system
|
||||
/** Base class of all geometric document objects.
|
||||
*/
|
||||
class AppExport Origin : public App::GeoFeatureGroup
|
||||
{
|
||||
|
||||
@@ -30,9 +30,8 @@
|
||||
#include <App/Plane.h>
|
||||
|
||||
#include "Part.h"
|
||||
#include "Origin.h"
|
||||
#include "PartPy.h"
|
||||
#include <boost/bind.hpp>
|
||||
|
||||
|
||||
using namespace App;
|
||||
|
||||
@@ -65,6 +64,7 @@ Part::Part(void)
|
||||
ADD_PROPERTY_TYPE(LicenseURL, ("http://creativecommons.org/licenses/by/3.0/"), 0, App::Prop_None, "URL to the license text/contract");
|
||||
// color and apperance
|
||||
ADD_PROPERTY(Color, (1.0, 1.0, 1.0, 1.0)); // set transparent -> not used
|
||||
|
||||
}
|
||||
|
||||
Part::~Part(void)
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "GeoFeatureGroup.h"
|
||||
#include "PropertyLinks.h"
|
||||
#include <boost/signals.hpp>
|
||||
|
||||
|
||||
|
||||
namespace App
|
||||
|
||||
@@ -42,10 +42,7 @@ PROPERTY_SOURCE(App::Plane, App::GeoFeature)
|
||||
Plane::Plane(void)
|
||||
{
|
||||
ADD_PROPERTY(PlaneType,(""));
|
||||
//placement can't be changed
|
||||
Placement.StatusBits.set(3, true);
|
||||
//plane can not be deleted by user
|
||||
StatusBits.set(ObjectStatus::Undeletable, true);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user