Salome HOME
projects
/
modules
/
geom.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge C++ part of kleontev/38044_auto_repair
[modules/geom.git]
/
src
/
GEOM
/
GEOM_BaseObject.cxx
diff --git
a/src/GEOM/GEOM_BaseObject.cxx
b/src/GEOM/GEOM_BaseObject.cxx
index 005c409efb2a7236333183b83b2baa306e8680f2..a833e7e40ca3b70fb20911b8f0f1d1790b633afb 100644
(file)
--- a/
src/GEOM/GEOM_BaseObject.cxx
+++ b/
src/GEOM/GEOM_BaseObject.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-20
13 CEA/DEN, EDF R&D
, OPEN CASCADE
+// Copyright (C) 2007-20
24 CEA, EDF
, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@
-6,7
+6,7
@@
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License
, or (at your option) any later version
.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-36,7
+36,6
@@
#include <TDataStd_UAttribute.hxx>
#include <TDocStd_Document.hxx>
#include <TDocStd_Owner.hxx>
#include <TDataStd_UAttribute.hxx>
#include <TDocStd_Document.hxx>
#include <TDocStd_Owner.hxx>
-#include <TFunction_Driver.hxx>
#include <TFunction_DriverTable.hxx>
#include "utilities.h"
#include <TFunction_DriverTable.hxx>
#include "utilities.h"
@@
-86,15
+85,9
@@
Handle(GEOM_BaseObject) GEOM_BaseObject::GetObject(const TDF_Label& theLabel)
TCollection_AsciiString anEntry;
TDF_Tool::Entry(theLabel, anEntry);
TCollection_AsciiString anEntry;
TDF_Tool::Entry(theLabel, anEntry);
- Handle(TDocStd_Document) aDoc = TDocStd_Owner::GetDocument(theLabel.Data());
- if(aDoc.IsNull()) return NULL;
-
- Handle(TDataStd_Integer) anID;
- if(!aDoc->Main().FindAttribute(TDataStd_Integer::GetID(), anID)) return NULL;
-
GEOM_Engine* anEngine = GEOM_Engine::GetEngine();
if(anEngine == NULL) return NULL;
GEOM_Engine* anEngine = GEOM_Engine::GetEngine();
if(anEngine == NULL) return NULL;
- return anEngine->GetObject(an
ID->Get(), an
Entry.ToCString());
+ return anEngine->GetObject(anEntry.ToCString());
}
//=============================================================================
}
//=============================================================================
@@
-168,14
+161,8
@@
int GEOM_BaseObject::GetType(const TDF_Label& theLabel)
*/
//=============================================================================
GEOM_BaseObject::GEOM_BaseObject(const TDF_Label& theEntry)
*/
//=============================================================================
GEOM_BaseObject::GEOM_BaseObject(const TDF_Label& theEntry)
- : _label(theEntry), _ior("")
, _docID(-1)
+ : _label(theEntry), _ior("")
{
{
- Handle(TDocStd_Document) aDoc = TDocStd_Owner::GetDocument(_label.Data());
- if(!aDoc.IsNull()) {
- Handle(TDataStd_Integer) anID;
- if(aDoc->Main().FindAttribute(TDataStd_Integer::GetID(), anID)) _docID = anID->Get();
- }
-
if(!theEntry.FindAttribute(TDataStd_TreeNode::GetDefaultTreeID(), _root))
_root = TDataStd_TreeNode::Set(theEntry);
}
if(!theEntry.FindAttribute(TDataStd_TreeNode::GetDefaultTreeID(), _root))
_root = TDataStd_TreeNode::Set(theEntry);
}
@@
-186,14
+173,8
@@
GEOM_BaseObject::GEOM_BaseObject(const TDF_Label& theEntry)
*/
//=============================================================================
GEOM_BaseObject::GEOM_BaseObject(const TDF_Label& theEntry, int theType)
*/
//=============================================================================
GEOM_BaseObject::GEOM_BaseObject(const TDF_Label& theEntry, int theType)
-: _label(theEntry), _ior("")
, _docID(-1)
+: _label(theEntry), _ior("")
{
{
- Handle(TDocStd_Document) aDoc = TDocStd_Owner::GetDocument(_label.Data());
- if(!aDoc.IsNull()) {
- Handle(TDataStd_Integer) anID;
- if(aDoc->Main().FindAttribute(TDataStd_Integer::GetID(), anID)) _docID = anID->Get();
- }
-
theEntry.ForgetAllAttributes(Standard_True);
if(!theEntry.FindAttribute(TDataStd_TreeNode::GetDefaultTreeID(), _root))
theEntry.ForgetAllAttributes(Standard_True);
if(!theEntry.FindAttribute(TDataStd_TreeNode::GetDefaultTreeID(), _root))
@@
-211,7
+192,7
@@
GEOM_BaseObject::GEOM_BaseObject(const TDF_Label& theEntry, int theType)
//=============================================================================
GEOM_BaseObject::~GEOM_BaseObject()
{
//=============================================================================
GEOM_BaseObject::~GEOM_BaseObject()
{
- MESSAGE("GEOM_BaseObject::~GEOM_BaseObject()");
+
//
MESSAGE("GEOM_BaseObject::~GEOM_BaseObject()");
}
//=============================================================================
}
//=============================================================================
@@
-289,17
+270,6
@@
void GEOM_BaseObject::IncrementTic()
TDataStd_Integer::Set(aTicLabel, aTic + 1);
}
TDataStd_Integer::Set(aTicLabel, aTic + 1);
}
-
-//=============================================================================
-/*!
- * GetDocID
- */
-//=============================================================================
-int GEOM_BaseObject::GetDocID()
-{
- return _docID;
-}
-
//=============================================================================
/*!
* SetName
//=============================================================================
/*!
* SetName
@@
-323,7
+293,7
@@
TCollection_AsciiString GEOM_BaseObject::GetName()
aName = aNameAttr->Get();
// do not return pointer of local variable
// return aName.ToCString();
aName = aNameAttr->Get();
// do not return pointer of local variable
// return aName.ToCString();
- // the following code could lead to memory leak, so take care about rec
ie
ved pointer
+ // the following code could lead to memory leak, so take care about rec
ei
ved pointer
return aName;
}
return aName;
}
@@
-493,18
+463,17
@@
Handle(TColStd_HSequenceOfTransient) GEOM_BaseObject::GetLastDependency()
*/
//================================================================================
*/
//================================================================================
-Handle(TFunction_Driver) GEOM_BaseObject::GetCreationDriver()
+Handle(TFunction_Driver) GEOM_BaseObject::GetCreationDriver(
int funNb
)
{
{
- Handle(TFunction_Driver) aDriver;
-
- Handle(GEOM_Function) function = GetFunction(1);
+ Handle(TFunction_Driver) driver;
+ Handle(GEOM_Function) function = GetFunction(funNb);
if ( !function.IsNull() )
{
Standard_GUID aGUID = function->GetDriverGUID();
if ( !function.IsNull() )
{
Standard_GUID aGUID = function->GetDriverGUID();
- if ( TFunction_DriverTable::Get()->FindDriver(aGUID,
aDriver
))
-
aD
river->Init( function->GetEntry() );
+ if ( TFunction_DriverTable::Get()->FindDriver(aGUID,
driver
))
+
d
river->Init( function->GetEntry() );
}
}
- return
aD
river;
+ return
d
river;
}
//=============================================================================
}
//=============================================================================
@@
-517,5
+486,4
@@
TDF_Label GEOM_BaseObject::GetFreeLabel()
return _label.FindChild(FREE_LABEL);
}
return _label.FindChild(FREE_LABEL);
}
-IMPLEMENT_STANDARD_HANDLE (GEOM_BaseObject, Standard_Transient );
-IMPLEMENT_STANDARD_RTTIEXT(GEOM_BaseObject, Standard_Transient );
+IMPLEMENT_STANDARD_RTTIEXT(GEOM_BaseObject, Standard_Transient )