#include <Config_PointerMessage.h>
+// LCOV_EXCL_START
Config_PointerMessage::Config_PointerMessage(const Events_ID theId, const void* theParent)
: Events_Message(theId, theParent),
myPointer(0)
{
myPointer = pointer;
}
+// LCOV_EXCL_STOP
#pragma warning(disable : 4996) // for sprintf
#endif
+// LCOV_EXCL_START
/**
* \class Config_TSReader
* \ingroup Config
myTranslator[aName][aSource] = aTranslat;
}
}
+// LCOV_EXCL_STOP
//******************************************************************************
//******************************************************************************
}
//=======================================================================
-void Model_Application::removeUselessDocuments(
- std::list<std::shared_ptr<ModelAPI_Document> > theUsedDocs)
-{
- std::map<int, std::shared_ptr<Model_Document> >::iterator aDoc = myDocs.begin();
- while(aDoc != myDocs.end()) {
- bool aFound = false;
- std::list<std::shared_ptr<ModelAPI_Document> >::iterator aUsed = theUsedDocs.begin();
- for(; !aFound && aUsed != theUsedDocs.end(); aUsed++) {
- aFound = aDoc->second == *aUsed;
- }
- if (!aFound) { // remove the useless
- aDoc->second->close();
- myDocs.erase(aDoc);
- aDoc = myDocs.begin();
- } else {
- aDoc++;
- }
- }
-}
-
int Model_Application::generateDocumentId()
{
int aResult;
void setLoadByDemand(std::string theID, const int theDocID);
//! Returns true if specified document must be loaded by demand
bool isLoadByDemand(std::string theID, const int theDocIndex);
- //! Closes and removes the documents that are not loaded by demand and
- //! not in the given list
- void removeUselessDocuments(std::list<std::shared_ptr<ModelAPI_Document> > theUsedDocs);
//! produces new unique identifier of the document
int generateDocumentId();
}
}
-void Model_AttributeRefList::exchange(const ObjectPtr& theObject1, const ObjectPtr& theObject2)
-{
- std::shared_ptr<Model_Document> aDoc = std::dynamic_pointer_cast<Model_Document>(
- owner()->document());
- if (aDoc) {
- std::shared_ptr<Model_Data> aData1 = std::dynamic_pointer_cast<Model_Data>(theObject1->data());
- if (aData1.get() && aData1->isValid()) {
- TDF_Label aLab1 = aData1->label().Father();
- if (theObject2.get() && theObject2->data()->isValid()) { // the new may be null
- std::shared_ptr<Model_Data> aData2 =
- std::dynamic_pointer_cast<Model_Data>(theObject2->data());
- if (aData2.get() && aData2->isValid()) {
- eraseHash();
- TDF_Label aLab2 = aData2->label().Father();
- // do the substitution: use the temporary label, as usually in exchange
- TDF_Label aTmpLab = aLab1.Root();
- if (myRef->InsertAfter(aTmpLab, aLab1)) {
- myRef->Remove(aLab1);
- }
- if (myRef->InsertAfter(aLab1, aLab2)) {
- myRef->Remove(aLab2);
- }
- if (myRef->InsertAfter(aLab2, aTmpLab)) {
- myRef->Remove(aTmpLab);
- }
- owner()->data()->sendAttributeUpdated(this);
- }
- }
- }
- }
-}
-
void Model_AttributeRefList::removeLast()
{
std::shared_ptr<Model_Document> aDoc = std::dynamic_pointer_cast<Model_Document>(
/// Does not support the external documents objects yet.
MODEL_EXPORT virtual void substitute(const ObjectPtr& theCurrent, const ObjectPtr& theNew);
- /// Substitutes the object by another one and back. So, features will become exchanged in the list
- /// Does not support the external documents objects yet.
- MODEL_EXPORT virtual void exchange(const ObjectPtr& theObject1, const ObjectPtr& theObject2);
-
/// Removes the last element in the list.
/// Does not support the external documents objects yet.
MODEL_EXPORT virtual void removeLast();
return this == Model_Session::get()->moduleDocument().get();
}
+// LCOV_EXCL_START
/// Makes all modification and generation naming shapes that have old shapes corresponding to
/// shapes in a root document be equal to this root document
static void updateShapesFromRoot(const TDF_Label theThisAccess, const TDF_Label theRootAccess)
}
}
}
+// LCOV_EXCL_STOP
bool Model_Document::load(const char* theDirName, const char* theFileName, DocumentPtr theThis)
{
}
bool isError = aStatus != PCDM_RS_OK;
if (isError) {
+ // LCOV_EXCL_START
switch (aStatus) {
case PCDM_RS_UnknownDocument:
Events_InfoMessage("Model_Document", "Can not open document").send();
Events_InfoMessage("Model_Document", "Can not open document: unknown error").send();
break;
}
+ // LCOV_EXCL_STOP
}
std::shared_ptr<Model_Session> aSession =
std::dynamic_pointer_cast<Model_Session>(Model_Session::get());
// update the current features status
setCurrentFeature(currentFeature(false), false);
}
-
+// this is used for creation of undo/redo1-list by GUI
+// LCOV_EXCL_START
std::list<std::string> Model_Document::undoList() const
{
std::list<std::string> aResult;
}
return aResult;
}
+// LCOV_EXCL_STOP
void Model_Document::operationId(const std::string& theId)
{
return myObjs->isLater(theLater, theCurrent);
}
+// Object Browser nodes states
+// LCOV_EXCL_START
void Model_Document::storeNodesState(const std::list<bool>& theStates)
{
TDF_Label aLab = generalLabel().FindChild(TAG_NODES_STATE);
}
}
}
+// LCOV_EXCL_STOP
void Model_Document::eraseAllFeatures()
{
}
}
+// LCOV_EXCL_START
void Model_ResultField::colorConfigInfo(std::string& theSection, std::string& theName,
std::string& theDefault)
{
theName = "result_field_color";
theDefault = DEFAULT_COLOR();
}
+// LCOV_EXCL_STOP
std::shared_ptr<GeomAPI_Shape> Model_ResultField::shape()
{
return "";
}
-
+// used by GUI only
+// LCOV_EXCL_START
ModelAPI_ResultField::ModelAPI_FieldStep* Model_ResultField::step(int theId) const
{
if (theId < mySteps.size()) {
}
return NULL;
}
+// LCOV_EXCL_STOP
redisplayWithResults(theFeature, aState);
}
+// it is called on GUI edit of feature start
+// LCOV_EXCL_START
void Model_Update::updateStability(void* theSender)
{
static ModelAPI_ValidatorsFactory* aFactory = ModelAPI_Session::get()->validators();
}
}
}
+// LCOV_EXCL_STOP
void Model_Update::updateSelection(const std::set<std::shared_ptr<ModelAPI_Object> >& theObjects)
{
/// Substitutes the object by another one. Does nothing if such object is not found.
virtual void substitute(const ObjectPtr& theCurrent, const ObjectPtr& theNew) = 0;
- /// Substitutes the object by another one and back. So, features wil become exchanged in the list
- virtual void exchange(const ObjectPtr& theObject1, const ObjectPtr& theObject2) = 0;
-
/// Removes the last element in the list.
virtual void removeLast() = 0;
ModelAPI_ObjectUpdatedMessage::ModelAPI_ObjectUpdatedMessage(const Events_ID theID,
const void* theSender)
: Events_MessageGroup(theID, theSender)
-{
-
-}
+{}
ModelAPI_ObjectUpdatedMessage::~ModelAPI_ObjectUpdatedMessage()
-{
-
-}
+{}
ModelAPI_ObjectDeletedMessage::ModelAPI_ObjectDeletedMessage(const Events_ID theID,
const void* theSender)
: Events_MessageGroup(theID, theSender)
-{
-
-}
+{}
ModelAPI_ObjectDeletedMessage::~ModelAPI_ObjectDeletedMessage()
-{
-
-}
+{}
ModelAPI_OrderUpdatedMessage::ModelAPI_OrderUpdatedMessage(const Events_ID theID,
const void* theSender)
: Events_Message(theID, theSender)
-{
-
-}
+{}
ModelAPI_OrderUpdatedMessage::~ModelAPI_OrderUpdatedMessage()
-{
-
-}
+{}
+// used by GUI only
+// LCOV_EXCL_START
ModelAPI_FeatureStateMessage::ModelAPI_FeatureStateMessage(const Events_ID theID,
const void* theSender)
: Events_Message(theID, theSender)
}
ModelAPI_FeatureStateMessage::~ModelAPI_FeatureStateMessage()
-{
-
-}
+{}
std::shared_ptr<ModelAPI_Feature> ModelAPI_FeatureStateMessage::feature() const
{
}
return result;
}
-
+// LCOV_EXCL_STOP
ModelAPI_DocumentCreatedMessage::ModelAPI_DocumentCreatedMessage(
const Events_ID theID, const void* theSender)
ModelAPI_ObjectRenamedMessage::ModelAPI_ObjectRenamedMessage(const Events_ID theID,
const void* theSender)
: Events_Message(theID, theSender)
-{
-
-}
+{}
ModelAPI_ObjectRenamedMessage::~ModelAPI_ObjectRenamedMessage()
-{
-
-}
+{}
void ModelAPI_ObjectRenamedMessage::send(ObjectPtr theObject,
const std::string& theOldName,
ModelAPI_ReplaceParameterMessage::ModelAPI_ReplaceParameterMessage(const Events_ID theID,
const void* theSender)
: Events_Message(theID, theSender)
-{
-
-}
+{}
ModelAPI_ReplaceParameterMessage::~ModelAPI_ReplaceParameterMessage()
-{
-
-}
+{}
void ModelAPI_ReplaceParameterMessage::send(ObjectPtr theObject,
const void* theSender)
const void* theSender)
: Events_Message(theID, theSender),
myDOF(-1)
-{
-}
+{}
ModelAPI_SolverFailedMessage::~ModelAPI_SolverFailedMessage()
-{
-}
+{}
void ModelAPI_SolverFailedMessage::setObjects(const std::set<ObjectPtr>& theObjects)
{
// ===== ModelAPI_ObjectMovedMessage =====
ModelAPI_ObjectMovedMessage::ModelAPI_ObjectMovedMessage(const void* theSender)
: Events_Message(Events_Loop::eventByName(EVENT_OBJECT_MOVED), theSender)
-{
-}
+{}
void ModelAPI_ObjectMovedMessage::setMovedObject(const ObjectPtr& theMovedObject)
{
theResult->setDisabled(theResult, false);
}
-void ModelAPI_Feature::removeResult(const std::shared_ptr<ModelAPI_Result>& theResult)
-{
- theResult->setDisabled(theResult, true);
- // flush visualization changes
- static Events_Loop* aLoop = Events_Loop::loop();
- static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
- aLoop->flush(aRedispEvent);
-}
-
void ModelAPI_Feature::eraseResultFromList(const std::shared_ptr<ModelAPI_Result>& theResult)
{
std::list<std::shared_ptr<ModelAPI_Result> >::iterator aResIter = myResults.begin();
return myIsDisabled;
}
+// LCOV_EXCL_START
bool ModelAPI_Feature::setStable(const bool theFlag)
{
if (myIsStable != theFlag) {
}
return false;
}
+// LCOV_EXCL_STOP
bool ModelAPI_Feature::isStable()
{
/// sets the result by index (zero based), results before this must be set before
MODELAPI_EXPORT void setResult(const std::shared_ptr<ModelAPI_Result>& theResult,
const int theIndex);
- /// removes the result from the feature
- MODELAPI_EXPORT void removeResult(const std::shared_ptr<ModelAPI_Result>& theResult);
/// removes all results starting from the given index (zero-based)
/// \param theSinceIndex - index of the deleted result and all after also will be deleted
/// \param theForever - removes results for long period (not just because of feature disabling)
myBuilder->loadFirstLevel(theShape, theName);
}
+// LCOV_EXCL_START
bool ModelAPI_ResultBody::isConnectedTopology()
{
if (myConnect == ConnectionNotComputed) {
for (int i = 0; i < numberOfSubs(); i++)
subResult(i)->setDisplayed(theDisplay);
}
+// LCOV_EXCL_STOP
}
}
+// LCOV_EXCL_START
std::string getFeatureError(const FeaturePtr& theFeature)
{
std::string anError;
return anError;
}
+// LCOV_EXCL_STOP
ObjectPtr objectByName(const DocumentPtr& theDocument, const std::string& theGroup,
const std::string& theName)